OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <!-- | 7 <!-- |
8 The triage-dialog element is the dialog box that is shown when a user clicks | 8 The triage-dialog element is the dialog box that is shown when a user clicks |
9 on an alert, or clicks on a "triage" button on the alerts page. It allows the | 9 on an alert, or clicks on a "triage" button on the alerts page. It allows the |
10 --> | 10 --> |
11 | 11 |
12 <link rel="import" href="/components/paper-button/paper-button.html"> | 12 <link rel="import" href="/components/paper-button/paper-button.html"> |
13 <link rel="import" href="/components/paper-dialog/paper-action-dialog.html"> | 13 <link rel="import" href="/components/paper-dialog/paper-dialog.html"> |
14 | 14 |
15 <link rel="import" href="/dashboard/static/simple_xhr.html"> | 15 <link rel="import" href="/dashboard/static/simple_xhr.html"> |
16 | 16 |
17 <polymer-element name="triage-dialog" attributes="xsrfToken alerts"> | 17 <dom-module id="triage-dialog"> |
18 <template> | 18 <template> |
19 <style> | 19 <style> |
20 #container { | 20 #container { |
21 position: relative; | 21 position: relative; |
22 margin: 0 0 10px 0; | 22 margin: 0 0 10px 0; |
23 } | 23 } |
24 </style> | 24 </style> |
25 | 25 |
26 <paper-action-dialog id="container" layered="false"> | 26 <paper-dialog id="container" alwaysOnTop> |
27 <!-- Styling for paper-action-dialog's children. --> | 27 <!-- Styling for paper-action-dialog's children. --> |
28 <style> | 28 <style> |
29 #loading { | 29 #loading { |
30 background-color: white; | 30 background-color: white; |
31 height: 100%; | 31 height: 100%; |
32 width: 100%; | 32 width: 100%; |
33 position: absolute; | 33 position: absolute; |
34 left: 0; | 34 left: 0; |
35 top: 0; | 35 top: 0; |
36 display: -webkit-flex; | 36 display: -webkit-flex; |
(...skipping 22 matching lines...) Expand all Loading... |
59 | 59 |
60 form { | 60 form { |
61 margin-bottom: 0; | 61 margin-bottom: 0; |
62 } | 62 } |
63 </style> | 63 </style> |
64 | 64 |
65 <form> | 65 <form> |
66 <fieldset name="Triage"> | 66 <fieldset name="Triage"> |
67 <legend>Triage</legend> | 67 <legend>Triage</legend> |
68 <paper-button class="submit-button" raised affirmative | 68 <paper-button class="submit-button" raised affirmative |
69 on-click="{{fileNewBug}}">New bug</paper-button> | 69 on-click="fileNewBug">New bug</paper-button> |
70 <paper-button class="submit-button" raised affirmative | 70 <paper-button class="submit-button" raised affirmative |
71 on-click="{{associateWithBug}}">Existing bug</paper-butt
on> | 71 on-click="associateWithBug">Existing bug</paper-button> |
72 <paper-button class="submit-button" raised affirmative | 72 <paper-button class="submit-button" raised affirmative |
73 on-click="{{markIgnored}}">Ignore</paper-button> | 73 on-click="markIgnored">Ignore</paper-button> |
74 </fieldset> | 74 </fieldset> |
75 <fieldset name="Fix-up alert"> | 75 <fieldset name="Fix-up alert"> |
76 <legend>Fix-up</legend> | 76 <legend>Fix-up</legend> |
77 <select class="kennedy-button" id="nudgeSelect" hidden?="{{!nudgeList}
}" on-change="{{nudgeAlert}}"> | 77 <select class="kennedy-button" id="nudgeSelect" hidden$="{{!nudgeList}
}" on-change="nudgeAlert"> |
78 <option template repeat="{{nudgeList}}" value="{{endRevision}}" sele
cted?="{{selected}}"> | 78 <option template is="dom-repeat" items="{{nudgeList}}" value="{{item
.endRevision}}" selected$="{{item.selected}}"> |
79 Nudge {{amount}} {{displayEndRevision}} ({{value}}) | 79 Nudge {{item.amount}} {{item.displayEndRevision}} ({{item.value}}) |
80 </option> | 80 </option> |
81 </select> | 81 </select> |
82 <paper-button raised on-click="{{markInvalid}}">Invalid</paper-button> | 82 <paper-button raised on-click="markInvalid">Invalid</paper-button> |
83 </fieldset> | 83 </fieldset> |
84 </form> | 84 </form> |
85 | 85 |
86 <paper-button dismissive raised>Close</paper-button> | 86 <paper-button dismissive raised>Close</paper-button> |
87 | 87 |
88 <template if="{{loading}}"> | 88 <template is="dom-if" if="{{loading}}"> |
89 <div id="loading"> | 89 <div id="loading"> |
90 <paper-spinner active></paper-spinner> | 90 <paper-spinner active></paper-spinner> |
91 </div> | 91 </div> |
92 </template> | 92 </template> |
93 </paper-action-dialog> | 93 </paper-action-dialog> |
94 | 94 |
95 <div id="toasts" hidden> | 95 <div id="toasts" hidden> |
96 <div id="jobsubmitted"> | 96 <div id="jobsubmitted"> |
97 Bug <a href="http://crbug.com/{{lastSubmittedBugId}}" | 97 Bug <a href="http://crbug.com/{{lastSubmittedBugId}}" |
98 target="_blank">{{lastSubmittedBugId}}</a> created/updated. | 98 target="_blank">{{lastSubmittedBugId}}</a> created/updated. |
99 <template if="{{lastSubmittedTryJobId}}"> | 99 <template is="dom-if" if="{{!!lastSubmittedTryJobId}}"> |
100 Bisect job <a href="{{lastSubmittedTryJobUrl}}" | 100 Bisect job <a href="{{lastSubmittedTryJobUrl}}" |
101 target="_blank">{{lastSubmittedTryJobId}}</a> started. | 101 target="_blank">{{lastSubmittedTryJobId}}</a> started. |
102 </template> | 102 </template> |
103 <template if="{{lastSubmittedTryJobError}}"> | 103 <template is="dom-if" if="{{lastSubmittedTryJobError}}"> |
104 <span class="error">No bisect automatically started. | 104 <span class="error">No bisect automatically started. |
105 {{lastSubmittedTryJobError}}</span> | 105 {{lastSubmittedTryJobError}}</span> |
106 </template> | 106 </template> |
107 </div> | 107 </div> |
108 </div> | 108 </div> |
109 | 109 |
110 </template> | 110 </template> |
111 <script> | 111 <script> |
112 'use strict'; | 112 'use strict'; |
113 Polymer('triage-dialog', { | 113 Polymer({ |
114 // A string describing the magnitude of change from zero to non-zero. | 114 |
115 FREAKIN_HUGE: 'zero-to-nonzero', | 115 is: 'triage-dialog', |
| 116 properties: { |
| 117 // A string describing the magnitude of change from zero to non-zero. |
| 118 FREAKIN_HUGE: { |
| 119 type: String, |
| 120 value: 'zero-to-nonzero', |
| 121 }, |
| 122 alerts: { |
| 123 notify: true, |
| 124 observer: 'alertsChanged' |
| 125 }, |
| 126 xsrfToken: { notify: true } |
| 127 }, |
116 | 128 |
117 /** | 129 /** |
118 * Custom element lifecycle callback. | 130 * Custom element lifecycle callback. |
119 * Called when the triage-dialog element is ready. | 131 * Called when the triage-dialog element is ready. |
120 */ | 132 */ |
121 ready: function() { | 133 ready: function() { |
122 // This allows tooltip to show beyond the current window size. | 134 // This allows tooltip to show beyond the current window size. |
123 // See chart-tooltip.html for more details. | 135 // See chart-tooltip.html for more details. |
124 this.$.container.sizingTarget = document.querySelector( | 136 this.$.container.sizingTarget = Polymer.dom(document).querySelector( |
125 'html /deep/ paper-action-dialog::shadow #scroller'); | 137 'html /deep/ paper-action-dialog::shadow #scroller'); |
126 | 138 |
127 this.bugWindow = null; | 139 this.bugWindow = null; |
128 this.close(); | 140 this.close(); |
129 // Event listener for the message event. | 141 // Event listener for the message event. |
130 // The message event can be fired when another window, such as the | 142 // The message event can be fired when another window, such as the |
131 // create bug dialog window, uses window.postMessage(). | 143 // create bug dialog window, uses window.postMessage(). |
132 // This is used so that the triage dialog is hidden when the popup | 144 // This is used so that the triage dialog is hidden when the popup |
133 // window is shown. | 145 // window is shown. |
134 window.addEventListener('message', function(e) { | 146 window.addEventListener('message', function(e) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 var form = document.createElement('form'); | 410 var form = document.createElement('form'); |
399 form.action = url; | 411 form.action = url; |
400 form.method = 'POST'; | 412 form.method = 'POST'; |
401 form.target = target; | 413 form.target = target; |
402 if (data) { | 414 if (data) { |
403 for (var i = 0; i < data.length; i++) { | 415 for (var i = 0; i < data.length; i++) { |
404 var input = document.createElement('textarea'); | 416 var input = document.createElement('textarea'); |
405 input.name = data[i].name; | 417 input.name = data[i].name; |
406 input.value = (typeof data[i].value === 'object' ? | 418 input.value = (typeof data[i].value === 'object' ? |
407 JSON.stringify(data[i].value) : data[i].value); | 419 JSON.stringify(data[i].value) : data[i].value); |
408 form.appendChild(input); | 420 Polymer.dom(form).appendChild(input); |
409 } | 421 } |
410 } | 422 } |
411 form.style.display = 'none'; | 423 form.style.display = 'none'; |
412 document.body.appendChild(form); | 424 Polymer.dom(document.body).appendChild(form); |
413 form.submit(); | 425 form.submit(); |
414 return popup; | 426 return popup; |
415 }, | 427 }, |
416 | 428 |
417 open: function() { | 429 open: function() { |
418 this.$.container.open(); | 430 this.$.container.open(); |
419 }, | 431 }, |
420 | 432 |
421 close: function() { | 433 close: function() { |
422 this.$.container.close(); | 434 this.$.container.close(); |
423 } | 435 } |
424 }); | 436 }); |
425 </script> | 437 </script> |
426 </polymer-element> | 438 </dom-module> |
OLD | NEW |