| <!DOCTYPE html> |
| <!-- |
| Copyright 2016 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. |
| --> |
| <!-- |
| The bug-info-span is a in-line element showing a bug ID with link, etc. |
| TODO(qyearsley): Expand this element and use it in chart-tooltip. |
| --> |
| |
| <link rel="import" href="/dashboard/elements/alert-remove-box.html"> |
| |
| <dom-module id="bug-info-span"> |
| <template> |
| <a href="/group_report?bug_id={{bugId}}" |
| hidden$="{{!computeIsPositive(bugId)}}">{{bugId}}</a> |
| <span hidden$="{{computeIsPositive(bugId)}}">{{statusString()}}</span> |
| <alert-remove-box hidden$="{{!bugId}}" |
| key="{{key}}" |
| xsrf-token="{{xsrfToken}}"> |
| </alert-remove-box> |
| </template> |
| <script> |
| 'use strict'; |
| 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 ''; |
| } |
| }); |
| </script> |
| </dom-module> |