| OLD | NEW |
| 1 <link rel="import" href="/bower_components/polymer/polymer.html"> | 1 <link rel="import" href="/bower_components/polymer/polymer.html"> |
| 2 <link rel="import" href="/bower_components/iron-ajax/iron-ajax.html"> | 2 <link rel="import" href="/bower_components/iron-ajax/iron-ajax.html"> |
| 3 <link rel="import" href="/bower_components/iron-flex-layout/classes/iron-flex-la
yout.html"> | 3 <link rel="import" href="/bower_components/iron-flex-layout/classes/iron-flex-la
yout.html"> |
| 4 <link rel="import" href="/bower_components/iron-icons/hardware-icons.html"> | 4 <link rel="import" href="/bower_components/iron-icons/hardware-icons.html"> |
| 5 <link rel="import" href="/bower_components/iron-icon/iron-icon.html"> | 5 <link rel="import" href="/bower_components/iron-icon/iron-icon.html"> |
| 6 <link rel="import" href="/bower_components/iron-icons/iron-icons.html"> | 6 <link rel="import" href="/bower_components/iron-icons/iron-icons.html"> |
| 7 <link rel="import" href="/bower_components/iron-list/iron-list.html"> | 7 <link rel="import" href="/bower_components/iron-list/iron-list.html"> |
| 8 <link rel="import" href="/bower_components/iron-location/iron-location.html"> | 8 <link rel="import" href="/bower_components/iron-location/iron-location.html"> |
| 9 <link rel="import" href="/bower_components/iron-pages/iron-pages.html"> | 9 <link rel="import" href="/bower_components/iron-pages/iron-pages.html"> |
| 10 <link rel="import" href="/bower_components/neon-animation/animations/scale-up-an
imation.html"> | 10 <link rel="import" href="/bower_components/neon-animation/animations/scale-up-an
imation.html"> |
| 11 <link rel="import" href="/bower_components/neon-animation/animations/fade-out-an
imation.html"> | 11 <link rel="import" href="/bower_components/neon-animation/animations/fade-out-an
imation.html"> |
| 12 <link rel="import" href="/bower_components/paper-badge/paper-badge.html"> | 12 <link rel="import" href="/bower_components/paper-badge/paper-badge.html"> |
| 13 <link rel="import" href="/bower_components/paper-button/paper-button.html"> | 13 <link rel="import" href="/bower_components/paper-button/paper-button.html"> |
| 14 <link rel="import" href="/bower_components/paper-dialog/paper-dialog.html"> | 14 <link rel="import" href="/bower_components/paper-dialog/paper-dialog.html"> |
| 15 <link rel="import" href="/bower_components/paper-drawer-panel/paper-drawer-panel
.html"> | 15 <link rel="import" href="/bower_components/paper-drawer-panel/paper-drawer-panel
.html"> |
| 16 <link rel="import" href="/bower_components/paper-header-panel/paper-header-panel
.html"> | 16 <link rel="import" href="/bower_components/paper-header-panel/paper-header-panel
.html"> |
| 17 <link rel="import" href="/bower_components/paper-icon-button/paper-icon-button.h
tml"> | 17 <link rel="import" href="/bower_components/paper-icon-button/paper-icon-button.h
tml"> |
| 18 <link rel="import" href="/bower_components/paper-input/paper-input.html"> | 18 <link rel="import" href="/bower_components/paper-input/paper-input.html"> |
| 19 <link rel="import" href="/bower_components/paper-spinner/paper-spinner.html"> | 19 <link rel="import" href="/bower_components/paper-spinner/paper-spinner.html"> |
| 20 <link rel="import" href="/bower_components/paper-toolbar/paper-toolbar.html"> | 20 <link rel="import" href="/bower_components/paper-toolbar/paper-toolbar.html"> |
| 21 <link rel="import" href="/elements/som-alert-item.html"> | 21 <link rel="import" href="/elements/som-alert-item.html"> |
| 22 <link rel="import" href="/elements/som-bug-queue.html"> |
| 22 <link rel="import" href="/elements/som-drawer.html"> | 23 <link rel="import" href="/elements/som-drawer.html"> |
| 23 <link rel="import" href="/elements/som-examine.html"> | 24 <link rel="import" href="/elements/som-examine.html"> |
| 24 | 25 |
| 25 <dom-module id="som-app"> | 26 <dom-module id="som-app"> |
| 26 <template> | 27 <template> |
| 27 <style> | 28 <style> |
| 28 paper-toolbar { | 29 paper-toolbar { |
| 29 --paper-toolbar-background: black; | 30 --paper-toolbar-background: black; |
| 30 } | 31 } |
| 31 paper-header-panel /deep/ #mainContainer { | 32 paper-header-panel /deep/ #mainContainer { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 <div class="user-name"> | 119 <div class="user-name"> |
| 119 [[user]] (<a href$="[[logoutUrl]]">Log Out </a>) | 120 [[user]] (<a href$="[[logoutUrl]]">Log Out </a>) |
| 120 </div> | 121 </div> |
| 121 <paper-icon-button on-tap="_refresh" id="refresh" icon="refresh"></p
aper-icon-button> | 122 <paper-icon-button on-tap="_refresh" id="refresh" icon="refresh"></p
aper-icon-button> |
| 122 </div> | 123 </div> |
| 123 <paper-spinner active="[[_networkActive]]"></paper-spinner> | 124 <paper-spinner active="[[_networkActive]]"></paper-spinner> |
| 124 </paper-toolbar> | 125 </paper-toolbar> |
| 125 <div class="flex layout vertical"> | 126 <div class="flex layout vertical"> |
| 126 <iron-pages attr-for-selected='id' selected="[[_selectedPage]]" class=
"flex layout vertical"> | 127 <iron-pages attr-for-selected='id' selected="[[_selectedPage]]" class=
"flex layout vertical"> |
| 127 <div id="alertsList"> | 128 <div id="alertsList"> |
| 128 <div hidden$="[[_haveAlerts]]"> | 129 <som-bug-queue id="bugQueue" alerts-group="[[_alertsGroup]]"></som-
bug-queue> |
| 130 <div hidden$="[[_haveAlerts]]"> |
| 129 No alerts! | 131 No alerts! |
| 130 </div> | 132 </div> |
| 131 <iron-list id="alertsIronList" items="[[_alerts]]" as="alert" clas
s="fit" selection-enabled multi-selection> | 133 <iron-list id="alertsIronList" items="[[_alerts]]" as="alert" sele
ction-enabled multi-selection> |
| 132 <template> | 134 <template> |
| 133 <div class="list-item" tabindex$="[[tabIndex]]"> | 135 <div class="list-item" tabindex$="[[tabIndex]]"> |
| 134 <som-alert-item | 136 <som-alert-item |
| 135 alert="{{alert}}" | 137 alert="{{alert}}" |
| 136 alerts-group="[[_alertsGroup]]" | 138 alerts-group="[[_alertsGroup]]" |
| 137 selected="[[selected]]" | 139 selected="[[selected]]" |
| 138 annotation="[[_computeAnnotation(annotations, alert)]]" | 140 annotation="[[_computeAnnotation(annotations, alert)]]" |
| 139 on-annotation-change="_handleAnnotation" | 141 on-annotation-change="_handleAnnotation" |
| 140 on-link-bug="_handleLinkBug" | 142 on-link-bug="_handleLinkBug" |
| 141 ></som-alert-item> | 143 ></som-alert-item> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 type: Object, | 218 type: Object, |
| 217 value: function() { return {}; }, | 219 value: function() { return {}; }, |
| 218 }, | 220 }, |
| 219 _bugModel: Object, | 221 _bugModel: Object, |
| 220 _filedBug: { | 222 _filedBug: { |
| 221 type: Boolean, | 223 type: Boolean, |
| 222 value: false, | 224 value: false, |
| 223 }, | 225 }, |
| 224 _haveAlerts: { | 226 _haveAlerts: { |
| 225 type: Boolean, | 227 type: Boolean, |
| 226 computed: '_computeHaveAlerts(alerts)', | 228 computed: '_computeHaveAlerts(_alerts)', |
| 227 }, | 229 }, |
| 228 logoutUrl: String, | 230 logoutUrl: String, |
| 229 _networkActive: { | 231 _networkActive: { |
| 230 type: Boolean, | 232 type: Boolean, |
| 231 value: false, | 233 value: false, |
| 232 }, | 234 }, |
| 233 _path: { | 235 _path: { |
| 234 type: String, | 236 type: String, |
| 235 }, | 237 }, |
| 236 _selectedPage: { | 238 _selectedPage: { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 253 }, | 255 }, |
| 254 | 256 |
| 255 created: function() { | 257 created: function() { |
| 256 this.async(this._refreshAsync, refreshDelayMs); | 258 this.async(this._refreshAsync, refreshDelayMs); |
| 257 }, | 259 }, |
| 258 | 260 |
| 259 ////////////////////// Refresh /////////////////////////// | 261 ////////////////////// Refresh /////////////////////////// |
| 260 | 262 |
| 261 _refresh: function() { | 263 _refresh: function() { |
| 262 this.$.alertsAjax.generateRequest(); | 264 this.$.alertsAjax.generateRequest(); |
| 265 this.$.bugQueue.refresh(); |
| 263 }, | 266 }, |
| 264 | 267 |
| 265 _refreshAsync: function() { | 268 _refreshAsync: function() { |
| 266 this._refresh(); | 269 this._refresh(); |
| 267 this.async(this._refreshAsync, refreshDelayMs); | 270 this.async(this._refreshAsync, refreshDelayMs); |
| 268 }, | 271 }, |
| 269 | 272 |
| 270 ////////////////////// Alerts and path /////////////////////////// | 273 ////////////////////// Alerts and path /////////////////////////// |
| 271 | 274 |
| 272 _computeAlertsGroup: function(path) { | 275 _computeAlertsGroup: function(path) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 let aAnn = this._computeAnnotation(annotations, a); | 346 let aAnn = this._computeAnnotation(annotations, a); |
| 344 let bAnn = this._computeAnnotation(annotations, b); | 347 let bAnn = this._computeAnnotation(annotations, b); |
| 345 | 348 |
| 346 if (aAnn.snoozed == bAnn.snoozed) { | 349 if (aAnn.snoozed == bAnn.snoozed) { |
| 347 return a.severity - b.severity; | 350 return a.severity - b.severity; |
| 348 } | 351 } |
| 349 | 352 |
| 350 return aAnn.snoozed ? 1 : -1; | 353 return aAnn.snoozed ? 1 : -1; |
| 351 }); | 354 }); |
| 352 | 355 |
| 356 // Otherwise alertsIronList doesn't render all of the alert items. |
| 357 setTimeout(() => { |
| 358 this.$.alertsIronList.notifyResize(); |
| 359 }, 250); |
| 360 |
| 353 return alerts; | 361 return alerts; |
| 354 }, | 362 }, |
| 355 | 363 |
| 364 _computeHaveAlerts: function(alerts) { |
| 365 if (!alerts) { |
| 366 return true; |
| 367 } |
| 368 return alerts.length > 0; |
| 369 }, |
| 370 |
| 356 ////////////////////// Annotations /////////////////////////// | 371 ////////////////////// Annotations /////////////////////////// |
| 357 | 372 |
| 358 _computeAnnotations: function(annotationsJson) { | 373 _computeAnnotations: function(annotationsJson) { |
| 359 let annotations = {}; | 374 let annotations = {}; |
| 360 if (!annotationsJson) { | 375 if (!annotationsJson) { |
| 361 return annotations; | 376 return annotations; |
| 362 } | 377 } |
| 363 annotationsJson.forEach(function(annotation) { | 378 annotationsJson.forEach(function(annotation) { |
| 364 annotations[annotation.key] = annotation; | 379 annotations[annotation.key] = annotation; |
| 365 }); | 380 }); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 _saveBug: function() { | 452 _saveBug: function() { |
| 438 this._sendAnnotation( | 453 this._sendAnnotation( |
| 439 this._keyForAlert(this._bugModel), 'add', { | 454 this._keyForAlert(this._bugModel), 'add', { |
| 440 bugs: [this.$.bug.value] | 455 bugs: [this.$.bug.value] |
| 441 }); | 456 }); |
| 442 }, | 457 }, |
| 443 }); | 458 }); |
| 444 })(); | 459 })(); |
| 445 </script> | 460 </script> |
| 446 </dom-module> | 461 </dom-module> |
| OLD | NEW |