Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: go/src/infra/appengine/sheriff-o-matic/elements/som-app.html

Issue 2094343004: SoM: Fixed unwanted autorefreshing bug. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Changed to use variable directly. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-location/iron-location.html"> 7 <link rel="import" href="/bower_components/iron-location/iron-location.html">
8 <link rel="import" href="/bower_components/iron-pages/iron-pages.html"> 8 <link rel="import" href="/bower_components/iron-pages/iron-pages.html">
9 <link rel="import" href="/bower_components/neon-animation/animations/scale-up-an imation.html"> 9 <link rel="import" href="/bower_components/neon-animation/animations/scale-up-an imation.html">
10 <link rel="import" href="/bower_components/neon-animation/animations/fade-out-an imation.html"> 10 <link rel="import" href="/bower_components/neon-animation/animations/fade-out-an imation.html">
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 computed: '_computeHaveAlerts(_alerts)', 252 computed: '_computeHaveAlerts(_alerts)',
253 }, 253 },
254 _hideWebkitNotice: { 254 _hideWebkitNotice: {
255 type: Boolean, 255 type: Boolean,
256 computed: '_computeHideWebkitNotice(_tree)', 256 computed: '_computeHideWebkitNotice(_tree)',
257 }, 257 },
258 logoutUrl: String, 258 logoutUrl: String,
259 _path: { 259 _path: {
260 type: String, 260 type: String,
261 }, 261 },
262 _refreshEnabled: {
263 type: Boolean,
264 computed: '_computeRefreshEnabled(_selectedPage)',
265 },
262 _refreshPosition: { 266 _refreshPosition: {
263 type: Number, 267 type: Number,
264 value: function() { return 0; }, 268 value: function() { return 0; },
265 }, 269 },
266 _selectedPage: { 270 _selectedPage: {
267 type: String, 271 type: String,
268 computed: '_computeSelectedPage(_path)', 272 computed: '_computeSelectedPage(_path)',
269 }, 273 },
270 showInfraFailures: { 274 showInfraFailures: {
271 type: Boolean, 275 type: Boolean,
(...skipping 16 matching lines...) Expand all
288 user: String, 292 user: String,
289 }, 293 },
290 294
291 created: function() { 295 created: function() {
292 this.async(this._refreshAsync, refreshDelayMs); 296 this.async(this._refreshAsync, refreshDelayMs);
293 }, 297 },
294 298
295 ////////////////////// Refresh /////////////////////////// 299 ////////////////////// Refresh ///////////////////////////
296 300
297 _refresh: function() { 301 _refresh: function() {
302 if (!this._refreshEnabled) {
303 return;
304 }
298 this._refreshPosition = this.$.mainHeaderPanel.$.mainContainer.scrollTo p; 305 this._refreshPosition = this.$.mainHeaderPanel.$.mainContainer.scrollTo p;
299 this.$.annotations.generateRequest(); 306 this.$.annotations.generateRequest();
300 this._alertsGroupsChanged(this._alertsGroups); 307 this._alertsGroupsChanged(this._alertsGroups);
301 }, 308 },
302 309
303 _refreshAsync: function() { 310 _refreshAsync: function() {
304 this._refresh(); 311 this._refresh();
305 this.async(this._refreshAsync, refreshDelayMs); 312 this.async(this._refreshAsync, refreshDelayMs);
306 }, 313 },
307 314
(...skipping 14 matching lines...) Expand all
322 return []; 329 return [];
323 } 330 }
324 331
325 if (trees && trees[tree] && trees[tree].alert_streams) { 332 if (trees && trees[tree] && trees[tree].alert_streams) {
326 return trees[tree].alert_streams 333 return trees[tree].alert_streams
327 } 334 }
328 335
329 return [tree]; 336 return [tree];
330 }, 337 },
331 338
339 _computeRefreshEnabled: function(selectedPage) {
340 return selectedPage == "alertsList";
341 },
342
332 _computeSelectedPage: function(path) { 343 _computeSelectedPage: function(path) {
333 let pathParts = path.split('/'); 344 let pathParts = path.split('/');
334 if (pathParts.length < 2) { 345 if (pathParts.length < 2) {
335 console.error('error: pathParts < 2', pathParts); 346 console.error('error: pathParts < 2', pathParts);
336 } 347 }
337 if (pathParts.length < 3) { 348 if (pathParts.length < 3) {
338 return 'alertsList'; 349 return 'alertsList';
339 } 350 }
340 if (pathParts[2] == 'examine') { 351 if (pathParts[2] == 'examine') {
341 return 'examineAlert'; 352 return 'examineAlert';
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 571 }
561 ).completes.then(() => { 572 ).completes.then(() => {
562 this.$.snoozeTime.value = ''; 573 this.$.snoozeTime.value = '';
563 }); 574 });
564 }, 575 },
565 576
566 }); 577 });
567 })(); 578 })();
568 </script> 579 </script>
569 </dom-module> 580 </dom-module>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698