Skip to content

Commit

Permalink
Addressed review comments (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 3, 2024
1 parent 3779429 commit 43e5c7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 1 addition & 5 deletions plugins/ui/src/js/src/DashboardPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import DashboardWidgetHandler from './widget/DashboardWidgetHandler';

const NAME_ELEMENT = 'deephaven.ui.Element';
const DASHBOARD_ELEMENT = 'deephaven.ui.Dashboard';
const TABLE_TYPE = 'Table';
const PLUGIN_NAME = '@deephaven/js-plugin-ui.DashboardPlugin';

const log = Log.module('@deephaven/js-plugin-ui.DashboardPlugin');
Expand Down Expand Up @@ -145,11 +144,8 @@ export function DashboardPlugin(
handleDashboardOpen({ widget, dashboardId: widgetId });
break;
}
case TABLE_TYPE: {
break;
}
default: {
log.error('Unknown widget type', type);
break;
}
}
},
Expand Down
11 changes: 7 additions & 4 deletions plugins/ui/src/js/src/elements/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import {
Picker as DHPickerJSApi,
PickerProps as DHPickerJSApiProps,
useTableClose,
} from '@deephaven/jsapi-components';
import { isElementOfType, usePromiseFactory } from '@deephaven/react-hooks';
import { SerializedPickerEventProps, usePickerProps } from './usePickerProps';
Expand All @@ -22,15 +23,17 @@ export type PickerProps = (DHPickerProps | WrappedDHPickerJSApiProps) &
function Picker({ children, ...props }: PickerProps) {
const pickerProps = usePickerProps(props);

const maybeExportedObject = isElementOfType(children, ObjectView)
? children.props.object
: null;
const isObjectView = isElementOfType(children, ObjectView);

const maybeExportedObject = isObjectView ? children.props.object : null;

const { data: table } = usePromiseFactory(fetchReexportedTable, [
maybeExportedObject,
]);

if (isElementOfType(children, ObjectView)) {
useTableClose(table);

if (isObjectView) {
// eslint-disable-next-line react/jsx-props-no-spreading
return table && <DHPickerJSApi {...pickerProps} table={table} />;
}
Expand Down

0 comments on commit 43e5c7d

Please sign in to comment.