diff --git a/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx b/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx index 9805027072..0f15937755 100644 --- a/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx +++ b/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx @@ -44,8 +44,6 @@ import { IrisGridContextMenuData, IrisGridTableModel, PartitionConfig, - isPartitionedGridModel, - PartitionedGridModel, } from '@deephaven/iris-grid'; import { AdvancedFilterOptions, @@ -583,7 +581,6 @@ export class IrisGridPanel extends PureComponent< customColumns, selectDistinctColumns = [], rollupConfig, - partitionConfig, } = { ...irisGridState, ...irisGridStateOverrides }; if (customColumns.length > 0) { @@ -613,13 +610,6 @@ export class IrisGridPanel extends PureComponent< m.selectDistinctColumns = selectDistinctColumns; }); } - - if (partitionConfig != null && isPartitionedGridModel(model)) { - modelQueue.push(m => { - // eslint-disable-next-line no-param-reassign - (m as PartitionedGridModel).partitionConfig = partitionConfig; - }); - } } this.setState({ model, modelQueue }); diff --git a/packages/iris-grid/src/IrisGrid.tsx b/packages/iris-grid/src/IrisGrid.tsx index cd1537bda2..4d7c7a33b2 100644 --- a/packages/iris-grid/src/IrisGrid.tsx +++ b/packages/iris-grid/src/IrisGrid.tsx @@ -841,13 +841,10 @@ export class IrisGrid extends Component { } componentDidMount(): void { - const { model, partitions, partitionConfig } = this.props; + const { model, partitions } = this.props; try { if (isPartitionedGridModel(model) && model.isPartitionRequired) { - log.log('Partition mounting', partitions, partitionConfig); - if (partitionConfig) { - model.partitionConfig = partitionConfig; - } else if (partitions.length) { + if (partitions.length) { model.partitionConfig = { partitions, mode: 'partition' }; } this.setState({ isSelectingPartition: true }, () => { diff --git a/packages/iris-grid/src/IrisGridPartitionSelector.test.tsx b/packages/iris-grid/src/IrisGridPartitionSelector.test.tsx index b9a46e92eb..5a008580d2 100644 --- a/packages/iris-grid/src/IrisGridPartitionSelector.test.tsx +++ b/packages/iris-grid/src/IrisGridPartitionSelector.test.tsx @@ -3,6 +3,7 @@ import { render, fireEvent } from '@testing-library/react'; import dh from '@deephaven/jsapi-shim'; import IrisGridPartitionSelector from './IrisGridPartitionSelector'; import IrisGridTestUtils from './IrisGridTestUtils'; +import { PartitionConfig } from './PartitionedGridModel'; function makeIrisGridPartitionSelector( table = new IrisGridTestUtils(dh).makeTable(), @@ -10,7 +11,8 @@ function makeIrisGridPartitionSelector( onChange = jest.fn(), onMerge = jest.fn(), onKeyTable = jest.fn(), - getFormattedString = jest.fn(value => `${value}`) + getFormattedString = jest.fn(value => `${value}`), + partitionConfig = { partitions: [], mode: 'merged' } ) { const tablePromise = Promise.resolve(table); return render( @@ -22,6 +24,7 @@ function makeIrisGridPartitionSelector( onChange={onChange} onMerge={onMerge} onKeyTable={onKeyTable} + partitionConfig={partitionConfig as PartitionConfig} /> ); } diff --git a/packages/iris-grid/src/IrisGridProxyModel.ts b/packages/iris-grid/src/IrisGridProxyModel.ts index 8ff33f100c..68eb67beff 100644 --- a/packages/iris-grid/src/IrisGridProxyModel.ts +++ b/packages/iris-grid/src/IrisGridProxyModel.ts @@ -543,10 +543,7 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel { this.setNextModel( tablePromise.then(table => makeModel(this.dh, table, this.formatter)) ); - } else if ( - isIrisGridTableModelTemplate(this.originalModel) && - this.model !== this.originalModel - ) { + } else if (isIrisGridTableModelTemplate(this.originalModel)) { this.setNextModel(Promise.resolve(this.originalModel)); } } diff --git a/packages/iris-grid/src/IrisGridTableModel.ts b/packages/iris-grid/src/IrisGridTableModel.ts index 427b5a2ab6..94968ce696 100644 --- a/packages/iris-grid/src/IrisGridTableModel.ts +++ b/packages/iris-grid/src/IrisGridTableModel.ts @@ -228,7 +228,7 @@ class IrisGridTableModel } set partitionConfig(partitionConfig: PartitionConfig) { - log.log('setting partition', partitionConfig); + log.debug('setting partition', partitionConfig); const { partitions, mode } = partitionConfig; const partitionFilters = []; diff --git a/packages/iris-grid/src/IrisGridUtils.test.ts b/packages/iris-grid/src/IrisGridUtils.test.ts index a9507c8952..d332f1c24e 100644 --- a/packages/iris-grid/src/IrisGridUtils.test.ts +++ b/packages/iris-grid/src/IrisGridUtils.test.ts @@ -646,7 +646,6 @@ describe('dehydration methods', () => { IrisGridUtils.dehydrateIrisGridPanelState(irisGridTestUtils.makeModel(), { isSelectingPartition: false, partitions: [], - partitionColumns: [], advancedSettings: new Map(), }), ], @@ -676,55 +675,11 @@ describe('hydration methods', () => { ); it.each([ - [ - 'hydrateIrisGridPanelStateV1', - { - isSelectingPartition: false, - partition: null, - partitionColumn: 'INVALID', - advancedSettings: [], - }, - ], - [ - 'hydrateIrisGridPanelStateV2', - { - isSelectingPartition: false, - partitions: [null], - partitionColumns: ['INVALID'], - advancedSettings: [], - }, - ], - ])('%s invalid column error', (_label, panelState) => { - expect(() => - IrisGridUtils.hydrateIrisGridPanelState(model, panelState) - ).toThrow('Invalid partition column INVALID'); - }); - - it.each([ - [ - 'hydrateIrisGridPanelStateV1 null partition column', - { - isSelectingPartition: false, - partition: null, - partitionColumn: null, - advancedSettings: [], - }, - ], [ 'hydrateIrisGridPanelStateV1 null partition', { isSelectingPartition: false, partition: null, - partitionColumn: 'name_0', - advancedSettings: [], - }, - ], - [ - 'hydrateIrisGridPanelStateV1 unselected partition', - { - isSelectingPartition: false, - partition: 'a', - partitionColumn: 'name_0', advancedSettings: [], }, ], @@ -733,7 +688,6 @@ describe('hydration methods', () => { { isSelectingPartition: true, partition: 'a', - partitionColumn: 'name_0', advancedSettings: [], }, ], @@ -742,7 +696,6 @@ describe('hydration methods', () => { { isSelectingPartition: false, partitions: [], - partitionColumns: [], advancedSettings: [], }, ], @@ -751,7 +704,6 @@ describe('hydration methods', () => { { isSelectingPartition: true, partitions: [null, null], - partitionColumns: ['name_0', 'name_1'], advancedSettings: [], }, ], @@ -760,7 +712,6 @@ describe('hydration methods', () => { { isSelectingPartition: true, partitions: ['a', 'b'], - partitionColumns: ['name_0', 'name_1'], advancedSettings: [], }, ], @@ -769,7 +720,6 @@ describe('hydration methods', () => { { isSelectingPartition: true, partitions: [null, 'b', null], - partitionColumns: ['name_0', 'name_1', 'name_2'], advancedSettings: [], }, ], @@ -778,7 +728,6 @@ describe('hydration methods', () => { { isSelectingPartition: true, partitions: ['a', null, 'b'], - partitionColumns: ['name_0', 'name_1', 'name_2'], advancedSettings: [], }, ], @@ -787,18 +736,8 @@ describe('hydration methods', () => { expect(result.isSelectingPartition).toBe(panelState.isSelectingPartition); if (isPanelStateV1(panelState)) { expect(result.partitions).toEqual([panelState.partition]); - if (panelState.partitionColumn !== null) { - expect(result.partitionColumns[0].name).toBe( - panelState.partitionColumn - ); - } else { - expect(result.partitionColumns).toEqual([]); - } } else { expect(result.partitions).toEqual(panelState.partitions); - panelState.partitionColumns.forEach((partition, index) => { - expect(result.partitionColumns[index].name === partition).toBeTruthy(); - }); } }); });