Skip to content

Commit 9c9d099

Browse files
committed
Remove append command feature
1 parent a848dd6 commit 9c9d099

3 files changed

Lines changed: 2 additions & 63 deletions

File tree

packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ import type {
7979
TablePluginComponent,
8080
TablePluginElement,
8181
} from '@deephaven/plugin';
82-
import { ConsoleEvent, InputFilterEvent, IrisGridEvent } from '../events';
82+
import { InputFilterEvent, IrisGridEvent } from '../events';
8383
import {
8484
getInputFiltersForDashboard,
8585
getLinksForDashboard,
@@ -250,7 +250,6 @@ export class IrisGridPanel extends PureComponent<
250250
this.handleError = this.handleError.bind(this);
251251
this.handleGridStateChange = this.handleGridStateChange.bind(this);
252252
this.handlePluginStateChange = this.handlePluginStateChange.bind(this);
253-
this.handlePartitionAppend = this.handlePartitionAppend.bind(this);
254253
this.handleCreateChart = this.handleCreateChart.bind(this);
255254
this.handleResize = this.handleResize.bind(this);
256255
this.handleShow = this.handleShow.bind(this);
@@ -711,26 +710,6 @@ export class IrisGridPanel extends PureComponent<
711710
glEventHub.emit(InputFilterEvent.TABLE_CHANGED, this, table);
712711
}
713712

714-
handlePartitionAppend(columns: Column[], values: unknown[]): void {
715-
const { glEventHub } = this.props;
716-
const tableName = this.getTableName();
717-
const filters = values
718-
.reduce<string[]>((filterArray, value, index) => {
719-
const column = columns[index];
720-
if (value !== null) {
721-
filterArray.push(
722-
`"${column.name}=${
723-
TableUtils.isTextType(column.type) ? `\`${value}\`` : value
724-
}"`
725-
);
726-
}
727-
return filterArray;
728-
}, [])
729-
.join(', ');
730-
const command = `${tableName} = ${tableName}.where(filters=[${filters}])`;
731-
glEventHub.emit(ConsoleEvent.SEND_COMMAND, command, false, true);
732-
}
733-
734713
/**
735714
* Create a chart with the specified settings
736715
* @param settings The settings from the chart builder
@@ -1358,7 +1337,6 @@ export class IrisGridPanel extends PureComponent<
13581337
onCreateChart={this.handleCreateChart}
13591338
onDataSelected={this.handleDataSelected}
13601339
onError={this.handleError}
1361-
onPartitionAppend={this.handlePartitionAppend}
13621340
onStateChange={this.handleGridStateChange}
13631341
onContextMenu={this.handleContextMenu}
13641342
onAdvancedSettingsChange={this.handleAdvancedSettingsChange}

packages/iris-grid/src/IrisGrid.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ export interface IrisGridProps {
283283
onError: (error: unknown) => void;
284284
onDataSelected: (index: ModelIndex, map: Record<ColumnName, unknown>) => void;
285285
onStateChange: (irisGridState: IrisGridState, gridState: GridState) => void;
286-
onPartitionAppend?: (
287-
partitionColumns: Column[],
288-
values: (string | null)[]
289-
) => void;
290286
onAdvancedSettingsChange: AdvancedSettingsMenuCallback;
291287
partitions: (string | null)[];
292288
partitionColumns: Column[];
@@ -580,7 +576,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
580576
this.handleCancelDownloadTable = this.handleCancelDownloadTable.bind(this);
581577
this.handleDownloadCanceled = this.handleDownloadCanceled.bind(this);
582578
this.handleDownloadCompleted = this.handleDownloadCompleted.bind(this);
583-
this.handlePartitionAppend = this.handlePartitionAppend.bind(this);
584579
this.handlePartitionChange = this.handlePartitionChange.bind(this);
585580
this.handlePartitionFetchAll = this.handlePartitionFetchAll.bind(this);
586581
this.handlePartitionDone = this.handlePartitionDone.bind(this);
@@ -2376,15 +2371,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
23762371
this.isAnimating = false;
23772372
}
23782373

2379-
handlePartitionAppend(values: (string | null)[]): void {
2380-
const { onPartitionAppend } = this.props;
2381-
const { partitionColumns } = this.state;
2382-
if (partitionColumns.length === 0) {
2383-
return;
2384-
}
2385-
onPartitionAppend?.(partitionColumns, values);
2386-
}
2387-
23882374
handlePartitionChange(partitions: (string | null)[]): void {
23892375
const { partitionColumns } = this.state;
23902376
if (partitionColumns.length === 0) {
@@ -3914,7 +3900,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
39143900
onAdvancedSettingsChange,
39153901
canDownloadCsv,
39163902
onCreateChart,
3917-
onPartitionAppend,
39183903
} = this.props;
39193904
const {
39203905
metricCalculator,
@@ -4473,11 +4458,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
44734458
partitions={partitions}
44744459
onChange={this.handlePartitionChange}
44754460
onFetchAll={this.handlePartitionFetchAll}
4476-
onAppend={
4477-
onPartitionAppend !== undefined
4478-
? this.handlePartitionAppend
4479-
: undefined
4480-
}
44814461
onDone={this.handlePartitionDone}
44824462
/>
44834463
)}

packages/iris-grid/src/IrisGridPartitionSelector.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ interface IrisGridPartitionSelectorProps<T> {
1919
table: Table;
2020
columns: Column[];
2121
partitions: (string | null)[];
22-
onAppend?: (partitions: (string | null)[]) => void;
2322
onFetchAll: () => void;
2423
onDone: (event?: React.MouseEvent<HTMLButtonElement>) => void;
2524
onChange: (partitions: (string | null)[]) => void;
@@ -42,7 +41,6 @@ class IrisGridPartitionSelector<T> extends Component<
4241
constructor(props: IrisGridPartitionSelectorProps<T>) {
4342
super(props);
4443

45-
this.handleAppendClick = this.handleAppendClick.bind(this);
4644
this.handleCloseClick = this.handleCloseClick.bind(this);
4745
this.handleIgnoreClick = this.handleIgnoreClick.bind(this);
4846
this.handlePartitionChange = this.handlePartitionChange.bind(this);
@@ -85,14 +83,6 @@ class IrisGridPartitionSelector<T> extends Component<
8583

8684
selectorSearch: (PartitionSelectorSearch<T> | null)[];
8785

88-
handleAppendClick(): void {
89-
log.debug2('handleAppendClick');
90-
91-
const { onAppend } = this.props;
92-
const { partitions } = this.state;
93-
onAppend?.(partitions);
94-
}
95-
9686
handleCloseClick(): void {
9787
log.debug2('handleCloseClick');
9888

@@ -246,7 +236,7 @@ class IrisGridPartitionSelector<T> extends Component<
246236
}
247237

248238
render(): JSX.Element {
249-
const { columns, dh, getFormattedString, onAppend, onDone } = this.props;
239+
const { columns, dh, getFormattedString, onDone } = this.props;
250240
const { partitionTables } = this.state;
251241

252242
const partitionSelectorSearch = columns.map(
@@ -314,15 +304,6 @@ class IrisGridPartitionSelector<T> extends Component<
314304
>
315305
Ignore &amp; Fetch All
316306
</button>
317-
{onAppend !== undefined && (
318-
<button
319-
type="button"
320-
className="btn btn-outline-primary btn-append"
321-
onClick={this.handleAppendClick}
322-
>
323-
Append Command
324-
</button>
325-
)}
326307
<button
327308
type="button"
328309
className="btn btn-link btn-link-icon btn-close"

0 commit comments

Comments
 (0)