| 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"> |
| 11 <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"> |
| 12 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | 12 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
| 13 | 13 |
| 14 <polymer-element name="ct-failure-card" attributes="group commits tree bug"> | 14 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> |
| 15 <template> | 15 <template> |
| 16 <style> | 16 <style> |
| 17 :host { | 17 :host { |
| 18 display: flex; | 18 display: flex; |
| 19 } | 19 } |
| 20 | 20 |
| 21 /* FIXME: All this paper-button styling should go in a cr-button component
so that | 21 /* FIXME: All this paper-button styling should go in a cr-button component
so that |
| 22 we can use buttons in different places and have them all look the same.
*/ | 22 we can use buttons in different places and have them all look the same.
*/ |
| 23 paper-button { | 23 paper-button { |
| 24 -webkit-user-select: none; | 24 -webkit-user-select: none; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 flex-direction: column; | 61 flex-direction: column; |
| 62 } | 62 } |
| 63 | 63 |
| 64 .snoozed { | 64 .snoozed { |
| 65 opacity: 0.5; | 65 opacity: 0.5; |
| 66 } | 66 } |
| 67 </style> | 67 </style> |
| 68 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> | 68 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> |
| 69 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> | 69 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> |
| 70 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis
t> | 70 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis
t> |
| 71 <ct-commit-list commitList="{{ _commits() }}"></ct-commit-list> | 71 <ct-commit-list commitList="{{ _commitList }}"></ct-commit-list> |
| 72 </div> | 72 </div> |
| 73 <div id="buttons"> | 73 <div id="buttons"> |
| 74 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-
button> | 74 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-
button> |
| 75 <template if="{{ !group.isSnoozed }}"> | 75 <template if="{{ !group.isSnoozed }}"> |
| 76 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b
utton> | 76 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b
utton> |
| 77 </template> | 77 </template> |
| 78 <template if="{{ group.isSnoozed }}"> | 78 <template if="{{ group.isSnoozed }}"> |
| 79 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap
er-button> | 79 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap
er-button> |
| 80 </template> | 80 </template> |
| 81 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape
r-button> | 81 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape
r-button> |
| 82 <template if="{{ group.bug !== undefined }}"> | 82 <template if="{{ group.bug !== undefined }}"> |
| 83 <div> | 83 <div> |
| 84 <a href="{{ group.bug }}"> | 84 <a href="{{ group.bug }}"> |
| 85 {{ group.bugLabel }}</a> | 85 {{ group.bugLabel }}</a> |
| 86 </div> | 86 </div> |
| 87 </template> | 87 </template> |
| 88 </div> | 88 </div> |
| 89 | 89 |
| 90 <paper-dialog heading="Enter bug number" transition="paper-transition-center
" id="bugDialog"> | 90 <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> | 91 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> |
| 92 <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive
id="dialogRemoveBug"></paper-button> | 92 <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> | 93 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk">
</paper-button> |
| 94 </paper-dialog> | 94 </paper-dialog> |
| 95 </template> | 95 </template> |
| 96 <script> | 96 <script> |
| 97 Polymer({ | 97 Polymer({ |
| 98 group: null, | 98 group: null, |
| 99 commits: null, | 99 commitLog: null, |
| 100 tree: '', | 100 tree: '', |
| 101 _commitList: null, |
| 102 |
| 103 observe: { |
| 104 group: '_updateCommitList', |
| 105 commitLog: '_updateCommitList' |
| 106 }, |
| 101 | 107 |
| 102 examine: function() { | 108 examine: function() { |
| 103 this.fire('ct-examine-failures', this.group); | 109 this.fire('ct-examine-failures', this.group); |
| 104 }, | 110 }, |
| 105 | 111 |
| 106 snooze: function() { | 112 snooze: function() { |
| 107 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 113 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 108 }, | 114 }, |
| 109 | 115 |
| 110 unsnooze: function() { | 116 unsnooze: function() { |
| 111 this.group.unsnooze(); | 117 this.group.unsnooze(); |
| 112 }, | 118 }, |
| 113 | 119 |
| 114 _commits: function() { | 120 _updateCommitList: function() { |
| 115 if (!this.group) | 121 this._commitList = this.group ? |
| 116 return undefined; | 122 this.group.commitList(this.commitLog) : undefined; |
| 117 return this.group.commitList(this.commits); | |
| 118 }, | 123 }, |
| 119 | 124 |
| 120 linkBug: function() { | 125 linkBug: function() { |
| 121 this.$.bug.value = this.group.bug; | 126 this.$.bug.value = this.group.bug; |
| 122 this.$.bugDialog.toggle(); | 127 this.$.bugDialog.toggle(); |
| 123 }, | 128 }, |
| 124 | 129 |
| 125 saveBug: function() { | 130 saveBug: function() { |
| 126 this.group.setBug(this.$.bug.value); | 131 this.group.setBug(this.$.bug.value); |
| 127 }, | 132 }, |
| 128 | 133 |
| 129 removeBug: function() { | 134 removeBug: function() { |
| 130 this.group.clearBug(); | 135 this.group.clearBug(); |
| 131 }, | 136 }, |
| 132 }); | 137 }); |
| 133 </script> | 138 </script> |
| 134 </polymer-element> | 139 </polymer-element> |
| OLD | NEW |