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="../bower_components/paper-button/paper-button.html"> | 7 <link rel="import" href="../bower_components/paper-button/paper-button.html"> |
| 8 <link rel="import" href="../model/ct-commit-log.html"> | 8 <link rel="import" href="../model/ct-commit-log.html"> |
| 9 <link rel="import" href="../model/tree-status.html"> | |
| 9 <link rel="import" href="ct-failure-analyzer.html"> | 10 <link rel="import" href="ct-failure-analyzer.html"> |
| 10 <link rel="import" href="ct-failure-stream.html"> | 11 <link rel="import" href="ct-failure-stream.html"> |
| 11 <link rel="import" href="ct-party-time.html"> | 12 <link rel="import" href="ct-party-time.html"> |
| 12 <link rel="import" href="ct-revision-details.html"> | 13 <link rel="import" href="ct-revision-details.html"> |
| 13 <link rel="import" href="ct-tree-status.html"> | 14 <link rel="import" href="ct-tree-status.html"> |
| 14 | 15 |
| 15 <polymer-element name="ct-unexpected-failures" attributes="tree"> | 16 <polymer-element name="ct-unexpected-failures" attributes="tree"> |
| 16 <template> | 17 <template> |
| 17 <style> | |
| 18 ct-tree-status { | |
|
ojan
2014/08/07 18:30:49
This styling was intentionally out here. You could
dsinclair
2014/08/08 13:43:47
Done.
| |
| 19 white-space: nowrap; | |
| 20 overflow: hidden; | |
| 21 text-overflow: ellipsis; | |
| 22 margin: 5px; | |
| 23 padding: 3px; | |
| 24 } | |
| 25 | |
| 26 ct-tree-status[status=open] { | |
| 27 margin: 0; | |
| 28 padding: 0; | |
| 29 } | |
| 30 </style> | |
| 31 <ct-failure-analyzer id="analyzer" failures="{{ failures }}" builderLatestRe visions="{{ builderLatestRevisions }}"></ct-failure-analyzer> | 18 <ct-failure-analyzer id="analyzer" failures="{{ failures }}" builderLatestRe visions="{{ builderLatestRevisions }}"></ct-failure-analyzer> |
| 32 <ct-tree-status project="chromium"></ct-tree-status> | 19 <div id="ctTreeStatuses"></div> |
|
ojan
2014/08/07 18:30:49
I don't think you need the domReady business if yo
dsinclair
2014/08/08 13:43:47
Done.
| |
| 33 <ct-tree-status project="blink"></ct-tree-status> | |
| 34 <ct-revision-details id="revisionDetails" builderLatestRevisions="{{ builder LatestRevisions }}" revisionLog="{{ revisionLog }}" tree="{{ tree }}"></ct-revis ion-details> | 20 <ct-revision-details id="revisionDetails" builderLatestRevisions="{{ builder LatestRevisions }}" revisionLog="{{ revisionLog }}" tree="{{ tree }}"></ct-revis ion-details> |
| 35 <ct-party-time failures="{{ failures }}" tree="{{ tree }}"></ct-party-time> | 21 <ct-party-time failures="{{ failures }}" tree="{{ tree }}"></ct-party-time> |
| 36 <ct-failure-stream groups="{{ failures[tree] }}" commits="{{ revisionLog }}" tree="{{ tree }}"></ct-failure-stream> | 22 <ct-failure-stream groups="{{ failures[tree] }}" commits="{{ revisionLog }}" tree="{{ tree }}"></ct-failure-stream> |
| 37 </template> | 23 </template> |
| 38 <script> | 24 <script> |
| 39 (function() { | 25 (function() { |
| 40 // FIXME: Make the update frequency 30 seconds again once we fix crbug.com/4 01358. | 26 // FIXME: Make the update frequency 30 seconds again once we fix crbug.com/4 01358. |
| 41 var kUpdateFrequency = 1000 * 30 * 10; | 27 var kUpdateFrequency = 1000 * 30 * 10; |
| 42 | 28 |
| 43 Polymer({ | 29 Polymer({ |
| 44 revisionLog: new CTCommitLog(), | 30 revisionLog: new CTCommitLog(), |
| 45 tree: '', | 31 tree: '', |
| 46 | 32 |
| 33 created: function() { | |
| 34 this.treeStatuses = []; | |
| 35 | |
| 36 var projects = ['chromium', 'blink']; | |
| 37 for (var i = 0; i < projects.length; i++) { | |
| 38 this.treeStatuses.add(new TreeStatus(projects[i])); | |
| 39 } | |
| 40 }, | |
| 41 | |
| 42 domReady: function() { | |
| 43 for (var i = 0; i < this.treeStatuses.length; i++) { | |
| 44 var ctTreeStatus = document.createElement('ct-tree-status'); | |
| 45 ctTreeStatus.treeStatus = this.treeStatuses[i]; | |
| 46 this.$.ctTreeStatuses.appendChild(ctTreeStatus); | |
| 47 } | |
| 48 }, | |
| 49 | |
| 47 attached: function() { | 50 attached: function() { |
| 48 this.update(); | 51 this.update(); |
| 49 setInterval(this.update.bind(this), kUpdateFrequency); | 52 setInterval(this.update.bind(this), kUpdateFrequency); |
| 50 }, | 53 }, |
| 51 | 54 |
| 52 update: function() { | 55 update: function() { |
| 53 // FIXME: These shouldn't update if there's already an update in progres s. | 56 // FIXME: These shouldn't update if there's already an update in progres s. |
| 54 this.revisionLog.update(); | 57 this.revisionLog.update(); |
| 55 this.$.analyzer.update(); | 58 this.$.analyzer.update(); |
| 56 var treeStatuses = this.shadowRoot.querySelectorAll("ct-tree-status"); | 59 for (var i = 0; i < this.treeStatuses.length; i++) |
|
ojan
2014/08/07 18:30:48
If treeStatuses is an object, you can still iterat
dsinclair
2014/08/08 13:43:47
Done.
| |
| 57 for (var i = 0; i < treeStatuses.length; i++) | 60 this.treeStatuses[i].update(); |
| 58 treeStatuses[i].update(); | |
| 59 }, | 61 }, |
| 60 }); | 62 }); |
| 61 })(); | 63 })(); |
| 62 </script> | 64 </script> |
| 63 </polymer-element> | 65 </polymer-element> |
| OLD | NEW |