Skip to content

Commit

Permalink
Remove append command feature
Browse files Browse the repository at this point in the history
  • Loading branch information
georgecwan committed Oct 26, 2023
1 parent a848dd6 commit b0a89a9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 62 deletions.
22 changes: 0 additions & 22 deletions packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ export class IrisGridPanel extends PureComponent<
this.handleError = this.handleError.bind(this);
this.handleGridStateChange = this.handleGridStateChange.bind(this);
this.handlePluginStateChange = this.handlePluginStateChange.bind(this);
this.handlePartitionAppend = this.handlePartitionAppend.bind(this);
this.handleCreateChart = this.handleCreateChart.bind(this);
this.handleResize = this.handleResize.bind(this);
this.handleShow = this.handleShow.bind(this);
Expand Down Expand Up @@ -711,26 +710,6 @@ export class IrisGridPanel extends PureComponent<
glEventHub.emit(InputFilterEvent.TABLE_CHANGED, this, table);
}

handlePartitionAppend(columns: Column[], values: unknown[]): void {
const { glEventHub } = this.props;
const tableName = this.getTableName();
const filters = values
.reduce<string[]>((filterArray, value, index) => {
const column = columns[index];
if (value !== null) {
filterArray.push(
`"${column.name}=${
TableUtils.isTextType(column.type) ? `\`${value}\`` : value
}"`
);
}
return filterArray;
}, [])
.join(', ');
const command = `${tableName} = ${tableName}.where(filters=[${filters}])`;
glEventHub.emit(ConsoleEvent.SEND_COMMAND, command, false, true);
}

/**
* Create a chart with the specified settings
* @param settings The settings from the chart builder
Expand Down Expand Up @@ -1358,7 +1337,6 @@ export class IrisGridPanel extends PureComponent<
onCreateChart={this.handleCreateChart}
onDataSelected={this.handleDataSelected}
onError={this.handleError}
onPartitionAppend={this.handlePartitionAppend}
onStateChange={this.handleGridStateChange}
onContextMenu={this.handleContextMenu}
onAdvancedSettingsChange={this.handleAdvancedSettingsChange}
Expand Down
20 changes: 0 additions & 20 deletions packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ export interface IrisGridProps {
onError: (error: unknown) => void;
onDataSelected: (index: ModelIndex, map: Record<ColumnName, unknown>) => void;
onStateChange: (irisGridState: IrisGridState, gridState: GridState) => void;
onPartitionAppend?: (
partitionColumns: Column[],
values: (string | null)[]
) => void;
onAdvancedSettingsChange: AdvancedSettingsMenuCallback;
partitions: (string | null)[];
partitionColumns: Column[];
Expand Down Expand Up @@ -580,7 +576,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
this.handleCancelDownloadTable = this.handleCancelDownloadTable.bind(this);
this.handleDownloadCanceled = this.handleDownloadCanceled.bind(this);
this.handleDownloadCompleted = this.handleDownloadCompleted.bind(this);
this.handlePartitionAppend = this.handlePartitionAppend.bind(this);
this.handlePartitionChange = this.handlePartitionChange.bind(this);
this.handlePartitionFetchAll = this.handlePartitionFetchAll.bind(this);
this.handlePartitionDone = this.handlePartitionDone.bind(this);
Expand Down Expand Up @@ -2376,15 +2371,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
this.isAnimating = false;
}

handlePartitionAppend(values: (string | null)[]): void {
const { onPartitionAppend } = this.props;
const { partitionColumns } = this.state;
if (partitionColumns.length === 0) {
return;
}
onPartitionAppend?.(partitionColumns, values);
}

handlePartitionChange(partitions: (string | null)[]): void {
const { partitionColumns } = this.state;
if (partitionColumns.length === 0) {
Expand Down Expand Up @@ -3914,7 +3900,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
onAdvancedSettingsChange,
canDownloadCsv,
onCreateChart,
onPartitionAppend,
} = this.props;
const {
metricCalculator,
Expand Down Expand Up @@ -4473,11 +4458,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
partitions={partitions}
onChange={this.handlePartitionChange}
onFetchAll={this.handlePartitionFetchAll}
onAppend={
onPartitionAppend !== undefined
? this.handlePartitionAppend
: undefined
}
onDone={this.handlePartitionDone}
/>
)}
Expand Down
21 changes: 1 addition & 20 deletions packages/iris-grid/src/IrisGridPartitionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ interface IrisGridPartitionSelectorProps<T> {
table: Table;
columns: Column[];
partitions: (string | null)[];
onAppend?: (partitions: (string | null)[]) => void;
onFetchAll: () => void;
onDone: (event?: React.MouseEvent<HTMLButtonElement>) => void;
onChange: (partitions: (string | null)[]) => void;
Expand All @@ -42,7 +41,6 @@ class IrisGridPartitionSelector<T> extends Component<
constructor(props: IrisGridPartitionSelectorProps<T>) {
super(props);

this.handleAppendClick = this.handleAppendClick.bind(this);
this.handleCloseClick = this.handleCloseClick.bind(this);
this.handleIgnoreClick = this.handleIgnoreClick.bind(this);
this.handlePartitionChange = this.handlePartitionChange.bind(this);
Expand Down Expand Up @@ -85,14 +83,6 @@ class IrisGridPartitionSelector<T> extends Component<

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

handleAppendClick(): void {
log.debug2('handleAppendClick');

const { onAppend } = this.props;
const { partitions } = this.state;
onAppend?.(partitions);
}

handleCloseClick(): void {
log.debug2('handleCloseClick');

Expand Down Expand Up @@ -246,7 +236,7 @@ class IrisGridPartitionSelector<T> extends Component<
}

render(): JSX.Element {
const { columns, dh, getFormattedString, onAppend, onDone } = this.props;
const { columns, dh, getFormattedString, onDone } = this.props;
const { partitionTables } = this.state;

const partitionSelectorSearch = columns.map(
Expand Down Expand Up @@ -314,15 +304,6 @@ class IrisGridPartitionSelector<T> extends Component<
>
Ignore &amp; Fetch All
</button>
{onAppend !== undefined && (
<button
type="button"
className="btn btn-outline-primary btn-append"
onClick={this.handleAppendClick}
>
Append Command
</button>
)}
<button
type="button"
className="btn btn-link btn-link-icon btn-close"
Expand Down

0 comments on commit b0a89a9

Please sign in to comment.