Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html

Issue 1922983002: sheriff_o_matic: Add error if ajax request fails. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/sheriff_o_matic/model/ct-failure-group.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html
diff --git a/appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html b/appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html
index e9ac9028b6cd551d4c427a12bb9b9714e93f3690..87b3be3234ba4c864e69e6268d21d03d7fb13368 100644
--- a/appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html
+++ b/appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html
@@ -33,6 +33,7 @@ found in the LICENSE file.
padding: 6px 22px;
}
</style>
+ <ct-user-prefs id="userPrefs"></ct-user-prefs>
<a is="pushstate-anchor" href="{{ group.examineUrl }}" id="examineLink">Examine</a>
<template if="{{ !group.isSnoozed }}">
<ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button>
@@ -57,12 +58,32 @@ found in the LICENSE file.
<ct-button on-tap="{{ removeBug }}" dismissive role="button" id="dialogRemoveBug" label="Remove bug link"></ct-button>
<ct-button on-tap="{{ saveBug }}" affirmative role="button" id="dialogOk" label="OK"></ct-button>
</paper-action-dialog>
+ <paper-action-dialog heading="Error" transition="paper-transition-center" id="loginDialog">
+ <div id="accessDeniedMessage">
+ Please <a href="{{ $.userPrefs.values.loginUrl }}">log in</a> to modify alerts.
+ </div>
+ <div id="otherMessage"></div>
+ </paper-action-dialog>
</template>
<script>
Polymer({
group: null,
_fileBugClicked: false,
+ ready: function() {
+ this.group.errorCallback = this.errorCallback.bind(this);
+ },
+
+ errorCallback: function(args) {
+ if (args.message == "Forbidden") {
+ this.$.otherMessage.hidden = true;
+ } else {
+ this.$.accessDeniedMessage.hidden = true;
+ this.$.otherMessage.textContent = args.message;
+ }
+ this.$.loginDialog.open();
+ },
+
snooze: function() {
this.group.snoozeUntil(Date.now() + 60 * 60 * 1000);
ga('send', 'event', 'snooze', 'click');
« no previous file with comments | « appengine/sheriff_o_matic/model/ct-failure-group.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698