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

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

Issue 1315693002: SoM: upgrade Polymer from 0.5 to 1.0 Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: get bower_components from polymer_1.0.4 Created 5 years, 4 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/ui/ct-time-series.html ('k') | appengine/sheriff_o_matic/ui/ct-tree-select.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/sheriff_o_matic/ui/ct-time-series-failure-card-buttons.html
diff --git a/appengine/sheriff_o_matic/ui/ct-time-series-failure-card-buttons.html b/appengine/sheriff_o_matic/ui/ct-time-series-failure-card-buttons.html
index f01d3de99740c5ee08134a9a24c4a9d8ed214182..2fac908004ab70b1340fbe171dbe136bff56d063 100644
--- a/appengine/sheriff_o_matic/ui/ct-time-series-failure-card-buttons.html
+++ b/appengine/sheriff_o_matic/ui/ct-time-series-failure-card-buttons.html
@@ -2,15 +2,12 @@
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
--->
-
-<link rel="import" href="ct-button.html">
+--><html><head><link rel="import" href="ct-button.html">
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">
-<polymer-element name="ct-time-series-failure-card-buttons" attributes="alerts key bug">
- <template>
- <style>
+<dom-module id="ct-time-series-failure-card-buttons">
+ <style>
:host {
display: flex;
}
@@ -22,75 +19,75 @@ found in the LICENSE file.
white-space: nowrap;
}
</style>
- <ct-button on-tap="{{ showBugDialog }}" label="Link Bug">
+ <template>
+ <ct-button on-tap=" showBugDialog " label="Link Bug">
</ct-button>
<paper-action-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
- <paper-input label="Bug# or URL" floatingLabel value="{{ bug }}" autofocus id="bug">
+ <paper-input label="Bug# or URL" always-float-label="" value="{{ bug }}" autofocus="" id="bug">
</paper-input>
- <ct-button on-tap="{{ removeBug }}" role="button" id="dialogRemoveBug" dismissive label="Remove bug link">
+ <ct-button on-tap=" removeBug " role="button" id="dialogRemoveBug" dismissive="" label="Remove bug link">
</ct-button>
- <ct-button on-tap="{{ saveBug }}" role="button" id="dialogOk" affirmative label="OK">
+ <ct-button on-tap=" saveBug " role="button" id="dialogOk" affirmative="" label="OK">
</ct-button>
</paper-action-dialog>
- <ct-button on-click="{{ toggleDelDialog }}" id="delAlert" label="Dismiss">
+ <ct-button on-click=" toggleDelDialog " id="delAlert" label="Dismiss">
</ct-button>
<paper-action-dialog heading="Dismiss alert?" transition="paper-transition-center" id="delBugDialog">
- <ct-button role="button" dismissive label="Cancel"></ct-button>
- <ct-button on-tap="{{ delAlert }}" role="button" affirmative label="Dismiss"></ct-button>
+ <ct-button role="button" dismissive="" label="Cancel"></ct-button>
+ <ct-button on-tap=" delAlert " role="button" affirmative="" label="Dismiss"></ct-button>
</paper-action-dialog>
</template>
<script>
Polymer({
-
- toggleDelDialog: function() {
+ is: 'ct-time-series-failure-card-buttons',
+ properties: {
+ alerts: { notify: true },
+ bug: { notify: true },
+ key: { notify: true }
+ },
+ toggleDelDialog: function () {
this.$.delBugDialog.toggle();
},
-
- delAlert: function() {
+ delAlert: function () {
var opt = {
url: '/ts-alerts/' + this.key,
type: 'DELETE'
};
- return net.ajax(opt).then(function(response) {
+ return net.ajax(opt).then(function (response) {
console.log(response);
- this.alerts = this.alerts.filter(function(a) {
+ this.alerts = this.alerts.filter(function (a) {
return a.hash_key !== this.key;
- })
- }.bind(this), function(err) {
+ });
+ }.bind(this), function (err) {
console.log('Failed to delete: ' + err);
});
},
-
- showBugDialog: function() {
+ showBugDialog: function () {
this.$.bugDialog.toggle();
},
-
- updateBug: function(key, bug_id) {
+ updateBug: function (key, bug_id) {
opt = {
url: '/ts-alerts/' + key,
type: 'PUT',
- data: JSON.stringify({'bug_id': bug_id})
+ data: JSON.stringify({ 'bug_id': bug_id })
};
this.$.bugDialog.toggle();
- return net.ajax(opt).then(function(response) {
+ return net.ajax(opt).then(function (response) {
console.log(response);
- }.bind(this), function(err) {
+ }.bind(this), function (err) {
console.log('Failed to update bug: ' + err);
});
},
-
- saveBug: function() {
- bug_id = /([0-9]{3,})/.exec(this.$.bug.value)[0]
-
+ saveBug: function () {
+ bug_id = /([0-9]{3,})/.exec(this.$.bug.value)[0];
if (bug_id != null) {
this.updateBug(this.key, bug_id);
}
},
-
- removeBug: function() {
+ removeBug: function () {
this.bug = '';
- this.updateBug(this.key, '')
+ this.updateBug(this.key, '');
}
});
</script>
-</polymer-element>
+</dom-module>
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-time-series.html ('k') | appengine/sheriff_o_matic/ui/ct-tree-select.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698