Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Default to Skip operation instead of Sum operation #1648

Merged
merged 5 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,12 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
const operationMap = this.getOperationMap(columns, aggregations);
const operationOrder = this.getOperationOrder(aggregations);

return { operationMap, operationOrder, showOnTop };
return {
operationMap,
operationOrder,
showOnTop,
defaultOperation: AggregationOperation.SKIP,
mattrunyon marked this conversation as resolved.
Show resolved Hide resolved
};
}
);

Expand Down
55 changes: 2 additions & 53 deletions packages/iris-grid/src/IrisGridTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ import type {
} from '@deephaven/jsapi-types';
import Log from '@deephaven/log';
import { Formatter } from '@deephaven/jsapi-utils';
import {
EventShimCustomEvent,
PromiseUtils,
assertNotNull,
} from '@deephaven/utils';
import { EventShimCustomEvent, assertNotNull } from '@deephaven/utils';
import IrisGridModel from './IrisGridModel';
import { ColumnName, UITotalsTableConfig, UIRow } from './CommonTypes';
import { ColumnName, UIRow } from './CommonTypes';
import IrisGridTableModelTemplate from './IrisGridTableModelTemplate';

const log = Log.module('IrisGridTableModel');
Expand Down Expand Up @@ -185,53 +181,6 @@ class IrisGridTableModel extends IrisGridTableModelTemplate<Table, UIRow> {
);
}

set totalsConfig(totalsConfig: UITotalsTableConfig | null) {
log.debug('set totalsConfig', totalsConfig);

if (totalsConfig === this.totals) {
// Totals already set, or it will be set when the next model actually gets set
return;
}

this.totals = totalsConfig;
this.formattedStringData = [];

if (this.totalsTablePromise != null) {
this.totalsTablePromise.cancel();
}

this.setTotalsTable(null);

if (totalsConfig == null) {
this.dispatchEvent(new EventShimCustomEvent(IrisGridModel.EVENT.UPDATED));
return;
}

this.totalsTablePromise = PromiseUtils.makeCancelable(
this.table.getTotalsTable(totalsConfig),
table => table.close()
);
this.totalsTablePromise
.then(totalsTable => {
this.totalsTablePromise = null;
this.setTotalsTable(totalsTable);
})
.catch(err => {
if (PromiseUtils.isCanceled(err)) {
return;
}

log.error('Unable to set next totalsTable', err);
this.totalsTablePromise = null;

this.dispatchEvent(
new EventShimCustomEvent(IrisGridModel.EVENT.REQUEST_FAILED, {
detail: err,
})
);
});
}

get isFilterRequired(): boolean {
return this.table.isUncoalesced;
}
Expand Down
Loading