OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/dashboard/elements/chart-container.html"> | 7 <link rel="import" href="/dashboard/elements/chart-container.html"> |
8 <link rel="import" href="/dashboard/elements/test-picker.html"> | 8 <link rel="import" href="/dashboard/elements/test-picker.html"> |
9 <link rel="import" href="/dashboard/static/events.html"> | 9 <link rel="import" href="/dashboard/static/events.html"> |
10 <link rel="import" href="/dashboard/static/series_group.html"> | 10 <link rel="import" href="/dashboard/static/series_group.html"> |
(...skipping 23 matching lines...) Expand all Loading... |
34 bug #{{warningBug}}.</a> | 34 bug #{{warningBug}}.</a> |
35 </template> | 35 </template> |
36 </div> | 36 </div> |
37 </div> | 37 </div> |
38 | 38 |
39 </template> | 39 </template> |
40 | 40 |
41 <script> | 41 <script> |
42 'use strict'; | 42 'use strict'; |
43 Polymer({ | 43 Polymer({ |
| 44 is: 'report-page', |
44 | 45 |
45 is: 'report-page', | 46 listeners: { |
| 47 populateTestPicker: 'populateTestPicker_', |
| 48 }, |
| 49 |
46 properties: { | 50 properties: { |
47 charts: { | 51 charts: { |
48 type: Array, | 52 type: Array, |
49 value: () => [], | 53 value: () => [], |
50 notify: true | 54 notify: true |
51 }, | 55 }, |
52 hasChart: { notify: true }, | 56 hasChart: { notify: true }, |
53 onRevisionRange: { observer: 'onRevisionRangeChanged' }, | 57 onRevisionRange: { observer: 'onRevisionRangeChanged' }, |
54 graphParams: { | 58 graphParams: { |
55 type: Object, | 59 type: Object, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 118 |
115 this.testPicker = this.$['test-picker']; | 119 this.testPicker = this.$['test-picker']; |
116 this.testPicker.addEventListener( | 120 this.testPicker.addEventListener( |
117 'add', this.onAddChartButtonClicked.bind(this)); | 121 'add', this.onAddChartButtonClicked.bind(this)); |
118 | 122 |
119 events.addEventListener(window, 'uriload', this.onUriLoad.bind(this)); | 123 events.addEventListener(window, 'uriload', this.onUriLoad.bind(this)); |
120 this.uriController = new uri.Controller(this.getPageState.bind(this)); | 124 this.uriController = new uri.Controller(this.getPageState.bind(this)); |
121 this.uriController.load(); | 125 this.uriController.load(); |
122 }, | 126 }, |
123 | 127 |
| 128 async populateTestPicker_(event) { |
| 129 this.testPicker.scrollIntoViewIfNeeded(); |
| 130 await this.testPicker.setCurrentSelectedPath(event.detail.testPath); |
| 131 }, |
| 132 |
124 /** | 133 /** |
125 * On 'uriload' event, adds charts from the current query parameters. | 134 * On 'uriload' event, adds charts from the current query parameters. |
126 * @param {Object} event Event object. | 135 * @param {Object} event Event object. |
127 */ | 136 */ |
128 onUriLoad(event) { | 137 onUriLoad(event) { |
129 const params = event.detail.params; | 138 const params = event.detail.params; |
130 const pageState = event.detail.state; | 139 const pageState = event.detail.state; |
131 if (!pageState) { | 140 if (!pageState) { |
132 return; | 141 return; |
133 } | 142 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } else if (status == 'error') { | 309 } else if (status == 'error') { |
301 this.fire('display-toast', { | 310 this.fire('display-toast', { |
302 'text': 'Failed to save report.', | 311 'text': 'Failed to save report.', |
303 'error': true | 312 'error': true |
304 }); | 313 }); |
305 } | 314 } |
306 } | 315 } |
307 }); | 316 }); |
308 </script> | 317 </script> |
309 </dom-module> | 318 </dom-module> |
OLD | NEW |