OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
| 7 <link rel="import" href="../model/ct-builder-list.html"> |
7 <link rel="import" href="ct-bot-failure-card.html"> | 8 <link rel="import" href="ct-bot-failure-card.html"> |
8 <link rel="import" href="ct-trooper-card.html"> | 9 <link rel="import" href="ct-trooper-card.html"> |
9 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> | 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> |
10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> | 11 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> |
11 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | 12 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
12 | 13 |
13 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> | 14 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> |
14 <template> | 15 <template> |
15 <style> | 16 <style> |
16 :host { | 17 :host { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 display: flex; | 56 display: flex; |
56 flex: 1; | 57 flex: 1; |
57 } | 58 } |
58 | 59 |
59 .snoozed { | 60 .snoozed { |
60 opacity: 0.5; | 61 opacity: 0.5; |
61 } | 62 } |
62 </style> | 63 </style> |
63 <div class="card {{ { snoozed: group.isSnoozed } | tokenList }}"> | 64 <div class="card {{ { snoozed: group.isSnoozed } | tokenList }}"> |
64 <template if="{{ group.data.type == 'sheriff' }}"> | 65 <template if="{{ group.data.type == 'sheriff' }}"> |
65 <ct-bot-failure-card class='card' group="{{ group.data }}"></ct-bot-fail
ure-card> | 66 <ct-bot-failure-card class='card' group="{{ group.data }}" builderList="
{{ _builderList }}"></ct-bot-failure-card> |
66 </template> | 67 </template> |
67 <template if="{{ group.data.type != 'sheriff' }}"> | 68 <template if="{{ group.data.type != 'sheriff' }}"> |
68 <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-card
> | 69 <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-card
> |
69 </template> | 70 </template> |
70 </div> | 71 </div> |
71 <div id="buttons"> | 72 <div id="buttons"> |
72 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-
button> | 73 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-
button> |
73 <template if="{{ !group.isSnoozed }}"> | 74 <template if="{{ !group.isSnoozed }}"> |
74 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b
utton> | 75 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b
utton> |
75 </template> | 76 </template> |
(...skipping 12 matching lines...) Expand all Loading... |
88 <paper-dialog heading="Enter bug number" transition="paper-transition-center
" id="bugDialog"> | 89 <paper-dialog heading="Enter bug number" transition="paper-transition-center
" id="bugDialog"> |
89 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> | 90 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> |
90 <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive
id="dialogRemoveBug"></paper-button> | 91 <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive
id="dialogRemoveBug"></paper-button> |
91 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk">
</paper-button> | 92 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk">
</paper-button> |
92 </paper-dialog> | 93 </paper-dialog> |
93 </template> | 94 </template> |
94 <script> | 95 <script> |
95 Polymer({ | 96 Polymer({ |
96 group: null, | 97 group: null, |
97 commitLog: null, | 98 commitLog: null, |
| 99 _builderList: null, |
98 tree: '', | 100 tree: '', |
99 | 101 |
100 observe: { | 102 observe: { |
101 group: '_updateCommitList', | 103 group: '_updateCommitList', |
102 commitLog: '_updateCommitList' | 104 commitLog: '_updateCommitList', |
| 105 'group.data.failures': '_updateBuilderList', |
103 }, | 106 }, |
104 | 107 |
105 examine: function() { | 108 examine: function() { |
106 this.fire('ct-examine-failures', this.group); | 109 this.fire('ct-examine-failures', this.group); |
107 }, | 110 }, |
108 | 111 |
109 snooze: function() { | 112 snooze: function() { |
110 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 113 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
111 }, | 114 }, |
112 | 115 |
113 unsnooze: function() { | 116 unsnooze: function() { |
114 this.group.unsnooze(); | 117 this.group.unsnooze(); |
115 }, | 118 }, |
116 | 119 |
117 _updateCommitList: function() { | 120 _updateCommitList: function() { |
118 if (this.group && this.group.commitList && this.commitLog) | 121 if (this.group && this.group.commitList && this.commitLog) |
119 this.group.commitList.update(this.commitLog); | 122 this.group.commitList.update(this.commitLog); |
120 }, | 123 }, |
121 | 124 |
| 125 _updateBuilderList: function() { |
| 126 if (this.group.data.type == 'sheriff') |
| 127 this._builderList = new CTBuilderList(this.group.data.failures); |
| 128 }, |
| 129 |
122 linkBug: function() { | 130 linkBug: function() { |
123 this.$.bug.value = this.group.bug; | 131 this.$.bug.value = this.group.bug; |
124 this.$.bugDialog.toggle(); | 132 this.$.bugDialog.toggle(); |
125 }, | 133 }, |
126 | 134 |
127 saveBug: function() { | 135 saveBug: function() { |
128 this.group.setBug(this.$.bug.value); | 136 this.group.setBug(this.$.bug.value); |
129 }, | 137 }, |
130 | 138 |
131 removeBug: function() { | 139 removeBug: function() { |
132 this.group.clearBug(); | 140 this.group.clearBug(); |
133 }, | 141 }, |
134 }); | 142 }); |
135 </script> | 143 </script> |
136 </polymer-element> | 144 </polymer-element> |
OLD | NEW |