Skip to content

Commit

Permalink
Hierarchical table support (#988)
Browse files Browse the repository at this point in the history
* Add Hierarchical table support to code-studio and iframes
  • Loading branch information
mofojed authored Jan 11, 2023
1 parent 0175de8 commit 81eceea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/console/src/common/ConsoleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class ConsoleUtils {
}

static isTableType(type: VariableTypeUnion): boolean {
return type === dh.VariableType.TABLE || type === dh.VariableType.TREETABLE;
return (
type === dh.VariableType.TABLE ||
type === dh.VariableType.TREETABLE ||
type === dh.VariableType.HIERARCHICALTABLE
);
}

static isWidgetType(type: VariableTypeUnion): boolean {
Expand Down
1 change: 1 addition & 0 deletions packages/console/src/common/ObjectIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function ObjectIcon({ type }: ObjectIconProps): JSX.Element {
case dh.VariableType.TABLE:
case dh.VariableType.TABLEMAP:
case dh.VariableType.TREETABLE:
case dh.VariableType.HIERARCHICALTABLE:
return <FontAwesomeIcon icon={dhTable} />;
case dh.VariableType.FIGURE:
return <FontAwesomeIcon icon={vsGraph} />;
Expand Down
1 change: 1 addition & 0 deletions packages/dashboard-core-plugins/src/GridPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { IrisGridPanel, IrisGridPanelProps } from './panels';
export const SUPPORTED_TYPES: string[] = [
dh.VariableType.TABLE,
dh.VariableType.TREETABLE,
dh.VariableType.HIERARCHICALTABLE,
];

export type GridPluginProps = Partial<DashboardPluginComponentProps> & {
Expand Down
1 change: 1 addition & 0 deletions packages/embed-grid/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const log = Log.module('EmbedGrid.App');
export const SUPPORTED_TYPES: string[] = [
dh.VariableType.TABLE,
dh.VariableType.TREETABLE,
dh.VariableType.HIERARCHICALTABLE,
dh.VariableType.PANDAS,
];

Expand Down
8 changes: 8 additions & 0 deletions packages/jsapi-shim/src/dh.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const VariableType = {
TABLE: 'Table',
TABLEMAP: 'TableMap',
TREETABLE: 'TreeTable',
HIERARCHICALTABLE: 'HierarchicalTable',
PARTITIONEDTABLE: 'PartitionedTable',
} as const;

export interface CalendarStatic {
Expand Down Expand Up @@ -135,6 +137,9 @@ export interface IdeSession extends Evented {
getObject(
definition: VariableDefinition<typeof VariableType.TREETABLE>
): Promise<TreeTable>;
getObject(
definition: VariableDefinition<typeof VariableType.HIERARCHICALTABLE>
): Promise<TreeTable>;
getObject(definition: VariableDefinition): Promise<unknown>;
onLogMessage(logHandler: (logItem: LogItem) => void): () => void;
runCode(code: string): Promise<CommandResult>;
Expand Down Expand Up @@ -956,6 +961,9 @@ export interface IdeConnection
getObject(
definition: VariableDefinition<typeof VariableType.TREETABLE>
): Promise<TreeTable>;
getObject(
definition: VariableDefinition<typeof VariableType.HIERARCHICALTABLE>
): Promise<TreeTable>;
getObject(definition: VariableDefinition): Promise<unknown>;
subscribeToFieldUpdates(
param: (changes: VariableChanges) => void
Expand Down

0 comments on commit 81eceea

Please sign in to comment.