| 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>
|
|
|