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

Unified Diff: dashboard/dashboard/elements/chart-container.html

Issue 2750313003: Revert of [Dashboard] Start using /list_tests's test_path_dict mode in test-picker (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | dashboard/dashboard/elements/report-page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/chart-container.html
diff --git a/dashboard/dashboard/elements/chart-container.html b/dashboard/dashboard/elements/chart-container.html
index 3953ccf656dd5db68ebbb5f477e19a78812ceec5..ccc9aef279ac4bb31b513529ecc2c6f56f765755 100644
--- a/dashboard/dashboard/elements/chart-container.html
+++ b/dashboard/dashboard/elements/chart-container.html
@@ -622,7 +622,7 @@
*
* @param {Array.<Array>} testPathAndSelected A list of
* pair of test path and a list of selected series.
- * @param {boolean} collapse Whether unchecked and unimportant
+ * @return {boolean} collapse Whether unchecked and unimportant
* series should start off hidden.
*/
addSeriesGroup: function(testPathAndSelected, collapse) {
@@ -693,85 +693,22 @@
},
/**
- * Adds series group to graph explicitly.
- *
- * Since adding the test_path_dict mode for /list_tests, the preferred
- * flow for resolving a test path into lists of selected and unselected
- * tests is to use this endpoint to resolve them directly. This function
- * should be functionally equivalent to addSeriesGroup except for this
- * resolution step, and the goal is to replace it
- * (https://github.com/catapult-project/catapult/issues/3385).
- *
- * @param {string} mainPath The main path for this series group
- * @param {string[]} selectedPaths The selected subpaths
- * @param {string[]} unselectedPaths The unselected subpaths
- * @param {boolean} collapse Whether unchecked and unimportant
- * series should start off hidden.
- */
- addSeriesGroup2: function(
- mainPath, selectedPaths, unselectedPaths, collapse) {
- // Checks if test path already exists.
- const testPathSet = new Set(
- this.seriesGroupList.map(group => group.path));
-
- if (testPathSet.has(mainPath)) {
- return;
- }
-
- const tests = [];
- for (const selectedPath of selectedPaths) {
- tests.push({
- name: selectedPath.split('/').slice(-1)[0],
- selected: true
- });
- }
-
- const seriesGroup = {
- path: mainPath,
- tests: tests,
- collapse: collapse,
- numPendingRequests: 0
- };
-
- this.push('seriesGroupList', seriesGroup);
-
- if (selectedPaths.length > 0) {
- this.sendGraphJsonRequest(selectedPaths, true, mainPath);
- }
-
- if (unselectedPaths.length > 0) {
- this.sendGraphJsonRequest(unselectedPaths, false, mainPath);
- }
-
- this.updateSlider();
- this.$.title.update();
- },
-
-
- /**
* Sends a request for graph JSON.
*
* @param {Object} testPathDictOrList Dictionary of test path to list of
* selected series, or flat list of test paths.
- * @param {boolean} isSelected Whether this request is for selected
+ * @return {boolean} isSelected Whether this request is for selected
* or unselected series.
- * @param {String} mainPath If a list of tests is supplied, the main
- * path to which they belong, for updating the counter.
- */
- sendGraphJsonRequest: function(
- testPathDictOrList, isSelected, mainPath) {
- // TODO(eakuefner): Get rid of mainPath once loading counter is
- // cleaned up
+ */
+ sendGraphJsonRequest: function(testPathDictOrList, isSelected) {
var params = JSON.parse(JSON.stringify(this.graphParams));
if (testPathDictOrList instanceof Array) {
var testPaths = testPathDictOrList;
params.test_path_list = testPathDictOrList;
- var pathsForUpdate = [mainPath];
} else {
var testPaths = Object.keys(testPathDictOrList);
params.test_path_dict = testPathDictOrList;
- var pathsForUpdate = testPaths;
}
// TODO(eakuefner): Figure out how to remove this parameter since in
@@ -780,7 +717,7 @@
params['is_selected'] = true;
}
- this.updateSeriesGroupLoadingCounter(pathsForUpdate, true);
+ this.updateSeriesGroupLoadingCounter(testPaths, true);
var req = simple_xhr.send(
'/graph_json',
@@ -795,7 +732,7 @@
}
this.updateSeriesGroupLoadingCounter(
- pathsForUpdate, false);
+ testPaths, false);
this.$['loading-div'].style.display = 'none';
}.bind(this),
function(error) {
@@ -804,7 +741,7 @@
this.checkForInternalUser();
}
this.updateSeriesGroupLoadingCounter(
- pathsForUpdate, false);
+ testPaths, false);
this.$['loading-div'].style.display = 'none';
}.bind(this)
);
@@ -2496,8 +2433,7 @@
}
var data = JSON.parse(dataTransfer.getData('data'));
if (data) {
- this.addSeriesGroup2(
- data.mainPath, data.selectedPaths, data.unselectedPaths, true);
+ this.addSeriesGroup(data, true);
}
this.fireChartStateChangedEvent(this.seriesGroupList);
},
« no previous file with comments | « no previous file | dashboard/dashboard/elements/report-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698