Chromium Code Reviews| 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="ct-builder-grid.html"> | 7 <link rel="import" href="ct-builder-grid.html"> |
| 8 <link rel="import" href="ct-commit-list.html"> | 8 <link rel="import" href="ct-commit-list.html"> |
| 9 <link rel="import" href="ct-test-list.html"> | 9 <link rel="import" href="ct-test-list.html"> |
| 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> | 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 | 54 |
| 55 #failure { | 55 #failure { |
| 56 flex: 1; | 56 flex: 1; |
| 57 } | 57 } |
| 58 | 58 |
| 59 #buttons { | 59 #buttons { |
| 60 display: flex; | 60 display: flex; |
| 61 flex-direction: column; | 61 flex-direction: column; |
| 62 } | 62 } |
| 63 | 63 |
| 64 #bugReminder { | |
| 65 font-size: large; | |
| 66 color: red; | |
| 67 } | |
| 68 | |
| 64 .snoozed { | 69 .snoozed { |
| 65 opacity: 0.5; | 70 opacity: 0.5; |
| 66 } | 71 } |
| 67 </style> | 72 </style> |
| 68 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> | 73 <ct-builder-grid failures="{{ group.failures }}" id="builderGrid"></ct-build er-grid> |
| 69 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> | 74 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> |
| 70 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis t> | 75 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis t> |
| 71 <ct-commit-list commitList="{{ _commitList }}"></ct-commit-list> | 76 <ct-commit-list commitList="{{ _commitList }}"></ct-commit-list> |
| 72 </div> | 77 </div> |
| 73 <div id="buttons"> | 78 <div id="buttons"> |
| 74 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper- button> | 79 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper- button> |
| 75 <template if="{{ !group.isSnoozed }}"> | 80 <template if="{{ !group.isSnoozed }}"> |
| 76 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b utton> | 81 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b utton> |
| 77 </template> | 82 </template> |
| 78 <template if="{{ group.isSnoozed }}"> | 83 <template if="{{ group.isSnoozed }}"> |
| 79 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap er-button> | 84 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap er-button> |
| 80 </template> | 85 </template> |
| 81 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape r-button> | 86 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape r-button> |
| 82 <template if="{{ group.bug !== undefined }}"> | 87 <template if="{{ group.bug !== undefined }}"> |
| 83 <div> | 88 <div> |
| 84 <a href="{{ group.bug }}"> | 89 <a href="{{ group.bug }}"> |
| 85 {{ group.bugLabel }}</a> | 90 {{ group.bugLabel }}</a> |
| 86 </div> | 91 </div> |
| 87 </template> | 92 </template> |
| 88 </div> | 93 </div> |
| 89 | 94 |
| 90 <paper-dialog heading="Enter bug number" transition="paper-transition-center " id="bugDialog"> | 95 <paper-dialog heading="Enter bug number" transition="paper-transition-center " id="bugDialog"> |
| 91 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper- input> | 96 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper- input> |
| 97 <div><a id="fileBugLink" target="_new" on-click="{{ fileBugClicked }}">Fil e bug</a></div> | |
|
ojan
2014/08/26 03:14:17
What's _new do? I've always done _blank.
cbiesinger
2014/09/11 06:24:34
Sigh, I misremembered the name. Fixed.
| |
| 98 <div style="display: hidden" id="bugReminder"> | |
|
ojan
2014/08/26 03:14:17
Instead of toggling display with script, just wrap
cbiesinger
2014/09/11 06:24:34
Done.
cbiesinger
2014/09/29 21:18:06
FYI I did this but had to move the template inside
| |
| 99 Remember to enter the new bug number above! | |
| 100 </div> | |
| 92 <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></paper-button> | 101 <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></paper-button> |
| 93 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"> </paper-button> | 102 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"> </paper-button> |
| 94 </paper-dialog> | 103 </paper-dialog> |
| 95 </template> | 104 </template> |
| 96 <script> | 105 <script> |
| 97 Polymer({ | 106 Polymer({ |
| 98 group: null, | 107 group: null, |
| 99 commitLog: null, | 108 commitLog: null, |
| 100 tree: '', | 109 tree: '', |
| 101 _commitList: null, | 110 _commitList: null, |
| 111 _fileBugUrl: 'https://code.google.com/p/chromium/issues/entry?' + | |
| 112 'status=Available&labels=Pri-2,gardening-blink&' + | |
| 113 'summary=Build%20failure&comment=Build%20is%20broken:%0a', | |
|
ojan
2014/08/26 03:14:17
Lets leave the summary out of this. google code ha
cbiesinger
2014/09/11 06:24:34
Done.
| |
| 102 | 114 |
| 103 observe: { | 115 observe: { |
| 104 group: '_updateCommitList', | 116 group: '_updateCommitList', |
| 105 commitLog: '_updateCommitList' | 117 commitLog: '_updateCommitList' |
| 106 }, | 118 }, |
| 107 | 119 |
| 108 examine: function() { | 120 examine: function() { |
| 109 this.fire('ct-examine-failures', this.group); | 121 this.fire('ct-examine-failures', this.group); |
| 110 }, | 122 }, |
| 111 | 123 |
| 112 snooze: function() { | 124 snooze: function() { |
| 113 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 125 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 114 }, | 126 }, |
| 115 | 127 |
| 116 unsnooze: function() { | 128 unsnooze: function() { |
| 117 this.group.unsnooze(); | 129 this.group.unsnooze(); |
| 118 }, | 130 }, |
| 119 | 131 |
| 120 _updateCommitList: function() { | 132 _updateCommitList: function() { |
| 121 this._commitList = this.group ? | 133 this._commitList = this.group ? |
| 122 this.group.commitList(this.commitLog) : undefined; | 134 this.group.commitList(this.commitLog) : undefined; |
| 123 }, | 135 }, |
| 124 | 136 |
| 125 linkBug: function() { | 137 linkBug: function() { |
| 138 var message = ''; | |
|
ojan
2014/08/26 03:14:17
Can you move the function that generates this url
cbiesinger
2014/09/11 06:24:34
I thought about that, but I'm really not sure that
ojan
2014/09/11 23:44:25
Maybe you don't need to move the url generation to
| |
| 139 for (var i = 0; i < this.group.failures.length; ++i) { | |
|
ojan
2014/08/26 03:14:17
Here and below, use forEach?
cbiesinger
2014/09/11 06:24:34
Done.
| |
| 140 var failure = this.group.failures[i]; | |
| 141 message += failure.step; | |
| 142 if (failure.testName) { | |
| 143 message += ' ' + failure.testName + '\n'; | |
| 144 message += failure.flakinessDashboardURL(this.tree); | |
| 145 } | |
| 146 message += '\n'; | |
| 147 } | |
| 148 message += '\nRevision range:\n'; | |
| 149 for (i = 0; i < this._commitList.repositories.length; ++i) { | |
| 150 var repository = this._commitList.repositories[i]; | |
| 151 message += repository.name + ' ' + repository.range + '\n'; | |
| 152 } | |
| 153 message += '\nFailing builders:\n'; | |
| 154 for (i = 0; i < this.$.builderGrid.builders.length; ++i) { | |
| 155 var builder = this.$.builderGrid.builders[i]; | |
| 156 message += builder.builder + ': ' + builder.buildUrl + '\n'; | |
| 157 } | |
| 158 | |
| 126 this.$.bug.value = this.group.bug; | 159 this.$.bug.value = this.group.bug; |
| 160 this.$.fileBugLink.href = this._fileBugUrl + encodeURIComponent(message) ; | |
| 161 this.$.bugReminder.style.display = 'none'; | |
| 162 this.$.fileBugLink.style.display = ''; | |
| 127 this.$.bugDialog.toggle(); | 163 this.$.bugDialog.toggle(); |
| 128 }, | 164 }, |
| 129 | 165 |
| 130 saveBug: function() { | 166 saveBug: function() { |
| 131 this.group.setBug(this.$.bug.value); | 167 this.group.setBug(this.$.bug.value); |
| 132 }, | 168 }, |
| 133 | 169 |
| 134 removeBug: function() { | 170 removeBug: function() { |
| 135 this.group.clearBug(); | 171 this.group.clearBug(); |
| 136 }, | 172 }, |
| 173 | |
| 174 fileBugClicked: function() { | |
| 175 this.$.bugReminder.style.display = ''; | |
| 176 this.$.fileBugLink.style.display = 'none'; | |
| 177 }, | |
| 137 }); | 178 }); |
| 138 </script> | 179 </script> |
| 139 </polymer-element> | 180 </polymer-element> |
| OLD | NEW |