Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspun-wandb committed Nov 4, 2024
1 parent b240cbc commit 3121586
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions weave-js/src/components/Panel2/PanelTable/tableState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,10 @@ export async function disableGroupByCol(
// We may try to sort on aggregated columns after ungrouping
// To prevent this, disable sorting on all the columns and re-enable
// after the ungroup
const initiallySortedCols = _.clone(ts.sort)
const initiallySortedCols = _.clone(ts.sort);
ts.sort.forEach(sortObj => {
ts = disableSortByCol(ts, sortObj.columnId)
})
ts = disableSortByCol(ts, sortObj.columnId);
});

ts = produce(ts, draft => {
draft.autoColumns = false;
Expand All @@ -714,10 +714,13 @@ export async function disableGroupByCol(
ts = await refreshSelectFunctions(ts, inputArrayNode, weave, stack);

initiallySortedCols.forEach(sortObj => {
if (sortObj.columnId !== colId && canSortType(ts.columnSelectFunctions[sortObj.columnId].type)) {
ts = enableSortByCol(ts, sortObj.columnId, sortObj.dir === 'asc')
if (
sortObj.columnId !== colId &&
canSortType(ts.columnSelectFunctions[sortObj.columnId].type)
) {
ts = enableSortByCol(ts, sortObj.columnId, sortObj.dir === 'asc');
}
})
});
return ts;
}

Expand Down

0 comments on commit 3121586

Please sign in to comment.