Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: appengine/sheriff_o_matic/ui/ct-unexpected-failures.html

Issue 1315693002: SoM: upgrade Polymer from 0.5 to 1.0 Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: get bower_components from polymer_1.0.4 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-trooper-card.html ('k') | appengine/sheriff_o_matic/ui/ct-user-prefs.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/sheriff_o_matic/ui/ct-unexpected-failures.html
diff --git a/appengine/sheriff_o_matic/ui/ct-unexpected-failures.html b/appengine/sheriff_o_matic/ui/ct-unexpected-failures.html
index 7d8962bbe45113f4bcff7a22b94391741c24b22d..0212bb6eb3b79e46591fd5181435cf9d4e79945c 100644
--- a/appengine/sheriff_o_matic/ui/ct-unexpected-failures.html
+++ b/appengine/sheriff_o_matic/ui/ct-unexpected-failures.html
@@ -2,10 +2,8 @@
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
--->
-
-<link rel="import" href="../bower_components/paper-button/paper-button.html">
-<link rel="import" href="../bower_components/paper-shadow/paper-shadow.html">
+--><html><head><link rel="import" href="../bower_components/paper-button/paper-button.html">
+<link rel="import" href="../bower_components/paper-material/paper-material.html">
<link rel="import" href="../model/tree-status.html">
<link rel="import" href="ct-alerts.html">
<link rel="import" href="ct-failure-stream.html">
@@ -14,9 +12,8 @@ found in the LICENSE file.
<link rel="import" href="ct-time-series.html">
<link rel="import" href="ct-tree-status.html">
-<polymer-element name="ct-unexpected-failures" attributes="tree repositories failures">
- <template>
- <style>
+<dom-module id="ct-unexpected-failures">
+ <style>
.toolbar {
display: flex;
justify-content: space-between;
@@ -32,59 +29,85 @@ found in the LICENSE file.
text-align: center;
}
</style>
+ <template>
<ct-tree-status status="{{ treeStatuses['chromium'] }}" state="{{ treeStatuses['chromium'].status }}"></ct-tree-status>
- <template if="{{ tree == 'blink' }}">
+ <template is="dom-if" if="{{computeIf(tree)}}">
<ct-tree-status status="{{ treeStatuses['blink'] }}" state="{{ treeStatuses['blink'].status }}"></ct-tree-status>
</template>
- <template if="{{ tree == 'trooper' }}">
+ <template is="dom-if" if="{{computeIf2(tree)}}">
<ct-tree-status status="{{ treeStatuses['infra'] }}" state="{{ treeStatuses['infra'].status }}"></ct-tree-status>
- <paper-shadow z="1">
+ <paper-material elevation="1">
<div class="trooper-bugs">
- <a href="https://code.google.com/p/chromium/issues/list?can=2&q=Infra%3DTroopers">
+ <a href="https://code.google.com/p/chromium/issues/list?can=2&amp;q=Infra%3DTroopers">
Current Trooper bug list
</a>
</div>
- </paper-shadow>
+ </paper-material>
</template>
- <template if="{{ tree == 'time-series-alerts' }}">
+ <template is="dom-if" if="{{computeIf3(tree)}}">
<ct-time-series>
</ct-time-series>
</template>
- <template if="{{ tree != 'time-series-alerts' && (!failures.failures[tree] || failures.failures[tree].length == 0) }}">
+ <template is="dom-if" if="{{computeIf4(failures, tree)}}">
<ct-party-time></ct-party-time>
</template>
- <ct-failure-stream caption="Tree closers" category="treeCloser" groups="{{ failures && failures.failures[tree] }}" repositories="{{ repositories }}"></ct-failure-stream>
- <ct-failure-stream caption="Probably-hung bots" category="builder" groups="{{ failures && failures.failures[tree] }}" repositories="{{ repositories }}"></ct-failure-stream>
- <ct-failure-stream caption="Reliable failures" category="default" groups="{{ failures && failures.failures[tree] }}" repositories="{{ repositories }}"></ct-failure-stream>
- <ct-failure-stream caption="Failures that have only happened once (on one bot)" category="failedOnce" groups="{{ failures && failures.failures[tree] }}" repositories="{{ repositories }}"></ct-failure-stream>
- <ct-failure-stream caption="Snoozed failures" category="snoozed" groups="{{ failures && failures.failures[tree] }}" repositories="{{ repositories }}"></ct-failure-stream>
+ <ct-failure-stream caption="Tree closers" category="treeCloser" groups="{{computeGroups(failures, tree)}}" repositories="{{computeGroups(failures, tree)}}"></ct-failure-stream>
+ <ct-failure-stream caption="Probably-hung bots" category="builder" groups="{{computeGroups(failures, tree)}}" repositories="{{computeGroups(failures, tree)}}"></ct-failure-stream>
+ <ct-failure-stream caption="Reliable failures" category="default" groups="{{computeGroups(failures, tree)}}" repositories="{{computeGroups(failures, tree)}}"></ct-failure-stream>
+ <ct-failure-stream caption="Failures that have only happened once (on one bot)" category="failedOnce" groups="{{computeGroups(failures, tree)}}" repositories="{{computeGroups(failures, tree)}}"></ct-failure-stream>
+ <ct-failure-stream caption="Snoozed failures" category="snoozed" groups="{{computeGroups(failures, tree)}}" repositories="{{ repositories }}"></ct-failure-stream>
</template>
<script>
- (function() {
- Polymer({
- tree: '',
-
- created: function() {
- this.treeStatuses = {};
- var projects = ['chromium', 'blink', 'infra'];
- for (var i = 0; i < projects.length; i++) {
- this.treeStatuses[projects[i]] = new TreeStatus(projects[i]);
+ (function () {
+ Polymer({
+ is: 'ct-unexpected-failures',
+ properties: {
+ failures: { notify: true },
+ repositories: { notify: true },
+ tree: {
+ type: String,
+ value: '',
+ notify: true
+ }
+ },
+ created: function () {
+ this.treeStatuses = {};
+ var projects = [
+ 'chromium',
+ 'blink',
+ 'infra'
+ ];
+ for (var i = 0; i < projects.length; i++) {
+ this.treeStatuses[projects[i]] = new TreeStatus(projects[i]);
+ }
+ },
+ attached: function () {
+ this.update();
+ },
+ update: function () {
+ // FIXME: These shouldn't update if there's already an update in progress.
+ // This causes noticeable jank becuse <tree-status>.update makes an xhr
+ // for current?format=json every time you nav from one tree to another.
+ Object.keys(this.treeStatuses, function (tree, status) {
+ status.update();
+ });
+ },
+ computeIf: function (tree) {
+ return tree == 'blink';
+ },
+ computeIf2: function (tree) {
+ return tree == 'trooper';
+ },
+ computeIf3: function (tree) {
+ return tree == 'time-series-alerts';
+ },
+ computeIf4: function (failures, tree) {
+ return tree != 'time-series-alerts' && (!failures.failures[tree] || failures.failures[tree].length == 0);
+ },
+ computeGroups: function (failures, tree) {
+ return failures && failures.failures[tree];
}
- },
-
- attached: function() {
- this.update();
- },
-
- update: function() {
- // FIXME: These shouldn't update if there's already an update in progress.
- // This causes noticeable jank becuse <tree-status>.update makes an xhr
- // for current?format=json every time you nav from one tree to another.
- Object.keys(this.treeStatuses, function(tree, status) {
- status.update();
- });
- },
- });
- })();
+ });
+ }());
</script>
-</polymer-element>
+</dom-module>
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-trooper-card.html ('k') | appengine/sheriff_o_matic/ui/ct-user-prefs.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698