Skip to content

Commit

Permalink
fix: Use correct formatting settings for ui.table (#326)
Browse files Browse the repository at this point in the history
- Wasn't passing the settings into `IrisGrid`
- Pull the settings from redux and pass them to `IrisGrid`
- Fixes #315
- Verified using the steps in the ticket. The table uses the correct
time zone.
  • Loading branch information
mofojed authored Feb 28, 2024
1 parent dfe5c48 commit 4762053
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions plugins/ui/src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
"@deephaven/log": "0.62.0",
"@deephaven/plugin": "0.62.0",
"@deephaven/react-hooks": "0.62.0",
"@deephaven/redux": "0.62.0",
"@deephaven/utils": "0.62.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@react-types/shared": "^3.22.0",
"react-redux": "^7.x",
"json-rpc-2.0": "^1.6.0",
"shortid": "^2.2.16"
},
Expand Down
5 changes: 5 additions & 0 deletions plugins/ui/src/js/src/elements/UITable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { useSelector } from 'react-redux';
import {
DehydratedQuickFilter,
IrisGrid,
Expand All @@ -10,6 +11,7 @@ import {
import { useApi } from '@deephaven/jsapi-bootstrap';
import type { Table } from '@deephaven/jsapi-types';
import Log from '@deephaven/log';
import { getSettings } from '@deephaven/redux';
import { UITableProps } from './UITableUtils';

const log = Log.module('@deephaven/js-plugin-ui/UITable');
Expand All @@ -26,6 +28,7 @@ function UITable({
const [model, setModel] = useState<IrisGridModel>();
const [columns, setColumns] = useState<Table['columns']>();
const utils = useMemo(() => new IrisGridUtils(dh), [dh]);
const settings = useSelector(getSettings);

const hydratedSorts = useMemo(() => {
if (sorts !== undefined && columns !== undefined) {
Expand Down Expand Up @@ -81,13 +84,15 @@ function UITable({
showSearchBar: canSearch,
sorts: hydratedSorts,
quickFilters: hydratedQuickFilters,
settings,
}),
[
onRowDoublePress,
alwaysFetchColumns,
canSearch,
hydratedSorts,
hydratedQuickFilters,
settings,
]
);

Expand Down

0 comments on commit 4762053

Please sign in to comment.