Skip to content

Commit

Permalink
Clean up based on review
Browse files Browse the repository at this point in the history
- Just some minor cleanup
  • Loading branch information
mofojed committed Nov 20, 2023
1 parent d821f56 commit 559d4d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
5 changes: 1 addition & 4 deletions packages/iris-grid/src/ColumnStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import classNames from 'classnames';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Button, CopyButton, LoadingSpinner } from '@deephaven/components';
import { dhFreeze, dhRefresh, dhSortSlash, vsLock } from '@deephaven/icons';
import type {
Column,
ColumnStatistics as APIColumnStatistics,
} from '@deephaven/jsapi-types';
import type { ColumnStatistics as APIColumnStatistics } from '@deephaven/jsapi-types';
import Log from '@deephaven/log';
import { CancelablePromise, PromiseUtils } from '@deephaven/utils';
import { isExpandableGridModel } from '@deephaven/grid';
Expand Down
40 changes: 20 additions & 20 deletions packages/iris-grid/src/mousehandlers/IrisGridContextMenuHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -717,32 +717,32 @@ class IrisGridContextMenuHandler extends GridMouseHandler {

const actions: ResolvableContextAction[] = [];

if (modelColumn != null) {
if (modelColumn != null && modelRow != null) {
const sourceCell = model.sourceForCell(modelColumn, modelRow ?? 0);
const { column: sourceColumn, row: sourceRow } = sourceCell;
if (modelRow != null) {
const value = model.valueForCell(sourceColumn, sourceRow);
const valueText = model.textForCell(sourceColumn, sourceRow);
const column = columns[sourceColumn];
const value = model.valueForCell(sourceColumn, sourceRow);
const valueText = model.textForCell(sourceColumn, sourceRow);
const column = columns[sourceColumn];

const { onContextMenu } = irisGrid.props;
const { onContextMenu } = irisGrid.props;

if (column != null) {
actions.push(
...onContextMenu({
model,
value,
valueText,
column,
rowIndex,
columnIndex,
modelRow,
modelColumn,
})
);
}
if (column != null) {
actions.push(
...onContextMenu({
model,
value,
valueText,
column,
rowIndex,
columnIndex,
modelRow,
modelColumn,
})
);
}
}

if (modelColumn != null) {
const clearFilterRange = model.getClearFilterRange(modelColumn);
if (clearFilterRange != null && clearFilterRange.length > 0) {
// Clear column filter should still be available after last row
Expand Down

0 comments on commit 559d4d6

Please sign in to comment.