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-bot-failure-card.html"> |
| 8 <link rel="import" href="ct-commit-list.html"> | 8 <link rel="import" href="ct-trooper-card.html"> |
| 9 <link rel="import" href="ct-test-list.html"> | |
| 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> | 9 <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"> | 10 <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"> | 11 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
| 13 | 12 |
| 14 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> | 13 <polymer-element name="ct-failure-card" attributes="group commitLog tree bug"> |
| 15 <template> | 14 <template> |
| 16 <style> | 15 <style> |
| 17 :host { | 16 :host { |
| 18 display: flex; | 17 display: flex; |
| 19 } | 18 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 40 box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); | 39 box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); |
| 41 } | 40 } |
| 42 | 41 |
| 43 paper-button:active, paper-button:hover { | 42 paper-button:active, paper-button:hover { |
| 44 background: #f8f8f8; | 43 background: #f8f8f8; |
| 45 border-color: #c6c6c6; | 44 border-color: #c6c6c6; |
| 46 box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); | 45 box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); |
| 47 color: #222; | 46 color: #222; |
| 48 } | 47 } |
| 49 | 48 |
| 50 ct-builder-grid { | |
| 51 margin-right: 10px; | |
| 52 width: 250px; | |
| 53 } | |
| 54 | |
| 55 #failure { | |
| 56 flex: 1; | |
| 57 } | |
| 58 | |
| 59 #buttons { | 49 #buttons { |
| 60 display: flex; | 50 display: flex; |
| 61 flex-direction: column; | 51 flex-direction: column; |
| 62 } | 52 } |
| 63 | 53 |
| 54 .card { | |
| 55 display: flex; | |
| 56 flex: 1; | |
| 57 } | |
| 58 | |
| 64 .snoozed { | 59 .snoozed { |
| 65 opacity: 0.5; | 60 opacity: 0.5; |
| 66 } | 61 } |
| 67 </style> | 62 </style> |
| 68 <ct-builder-grid failures="{{ group.failures }}"></ct-builder-grid> | 63 <div class="{{ { snoozed: group.isSnoozed, card: true } | tokenList }}"> |
|
ojan
2014/09/04 02:58:43
"card {{ { snoozed: ... } | tokenList }}"
shans
2014/09/05 00:08:20
Done.
| |
| 69 <div id="failure" class="{{ { snoozed: group.isSnoozed } | tokenList }}"> | 64 <template if="{{ group.data.type == 'sheriff' }}"> |
| 70 <ct-test-list tests="{{ group.failures }}" tree="{{ tree }}"></ct-test-lis t> | 65 <ct-bot-failure-card class='card' group="{{ group.data }}"></ct-bot-fail ure-card> |
| 71 <ct-commit-list commitList="{{ group.commitList }}"></ct-commit-list> | 66 </template> |
| 67 <template if="{{ group.data.type != 'sheriff' }}"> | |
|
ojan
2014/09/04 02:58:43
Nit: how about == 'trooper' instead?
shans
2014/09/05 00:08:20
I'd need to add a sub-type field. type currently c
| |
| 68 <ct-trooper-card class='card' group="{{ group.data }}"></ct-trooper-card > | |
| 69 </template> | |
| 72 </div> | 70 </div> |
| 73 <div id="buttons"> | 71 <div id="buttons"> |
| 74 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper- button> | 72 <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper- button> |
| 75 <template if="{{ !group.isSnoozed }}"> | 73 <template if="{{ !group.isSnoozed }}"> |
| 76 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b utton> | 74 <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-b utton> |
| 77 </template> | 75 </template> |
| 78 <template if="{{ group.isSnoozed }}"> | 76 <template if="{{ group.isSnoozed }}"> |
| 79 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap er-button> | 77 <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></pap er-button> |
| 80 </template> | 78 </template> |
| 81 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape r-button> | 79 <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></pape r-button> |
| 82 <template if="{{ group.bug !== undefined }}"> | 80 <template if="{{ group.bug !== undefined }}"> |
| 83 <div> | 81 <div> |
| 84 <a href="{{ group.bug }}"> | 82 <a href="{{ group.bug }}"> |
| 85 {{ group.bugLabel }}</a> | 83 {{ group.bugLabel }}</a> |
| 86 </div> | 84 </div> |
| 87 </template> | 85 </template> |
| 88 </div> | 86 </div> |
| 89 | 87 |
| 90 <paper-dialog heading="Enter bug number" transition="paper-transition-center " id="bugDialog"> | 88 <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> | 89 <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> | 90 <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> | 91 <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"> </paper-button> |
| 94 </paper-dialog> | 92 </paper-dialog> |
| 95 </template> | 93 </template> |
| 96 <script> | 94 <script> |
| 97 Polymer({ | 95 Polymer({ |
| 98 group: null, | 96 group: null, |
| 99 commitLog: null, | 97 commitLog: null, |
|
ojan
2014/09/04 02:58:43
In this design we're still passing a commitLog whe
shans
2014/09/05 00:08:19
On the other hand, if we made trooper-card a sibli
| |
| 100 tree: '', | 98 tree: '', |
| 101 | 99 |
| 102 observe: { | 100 observe: { |
| 103 group: '_updateCommitList', | 101 group: '_updateCommitList', |
| 104 commitLog: '_updateCommitList' | 102 commitLog: '_updateCommitList' |
| 105 }, | 103 }, |
| 106 | 104 |
| 107 examine: function() { | 105 examine: function() { |
| 108 this.fire('ct-examine-failures', this.group); | 106 this.fire('ct-examine-failures', this.group); |
| 109 }, | 107 }, |
| 110 | 108 |
| 111 snooze: function() { | 109 snooze: function() { |
| 112 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 110 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
| 113 }, | 111 }, |
| 114 | 112 |
| 115 unsnooze: function() { | 113 unsnooze: function() { |
| 116 this.group.unsnooze(); | 114 this.group.unsnooze(); |
| 117 }, | 115 }, |
| 118 | 116 |
| 119 _updateCommitList: function() { | 117 _updateCommitList: function() { |
| 120 if (this.group && this.commitLog) | 118 if (this.group && this.group.commitList && this.commitLog) |
|
ojan
2014/09/04 02:58:43
Isn't this still the card that doesn't have commit
shans
2014/09/05 00:08:19
No, this is the container of both card types decid
| |
| 121 this.group.commitList.update(this.commitLog); | 119 this.group.commitList.update(this.commitLog); |
| 122 }, | 120 }, |
| 123 | 121 |
| 124 linkBug: function() { | 122 linkBug: function() { |
| 125 this.$.bug.value = this.group.bug; | 123 this.$.bug.value = this.group.bug; |
| 126 this.$.bugDialog.toggle(); | 124 this.$.bugDialog.toggle(); |
| 127 }, | 125 }, |
| 128 | 126 |
| 129 saveBug: function() { | 127 saveBug: function() { |
| 130 this.group.setBug(this.$.bug.value); | 128 this.group.setBug(this.$.bug.value); |
| 131 }, | 129 }, |
| 132 | 130 |
| 133 removeBug: function() { | 131 removeBug: function() { |
| 134 this.group.clearBug(); | 132 this.group.clearBug(); |
| 135 }, | 133 }, |
| 136 }); | 134 }); |
| 137 </script> | 135 </script> |
| 138 </polymer-element> | 136 </polymer-element> |
| OLD | NEW |