Skip to content

Commit f6a859d

Browse files
authored
fix: Partition aware source table UI widget swaps from merge to coalesce (#2397)
- Fixes the observed issue of the partition selector button flipping between Merge and Coalesce depending on which partition view is selected. - The original condition for `isPartitionAwareSourceTable` in `IrisGridTableModel.ts` isn't always accurate as `table.isUncoalesced` is only true when no filters have been applied yet. Once a filter is applied, the table is no longer considered uncoalesced but the source table should still have the same property as before. - Test snippet is linked on the ticket: [DH-19015](https://deephaven.atlassian.net/browse/DH-19015) [DH-19015]: https://deephaven.atlassian.net/browse/DH-19015?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 6c406ba commit f6a859d

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/iris-grid/src/IrisGridProxyModel.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,13 @@ class IrisGridProxyModel extends IrisGridModel implements PartitionedGridModel {
442442
: undefined;
443443
}
444444

445+
get isPartitionAwareSourceTable(): boolean {
446+
return (
447+
isPartitionedGridModelProvider(this.originalModel) &&
448+
this.originalModel.isPartitionAwareSourceTable
449+
);
450+
}
451+
445452
get formatter(): Formatter {
446453
return this.originalModel.formatter;
447454
}

packages/iris-grid/src/IrisGridTableModel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class IrisGridTableModel
3737

3838
initialFilters: DhType.FilterCondition[] = [];
3939

40+
// The initial value for table.isUncoalesced on the source table before any transformations (e.g. filter, select)
41+
wasUncoalesced: boolean;
42+
4043
/**
4144
* @param dh JSAPI instance
4245
* @param table Iris data table to be used in the model
@@ -53,6 +56,7 @@ class IrisGridTableModel
5356
this.customColumnList = [];
5457
this.formatColumnList = [];
5558
this.initialFilters = table.filter;
59+
this.wasUncoalesced = this.isPartitionRequired;
5660
}
5761

5862
get isExportAvailable(): boolean {
@@ -301,7 +305,7 @@ class IrisGridTableModel
301305
}
302306

303307
get isPartitionAwareSourceTable(): boolean {
304-
return this.isPartitionRequired;
308+
return this.wasUncoalesced;
305309
}
306310

307311
isFilterable(columnIndex: ModelIndex): boolean {

0 commit comments

Comments
 (0)