| OLD | NEW |
| 1 <!-- Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 <!-- Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 Use of this source code is governed by a BSD-style license that can be | 2 Use of this source code is governed by a BSD-style license that can be |
| 3 found in the LICENSE file. --> | 3 found in the LICENSE file. --> |
| 4 | 4 |
| 5 <link rel="import" href="../common/cr-action.html"> | 5 <link rel="import" href="../common/cr-action.html"> |
| 6 <link rel="import" href="../common/cr-toolbar.html"> | 6 <link rel="import" href="../common/cr-toolbar.html"> |
| 7 <link rel="import" href="cr-issue-cq-dry-run-dialog.html"> | 7 <link rel="import" href="cr-issue-cq-dry-run-dialog.html"> |
| 8 <link rel="import" href="cr-issue-patchfile.html"> | 8 <link rel="import" href="cr-issue-patchfile.html"> |
| 9 <link rel="import" href="cr-try-results.html"> | 9 <link rel="import" href="cr-try-results.html"> |
| 10 <link rel="import" href="../diff/cr-diff-controls.html"> | 10 <link rel="import" href="../diff/cr-diff-controls.html"> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 </h2> | 57 </h2> |
| 58 <template if="{{ tryJobResults.length }}"> | 58 <template if="{{ tryJobResults.length }}"> |
| 59 <cr-try-results results="{{ tryJobResults }}"></cr-try-resul
ts> | 59 <cr-try-results results="{{ tryJobResults }}"></cr-try-resul
ts> |
| 60 </template> | 60 </template> |
| 61 <template if="{{ patchset.mostRecent && !patchset.issue.closed &
& !patchset.issue.commit }}"> | 61 <template if="{{ patchset.mostRecent && !patchset.issue.closed &
& !patchset.issue.commit }}"> |
| 62 <a class="choose-trybots" is="cr-action" on-tap="{{ handleAd
dMore }}">Choose try jobs</a> / | 62 <a class="choose-trybots" is="cr-action" on-tap="{{ handleAd
dMore }}">Choose try jobs</a> / |
| 63 <a class="trigger-dry-run" is="cr-action" on-tap="{{ showDry
RunDialog }}">CQ dry run</a> | 63 <a class="trigger-dry-run" is="cr-action" on-tap="{{ showDry
RunDialog }}">CQ dry run</a> |
| 64 </template> | 64 </template> |
| 65 </div> | 65 </div> |
| 66 </template> | 66 </template> |
| 67 <template if="{{ patchset.dependsOnPatchset }}"> |
| 68 <div id="depends-on-patchset"> |
| 69 <h2> |
| 70 Depends on Patchset |
| 71 </h2> |
| 72 <div class="{{ { linethrough: patchset.dependsOnPatchset.issue.c
losed } | tokenList }}"> |
| 73 <a class="view-depends-on-patchset" href="{{ patchset.depend
sOnPatchset | getPatchsetUrl }}" target="_blank"> |
| 74 Issue {{ patchset.dependsOnPatchset.issue.id }} Patch {{
patchset.dependsOnPatchset.id }} |
| 75 </a> |
| 76 </div> |
| 77 </div> |
| 78 </template> |
| 79 <template if="{{ patchset.dependentPatchsets }}"> |
| 80 <div id="dependent-patchsets"> |
| 81 <h2> |
| 82 Dependent Patchsets |
| 83 </h2> |
| 84 <template repeat="{{ dependentPatchset in patchset.dependentPatc
hsets }}"> |
| 85 <div class="{{ { linethrough: dependentPatchset.issue.closed
} | tokenList }}"> |
| 86 <a class="view-dependent-patchsets" href="{{ dependentPa
tchset | getPatchsetUrl }}" target="_blank"> |
| 87 Issue {{ dependentPatchset.issue.id }} Patch {{ depe
ndentPatchset.id }} |
| 88 </a> |
| 89 </div> |
| 90 </template> |
| 91 </div> |
| 92 </template> |
| 67 <div id="dialogs"></div> | 93 <div id="dialogs"></div> |
| 68 </template> | 94 </template> |
| 69 <script> | 95 <script> |
| 70 Polymer({ | 96 Polymer({ |
| 71 created: function() { | 97 created: function() { |
| 72 this.patchset = null; | 98 this.patchset = null; |
| 73 this.tryJobResults = null; | 99 this.tryJobResults = null; |
| 74 }, | 100 }, |
| 75 showDryRunDialog: function() { | 101 showDryRunDialog: function() { |
| 76 if (this.patchset.issue.closed) | 102 if (this.patchset.issue.closed) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 88 patchsetChanged: function(oldValue, newValue) { | 114 patchsetChanged: function(oldValue, newValue) { |
| 89 var self = this; | 115 var self = this; |
| 90 var list = new TryJobResultList(this.patchset); | 116 var list = new TryJobResultList(this.patchset); |
| 91 list.loadResults().then(function(results) { | 117 list.loadResults().then(function(results) { |
| 92 self.tryJobResults = results; | 118 self.tryJobResults = results; |
| 93 }).catch(function(e) { | 119 }).catch(function(e) { |
| 94 // TODO(esprehn): Show an error. | 120 // TODO(esprehn): Show an error. |
| 95 console.log(e); | 121 console.log(e); |
| 96 }); | 122 }); |
| 97 }, | 123 }, |
| 124 getPatchsetUrl: function(patchset) { |
| 125 return patchset.getPatchsetUrl(); |
| 126 }, |
| 98 getFiles: function() { | 127 getFiles: function() { |
| 99 // TODO(esprehn): Use an id instead. | 128 // TODO(esprehn): Use an id instead. |
| 100 return this.shadowRoot.querySelectorAll("cr-issue-patchfile").ar
ray(); | 129 return this.shadowRoot.querySelectorAll("cr-issue-patchfile").ar
ray(); |
| 101 }, | 130 }, |
| 102 expandAllDiffs: function() { | 131 expandAllDiffs: function() { |
| 103 return Promise.all(this.getFiles().map(function(file) { | 132 return Promise.all(this.getFiles().map(function(file) { |
| 104 return file.showDiff(); | 133 return file.showDiff(); |
| 105 })); | 134 })); |
| 106 }, | 135 }, |
| 107 collapseAllDiffs: function() { | 136 collapseAllDiffs: function() { |
| 108 return Promise.all(this.getFiles().map(function(file) { | 137 return Promise.all(this.getFiles().map(function(file) { |
| 109 return file.hideDiff(); | 138 return file.hideDiff(); |
| 110 })); | 139 })); |
| 111 }, | 140 }, |
| 112 handleAddMore: function() { | 141 handleAddMore: function() { |
| 113 this.fire("show-try-dialog"); | 142 this.fire("show-try-dialog"); |
| 114 }, | 143 }, |
| 115 }); | 144 }); |
| 116 </script> | 145 </script> |
| 117 </polymer-element> | 146 </polymer-element> |
| OLD | NEW |