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="../model/ct-builder-list.html"> |
8 <link rel="import" href="ct-bot-failure-card.html"> | 8 <link rel="import" href="ct-bot-failure-card.html"> |
9 <link rel="import" href="ct-builder-failure-card.html"> | |
9 <link rel="import" href="ct-trooper-card.html"> | 10 <link rel="import" href="ct-trooper-card.html"> |
10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> | 11 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> |
11 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio n.html"> | 12 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio n.html"> |
12 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | 13 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
13 | 14 |
14 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> | 15 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> |
15 <template> | 16 <template> |
16 <style> | 17 <style> |
17 :host { | 18 :host { |
18 display: block; | 19 display: block; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 display: flex; | 61 display: flex; |
61 flex: 1; | 62 flex: 1; |
62 } | 63 } |
63 | 64 |
64 .snoozed { | 65 .snoozed { |
65 opacity: 0.5; | 66 opacity: 0.5; |
66 } | 67 } |
67 </style> | 68 </style> |
68 <div id="container"> | 69 <div id="container"> |
69 <div class="card {{ { snoozed: group.isSnoozed } | tokenList }}"> | 70 <div class="card {{ { snoozed: group.isSnoozed } | tokenList }}"> |
70 <template if="{{ group.data.type == 'sheriff' }}"> | 71 <template if="{{ group.data.category == 'sheriff' }}"> |
ojan
2014/09/10 00:40:03
Please add FIXME to do the refactoring to move the
| |
71 <ct-bot-failure-card class='card' group="{{ group.data }}" builderList ="{{ _builderList }}"></ct-bot-failure-card> | 72 <ct-bot-failure-card class='card' group="{{ group.data }}" builderList ="{{ _builderList }}"></ct-bot-failure-card> |
72 </template> | 73 </template> |
73 <template if="{{ group.data.type != 'sheriff' }}"> | 74 <template if="{{ group.data.category == 'builder' }}"> |
75 <ct-builder-failure-card class='card' group="{{ group.data }}" builder List="{{ _builderList }}"></ct-builder-failure-card> | |
76 </template> | |
77 <template if="{{ group.data.category == 'trooper' }}"> | |
74 <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-ca rd> | 78 <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-ca rd> |
75 </template> | 79 </template> |
76 </div> | 80 </div> |
77 <div id="buttons"> | 81 <div id="buttons"> |
78 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></pape r-button> | 82 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></pape r-button> |
79 <template if="{{ !group.isSnoozed }}"> | 83 <template if="{{ !group.isSnoozed }}"> |
80 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper -button> | 84 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper -button> |
81 </template> | 85 </template> |
82 <template if="{{ group.isSnoozed }}"> | 86 <template if="{{ group.isSnoozed }}"> |
83 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></p aper-button> | 87 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></p aper-button> |
(...skipping 18 matching lines...) Expand all Loading... | |
102 Polymer({ | 106 Polymer({ |
103 group: null, | 107 group: null, |
104 commitLog: null, | 108 commitLog: null, |
105 _builderList: null, | 109 _builderList: null, |
106 tree: '', | 110 tree: '', |
107 | 111 |
108 observe: { | 112 observe: { |
109 group: '_updateCommitList', | 113 group: '_updateCommitList', |
110 commitLog: '_updateCommitList', | 114 commitLog: '_updateCommitList', |
111 'group.data.failures': '_updateBuilderList', | 115 'group.data.failures': '_updateBuilderList', |
116 'group.data.failure': '_updateBuilderList', | |
112 }, | 117 }, |
113 | 118 |
114 examine: function() { | 119 examine: function() { |
115 this.fire('ct-examine-failures', this.group); | 120 this.fire('ct-examine-failures', this.group); |
116 }, | 121 }, |
117 | 122 |
118 snooze: function() { | 123 snooze: function() { |
119 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 124 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
120 }, | 125 }, |
121 | 126 |
122 unsnooze: function() { | 127 unsnooze: function() { |
123 this.group.unsnooze(); | 128 this.group.unsnooze(); |
124 }, | 129 }, |
125 | 130 |
126 _updateCommitList: function() { | 131 _updateCommitList: function() { |
127 if (this.group && this.group.commitList && this.commitLog) | 132 if (this.group && this.group.commitList && this.commitLog) |
128 this.group.commitList.update(this.commitLog); | 133 this.group.commitList.update(this.commitLog); |
129 }, | 134 }, |
130 | 135 |
131 _updateBuilderList: function() { | 136 _updateBuilderList: function() { |
132 if (this.group.data.type == 'sheriff') | 137 if (this.group.data.type == 'sheriff') |
133 this._builderList = new CTBuilderList(this.group.data.failures); | 138 this._builderList = new CTBuilderList(this.group.data.failures); |
139 else if (this.group.data.type == 'builder') | |
140 this._builderList = new CTBuilderList(this.group.data.failure); | |
134 }, | 141 }, |
135 | 142 |
136 linkBug: function() { | 143 linkBug: function() { |
137 this.$.bug.value = this.group.bug; | 144 this.$.bug.value = this.group.bug; |
138 this.$.bugDialog.toggle(); | 145 this.$.bugDialog.toggle(); |
139 }, | 146 }, |
140 | 147 |
141 saveBug: function() { | 148 saveBug: function() { |
142 this.group.setBug(this.$.bug.value); | 149 this.group.setBug(this.$.bug.value); |
143 }, | 150 }, |
144 | 151 |
145 removeBug: function() { | 152 removeBug: function() { |
146 this.group.clearBug(); | 153 this.group.clearBug(); |
147 }, | 154 }, |
148 }); | 155 }); |
149 </script> | 156 </script> |
150 </polymer-element> | 157 </polymer-element> |
OLD | NEW |