| 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 | 10 |
| 11 <polymer-element name="ct-failure-card" attributes="failures commits tree"> | 11 <polymer-element name="ct-failure-card" attributes="group commits tree"> |
| 12 <template> | 12 <template> |
| 13 <style> | 13 <style> |
| 14 :host { | 14 :host { |
| 15 display: flex; | 15 display: flex; |
| 16 } | 16 } |
| 17 | 17 |
| 18 /* FIXME: All this paper-button styling should go in a cr-button component
so that | 18 /* FIXME: All this paper-button styling should go in a cr-button component
so that |
| 19 we can use buttons in different places and have them all look the same.
*/ | 19 we can use buttons in different places and have them all look the same.
*/ |
| 20 paper-button { | 20 paper-button { |
| 21 -webkit-user-select: none; | 21 -webkit-user-select: none; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 | 45 |
| 46 ct-builder-grid { | 46 ct-builder-grid { |
| 47 margin-right: 10px; | 47 margin-right: 10px; |
| 48 width: 250px; | 48 width: 250px; |
| 49 } | 49 } |
| 50 | 50 |
| 51 .failure { | 51 .failure { |
| 52 flex: 1; | 52 flex: 1; |
| 53 } | 53 } |
| 54 | 54 |
| 55 #examine { | 55 #examine, #snooze { |
| 56 align-self: flex-start; | 56 align-self: flex-start; |
| 57 } | 57 } |
| 58 </style> | 58 </style> |
| 59 <ct-builder-grid failures="{{ failures }}"></ct-builder-grid> | 59 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> |
| 60 <div class="failure"> | 60 <div class="failure"> |
| 61 <ct-test-list tests="{{ failures }}" tree="{{ tree }}"></ct-test-list> | 61 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis
t> |
| 62 <ct-commit-list first="{{ failures[0].lastPassingRevisions }}" | 62 <ct-commit-list first="{{ group.failures[0].lastPassingRevisions }}" |
| 63 last="{{ failures[0].firstFailingRevisions }}" | 63 last="{{ group.failures[0].firstFailingRevisions }}" |
| 64 commits="{{ commits }}"></ct-commit-list> | 64 commits="{{ commits }}"></ct-commit-list> |
| 65 </div> | 65 </div> |
| 66 <paper-button id="examine" on-tap="{{ examine }}">Examine</paper-button> | 66 <paper-button id="examine" on-tap="{{ examine }}">Examine</paper-button> |
| 67 <template if="{{ !group.isSnoozed }}"> |
| 68 <paper-button id="snooze" on-tap="{{ snooze }}">Snooze</paper-button> |
| 69 </template> |
| 70 <template if="{{ group.isSnoozed }}"> |
| 71 <paper-button id="snooze" on-tap="{{ unsnooze }}">Unsnooze</paper-button> |
| 72 </template> |
| 67 </template> | 73 </template> |
| 68 <script> | 74 <script> |
| 69 Polymer({ | 75 Polymer({ |
| 70 failures: [], | 76 group: null, |
| 71 commits: {}, | 77 commits: {}, |
| 72 tree: '', | 78 tree: '', |
| 73 | 79 |
| 74 examine: function() { | 80 examine: function() { |
| 75 this.fire('ct-examine-failures', this.failures); | 81 this.fire('ct-examine-failures', this.group); |
| 82 }, |
| 83 |
| 84 snooze: function() { |
| 85 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 86 }, |
| 87 |
| 88 unsnooze: function() { |
| 89 this.group.snoozeUntil(null); |
| 76 }, | 90 }, |
| 77 }); | 91 }); |
| 78 </script> | 92 </script> |
| 79 </polymer-element> | 93 </polymer-element> |
| OLD | NEW |