From d1fba8f664e1b33e492ddd9fe68d50545a08a3f9 Mon Sep 17 00:00:00 2001 From: Matthew Runyon Date: Thu, 9 May 2024 11:53:19 -0500 Subject: [PATCH] feat: Make grid widget respect global formatter settings (#1995) Fixes https://github.com/deephaven/deephaven-plugins/issues/435 Does not fix the issue in embed-widget. I think that should be a separate ticket. I'll keep https://github.com/deephaven/web-client-ui/issues/1964 open for tracking that if that seems fine Tested by creating a dh.ui component that included a table and then changed the formatter settings. Tried global column formats too (the formats for specifically named columns) Looks like ui.table already loads these settings, so this will fix for normal tables. --- packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx b/packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx index 8e3325ee9a..6f24bf663e 100644 --- a/packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx +++ b/packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx @@ -7,11 +7,14 @@ import { IrisGridModelFactory, type IrisGridModel, } from '@deephaven/iris-grid'; +import { useSelector } from 'react-redux'; +import { getSettings, RootState } from '@deephaven/redux'; export function GridWidgetPlugin( props: WidgetComponentProps ): JSX.Element | null { const dh = useApi(); + const settings = useSelector(getSettings); const [model, setModel] = useState(); const { fetch } = props; @@ -33,7 +36,7 @@ export function GridWidgetPlugin( }; }, [dh, fetch]); - return model ? : null; + return model ? : null; } export default GridWidgetPlugin;