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

Unified Diff: dashboard/dashboard/elements/bug-info-span.html

Issue 1926883002: [Polymer 1.0] Convert bug-info and bug-info-span to Polymer 1.0. (Closed) Base URL: https://github.com/catapult-project/catapult.git@polymer10-migration
Patch Set: Created 4 years, 8 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 | « dashboard/dashboard/elements/bug-info.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/bug-info-span.html
diff --git a/dashboard/dashboard/elements/bug-info-span.html b/dashboard/dashboard/elements/bug-info-span.html
index 9bedae36b9baf69b16e2c37bcd0588ab90fb598d..79c2a96fb0a0cefc05d2caf58dc67f3fc1376b2d 100644
--- a/dashboard/dashboard/elements/bug-info-span.html
+++ b/dashboard/dashboard/elements/bug-info-span.html
@@ -11,27 +11,51 @@ TODO(qyearsley): Expand this element and use it in chart-tooltip.
<link rel="import" href="/dashboard/elements/alert-remove-box.html">
-<polymer-element name="bug-info-span">
+<dom-module id="bug-info-span">
<template>
<a href="/group_report?bug_id={{bugId}}"
- hidden?="{{!(bugId > 0)}}">{{bugId}}</a>
- <span hidden?="{{bugId != -1}}">Invalid</span>
- <span hidden?="{{bugId != -2}}">Ignored</span>
- <span hidden?="{{!recovered}}">Recovered</span>
- <alert-remove-box hidden?="{{!bugId}}"
+ hidden$="{{!computeIsPositive(bugId)}}">{{bugId}}</a>
+ <span hidden$="{{computeIsPositive(bugId)}}">{{statusString()}}</span>
+ <alert-remove-box hidden$="{{!bugId}}"
key="{{key}}"
xsrfToken="{{xsrfToken}}">
</alert-remove-box>
</template>
<script>
'use strict';
- Polymer('bug-info-span', {
- publish: {
- bugId: null,
- xsrfToken: null,
- recovered: false,
- key: null
+ Polymer({
+ is: 'bug-info-span',
+ properties: {
+ bugId: {
+ type: Number,
+ value: 0
+ },
+ xsrfToken: {
+ value: null,
+ notify: True
+ },
+ recovered: {
+ type: Boolean,
+ value: false
+ },
+ key: {
+ value: null,
+ notify: True
+ }
+ },
+
+ computeIsPositive: n => n > 0,
+
+ statusString: function() {
+ if (this.bugId == -1)
+ return 'Invalid';
+ else if (this.bugId == -2)
+ return 'Ignored';
+ else if (this.recovered)
+ return 'Recovered';
+ else
+ return 'Unknown';
}
});
</script>
-</polymer-element>
+</dom-module>
« no previous file with comments | « dashboard/dashboard/elements/bug-info.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698