@@ -139,35 +141,37 @@ class Compare extends Page<{}, CompareState> {
- {Array.from(viewersMap.keys()).map((viewerType, i) =>
-
- {!collapseSections[componentMap[viewerType].prototype.getDisplayName()] &&
-
-
- {/* If the component allows aggregation, add one more card for
- its aggregated view. Only do this if there is more than one
- output, filtering out any unselected runs. */}
- {(componentMap[viewerType].prototype.isAggregatable() && (
- runsPerViewerType(viewerType).length > 1) && (
-
t.config)} maxDimension={400}
- title='Aggregated view' />
- )
- )}
-
- {runsPerViewerType(viewerType).map((taggedConfig, c) => (
-
- ))}
-
-
-
-
-
- }
-
-
+ {Array.from(viewersMap.keys()).map((viewerType, i) =>
+
+
+ {!collapseSections[componentMap[viewerType].prototype.getDisplayName()] && (
+
+
+ {/* If the component allows aggregation, add one more card for
+ its aggregated view. Only do this if there is more than one
+ output, filtering out any unselected runs. */}
+ {(componentMap[viewerType].prototype.isAggregatable() && (
+ runsPerViewerType(viewerType).length > 1) && (
+
t.config)} maxDimension={400}
+ title='Aggregated view' />
+ )
+ )}
+
+ {runsPerViewerType(viewerType).map((taggedConfig, c) => (
+
+ ))}
+
+
+
+
+
+ )}
+
+
)}
);
}
@@ -189,6 +193,7 @@ class Compare extends Page<{}, CompareState> {
const workflowObjects: Workflow[] = [];
const failingRuns: string[] = [];
let lastError: Error | null = null;
+
await Promise.all(runIds.map(async id => {
try {
const run = await Apis.runServiceApi.getRun(id);
@@ -201,19 +206,16 @@ class Compare extends Page<{}, CompareState> {
}));
if (lastError) {
- await this.showPageError(
- `Error: failed loading ${failingRuns.length} runs.`,
- lastError,
- );
+ await this.showPageError(`Error: failed loading ${failingRuns.length} runs.`, lastError);
logger.error(
`Failed loading ${failingRuns.length} runs, last failed with the error: ${lastError}`);
return;
}
- this.setState({
- runs,
- selectedIds: runs.map(r => r.run!.id!),
- workflowObjects,
+ this.setStateSafe({
+ runs,
+ selectedIds: runs.map(r => r.run!.id!),
+ workflowObjects,
}, () => this._loadParameters());
const outputPathsList = workflowObjects.map(
@@ -238,8 +240,12 @@ class Compare extends Page<{}, CompareState> {
}
}));
- // For each output artifact type, list all artifact instances in all runs
- this.setState({ viewersMap });
+ // For each output artifact type, list all artifact instances in all runs
+ this.setStateSafe({ viewersMap });
+ }
+
+ protected _selectionChanged(selectedIds: string[]): void {
+ this.setState({ selectedIds }, () => this._loadParameters());
}
private _collapseAllSections(): void {
@@ -248,13 +254,7 @@ class Compare extends Page<{}, CompareState> {
const sectionName = componentMap[t].prototype.getDisplayName();
collapseSections[sectionName] = true;
});
- this.setState({
- collapseSections,
- });
- }
-
- private _selectionChanged(selectedIds: string[]): void {
- this.setState({ selectedIds }, () => this._loadParameters());
+ this.setState({ collapseSections });
}
private _loadParameters(): void {
@@ -264,8 +264,7 @@ class Compare extends Page<{}, CompareState> {
const filteredRuns = runs.filter((_, i) => selectedIndices.indexOf(i) > -1);
const filteredWorkflows = workflowObjects.filter((_, i) => selectedIndices.indexOf(i) > -1);
- const paramsCompareProps = CompareUtils.getParamsCompareProps(
- filteredRuns, filteredWorkflows);
+ const paramsCompareProps = CompareUtils.getParamsCompareProps(filteredRuns, filteredWorkflows);
this.setState({ paramsCompareProps });
}
diff --git a/frontend/src/pages/ExperimentDetails.test.tsx b/frontend/src/pages/ExperimentDetails.test.tsx
index 88f2f94ae1f..9822b3ab57d 100644
--- a/frontend/src/pages/ExperimentDetails.test.tsx
+++ b/frontend/src/pages/ExperimentDetails.test.tsx
@@ -56,8 +56,7 @@ describe('ExperimentDetails', () => {
return {
history: { push: historyPushSpy } as any,
location: '' as any,
- // 'eid' here corresponds to RouteParams.experimentId
- match: { params: { eid: MOCK_EXPERIMENT.id } } as any,
+ match: { params: { [RouteParams.experimentId]: MOCK_EXPERIMENT.id } } as any,
toolbarProps: ExperimentDetails.prototype.getInitialToolbarState(),
updateBanner: updateBannerSpy,
updateDialog: updateDialogSpy,
@@ -182,7 +181,7 @@ describe('ExperimentDetails', () => {
it('calls getExperiment with the experiment ID in props', async () => {
const props = generateProps();
- props.match = { params: { eid: 'test exp ID' } } as any;
+ props.match = { params: { [RouteParams.experimentId]: 'test exp ID' } } as any;
tree = shallow(