| OLD | NEW |
| (Empty) | |
| 1 <link rel="import" href="/bower_components/polymer/polymer.html"> |
| 2 |
| 3 <link rel="import" href="/bower_components/iron-ajax/iron-ajax.html"> |
| 4 |
| 5 <dom-module id="som-bug-queue"> |
| 6 <template> |
| 7 <style> |
| 8 #main { |
| 9 padding: 1em; |
| 10 background: white; |
| 11 } |
| 12 #error { |
| 13 padding: 1em; |
| 14 color: red; |
| 15 } |
| 16 h2 { |
| 17 font-size: 18px; |
| 18 font-weight: bold; |
| 19 } |
| 20 .bug { |
| 21 padding: 0.5em; |
| 22 border-bottom: 1px solid #ddd; |
| 23 } |
| 24 .summary { |
| 25 font-weight: bold; |
| 26 } |
| 27 </style> |
| 28 <iron-ajax |
| 29 auto |
| 30 id="bugQueueAjax" |
| 31 url="/api/v1/bugqueue/[[alertsGroup]]" |
| 32 handle-as="json" |
| 33 last-error="{{_bugQueueJsonError}}" |
| 34 last-response="{{_bugQueueJson}}" |
| 35 debounce-duration="300"></iron-ajax> |
| 36 <div id="main" hidden$="[[_haveNoBugs(_bugQueueJson)]]"> |
| 37 <h2>Bug Queue (<a href="https://sites.google.com/a/chromium.org/dev/develo
pers/tree-sheriffs/sheriffing-bug-queues">What to do with this?</a>):</h2> |
| 38 <template is="dom-repeat" items="[[_bugQueueJson.items]]" as="item"> |
| 39 <div class="bug"> |
| 40 <div class="summary">[[item.summary]]</div> |
| 41 <a href="http://crbug.com/[[item.id]]">Bug [[item.id]]</a> ([[item.sta
tus]]) |
| 42 </div> |
| 43 </template> |
| 44 </div> |
| 45 <div id="error" hidden$="[[_haveNoErrors(_bugQueueJsonError)]]"> |
| 46 Error fetching bug queue: [[_bugQueueJsonError.error]] |
| 47 </div> |
| 48 </template> |
| 49 <script> |
| 50 (function() { |
| 51 'use strict'; |
| 52 |
| 53 Polymer({ |
| 54 is: 'som-bug-queue', |
| 55 |
| 56 properties: { |
| 57 alertsGroup: { |
| 58 type: String, |
| 59 }, |
| 60 _bugQueueJson: { |
| 61 type: Object, |
| 62 value: null, |
| 63 }, |
| 64 _bugQueueJsonError: { |
| 65 type: Object, |
| 66 value: null, |
| 67 }, |
| 68 }, |
| 69 |
| 70 refresh: function() { |
| 71 this.$.bugQueueAjax.generateRequest(); |
| 72 }, |
| 73 |
| 74 _haveNoBugs: function(json) { |
| 75 if (!json || !json.items) { |
| 76 return true |
| 77 } |
| 78 |
| 79 return json.items.length == 0; |
| 80 }, |
| 81 |
| 82 _haveNoErrors: function(error) { |
| 83 return !error; |
| 84 }, |
| 85 }); |
| 86 })(); |
| 87 </script> |
| 88 </dom-module> |
| OLD | NEW |