Chromium Code Reviews| Index: go/src/infra/appengine/sheriff-o-matic/elements/som-bug-queue.html |
| diff --git a/go/src/infra/appengine/sheriff-o-matic/elements/som-bug-queue.html b/go/src/infra/appengine/sheriff-o-matic/elements/som-bug-queue.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf32aa9315c8d3e78d03f3e7bea6743b6edbf2d6 |
| --- /dev/null |
| +++ b/go/src/infra/appengine/sheriff-o-matic/elements/som-bug-queue.html |
| @@ -0,0 +1,84 @@ |
| +<link rel="import" href="/bower_components/polymer/polymer.html"> |
| + |
| +<link rel="import" href="/bower_components/iron-ajax/iron-ajax.html"> |
| + |
| +<dom-module id="som-bug-queue"> |
| + <template> |
| + <style> |
| + #main { |
| + padding: 1em; |
| + background: white; |
| + } |
| + #error { |
| + padding: 1em; |
| + color: red; |
| + } |
| + h2 { |
| + font-size: 18px; |
| + font-weight: bold; |
| + } |
| + .bug { |
| + padding: 0.5em; |
| + border-bottom: 1px solid #ddd; |
| + } |
| + .summary { |
| + font-weight: bold; |
| + } |
| + </style> |
| + <iron-ajax |
|
martiniss
2016/06/10 21:11:28
Can you make this able to be refresh? The refresh
seanmccullough1
2016/06/10 21:23:27
added a refresh() method. Is that what you mean?
|
| + auto |
| + id="bugQueueAjax" |
| + url="/api/v1/bugqueue/[[alertsGroup]]" |
| + handle-as="json" |
| + last-error="{{_bugQueueJsonError}}" |
| + last-response="{{_bugQueueJson}}" |
| + debounce-duration="300"></iron-ajax> |
| + <div id="main" hidden$="[[_haveNoBugs(_bugQueueJson)]]"> |
| + <h2>Bug Queue (<a href="https://sites.google.com/a/chromium.org/dev/developers/tree-sheriffs/sheriffing-bug-queues">What to do with this?</a>):</h2> |
| + <template is="dom-repeat" items="[[_bugQueueJson.items]]" as="item"> |
| + <div class="bug"> |
| + <div class="summary">[[item.summary]]</div> |
| + <a href="http://crbug.com/[[item.id]]">http://crbug.com/[[item.id]]</a> ([[item.status]]) |
|
martiniss
2016/06/10 21:11:28
Maybe have the link text be 'Bug 123123'? That's s
seanmccullough1
2016/06/10 21:23:27
Done.
|
| + </div> |
| + </template> |
| + </div> |
| + <div id="error" hidden$="[[_haveNoErrors(_bugQueueJsonError)]]"> |
| + Error fetching bug queue: [[_bugQueueJsonError.error]] |
| + </div> |
| + </template> |
| + <script> |
| + (function() { |
| + 'use strict'; |
| + |
| + Polymer({ |
| + is: 'som-bug-queue', |
| + |
| + properties: { |
| + alertsGroup: { |
| + type: String, |
| + }, |
| + _bugQueueJson: { |
| + type: Object, |
| + value: null, |
| + }, |
| + _bugQueueJsonError: { |
| + type: Object, |
| + value: null, |
| + }, |
| + }, |
| + |
| + _haveNoBugs: function(json) { |
| + if (!json || !json.items) { |
| + return true |
| + } |
| + |
| + return json.items.length == 0; |
| + }, |
| + |
| + _haveNoErrors: function(error) { |
| + return !error; |
| + }, |
| + }); |
| + })(); |
| + </script> |
| +</dom-module> |