diff --git a/ts/webui/src/components/modals/ChangeColumnComponent.tsx b/ts/webui/src/components/modals/ChangeColumnComponent.tsx index ac3d03c15d..db346e48e4 100644 --- a/ts/webui/src/components/modals/ChangeColumnComponent.tsx +++ b/ts/webui/src/components/modals/ChangeColumnComponent.tsx @@ -12,6 +12,7 @@ interface ChangeColumnProps { onSelectedChange: (val: string[]) => void; onHideDialog: () => void; minSelected?: number; + whichComponent: string; // which component use this component } interface SimpleColumn { @@ -57,10 +58,14 @@ class ChangeColumnComponent extends React.Component { const { currentSelected } = this.state; - const { allColumns, onSelectedChange } = this.props; + const { allColumns, onSelectedChange, whichComponent } = this.props; const selectedColumns = allColumns.map(column => column.key).filter(key => currentSelected.includes(key)); - localStorage.setItem('columns', JSON.stringify(selectedColumns)); onSelectedChange(selectedColumns); + if (whichComponent === 'table') { + localStorage.setItem('columns', JSON.stringify(selectedColumns)); + } else { + localStorage.setItem('paraColumns', JSON.stringify(selectedColumns)); + } this.hideDialog(); }; diff --git a/ts/webui/src/components/trial-detail/Para.tsx b/ts/webui/src/components/trial-detail/Para.tsx index 9c4545becd..7791f17bbc 100644 --- a/ts/webui/src/components/trial-detail/Para.tsx +++ b/ts/webui/src/components/trial-detail/Para.tsx @@ -51,7 +51,11 @@ class Para extends React.Component { noChart: true, customizeColumnsDialogVisible: false, availableDimensions: [], - chosenDimensions: [] + chosenDimensions: + localStorage.getItem('paraColumns') !== null + ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + JSON.parse(localStorage.getItem('paraColumns')!) + : [] }; } @@ -130,6 +134,7 @@ class Para extends React.Component { this.setState({ customizeColumnsDialogVisible: false }); }} minSelected={2} + whichComponent='para' /> )}
diff --git a/ts/webui/src/components/trial-detail/TableList.tsx b/ts/webui/src/components/trial-detail/TableList.tsx index abcc037f88..cf6b270119 100644 --- a/ts/webui/src/components/trial-detail/TableList.tsx +++ b/ts/webui/src/components/trial-detail/TableList.tsx @@ -571,6 +571,7 @@ class TableList extends React.Component { onHideDialog={(): void => { this.setState({ customizeColumnsDialogVisible: false }); }} + whichComponent='table' /> )} {/* Clone a trial and customize a set of new parameters */}