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: TablePlugin needs to know table name and selected range #2181

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ export class IrisGridPanel extends PureComponent<
}

// TODO #2093: Find a better way to handle deprecated panel prop
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const deprecatedProps = {
panel: this,
};
Expand All @@ -436,10 +437,10 @@ export class IrisGridPanel extends PureComponent<
fetchColumns={this.handlePluginFetchColumns}
model={model}
table={model.table}
tableName={this.getTableName()}
selectedRanges={this.irisGrid.current?.state.selectedRanges}
onStateChange={this.handlePluginStateChange}
pluginState={pluginState}
// eslint-disable-next-line react/jsx-props-no-spreading
{...deprecatedProps}
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"@deephaven/components": "file:../components",
"@deephaven/golden-layout": "file:../golden-layout",
"@deephaven/grid": "file:../grid",
"@deephaven/icons": "file:../icons",
"@deephaven/iris-grid": "file:../iris-grid",
"@deephaven/jsapi-types": "^1.0.0-dev0.34.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/plugin/src/TablePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
IrisGridContextMenuData,
IrisGridModel,
} from '@deephaven/iris-grid';
import { GridRange } from '@deephaven/grid';
import type { ResolvableContextAction } from '@deephaven/components';
import type { dh } from '@deephaven/jsapi-types';

Expand Down Expand Up @@ -35,6 +36,16 @@ export interface TablePluginProps<S = unknown> {
*/
table: dh.Table;

/**
* The name of the table this plugin is associated with.
*/
tableName: string;

/**
* The currently selected ranges in the table.
*/
selectedRanges: readonly GridRange[] | undefined;

/**
* Notify of a state change in the plugin state. Will be saved with the panel data.
* Should be an object that can be serialized to JSON.
Expand Down
Loading