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> |