| 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 .snoozed { |
| 56 opacity: 0.5; |
| 57 } |
| 58 |
| 59 #examine, #snooze { |
| 56 align-self: flex-start; | 60 align-self: flex-start; |
| 57 } | 61 } |
| 58 </style> | 62 </style> |
| 59 <ct-builder-grid failures="{{ failures }}"></ct-builder-grid> | 63 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> |
| 60 <div class="failure"> | 64 <div class="{{ { failure: true, snoozed: group.isSnoozed } | tokenList }}"> |
| 61 <ct-test-list tests="{{ failures }}" tree="{{ tree }}"></ct-test-list> | 65 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis
t> |
| 62 <ct-commit-list first="{{ failures[0].lastPassingRevisions }}" | 66 <ct-commit-list first="{{ group.failures[0].lastPassingRevisions }}" |
| 63 last="{{ failures[0].firstFailingRevisions }}" | 67 last="{{ group.failures[0].firstFailingRevisions }}" |
| 64 commits="{{ commits }}"></ct-commit-list> | 68 commits="{{ commits }}"></ct-commit-list> |
| 65 </div> | 69 </div> |
| 66 <paper-button id="examine" on-tap="{{ examine }}">Examine</paper-button> | 70 <paper-button id="examine" on-tap="{{ examine }}">Examine</paper-button> |
| 71 <template if="{{ !group.isSnoozed }}"> |
| 72 <paper-button id="snooze" on-tap="{{ snooze }}">Snooze</paper-button> |
| 73 </template> |
| 74 <template if="{{ group.isSnoozed }}"> |
| 75 <paper-button id="snooze" on-tap="{{ unsnooze }}">Unsnooze</paper-button> |
| 76 </template> |
| 67 </template> | 77 </template> |
| 68 <script> | 78 <script> |
| 69 Polymer({ | 79 Polymer({ |
| 70 failures: [], | 80 group: null, |
| 71 commits: {}, | 81 commits: {}, |
| 72 tree: '', | 82 tree: '', |
| 73 | 83 |
| 74 examine: function() { | 84 examine: function() { |
| 75 this.fire('ct-examine-failures', this.failures); | 85 this.fire('ct-examine-failures', this.group); |
| 86 }, |
| 87 |
| 88 snooze: function() { |
| 89 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 90 }, |
| 91 |
| 92 unsnooze: function() { |
| 93 this.group.unsnooze(); |
| 76 }, | 94 }, |
| 77 }); | 95 }); |
| 78 </script> | 96 </script> |
| 79 </polymer-element> | 97 </polymer-element> |
| OLD | NEW |