| 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);
|
| },
|
|
|