@databiosphere/findable-ui 32.0.0 → 32.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "32.0.0"
2
+ ".": "32.0.1"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [32.0.1](https://github.com/DataBiosphere/findable-ui/compare/v32.0.0...v32.0.1) (2025-05-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * prevent table column def and data mismatch for client side filtering ([#484](https://github.com/DataBiosphere/findable-ui/issues/484)) ([#485](https://github.com/DataBiosphere/findable-ui/issues/485)) ([04f0ec8](https://github.com/DataBiosphere/findable-ui/commit/04f0ec8d1ac13e91c8f97d5becb58a0662f54939))
9
+ * update explorestate provider updateentityfilters action ([#486](https://github.com/DataBiosphere/findable-ui/issues/486)) ([ae16e1c](https://github.com/DataBiosphere/findable-ui/commit/ae16e1c810d629e533f287e229d783315fa37e29))
10
+ * update explorestate provider updateentityfilters action: update filters when tabvalue matches entitylisttype ([#486](https://github.com/DataBiosphere/findable-ui/issues/486)) ([#487](https://github.com/DataBiosphere/findable-ui/issues/487)) ([ae16e1c](https://github.com/DataBiosphere/findable-ui/commit/ae16e1c810d629e533f287e229d783315fa37e29))
11
+
3
12
  ## [32.0.0](https://github.com/DataBiosphere/findable-ui/compare/v31.0.0...v32.0.0) (2025-05-19)
4
13
 
5
14
 
@@ -11,7 +11,7 @@ import { useTable } from "./table/hook";
11
11
  export const Index = ({ categoryFilters, className, entityListType, entityName, ListHero, loading, SideBarButton, SubTitleHero, Summaries, Tabs, title, }) => {
12
12
  const { onChange, viewMode, viewStatus } = useEntitiesView();
13
13
  const { dimensions } = useLayoutDimensions();
14
- const { table } = useTable();
14
+ const { table } = useTable({ entityListType });
15
15
  return (React.createElement(IndexLayout, { className: className, marginTop: dimensions.header.height },
16
16
  React.createElement(Hero, { SideBarButton: SideBarButton, Summaries: Summaries, title: title }),
17
17
  SubTitleHero,
@@ -1,3 +1,3 @@
1
1
  import { RowData } from "@tanstack/react-table";
2
- import { UseTable } from "./types";
3
- export declare const useTable: <T extends RowData>() => UseTable<T>;
2
+ import { UseTable, UseTableProps } from "./types";
3
+ export declare const useTable: <T extends RowData>({ entityListType, }: UseTableProps) => UseTable<T>;
@@ -16,8 +16,7 @@ import { ROW_PREVIEW } from "../../Table/features/RowPreview/constants";
16
16
  import { buildBaseColumnDef } from "../../TableCreator/common/utils";
17
17
  import { useTableOptions } from "../../TableCreator/options/hook";
18
18
  import { createCell } from "./coreOptions/columns/cellFactory";
19
- // eslint-disable-next-line sonarjs/cognitive-complexity -- TODO fix component length / complexity
20
- export const useTable = () => {
19
+ export const useTable = ({ entityListType, }) => {
21
20
  const { entityConfig } = useConfig();
22
21
  const exploreMode = useExploreMode();
23
22
  const { exploreDispatch, exploreState } = useExploreState();
@@ -141,6 +140,8 @@ export const useTable = () => {
141
140
  }, [clientFiltering, filterState, table]);
142
141
  // Process explore response - client-side filtering only.
143
142
  useEffect(() => {
143
+ if (entityListType !== tabValue)
144
+ return;
144
145
  if (!listItems || listItems.length === 0)
145
146
  return;
146
147
  if (clientFiltering) {
@@ -162,9 +163,11 @@ export const useTable = () => {
162
163
  allColumns,
163
164
  clientFiltering,
164
165
  columnFilters,
166
+ entityListType,
165
167
  exploreDispatch,
166
168
  listItems,
167
169
  rows,
170
+ tabValue,
168
171
  ]);
169
172
  return { table };
170
173
  };
@@ -2,3 +2,6 @@ import { RowData, Table } from "@tanstack/react-table";
2
2
  export interface UseTable<T extends RowData> {
3
3
  table: Table<T>;
4
4
  }
5
+ export interface UseTableProps {
6
+ entityListType: string;
7
+ }
@@ -262,6 +262,13 @@ function exploreReducer(state, action, exploreContext) {
262
262
  ...state,
263
263
  entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(state, { grouping, rowPreview, rowSelection, sorting }, categoryGroupConfigKey),
264
264
  rowPreview: closeRowPreview(state.rowPreview),
265
+ ...(payload.entityListType === state.tabValue
266
+ ? {
267
+ filterCount: getFilterCount(filterState),
268
+ filterState,
269
+ paginationState: { ...resetPage(state.paginationState), rows: 0 },
270
+ }
271
+ : {}),
265
272
  };
266
273
  }
267
274
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "32.0.0",
3
+ "version": "32.0.1",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -25,7 +25,7 @@ export const Index = ({
25
25
  }: IndexProps): JSX.Element => {
26
26
  const { onChange, viewMode, viewStatus } = useEntitiesView();
27
27
  const { dimensions } = useLayoutDimensions();
28
- const { table } = useTable();
28
+ const { table } = useTable({ entityListType });
29
29
  return (
30
30
  <IndexLayout className={className} marginTop={dimensions.header.height}>
31
31
  <Hero SideBarButton={SideBarButton} Summaries={Summaries} title={title} />
@@ -40,10 +40,12 @@ import { RowPreviewState } from "../../Table/features/RowPreview/entities";
40
40
  import { buildBaseColumnDef } from "../../TableCreator/common/utils";
41
41
  import { useTableOptions } from "../../TableCreator/options/hook";
42
42
  import { createCell } from "./coreOptions/columns/cellFactory";
43
- import { UseTable } from "./types";
43
+ import { UseTable, UseTableProps } from "./types";
44
44
 
45
- // eslint-disable-next-line sonarjs/cognitive-complexity -- TODO fix component length / complexity
46
- export const useTable = <T extends RowData>(): UseTable<T> => {
45
+ export const useTable = <T extends RowData>({
46
+ entityListType,
47
+ }: // eslint-disable-next-line sonarjs/cognitive-complexity -- TODO fix complexity
48
+ UseTableProps): UseTable<T> => {
47
49
  const { entityConfig } = useConfig();
48
50
  const exploreMode = useExploreMode();
49
51
  const { exploreDispatch, exploreState } = useExploreState();
@@ -209,6 +211,7 @@ export const useTable = <T extends RowData>(): UseTable<T> => {
209
211
 
210
212
  // Process explore response - client-side filtering only.
211
213
  useEffect(() => {
214
+ if (entityListType !== tabValue) return;
212
215
  if (!listItems || listItems.length === 0) return;
213
216
  if (clientFiltering) {
214
217
  exploreDispatch({
@@ -229,9 +232,11 @@ export const useTable = <T extends RowData>(): UseTable<T> => {
229
232
  allColumns,
230
233
  clientFiltering,
231
234
  columnFilters,
235
+ entityListType,
232
236
  exploreDispatch,
233
237
  listItems,
234
238
  rows,
239
+ tabValue,
235
240
  ]);
236
241
 
237
242
  return { table };
@@ -3,3 +3,7 @@ import { RowData, Table } from "@tanstack/react-table";
3
3
  export interface UseTable<T extends RowData> {
4
4
  table: Table<T>;
5
5
  }
6
+
7
+ export interface UseTableProps {
8
+ entityListType: string;
9
+ }
@@ -620,6 +620,13 @@ function exploreReducer(
620
620
  categoryGroupConfigKey
621
621
  ),
622
622
  rowPreview: closeRowPreview(state.rowPreview),
623
+ ...(payload.entityListType === state.tabValue
624
+ ? {
625
+ filterCount: getFilterCount(filterState),
626
+ filterState,
627
+ paginationState: { ...resetPage(state.paginationState), rows: 0 },
628
+ }
629
+ : {}),
623
630
  };
624
631
  }
625
632
  /**