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

Unified Diff: appengine/sheriff_o_matic/ui/ct-health.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
Index: appengine/sheriff_o_matic/ui/ct-health.html
diff --git a/appengine/sheriff_o_matic/ui/ct-health.html b/appengine/sheriff_o_matic/ui/ct-health.html
index 5ad91bae0c421f1a7abea855732a313eb40660d0..d09aeb83b3a6c332dfc07fcd86f961a8c9c58be5 100644
--- a/appengine/sheriff_o_matic/ui/ct-health.html
+++ b/appengine/sheriff_o_matic/ui/ct-health.html
@@ -2,19 +2,41 @@
Copyright 2015 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="ct-trooper-card.html">
-<polymer-element name="ct-health" attributes="failures" noscript>
-<template>
+--><html><head><link rel="import" href="ct-trooper-card.html">
+<dom-module id="ct-health">
+ <template>
<h2>System Health</h2>
- <template repeat="{{ group in failures.failures['health'] }}">
- <template if="{{ group.data.category == 'trooper' }}">
- <ct-trooper-card class='{{ { snoozed: group.isSnoozed } | tokenList }}' group="{{ group.data }}"></ct-trooper-card>
+ <template is="dom-repeat" items="{{failures.failures['health']}}" as="group">
+ <template is="dom-if" if="{{computeIf2(group)}}">
+ <ct-trooper-card group="{{ group.data }}" class$="{{computeClass(group)}}"></ct-trooper-card>
</template>
</template>
- <template if="{{ !failures.failures['health'] || failures.failures['health'].length == 0 }}">
+ <template is="dom-if" if="{{computeIf(failures)}}">
<ct-party-time></ct-party-time>
</template>
</template>
-</polymer-element>
+ <script>
+ Polymer({
+ is: 'ct-health',
+ properties: { failures: { notify: true } },
+ computeIf: function (failures) {
+ return !failures.failures['health'] || failures.failures['health'].length == 0;
+ },
+ computeIf2: function (group) {
+ return group.data.category == 'trooper';
+ },
+ computeClass: function (group) {
+ return this.tokenList({ snoozed: group.isSnoozed });
+ },
+ tokenList: function (obj) {
+ var pieces = [];
+ for (key in obj) {
+ if (obj[key]) {
+ pieces.push(key);
+ }
+ }
+ return pieces.join(' ');
+ }
+ });
+ </script>
+</dom-module>
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html ('k') | appengine/sheriff_o_matic/ui/ct-last-updated.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698