Skip to content

Commit

Permalink
fix: Select distinct throwing for tables with multiple columns (#1286)
Browse files Browse the repository at this point in the history
Fixes #1275 

The true issue is we modify `IrisGridProxyModel.model` but there's no
update propagated to `IrisGrid` because it receives the proxy model
which does not actually change. This causes the potential for out of
sync model/metrics
  • Loading branch information
mattrunyon authored May 10, 2023
1 parent cb0e9ba commit 4b40e4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4207,6 +4207,14 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
const modelColumn = this.getModelColumn(columnIndex);
if (modelColumn != null) {
const column = model.columns[modelColumn];
if (column == null) {
// Grid metrics is likely out of sync with model
log.warn(
`Column does not exist at index ${modelColumn} for column array of length ${model.columns.length}`
);
// eslint-disable-next-line no-continue
continue;
}
const advancedFilter = advancedFilters.get(modelColumn);
const { options: advancedFilterOptions } = advancedFilter || {};
const sort = TableUtils.getSortForColumn(model.sort, column.name);
Expand Down

0 comments on commit 4b40e4b

Please sign in to comment.