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

Unified Diff: dashboard/dashboard/elements/report-page.html

Issue 2881193003: Add a button to chart-title to populate the test-picker. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/elements/chart-title.html ('k') | dashboard/dashboard/elements/test-picker.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/report-page.html
diff --git a/dashboard/dashboard/elements/report-page.html b/dashboard/dashboard/elements/report-page.html
index f32edfa3898133768889b357fd82eb4e7fdb635f..5357bfaf7aed32ff070a8de597103be0d1ea9c95 100644
--- a/dashboard/dashboard/elements/report-page.html
+++ b/dashboard/dashboard/elements/report-page.html
@@ -41,8 +41,12 @@ found in the LICENSE file.
<script>
'use strict';
Polymer({
-
is: 'report-page',
+
+ listeners: {
+ populateTestPicker: 'populateTestPicker_',
+ },
+
properties: {
charts: {
type: Array,
@@ -121,6 +125,22 @@ found in the LICENSE file.
this.uriController.load();
},
+ async populateTestPicker_(event) {
shatch 2017/05/19 19:43:53 I think it'd be cleaner if you just had chart-titl
+ // chart-title's testPaths have a different structure from test-picker's
+ // testPaths.
+ let testPath = [];
+ for (const part of event.detail.titleParts) {
+ testPath.push.apply(testPath, part.split('/'));
+ }
+
+ // chart-title's testPaths are in a different order from test-picker's
+ // testPaths.
+ testPath = [testPath[2], testPath[1]].concat(testPath.slice(3));
+
+ this.testPicker.scrollIntoViewIfNeeded();
+ await this.testPicker.setCurrentSelectedPath(testPath);
+ },
+
/**
* On 'uriload' event, adds charts from the current query parameters.
* @param {Object} event Event object.
« no previous file with comments | « dashboard/dashboard/elements/chart-title.html ('k') | dashboard/dashboard/elements/test-picker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698