@databiosphere/findable-ui 17.0.0 → 19.0.0
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.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -0
- package/lib/apis/azul/common/filterTransformer.js +1 -1
- package/lib/apis/azul/common/utils.d.ts +1 -1
- package/lib/apis/azul/common/utils.js +5 -1
- package/lib/common/entities.d.ts +3 -3
- package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -0
- package/lib/components/Detail/components/Table/components/TableRows/tableRows.js +1 -15
- package/lib/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.js +9 -10
- package/lib/components/Filter/common/utils.js +1 -1
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.d.ts +1 -1
- package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +23 -12
- package/lib/components/Table/common/columnDef.js +1 -0
- package/lib/components/Table/common/gridTable.styles.js +5 -11
- package/lib/components/Table/common/utils.d.ts +3 -29
- package/lib/components/Table/common/utils.js +26 -61
- package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
- package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
- package/lib/components/Table/components/TableBody/tableBody.d.ts +3 -2
- package/lib/components/Table/components/TableBody/tableBody.js +7 -28
- package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
- package/lib/components/Table/components/TableBody/utils.js +17 -0
- package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.d.ts +3 -1
- package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.js +6 -14
- package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.d.ts +28 -0
- package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.js +52 -0
- package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.d.ts +21 -0
- package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.js +37 -0
- package/lib/components/Table/components/TableFeatures/RowSorting/utils.d.ts +29 -0
- package/lib/components/Table/components/TableFeatures/RowSorting/utils.js +68 -0
- package/lib/components/Table/components/TableHead/tableHead.d.ts +2 -6
- package/lib/components/Table/components/TableHead/tableHead.js +6 -4
- package/lib/components/Table/components/TableHead/types.d.ts +6 -0
- package/lib/components/Table/components/TableHead/types.js +1 -0
- package/lib/components/Table/components/TableHead/utils.d.ts +19 -0
- package/lib/components/Table/components/TableHead/utils.js +34 -0
- package/lib/components/Table/components/TableRow/tableRow.styles.d.ts +1 -0
- package/lib/components/Table/components/TableRow/tableRow.styles.js +14 -2
- package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -2
- package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +8 -4
- package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.d.ts +9 -0
- package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.js +17 -0
- package/lib/components/Table/components/TableRows/tableRows.d.ts +3 -3
- package/lib/components/Table/components/TableRows/tableRows.js +9 -5
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.d.ts +3 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.js +26 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.d.ts +2 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.js +16 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.d.ts +3 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.js +12 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.d.ts +7 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.js +1 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.d.ts +4 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.js +13 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.d.ts +4 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.js +1 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.d.ts +17 -0
- package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.js +36 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +2 -3
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +3 -11
- package/lib/components/Table/components/TableToolbar/tableToolbar.js +4 -2
- package/lib/components/Table/features/RowPosition/constants.js +2 -2
- package/lib/components/Table/features/RowPosition/utils.d.ts +2 -2
- package/lib/components/Table/features/RowPosition/utils.js +12 -5
- package/lib/components/Table/options/updater.d.ts +10 -0
- package/lib/components/Table/options/updater.js +24 -0
- package/lib/components/Table/table.js +22 -17
- package/lib/components/TableCreator/common/constants.d.ts +2 -2
- package/lib/components/TableCreator/common/constants.js +2 -1
- package/lib/components/TableCreator/common/utils.d.ts +5 -2
- package/lib/components/TableCreator/common/utils.js +11 -4
- package/lib/components/TableCreator/options/expanded/constants.d.ts +2 -0
- package/lib/components/TableCreator/options/expanded/constants.js +6 -0
- package/lib/components/TableCreator/options/expanded/hook.d.ts +2 -0
- package/lib/components/TableCreator/options/expanded/hook.js +4 -0
- package/lib/components/TableCreator/options/grouping/constants.d.ts +2 -0
- package/lib/components/TableCreator/options/grouping/constants.js +5 -0
- package/lib/components/TableCreator/options/grouping/hook.d.ts +2 -0
- package/lib/components/TableCreator/options/grouping/hook.js +9 -0
- package/lib/components/TableCreator/options/hook.d.ts +2 -0
- package/lib/components/TableCreator/options/hook.js +25 -0
- package/lib/components/TableCreator/options/rowSelection/constants.d.ts +2 -0
- package/lib/components/TableCreator/options/rowSelection/constants.js +5 -0
- package/lib/components/TableCreator/options/rowSelection/hook.d.ts +2 -0
- package/lib/components/TableCreator/options/rowSelection/hook.js +4 -0
- package/lib/components/TableCreator/options/sorting/constants.d.ts +2 -0
- package/lib/components/TableCreator/options/sorting/constants.js +5 -0
- package/lib/components/TableCreator/options/sorting/hook.d.ts +2 -0
- package/lib/components/TableCreator/options/sorting/hook.js +4 -0
- package/lib/components/TableCreator/tableCreator.d.ts +3 -5
- package/lib/components/TableCreator/tableCreator.js +4 -2
- package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +2 -3
- package/lib/components/common/DropdownMenu/dropdownMenu.js +7 -7
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +1 -1
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +1 -1
- package/lib/components/common/Menu/hooks/useMenu.d.ts +5 -6
- package/lib/config/entities.d.ts +7 -7
- package/lib/config/utils.d.ts +0 -7
- package/lib/config/utils.js +0 -12
- package/lib/hooks/useCategoryFilter.js +5 -1
- package/lib/providers/exploreState/actions/updateGrouping/action.d.ts +10 -0
- package/lib/providers/exploreState/actions/updateGrouping/action.js +16 -0
- package/lib/providers/exploreState/actions/updateGrouping/dispatch.d.ts +7 -0
- package/lib/providers/exploreState/actions/updateGrouping/dispatch.js +12 -0
- package/lib/providers/exploreState/actions/updateGrouping/types.d.ts +9 -0
- package/lib/providers/exploreState/actions/updateGrouping/types.js +1 -0
- package/lib/providers/exploreState/actions/updateGrouping/utils.d.ts +10 -0
- package/lib/providers/exploreState/actions/updateGrouping/utils.js +26 -0
- package/lib/providers/exploreState/entities.d.ts +3 -4
- package/lib/providers/exploreState/initializer/utils.js +41 -8
- package/lib/providers/exploreState/payloads/entities.d.ts +2 -1
- package/lib/providers/exploreState/utils.d.ts +6 -4
- package/lib/providers/exploreState/utils.js +7 -4
- package/lib/providers/exploreState.d.ts +3 -1
- package/lib/providers/exploreState.js +15 -5
- package/lib/providers/fileManifestState.js +2 -4
- package/lib/viewModelBuilders/common/utils.d.ts +6 -6
- package/lib/viewModelBuilders/common/utils.js +10 -10
- package/lib/views/ExploreView/exploreView.js +3 -3
- package/package.json +1 -1
- package/src/apis/azul/common/filterTransformer.ts +1 -1
- package/src/apis/azul/common/utils.ts +4 -2
- package/src/common/entities.ts +3 -3
- package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +2 -0
- package/src/components/Detail/components/Table/components/TableRows/tableRows.tsx +3 -18
- package/src/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.tsx +28 -32
- package/src/components/Filter/common/utils.ts +1 -1
- package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +1 -1
- package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +1 -1
- package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +27 -13
- package/src/components/Table/common/columnDef.ts +1 -0
- package/src/components/Table/common/gridTable.styles.ts +5 -11
- package/src/components/Table/common/utils.ts +45 -108
- package/src/components/Table/components/TableBody/hooks/virtualizer/constants.ts +3 -0
- package/src/components/Table/components/TableBody/hooks/virtualizer/hook.ts +23 -0
- package/src/components/Table/components/TableBody/hooks/virtualizer/types.ts +5 -0
- package/src/components/Table/components/TableBody/tableBody.tsx +14 -30
- package/src/components/Table/components/TableBody/utils.ts +21 -0
- package/src/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.tsx +14 -15
- package/src/components/Table/components/TableFeatures/ColumnGrouping/utils.ts +70 -0
- package/src/components/Table/components/TableFeatures/ColumnVisibility/utils.ts +52 -0
- package/src/components/Table/components/TableFeatures/RowSorting/utils.ts +87 -0
- package/src/components/Table/components/TableHead/tableHead.tsx +21 -29
- package/src/components/Table/components/TableHead/types.ts +7 -0
- package/src/components/Table/components/TableHead/utils.ts +42 -0
- package/src/components/Table/components/TableRow/tableRow.styles.ts +19 -2
- package/src/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +8 -2
- package/src/components/Table/components/TableRows/components/CollapsableRows/hook.ts +20 -0
- package/src/components/Table/components/TableRows/tableRows.tsx +18 -15
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.ts +17 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.tsx +54 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.tsx +28 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/constants.ts +17 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/types.ts +5 -0
- package/src/components/Table/components/TableToolbar/components/ColumnGrouping/utils.ts +45 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +7 -20
- package/src/components/Table/components/TableToolbar/tableToolbar.tsx +8 -2
- package/src/components/Table/features/RowPosition/constants.ts +2 -2
- package/src/components/Table/features/RowPosition/utils.ts +10 -5
- package/src/components/Table/options/updater.ts +29 -0
- package/src/components/Table/table.tsx +43 -25
- package/src/components/TableCreator/common/constants.ts +4 -6
- package/src/components/TableCreator/common/utils.ts +14 -7
- package/src/components/TableCreator/options/expanded/constants.ts +14 -0
- package/src/components/TableCreator/options/expanded/hook.ts +6 -0
- package/src/components/TableCreator/options/grouping/constants.ts +6 -0
- package/src/components/TableCreator/options/grouping/hook.ts +17 -0
- package/src/components/TableCreator/options/hook.ts +31 -0
- package/src/components/TableCreator/options/rowSelection/constants.ts +10 -0
- package/src/components/TableCreator/options/rowSelection/hook.ts +8 -0
- package/src/components/TableCreator/options/sorting/constants.ts +10 -0
- package/src/components/TableCreator/options/sorting/hook.ts +6 -0
- package/src/components/TableCreator/tableCreator.tsx +4 -11
- package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +1 -1
- package/src/components/common/DropdownMenu/dropdownMenu.tsx +19 -17
- package/src/components/common/Menu/hooks/useMenu.ts +8 -9
- package/src/config/entities.ts +11 -10
- package/src/config/utils.ts +0 -14
- package/src/hooks/useCategoryFilter.ts +5 -1
- package/src/hooks/useFileManifest/common/utils.ts +2 -2
- package/src/providers/exploreState/actions/updateGrouping/action.ts +26 -0
- package/src/providers/exploreState/actions/updateGrouping/dispatch.ts +16 -0
- package/src/providers/exploreState/actions/updateGrouping/types.ts +11 -0
- package/src/providers/exploreState/actions/updateGrouping/utils.ts +33 -0
- package/src/providers/exploreState/entities.ts +3 -3
- package/src/providers/exploreState/initializer/utils.ts +58 -10
- package/src/providers/exploreState/payloads/entities.ts +2 -0
- package/src/providers/exploreState/utils.ts +10 -7
- package/src/providers/exploreState.tsx +29 -6
- package/src/providers/fileManifestState.tsx +2 -4
- package/src/viewModelBuilders/common/utils.ts +10 -10
- package/src/views/ExploreView/exploreView.tsx +2 -4
- package/types/data-explorer-ui.d.ts +8 -1
- package/lib/components/TableCreator/common/entities.d.ts +0 -5
- package/src/components/TableCreator/common/entities.ts +0 -6
- /package/lib/components/{TableCreator/common/entities.js → Table/components/TableBody/hooks/virtualizer/types.js} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ColumnSort } from "@tanstack/react-table";
|
|
2
1
|
import {
|
|
3
2
|
CategoryKey,
|
|
4
3
|
CategoryValueKey,
|
|
@@ -109,20 +108,24 @@ export function getEntityStateSavedFilter(
|
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
/**
|
|
112
|
-
*
|
|
111
|
+
* Retrieves a specified property from the "saved filter" for the given category value key.
|
|
112
|
+
* This function fetches a property (e.g., "sorting" or "grouping") from the saved filter
|
|
113
|
+
* associated with a given `selectedValue`.
|
|
113
114
|
* @param state - Explore state.
|
|
114
115
|
* @param selectedValue - Key of category value that has been de/selected.
|
|
115
116
|
* @param selected - True if value is selected, false if de-selected.
|
|
116
|
-
* @
|
|
117
|
+
* @param propertyName - The name of the property to retrieve from the saved filter. Should be one of the predefined keys: "sorting" or "grouping".
|
|
118
|
+
* @returns value of the specified property from the saved filter, or undefined if `selected` is false.
|
|
117
119
|
*/
|
|
118
|
-
export function
|
|
120
|
+
export function getEntityStateSavedProperty<K extends "sorting" | "grouping">(
|
|
119
121
|
state: ExploreState,
|
|
120
122
|
selectedValue: CategoryValueKey,
|
|
121
|
-
selected: boolean
|
|
122
|
-
|
|
123
|
+
selected: boolean,
|
|
124
|
+
propertyName: K
|
|
125
|
+
): EntityStateSavedFilter[K] | undefined {
|
|
123
126
|
if (!selected) return;
|
|
124
127
|
const savedFilter = getEntityStateSavedFilter(state, selectedValue);
|
|
125
|
-
return savedFilter?.
|
|
128
|
+
return savedFilter?.[propertyName];
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
/**
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
} from "../hooks/useCategoryFilter";
|
|
20
20
|
import { useConfig } from "../hooks/useConfig";
|
|
21
21
|
import { useURLFilterParams } from "../hooks/useURLFilterParams";
|
|
22
|
+
import { updateGroupingAction } from "./exploreState/actions/updateGrouping/action";
|
|
23
|
+
import { UpdateGroupingAction } from "./exploreState/actions/updateGrouping/types";
|
|
22
24
|
import {
|
|
23
25
|
EntityPageStateMapper,
|
|
24
26
|
EntityStateByCategoryGroupConfigKey,
|
|
@@ -49,7 +51,7 @@ import {
|
|
|
49
51
|
closeRowPreview,
|
|
50
52
|
getEntityCategoryGroupConfigKey,
|
|
51
53
|
getEntityState,
|
|
52
|
-
|
|
54
|
+
getEntityStateSavedProperty,
|
|
53
55
|
getFilterCount,
|
|
54
56
|
patchEntityListItems,
|
|
55
57
|
resetPage,
|
|
@@ -226,6 +228,7 @@ export enum ExploreActionKind {
|
|
|
226
228
|
UpdateEntityFilters = "UPDATE_ENTITY_FILTERS",
|
|
227
229
|
UpdateEntityViewAccess = "UPDATE_ENTITY_VIEW_ACCESS",
|
|
228
230
|
UpdateFilter = "UPDATE_FILTER",
|
|
231
|
+
UpdateGrouping = "UPDATE_GROUPING",
|
|
229
232
|
UpdateRowPreview = "UPDATE_ROW_PREVIEW",
|
|
230
233
|
UpdateRowSelection = "UPDATE_ROW_SELECTION",
|
|
231
234
|
UpdateSorting = "UPDATE_SORTING",
|
|
@@ -247,6 +250,7 @@ export type ExploreAction =
|
|
|
247
250
|
| UpdateEntityFiltersAction
|
|
248
251
|
| UpdateEntityViewAccessAction
|
|
249
252
|
| UpdateFilterAction
|
|
253
|
+
| UpdateGroupingAction
|
|
250
254
|
| UpdateRowPreviewAction
|
|
251
255
|
| UpdateRowSelectionAction
|
|
252
256
|
| UpdateSortingAction;
|
|
@@ -403,11 +407,19 @@ function exploreReducer(
|
|
|
403
407
|
payload.selectedValue,
|
|
404
408
|
payload.selected
|
|
405
409
|
);
|
|
406
|
-
const
|
|
410
|
+
const savedGrouping = getEntityStateSavedProperty(
|
|
407
411
|
state,
|
|
408
412
|
payload.selectedValue,
|
|
409
|
-
payload.selected
|
|
413
|
+
payload.selected,
|
|
414
|
+
"grouping"
|
|
415
|
+
);
|
|
416
|
+
const savedSorting = getEntityStateSavedProperty(
|
|
417
|
+
state,
|
|
418
|
+
payload.selectedValue,
|
|
419
|
+
payload.selected,
|
|
420
|
+
"sorting"
|
|
410
421
|
);
|
|
422
|
+
const grouping = savedGrouping || []; // Reset grouping to default if saved grouping is not available.
|
|
411
423
|
const sorting = savedSorting || []; // Reset sorting to default if saved sorting is not available.
|
|
412
424
|
updateEntityStateByCategoryGroupConfigKey(state, {
|
|
413
425
|
filterState,
|
|
@@ -417,7 +429,7 @@ function exploreReducer(
|
|
|
417
429
|
...state,
|
|
418
430
|
entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(
|
|
419
431
|
state,
|
|
420
|
-
{ rowPreview, rowSelection, sorting }
|
|
432
|
+
{ grouping, rowPreview, rowSelection, sorting }
|
|
421
433
|
),
|
|
422
434
|
filterCount: getFilterCount(filterState),
|
|
423
435
|
filterState,
|
|
@@ -592,7 +604,12 @@ function exploreReducer(
|
|
|
592
604
|
* - closes row preview, without updating the entity page state row preview.
|
|
593
605
|
*/
|
|
594
606
|
case ExploreActionKind.UpdateEntityFilters: {
|
|
595
|
-
const {
|
|
607
|
+
const {
|
|
608
|
+
entityListType,
|
|
609
|
+
filters: filterState,
|
|
610
|
+
grouping = [],
|
|
611
|
+
sorting = [],
|
|
612
|
+
} = payload;
|
|
596
613
|
const categoryGroupConfigKey = getEntityCategoryGroupConfigKey(
|
|
597
614
|
entityListType,
|
|
598
615
|
state.entityPageState
|
|
@@ -614,7 +631,7 @@ function exploreReducer(
|
|
|
614
631
|
...state,
|
|
615
632
|
entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(
|
|
616
633
|
state,
|
|
617
|
-
{ rowPreview, rowSelection, sorting },
|
|
634
|
+
{ grouping, rowPreview, rowSelection, sorting },
|
|
618
635
|
categoryGroupConfigKey
|
|
619
636
|
),
|
|
620
637
|
rowPreview: closeRowPreview(state.rowPreview),
|
|
@@ -658,6 +675,12 @@ function exploreReducer(
|
|
|
658
675
|
rowPreview,
|
|
659
676
|
};
|
|
660
677
|
}
|
|
678
|
+
/**
|
|
679
|
+
* Update grouping
|
|
680
|
+
**/
|
|
681
|
+
case ExploreActionKind.UpdateGrouping: {
|
|
682
|
+
return updateGroupingAction(state, payload);
|
|
683
|
+
}
|
|
661
684
|
/**
|
|
662
685
|
* Update row preview
|
|
663
686
|
*/
|
|
@@ -262,7 +262,7 @@ function fileManifestReducer(
|
|
|
262
262
|
const filters = buildNextFilterState(
|
|
263
263
|
state.filters,
|
|
264
264
|
payload.categoryKey,
|
|
265
|
-
getFilterParameterValue(payload.selectedValue)
|
|
265
|
+
getFilterParameterValue(payload.selectedValue),
|
|
266
266
|
payload.selected
|
|
267
267
|
);
|
|
268
268
|
// Get file summary filters.
|
|
@@ -322,9 +322,7 @@ function buildNextFileSummaryFilterState(
|
|
|
322
322
|
* @returns all terms for the given category.
|
|
323
323
|
*/
|
|
324
324
|
function getFileFacetTerms(fileFacet: FileFacet): SelectedFilterValue {
|
|
325
|
-
return fileFacet.terms.map(
|
|
326
|
-
(term) => getFilterParameterValue(term.name) as unknown as string // TODO CategoryValueKey may be boolean or null.
|
|
327
|
-
);
|
|
325
|
+
return fileFacet.terms.map((term) => getFilterParameterValue(term.name));
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
/**
|
|
@@ -19,27 +19,27 @@ export function mapCategoryKeyLabel(
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Sanitizes a string for display i.e. any empty, null or undefined value is sanitized to "Unspecified".
|
|
23
|
-
* @param
|
|
22
|
+
* Sanitizes a value to a string for display i.e. any empty, null or undefined value is sanitized to "Unspecified".
|
|
23
|
+
* @param value - Value to sanitize.
|
|
24
24
|
* @returns the string or sanitized string value.
|
|
25
25
|
*/
|
|
26
|
-
export function sanitizeString(
|
|
27
|
-
if (
|
|
26
|
+
export function sanitizeString(value: unknown): string {
|
|
27
|
+
if (value === "" || value === null || value === undefined) {
|
|
28
28
|
return "Unspecified";
|
|
29
29
|
} else {
|
|
30
|
-
return
|
|
30
|
+
return String(value);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Sanitizes
|
|
35
|
+
* Sanitizes array elements to strings for display i.e. any element within the string array that is an empty, null or
|
|
36
36
|
* undefined value is sanitized to "Unspecified".
|
|
37
|
-
* @param
|
|
37
|
+
* @param array - Array to sanitize.
|
|
38
38
|
* @returns the string array, sanitized.
|
|
39
39
|
*/
|
|
40
|
-
export function sanitizeStringArray(
|
|
41
|
-
if (!
|
|
40
|
+
export function sanitizeStringArray(array: unknown[]): string[] {
|
|
41
|
+
if (!array || array.length === 0) {
|
|
42
42
|
return ["Unspecified"];
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return array.map(sanitizeString);
|
|
45
45
|
}
|
|
@@ -114,7 +114,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
114
114
|
if (selected) {
|
|
115
115
|
track(EVENT_NAME.FILTER_SELECTED, {
|
|
116
116
|
[EVENT_PARAM.FILTER_NAME]: categoryKey,
|
|
117
|
-
[EVENT_PARAM.FILTER_VALUE]: selectedCategoryValue,
|
|
117
|
+
[EVENT_PARAM.FILTER_VALUE]: String(selectedCategoryValue),
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
};
|
|
@@ -248,7 +248,7 @@ function renderList(
|
|
|
248
248
|
): JSX.Element {
|
|
249
249
|
const { listItems, loading, tabValue } = exploreState;
|
|
250
250
|
const { getId: getRowId, list, listView } = entityConfig;
|
|
251
|
-
const { columns: columnsConfig
|
|
251
|
+
const { columns: columnsConfig } = list;
|
|
252
252
|
|
|
253
253
|
if (!exploreState || !tabValue) {
|
|
254
254
|
return <></>; //TODO: return the loading UI component
|
|
@@ -263,12 +263,10 @@ function renderList(
|
|
|
263
263
|
return (
|
|
264
264
|
<TableCreator
|
|
265
265
|
columns={columnsConfig}
|
|
266
|
-
defaultSort={defaultSort}
|
|
267
266
|
getRowId={getRowId}
|
|
268
267
|
items={listItems ?? []}
|
|
269
268
|
listView={listView}
|
|
270
269
|
loading={loading}
|
|
271
|
-
tableOptions={tableOptions}
|
|
272
270
|
/>
|
|
273
271
|
);
|
|
274
272
|
}
|
|
@@ -269,7 +269,6 @@ declare module "@tanstack/react-table" {
|
|
|
269
269
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
270
270
|
align?: TableCellProps["align"];
|
|
271
271
|
columnPinned?: boolean;
|
|
272
|
-
enableSortingInteraction?: boolean; // Flag to enable sorting interaction UI (e.g. sort icon) button; defaults to true.
|
|
273
272
|
header?: string;
|
|
274
273
|
width?: GridTrackSize;
|
|
275
274
|
}
|
|
@@ -277,6 +276,14 @@ declare module "@tanstack/react-table" {
|
|
|
277
276
|
interface InitialTableState extends CustomFeatureInitialTableState {}
|
|
278
277
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-unused-vars -- empty interface is needed for extending, TData is an unused variable.
|
|
279
278
|
interface Row<TData extends RowData> extends CustomFeatureRow {}
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TData is an unused variables.
|
|
280
|
+
interface SortingOptions<TData extends RowData> {
|
|
281
|
+
/**
|
|
282
|
+
* When false, sorting can still be applied programmatically (e.g., `getSortedRowModel`),
|
|
283
|
+
* but user interactions or showing sort icons are disabled.
|
|
284
|
+
*/
|
|
285
|
+
enableSortingInteraction?: boolean;
|
|
286
|
+
}
|
|
280
287
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface -- empty interface is needed for extending.
|
|
281
288
|
interface Table<TData extends RowData> extends CustomFeatureInstance<TData> {}
|
|
282
289
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-unused-vars -- empty interface is needed for extending, TData is an unused variable.
|
|
File without changes
|