Skip to content

Commit 0b37477

Browse files
authored
fix: TablePlugin needs to know table name and selected range (#2181)
Resolves #2093
1 parent 949118e commit 0b37477

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ export class IrisGridPanel extends PureComponent<
424424
}
425425

426426
// TODO #2093: Find a better way to handle deprecated panel prop
427+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
427428
const deprecatedProps = {
428429
panel: this,
429430
};
@@ -436,10 +437,10 @@ export class IrisGridPanel extends PureComponent<
436437
fetchColumns={this.handlePluginFetchColumns}
437438
model={model}
438439
table={model.table}
440+
tableName={this.getTableName()}
441+
selectedRanges={this.irisGrid.current?.state.selectedRanges}
439442
onStateChange={this.handlePluginStateChange}
440443
pluginState={pluginState}
441-
// eslint-disable-next-line react/jsx-props-no-spreading
442-
{...deprecatedProps}
443444
/>
444445
</div>
445446
);

packages/plugin/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"dependencies": {
2525
"@deephaven/components": "file:../components",
2626
"@deephaven/golden-layout": "file:../golden-layout",
27+
"@deephaven/grid": "file:../grid",
2728
"@deephaven/icons": "file:../icons",
2829
"@deephaven/iris-grid": "file:../iris-grid",
2930
"@deephaven/jsapi-types": "^1.0.0-dev0.34.0",

packages/plugin/src/TablePlugin.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
IrisGridContextMenuData,
66
IrisGridModel,
77
} from '@deephaven/iris-grid';
8+
import { GridRange } from '@deephaven/grid';
89
import type { ResolvableContextAction } from '@deephaven/components';
910
import type { dh } from '@deephaven/jsapi-types';
1011

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

39+
/**
40+
* The name of the table this plugin is associated with.
41+
*/
42+
tableName: string;
43+
44+
/**
45+
* The currently selected ranges in the table.
46+
*/
47+
selectedRanges: readonly GridRange[] | undefined;
48+
3849
/**
3950
* Notify of a state change in the plugin state. Will be saved with the panel data.
4051
* Should be an object that can be serialized to JSON.

0 commit comments

Comments
 (0)