@databiosphere/findable-ui 35.2.0 → 37.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 +27 -0
- package/lib/common/entities.d.ts +2 -3
- package/lib/components/DataDictionary/components/Entities/constants.d.ts +3 -1
- package/lib/components/DataDictionary/components/Entities/constants.js +6 -2
- package/lib/components/DataDictionary/components/Entities/entities.js +6 -2
- package/lib/components/DataDictionary/components/Entities/entities.styles.d.ts +3 -0
- package/lib/components/DataDictionary/components/Entities/entities.styles.js +5 -0
- package/lib/components/DataDictionary/components/Entity/entity.styles.js +1 -8
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.d.ts +4 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.js +15 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.d.ts +7 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.js +7 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.js +6 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.d.ts +6 -0
- package/lib/components/DataDictionary/components/Filters/filters.js +2 -0
- package/lib/components/DataDictionary/components/Filters/filters.styles.js +3 -3
- package/lib/components/DataDictionary/components/Filters/stories/constants.d.ts +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/constants.js +16 -0
- package/lib/components/DataDictionary/components/Filters/stories/filters.stories.js +11 -3
- package/lib/components/DataDictionary/components/Filters/stories/hook.d.ts +4 -0
- package/lib/components/DataDictionary/components/Filters/stories/hook.js +4 -0
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.d.ts +2 -1
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.js +4 -4
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +1 -4
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/types.d.ts +4 -2
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.d.ts +2 -1
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.js +4 -4
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.js +4 -1
- package/lib/components/DataDictionary/components/Table/hook.d.ts +2 -2
- package/lib/components/DataDictionary/components/Table/hook.js +8 -4
- package/lib/components/DataDictionary/components/Table/options/columnFilters/constants.js +2 -1
- package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.d.ts +2 -5
- package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.js +8 -6
- package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.js +5 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.js +16 -0
- package/lib/components/DataDictionary/components/Table/options/hook.js +7 -5
- package/lib/components/DataDictionary/components/Table/options/pagination/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/options/pagination/constants.js +3 -0
- package/lib/components/DataDictionary/dataDictionary.d.ts +1 -1
- package/lib/components/DataDictionary/dataDictionary.js +31 -12
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.d.ts +4 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.js +27 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.d.ts +7 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.js +1 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.d.ts +6 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.js +8 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.d.ts +2 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.js +17 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.d.ts +7 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.js +1 -0
- package/lib/components/DataDictionary/types.d.ts +1 -0
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +2 -1
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +3 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +2 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.js +3 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +2 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.js +3 -1
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.d.ts +2 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.js +8 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.d.ts +3 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.js +18 -0
- package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.d.ts +6 -0
- package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.js +6 -0
- package/lib/components/Filter/components/FilterCountChip/types.d.ts +5 -0
- package/lib/components/Filter/components/FilterCountChip/types.js +1 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Table/columnDef/globalFilter/constants.d.ts +2 -0
- package/lib/components/Table/columnDef/globalFilter/constants.js +4 -0
- package/lib/components/Table/columnDef/globalFilter/filterFn.d.ts +13 -0
- package/lib/components/Table/columnDef/globalFilter/filterFn.js +24 -0
- package/lib/components/Table/columnDef/globalFilter/types.d.ts +4 -0
- package/lib/components/Table/columnDef/globalFilter/types.js +1 -0
- package/lib/components/Table/columnDef/globalFilter/utils.d.ts +23 -0
- package/lib/components/Table/columnDef/globalFilter/utils.js +57 -0
- package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.d.ts +2 -1
- package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.js +25 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/utils.d.ts +30 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/utils.js +64 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +9 -5
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.d.ts +9 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.js +20 -1
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.js +9 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.d.ts +5 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.js +24 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.js +10 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.js +17 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.js +1 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.d.ts +2 -1
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/types.d.ts +3 -2
- package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.d.ts +2 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.js +6 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.js +10 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/types.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/types.js +1 -0
- package/lib/components/Table/coreOptions/state/pagination/constants.d.ts +2 -0
- package/lib/components/Table/coreOptions/state/pagination/constants.js +6 -0
- package/lib/components/Table/coreOptions/state/pagination/utils.d.ts +9 -0
- package/lib/components/Table/coreOptions/state/pagination/utils.js +18 -0
- package/lib/components/common/AnchorLink/anchorLink.js +4 -2
- package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +1 -1
- package/lib/components/common/AnchorLink/anchorLink.styles.js +1 -1
- package/lib/components/common/CustomIcon/components/SearchIcon/searchIcon.d.ts +2 -2
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.js +13 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.d.ts +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.js +11 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.d.ts +3 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.js +10 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.d.ts +4 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.js +1 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.js +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.d.ts +1 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.js +9 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.js +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.d.ts +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.js +5 -0
- package/lib/components/common/OutlinedInput/outlinedInput.styles.d.ts +7 -0
- package/lib/components/common/OutlinedInput/outlinedInput.styles.js +18 -0
- package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.js +2 -2
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.js +3 -3
- package/lib/hooks/stateSyncManager/types.d.ts +1 -1
- package/lib/hooks/useFileManifest/useFileManifestFileCount.d.ts +10 -0
- package/lib/hooks/useFileManifest/useFileManifestFileCount.js +44 -0
- package/lib/hooks/useRequestManifest/utils.d.ts +21 -14
- package/lib/hooks/useRequestManifest/utils.js +33 -21
- package/lib/mocks/useRequestFileManifest.mocks.js +2 -0
- package/lib/providers/dataDictionary/context.d.ts +2 -0
- package/lib/providers/dataDictionary/context.js +4 -0
- package/lib/providers/dataDictionary/hook.d.ts +6 -0
- package/lib/providers/dataDictionary/hook.js +9 -0
- package/lib/providers/dataDictionary/types.d.ts +3 -0
- package/lib/providers/dataDictionary/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/action.js +12 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.d.ts +6 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.js +11 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/types.d.ts +6 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/action.js +14 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/types.d.ts +12 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/types.js +5 -0
- package/lib/providers/dataDictionaryState/actions/types.d.ts +13 -0
- package/lib/providers/dataDictionaryState/actions/types.js +8 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.js +18 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.d.ts +10 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.d.ts +11 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.js +27 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.js +19 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.d.ts +10 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.d.ts +17 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.js +36 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/action.js +20 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/types.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/types.js +1 -0
- package/lib/providers/dataDictionaryState/context.d.ts +2 -0
- package/lib/providers/dataDictionaryState/context.js +6 -0
- package/lib/providers/dataDictionaryState/dictionaries/constants.d.ts +4 -0
- package/lib/providers/dataDictionaryState/dictionaries/constants.js +4 -0
- package/lib/providers/dataDictionaryState/dictionaries/state.d.ts +11 -0
- package/lib/providers/dataDictionaryState/dictionaries/state.js +29 -0
- package/lib/providers/dataDictionaryState/dictionaries/types.d.ts +9 -0
- package/lib/providers/dataDictionaryState/dictionaries/types.js +1 -0
- package/lib/providers/dataDictionaryState/dictionaries/utils.d.ts +14 -0
- package/lib/providers/dataDictionaryState/dictionaries/utils.js +20 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.d.ts +2 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.js +6 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.d.ts +4 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.js +1 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.d.ts +2 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.js +9 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.d.ts +6 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.js +9 -0
- package/lib/providers/dataDictionaryState/initializer/constants.d.ts +2 -0
- package/lib/providers/dataDictionaryState/initializer/constants.js +4 -0
- package/lib/providers/dataDictionaryState/initializer/initializer.d.ts +9 -0
- package/lib/providers/dataDictionaryState/initializer/initializer.js +17 -0
- package/lib/providers/dataDictionaryState/initializer/utils.d.ts +8 -0
- package/lib/providers/dataDictionaryState/initializer/utils.js +29 -0
- package/lib/providers/dataDictionaryState/provider.d.ts +4 -0
- package/lib/providers/dataDictionaryState/provider.js +7 -0
- package/lib/providers/dataDictionaryState/reducer.d.ts +9 -0
- package/lib/providers/dataDictionaryState/reducer.js +34 -0
- package/lib/providers/dataDictionaryState/types.d.ts +15 -0
- package/lib/providers/dataDictionaryState/types.js +1 -0
- package/lib/providers/fileManifestState/constants.js +1 -0
- package/lib/providers/fileManifestState.d.ts +16 -1
- package/lib/providers/fileManifestState.js +6 -0
- package/lib/styles/common/mui/iconButton.d.ts +11 -0
- package/lib/styles/common/mui/iconButton.js +29 -0
- package/lib/styles/common/mui/inputAdornment.d.ts +9 -0
- package/lib/styles/common/mui/inputAdornment.js +13 -0
- package/lib/styles/common/mui/outlinedInput.d.ts +7 -0
- package/lib/styles/common/mui/outlinedInput.js +7 -0
- package/lib/theme/common/components.js +122 -16
- package/lib/theme/components/muiButtonGroup.js +4 -0
- package/lib/theme/components/muiTableCell.js +6 -0
- package/lib/utils/parseJsonQueryParam.d.ts +14 -0
- package/lib/utils/parseJsonQueryParam.js +25 -0
- package/lib/utils/stateToUrlQuery.d.ts +15 -0
- package/lib/utils/stateToUrlQuery.js +35 -0
- package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -2
- package/lib/views/DataDictionaryView/dataDictionaryView.js +16 -2
- package/lib/views/DataDictionaryView/types.d.ts +4 -0
- package/lib/views/DataDictionaryView/types.js +1 -0
- package/lib/views/DataDictionaryView/utils.d.ts +12 -0
- package/lib/views/DataDictionaryView/utils.js +17 -0
- package/lib/views/ExploreView/utils.d.ts +1 -1
- package/lib/views/ExploreView/utils.js +1 -1
- package/package.json +2 -1
- package/src/common/entities.ts +2 -3
- package/src/components/DataDictionary/components/Entities/constants.ts +9 -3
- package/src/components/DataDictionary/components/Entities/entities.styles.ts +6 -0
- package/src/components/DataDictionary/components/Entities/entities.tsx +7 -2
- package/src/components/DataDictionary/components/Entity/entity.styles.ts +1 -10
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.ts +8 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +33 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.ts +8 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.ts +8 -0
- package/src/components/DataDictionary/components/Filters/filters.styles.ts +3 -3
- package/src/components/DataDictionary/components/Filters/filters.tsx +2 -0
- package/src/components/DataDictionary/components/Filters/stories/constants.ts +18 -0
- package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +15 -3
- package/src/components/DataDictionary/components/Filters/stories/hook.ts +8 -0
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +1 -5
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx +13 -7
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/types.ts +4 -2
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +4 -1
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx +13 -7
- package/src/components/DataDictionary/components/Table/hook.ts +10 -6
- package/src/components/DataDictionary/components/Table/options/columnFilters/constants.ts +2 -1
- package/src/components/DataDictionary/components/Table/options/columnFilters/hook.ts +13 -12
- package/src/components/DataDictionary/components/Table/options/globalFilter/constants.ts +14 -0
- package/src/components/DataDictionary/components/Table/options/globalFilter/hook.ts +28 -0
- package/src/components/DataDictionary/components/Table/options/hook.ts +9 -11
- package/src/components/DataDictionary/components/Table/options/pagination/constants.ts +6 -0
- package/src/components/DataDictionary/dataDictionary.tsx +45 -16
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.ts +38 -0
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/types.ts +8 -0
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.ts +8 -0
- package/src/components/DataDictionary/hooks/UseMeasureFilters/hook.ts +27 -0
- package/src/components/DataDictionary/hooks/UseMeasureFilters/types.ts +6 -0
- package/src/components/DataDictionary/types.ts +1 -0
- package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +4 -0
- package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +4 -0
- package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +4 -0
- package/src/components/Filter/components/FilterCountChip/filterCountChip.styles.ts +19 -0
- package/src/components/Filter/components/FilterCountChip/filterCountChip.tsx +21 -0
- package/src/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.tsx +12 -0
- package/src/components/Filter/components/FilterCountChip/types.ts +6 -0
- package/src/components/Table/columnDef/globalFilter/constants.ts +5 -0
- package/src/components/Table/columnDef/globalFilter/filterFn.ts +34 -0
- package/src/components/Table/columnDef/globalFilter/types.ts +5 -0
- package/src/components/Table/columnDef/globalFilter/utils.ts +74 -0
- package/src/components/Table/components/TableCell/components/CodeCell/codeCell.tsx +5 -2
- package/src/components/Table/components/TableCell/components/RankedCell/rankedCell.tsx +50 -0
- package/src/components/Table/components/TableCell/components/RankedCell/utils.ts +85 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts +26 -1
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +11 -5
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.ts +25 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.tsx +31 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.ts +13 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.tsx +26 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.ts +9 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +8 -1
- package/src/components/Table/components/TableFeatures/ColumnFilter/types.ts +3 -2
- package/src/components/Table/components/TableFeatures/GlobalFilter/constants.ts +8 -0
- package/src/components/Table/components/TableFeatures/GlobalFilter/globalFilter.tsx +33 -0
- package/src/components/Table/components/TableFeatures/GlobalFilter/types.ts +9 -0
- package/src/components/Table/coreOptions/state/pagination/constants.ts +8 -0
- package/src/components/Table/coreOptions/state/pagination/utils.ts +21 -0
- package/src/components/common/AnchorLink/anchorLink.styles.ts +1 -1
- package/src/components/common/AnchorLink/anchorLink.tsx +9 -3
- package/src/components/common/CustomIcon/components/SearchIcon/searchIcon.tsx +2 -3
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.ts +12 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.tsx +21 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.ts +13 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.ts +4 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.ts +7 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.tsx +13 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/constants.ts +7 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.ts +6 -0
- package/src/components/common/OutlinedInput/outlinedInput.styles.ts +24 -0
- package/src/hooks/stateSyncManager/hooks/UseMetaCommands/hook.ts +2 -2
- package/src/hooks/stateSyncManager/hooks/UseStateSync/hook.ts +3 -3
- package/src/hooks/stateSyncManager/types.ts +1 -1
- package/src/hooks/useFileManifest/useFileManifestFileCount.ts +65 -0
- package/src/hooks/useRequestManifest/utils.ts +37 -24
- package/src/mocks/useRequestFileManifest.mocks.ts +2 -0
- package/src/providers/dataDictionary/context.ts +6 -0
- package/src/providers/dataDictionary/hook.ts +11 -0
- package/src/providers/dataDictionary/types.ts +6 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/action.ts +18 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/dispatch.ts +13 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/types.ts +8 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/action.ts +20 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/dispatch.ts +14 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/types.ts +15 -0
- package/src/providers/dataDictionaryState/actions/types.ts +20 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/action.ts +24 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.ts +16 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/types.ts +12 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/utils.ts +41 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/action.ts +25 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.ts +16 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/types.ts +12 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/utils.ts +50 -0
- package/src/providers/dataDictionaryState/actions/urlToState/action.ts +28 -0
- package/src/providers/dataDictionaryState/actions/urlToState/dispatch.ts +14 -0
- package/src/providers/dataDictionaryState/actions/urlToState/types.ts +11 -0
- package/src/providers/dataDictionaryState/context.ts +9 -0
- package/src/providers/dataDictionaryState/dictionaries/constants.ts +4 -0
- package/src/providers/dataDictionaryState/dictionaries/state.ts +45 -0
- package/src/providers/dataDictionaryState/dictionaries/types.ts +11 -0
- package/src/providers/dataDictionaryState/dictionaries/utils.ts +25 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.ts +14 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.ts +5 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.ts +17 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.ts +11 -0
- package/src/providers/dataDictionaryState/initializer/constants.ts +6 -0
- package/src/providers/dataDictionaryState/initializer/initializer.ts +22 -0
- package/src/providers/dataDictionaryState/initializer/utils.ts +39 -0
- package/src/providers/dataDictionaryState/provider.tsx +16 -0
- package/src/providers/dataDictionaryState/reducer.ts +42 -0
- package/src/providers/dataDictionaryState/types.ts +18 -0
- package/src/providers/fileManifestState/constants.ts +1 -0
- package/src/providers/fileManifestState.tsx +23 -0
- package/src/styles/common/mui/iconButton.ts +40 -0
- package/src/styles/common/mui/inputAdornment.ts +22 -0
- package/src/styles/common/mui/outlinedInput.ts +14 -0
- package/src/theme/common/components.ts +122 -16
- package/src/theme/components/muiButtonGroup.ts +4 -0
- package/src/theme/components/muiTableCell.ts +6 -0
- package/src/utils/parseJsonQueryParam.ts +27 -0
- package/src/utils/stateToUrlQuery.ts +40 -0
- package/src/views/DataDictionaryView/dataDictionaryView.tsx +29 -3
- package/src/views/DataDictionaryView/types.ts +5 -0
- package/src/views/DataDictionaryView/utils.ts +23 -0
- package/src/views/ExploreView/utils.ts +1 -1
- package/tests/buildRequestFilters.test.ts +5 -13
- package/tests/useRequestManifest.test.ts +10 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +0 -4
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +0 -36
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +0 -8
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +0 -51
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +0 -9
- /package/lib/components/DataDictionary/{hooks/UseDataDictionary → components/Filters/components/ColumnFilterTags}/types.js +0 -0
|
@@ -5,6 +5,7 @@ import { PALETTE } from "../../styles/common/constants/palette";
|
|
|
5
5
|
import { SHADOWS } from "../../styles/common/constants/shadows";
|
|
6
6
|
import { BUTTON_PROPS } from "../../styles/common/mui/button";
|
|
7
7
|
import { CHIP_PROPS } from "../../styles/common/mui/chip";
|
|
8
|
+
import { OUTLINED_INPUT_PROPS } from "../../styles/common/mui/outlinedInput";
|
|
8
9
|
import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
|
|
9
10
|
import {
|
|
10
11
|
TEXT_BODY_400,
|
|
@@ -256,11 +257,25 @@ export const MuiButton = (theme: Theme): Components["MuiButton"] => {
|
|
|
256
257
|
minWidth: 0,
|
|
257
258
|
padding: 0,
|
|
258
259
|
},
|
|
259
|
-
textPrimary: {
|
|
260
|
-
color: theme.palette.primary.main,
|
|
261
|
-
},
|
|
262
260
|
},
|
|
263
261
|
variants: [
|
|
262
|
+
{
|
|
263
|
+
props: {
|
|
264
|
+
color: BUTTON_PROPS.COLOR.PRIMARY,
|
|
265
|
+
variant: BUTTON_PROPS.VARIANT.TEXT,
|
|
266
|
+
},
|
|
267
|
+
style: {
|
|
268
|
+
color: PALETTE.PRIMARY_MAIN,
|
|
269
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
270
|
+
"&:hover": {
|
|
271
|
+
backgroundColor: "transparent",
|
|
272
|
+
textDecoration: "underline",
|
|
273
|
+
textDecorationColor: "currentColor",
|
|
274
|
+
textDecorationSkipInk: "none",
|
|
275
|
+
textUnderlinePosition: "from-font",
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
264
279
|
{
|
|
265
280
|
props: {
|
|
266
281
|
variant: "activeNav", // associated with "nav" variant.
|
|
@@ -439,6 +454,16 @@ export const MuiChip = (theme: Theme): Components["MuiChip"] => {
|
|
|
439
454
|
color: theme.palette.info.main,
|
|
440
455
|
},
|
|
441
456
|
},
|
|
457
|
+
{
|
|
458
|
+
props: {
|
|
459
|
+
color: CHIP_PROPS.COLOR.PRIMARY,
|
|
460
|
+
variant: CHIP_PROPS.VARIANT.FILLED,
|
|
461
|
+
},
|
|
462
|
+
style: {
|
|
463
|
+
backgroundColor: PALETTE.PRIMARY_MAIN,
|
|
464
|
+
color: PALETTE.COMMON_WHITE,
|
|
465
|
+
},
|
|
466
|
+
},
|
|
442
467
|
{
|
|
443
468
|
props: { color: "success" },
|
|
444
469
|
style: {
|
|
@@ -866,9 +891,6 @@ export const MuiIconButton = (theme: Theme): Components["MuiIconButton"] => {
|
|
|
866
891
|
export const MuiInputBase = (theme: Theme): Components["MuiInputBase"] => {
|
|
867
892
|
return {
|
|
868
893
|
styleOverrides: {
|
|
869
|
-
adornedStart: {
|
|
870
|
-
gap: 8,
|
|
871
|
-
},
|
|
872
894
|
multiline: {
|
|
873
895
|
height: "unset",
|
|
874
896
|
},
|
|
@@ -881,6 +903,17 @@ export const MuiInputBase = (theme: Theme): Components["MuiInputBase"] => {
|
|
|
881
903
|
[tabletUp]: {
|
|
882
904
|
fontSize: theme.typography[TEXT_BODY_400].fontSize,
|
|
883
905
|
},
|
|
906
|
+
variants: [
|
|
907
|
+
/* PRIMARY */ /* TODO: remove `adornedStart` when all input components are refactored to color: secondary */
|
|
908
|
+
{
|
|
909
|
+
props: { color: "primary" },
|
|
910
|
+
style: {
|
|
911
|
+
adornedStart: {
|
|
912
|
+
gap: 8,
|
|
913
|
+
},
|
|
914
|
+
},
|
|
915
|
+
},
|
|
916
|
+
],
|
|
884
917
|
},
|
|
885
918
|
},
|
|
886
919
|
};
|
|
@@ -1012,11 +1045,8 @@ export const MuiOutlinedInput = (
|
|
|
1012
1045
|
root: {
|
|
1013
1046
|
backgroundColor: PALETTE.COMMON_WHITE,
|
|
1014
1047
|
boxShadow: `inset 0 2px 0 0 ${COLOR_MIXES.COMMON_BLACK_04}`,
|
|
1015
|
-
paddingLeft: 12,
|
|
1048
|
+
paddingLeft: 12, // TODO: remove when all input components are refactored to color: secondary.
|
|
1016
1049
|
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
1017
|
-
"& .MuiSvgIcon-root": {
|
|
1018
|
-
color: theme.palette.ink.light, // Adornment e.g. "SearchIcon".
|
|
1019
|
-
},
|
|
1020
1050
|
"&:hover": {
|
|
1021
1051
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
1022
1052
|
borderColor: theme.palette.smoke.dark,
|
|
@@ -1028,9 +1058,6 @@ export const MuiOutlinedInput = (
|
|
|
1028
1058
|
borderColor: theme.palette.ink.main,
|
|
1029
1059
|
borderWidth: 1,
|
|
1030
1060
|
},
|
|
1031
|
-
"& .MuiSvgIcon-root": {
|
|
1032
|
-
color: theme.palette.ink.main, // Adornment e.g. "SearchIcon".
|
|
1033
|
-
},
|
|
1034
1061
|
},
|
|
1035
1062
|
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1036
1063
|
"&.Mui-disabled": {
|
|
@@ -1038,9 +1065,6 @@ export const MuiOutlinedInput = (
|
|
|
1038
1065
|
borderColor: theme.palette.smoke.dark,
|
|
1039
1066
|
borderWidth: 1,
|
|
1040
1067
|
},
|
|
1041
|
-
"& .MuiSvgIcon-root": {
|
|
1042
|
-
color: theme.palette.ink.light,
|
|
1043
|
-
},
|
|
1044
1068
|
},
|
|
1045
1069
|
"&.Mui-error": {
|
|
1046
1070
|
backgroundColor: theme.palette.alert.lightest,
|
|
@@ -1050,6 +1074,88 @@ export const MuiOutlinedInput = (
|
|
|
1050
1074
|
borderWidth: 1,
|
|
1051
1075
|
},
|
|
1052
1076
|
},
|
|
1077
|
+
variants: [
|
|
1078
|
+
/* PRIMARY */
|
|
1079
|
+
{
|
|
1080
|
+
props: { color: OUTLINED_INPUT_PROPS.COLOR.PRIMARY },
|
|
1081
|
+
style: {
|
|
1082
|
+
"& .MuiSvgIcon-root": {
|
|
1083
|
+
color: theme.palette.ink.light, // Adornment e.g. "SearchIcon". TODO: remove when all input components are refactored to color: secondary.
|
|
1084
|
+
},
|
|
1085
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1086
|
+
"&.Mui-focused": {
|
|
1087
|
+
"& .MuiSvgIcon-root": {
|
|
1088
|
+
color: theme.palette.ink.main, // Adornment e.g. "SearchIcon". TODO: remove when all input components are refactored to color: secondary.
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1092
|
+
"&.Mui-disabled": {
|
|
1093
|
+
"& .MuiSvgIcon-root": {
|
|
1094
|
+
color: theme.palette.ink.light, // TODO: remove when all input components are refactored to color: secondary.
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
},
|
|
1098
|
+
},
|
|
1099
|
+
/* SECONDARY */
|
|
1100
|
+
{
|
|
1101
|
+
props: { color: OUTLINED_INPUT_PROPS.COLOR.SECONDARY },
|
|
1102
|
+
style: {
|
|
1103
|
+
backgroundColor: PALETTE.COMMON_WHITE,
|
|
1104
|
+
boxShadow: `inset 0 2px 0 0 ${COLOR_MIXES.COMMON_BLACK_04}`,
|
|
1105
|
+
color: PALETTE.INK_LIGHT,
|
|
1106
|
+
padding: "0 12px",
|
|
1107
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1108
|
+
".MuiOutlinedInput-input": {
|
|
1109
|
+
color: "inherit",
|
|
1110
|
+
height: 20,
|
|
1111
|
+
padding: "10px 0",
|
|
1112
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1113
|
+
"&::placeholder": {
|
|
1114
|
+
color: "inherit",
|
|
1115
|
+
opacity: 0.8,
|
|
1116
|
+
},
|
|
1117
|
+
},
|
|
1118
|
+
".MuiOutlinedInput-notchedOutline": {
|
|
1119
|
+
borderColor: PALETTE.SMOKE_DARK,
|
|
1120
|
+
borderWidth: 1,
|
|
1121
|
+
},
|
|
1122
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1123
|
+
"&.Mui-focused": {
|
|
1124
|
+
color: PALETTE.INK_MAIN,
|
|
1125
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1126
|
+
".MuiOutlinedInput-input": {
|
|
1127
|
+
"&::placeholder": {
|
|
1128
|
+
opacity: 0,
|
|
1129
|
+
},
|
|
1130
|
+
},
|
|
1131
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1132
|
+
".MuiOutlinedInput-notchedOutline": {
|
|
1133
|
+
borderColor: PALETTE.INK_MAIN,
|
|
1134
|
+
borderWidth: 1,
|
|
1135
|
+
},
|
|
1136
|
+
},
|
|
1137
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1138
|
+
"&.Mui-disabled": {
|
|
1139
|
+
backgroundColor: PALETTE.SMOKE_LIGHT,
|
|
1140
|
+
color: PALETTE.INK_LIGHT,
|
|
1141
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1142
|
+
".MuiOutlinedInput-input": {
|
|
1143
|
+
WebkitTextFillColor: "unset",
|
|
1144
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1145
|
+
"&::placeholder": {
|
|
1146
|
+
color: "inherit",
|
|
1147
|
+
opacity: 1,
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
// eslint-disable-next-line sort-keys -- disabling key order for specificity
|
|
1151
|
+
".MuiOutlinedInput-notchedOutline": {
|
|
1152
|
+
borderColor: PALETTE.SMOKE_DARK,
|
|
1153
|
+
borderWidth: 1,
|
|
1154
|
+
},
|
|
1155
|
+
},
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
],
|
|
1053
1159
|
},
|
|
1054
1160
|
},
|
|
1055
1161
|
};
|
|
@@ -59,6 +59,10 @@ export const MuiButtonGroup: Components["MuiButtonGroup"] = {
|
|
|
59
59
|
backgroundColor: PALETTE.SMOKE_LIGHTEST,
|
|
60
60
|
boxShadow: `inset 0 0 0 1px ${PALETTE.SMOKE_DARK}`,
|
|
61
61
|
},
|
|
62
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
63
|
+
"&.Mui-focusVisible": {
|
|
64
|
+
boxShadow: `inset 0 0 0 1px ${PALETTE.SMOKE_DARK}, 0 1px 0 0 ${COLOR_MIXES.COMMON_BLACK_08}`,
|
|
65
|
+
},
|
|
62
66
|
},
|
|
63
67
|
},
|
|
64
68
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Components, Theme } from "@mui/material";
|
|
2
|
+
import { PALETTE } from "../../styles/common/constants/palette";
|
|
2
3
|
import { TABLE_CELL_PROPS } from "../../styles/common/mui/tableCell";
|
|
3
4
|
import { TEXT_BODY_400, TEXT_BODY_SMALL_500 } from "../common/typography";
|
|
4
5
|
|
|
@@ -34,6 +35,11 @@ export const MuiTableCell = (theme: Theme): Components["MuiTableCell"] => {
|
|
|
34
35
|
props: { variant: TABLE_CELL_PROPS.VARIANT.BODY },
|
|
35
36
|
style: {
|
|
36
37
|
...typography[TEXT_BODY_400],
|
|
38
|
+
"& mark": {
|
|
39
|
+
backgroundColor: PALETTE.WARNING_LIGHT,
|
|
40
|
+
color: "inherit",
|
|
41
|
+
padding: "2px 0",
|
|
42
|
+
},
|
|
37
43
|
},
|
|
38
44
|
},
|
|
39
45
|
{
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a JSON-encoded value from a URL query parameter.
|
|
3
|
+
*
|
|
4
|
+
* This function is specifically designed for query parameters that contain
|
|
5
|
+
* serialized complex data (arrays or objects), not for simple string values.
|
|
6
|
+
*
|
|
7
|
+
* It handles Next.js query parameters which can be string, string[] or undefined.
|
|
8
|
+
* Repeated parameters (`string[]`) are not supported.
|
|
9
|
+
*
|
|
10
|
+
* @param param - URL query parameter value.
|
|
11
|
+
* @param defaultValue - Default value.
|
|
12
|
+
* @returns Parsed complex data structure or default value.
|
|
13
|
+
*/
|
|
14
|
+
export function parseJsonQueryParam<T = unknown>(
|
|
15
|
+
param: string | string[] | undefined,
|
|
16
|
+
defaultValue?: T
|
|
17
|
+
): T | undefined {
|
|
18
|
+
// Handle non-string parameters.
|
|
19
|
+
if (typeof param !== "string") return defaultValue;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(decodeURIComponent(param));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.warn("Failed to parse query param JSON:", error);
|
|
25
|
+
return defaultValue;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NextRouter } from "next/router";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Builds a query object from state for URL parameter synchronization.
|
|
5
|
+
*
|
|
6
|
+
* This function converts a state object into a format compatible with NextRouter query parameters.
|
|
7
|
+
* It handles different value types appropriately:
|
|
8
|
+
*
|
|
9
|
+
* - Undefined values are excluded.
|
|
10
|
+
* - Strings are used as-is (empty strings are excluded).
|
|
11
|
+
* - Arrays are JSON stringified (empty arrays are excluded).
|
|
12
|
+
*
|
|
13
|
+
* @param state - State object containing values to convert to URL parameters.
|
|
14
|
+
* @returns A query object compatible with NextRouter.
|
|
15
|
+
*/
|
|
16
|
+
export function stateToUrlQuery<
|
|
17
|
+
S extends Record<string, string | unknown[] | undefined>
|
|
18
|
+
>(state: S): NextRouter["query"] {
|
|
19
|
+
const query: NextRouter["query"] = {};
|
|
20
|
+
|
|
21
|
+
for (const [key, value] of Object.entries(state)) {
|
|
22
|
+
// Handle the undefined case.
|
|
23
|
+
if (value === undefined) continue;
|
|
24
|
+
|
|
25
|
+
// Handle the string case.
|
|
26
|
+
if (typeof value === "string") {
|
|
27
|
+
if (!value) continue;
|
|
28
|
+
query[key] = value;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Handle the array case.
|
|
33
|
+
if (Array.isArray(value)) {
|
|
34
|
+
if (value.length === 0) continue;
|
|
35
|
+
query[key] = JSON.stringify(value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return query;
|
|
40
|
+
}
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataDictionary } from "../../components/DataDictionary/dataDictionary";
|
|
3
|
-
import {
|
|
3
|
+
import { useStateSyncManager } from "../../hooks/stateSyncManager/hook";
|
|
4
|
+
import { DataDictionaryContext } from "../../providers/dataDictionary/context";
|
|
5
|
+
import { clearMeta } from "../../providers/dataDictionaryState/actions/clearMeta/dispatch";
|
|
6
|
+
import { stateToUrl } from "../../providers/dataDictionaryState/actions/stateToUrl/dispatch";
|
|
7
|
+
import { urlToState } from "../../providers/dataDictionaryState/actions/urlToState/dispatch";
|
|
8
|
+
import { useDataDictionaryState } from "../../providers/dataDictionaryState/hooks/UseDataDictionaryState/hook";
|
|
9
|
+
import { DataDictionaryViewProps } from "./types";
|
|
10
|
+
import { buildStateSyncManagerContext } from "./utils";
|
|
4
11
|
|
|
5
12
|
export const DataDictionaryView = ({
|
|
6
13
|
className,
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
dictionary,
|
|
15
|
+
}: DataDictionaryViewProps): JSX.Element => {
|
|
16
|
+
const { dataDictionaryDispatch, dataDictionaryState } =
|
|
17
|
+
useDataDictionaryState();
|
|
18
|
+
|
|
19
|
+
useStateSyncManager({
|
|
20
|
+
actions: { clearMeta, stateToUrl, urlToState },
|
|
21
|
+
dispatch: dataDictionaryDispatch,
|
|
22
|
+
state: buildStateSyncManagerContext(dataDictionaryState, dictionary),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<DataDictionaryContext.Provider value={{ dictionary }}>
|
|
27
|
+
{/* Using dictionary as `key` to force component mount when dictionary changes to prevent stale outline, global filter value. */}
|
|
28
|
+
<DataDictionary
|
|
29
|
+
key={dictionary}
|
|
30
|
+
className={className}
|
|
31
|
+
dictionary={dictionary}
|
|
32
|
+
/>
|
|
33
|
+
</DataDictionaryContext.Provider>
|
|
34
|
+
);
|
|
9
35
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StateSyncManagerContext } from "../../hooks/stateSyncManager/types";
|
|
2
|
+
import { DATA_DICTIONARY_URL_PARAMS } from "../../providers/dataDictionaryState/dictionaries/constants";
|
|
3
|
+
import { DataDictionaryState } from "../../providers/dataDictionaryState/types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Builds the state sync manager context object for URL-state synchronization.
|
|
7
|
+
* - Command: The meta command that signals a URL update operation is needed e.g. "STATE_TO_URL_PUSH" or "STATE_TO_URL_REPLACE".
|
|
8
|
+
* - ParamKeys: Expected list of URL parameter keys that should be synchronized with state e.g. "filter".
|
|
9
|
+
* - Query: Dictionary related query object from state that should be synchronized with the URL.
|
|
10
|
+
* @param dataDictionaryState - Data dictionary state.
|
|
11
|
+
* @param dictionary - Dictionary ID.
|
|
12
|
+
* @returns The state sync manager context.
|
|
13
|
+
*/
|
|
14
|
+
export function buildStateSyncManagerContext(
|
|
15
|
+
dataDictionaryState: DataDictionaryState,
|
|
16
|
+
dictionary: string
|
|
17
|
+
): StateSyncManagerContext {
|
|
18
|
+
return {
|
|
19
|
+
command: dataDictionaryState.meta?.command,
|
|
20
|
+
paramKeys: Object.values(DATA_DICTIONARY_URL_PARAMS),
|
|
21
|
+
query: dataDictionaryState.dictionaries?.[dictionary]?.query,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -5,7 +5,7 @@ import { EXPLORE_URL_PARAMS } from "../../providers/exploreState/constants";
|
|
|
5
5
|
import { ExploreView } from "./exploreView";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*Builds the state sync manager context object for URL-state synchronization.
|
|
8
|
+
* Builds the state sync manager context object for URL-state synchronization.
|
|
9
9
|
* - Command: The meta command that signals a URL update operation is needed e.g. "STATE_TO_URL_PUSH" or "STATE_TO_URL_REPLACE".
|
|
10
10
|
* - ParamKeys: Expected list of URL parameter keys that should be synchronized with state e.g. "filter", "catalog".
|
|
11
11
|
* - Query: Entity related query object from state that should be synchronized with the URL.
|
|
@@ -24,26 +24,18 @@ describe("buildRequestFilters", () => {
|
|
|
24
24
|
expect(result).toEqual(fileManifestState.filters);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
test("when
|
|
28
|
-
const fileManifestState = getFileManifestState(
|
|
29
|
-
FILTERS.FORM_INCOMPLETE_SET
|
|
30
|
-
);
|
|
27
|
+
test("when summary file count is not equal to initial file count", () => {
|
|
28
|
+
const fileManifestState = getFileManifestState(FILTERS.FORM_COMPLETE_SET);
|
|
31
29
|
const result = buildRequestFilters(
|
|
32
|
-
fileManifestState,
|
|
33
|
-
FORM_FACET.
|
|
30
|
+
{ ...fileManifestState, summary: { fileCount: 9 } },
|
|
31
|
+
FORM_FACET.COMPLETE_SET
|
|
34
32
|
);
|
|
35
33
|
expect(result).toEqual(fileManifestState.filters);
|
|
36
34
|
});
|
|
37
|
-
|
|
38
|
-
test("when at least one form facet has an unselected term", () => {
|
|
39
|
-
const fileManifestState = getFileManifestState(FILTERS.FORM_SUBSET);
|
|
40
|
-
const result = buildRequestFilters(fileManifestState, FORM_FACET.SUBSET);
|
|
41
|
-
expect(result).toEqual(fileManifestState.filters);
|
|
42
|
-
});
|
|
43
35
|
});
|
|
44
36
|
|
|
45
37
|
describe("should return filters excluding form related filters", () => {
|
|
46
|
-
test("when
|
|
38
|
+
test("when summary file count is equal to initial file count", () => {
|
|
47
39
|
const fileManifestState = getFileManifestState(FILTERS.FORM_COMPLETE_SET);
|
|
48
40
|
const result = buildRequestFilters(
|
|
49
41
|
fileManifestState,
|
|
@@ -109,6 +109,16 @@ describe("useRequestManifest", () => {
|
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
test("when fileManifestState fileCount is undefined", () => {
|
|
113
|
+
MOCK_USE_FILE_MANIFEST_STATE.mockReturnValue({
|
|
114
|
+
fileManifestDispatch: jest.fn(),
|
|
115
|
+
fileManifestState: { ...FILE_MANIFEST_STATE, fileCount: undefined },
|
|
116
|
+
});
|
|
117
|
+
testRequestManifest({
|
|
118
|
+
fileManifestFormat: MANIFEST_DOWNLOAD_FORMAT.VERBATIM_PFB,
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
112
122
|
describe("form selection is not ready", () => {
|
|
113
123
|
test("when a form facet is undefined", () => {
|
|
114
124
|
testRequestManifest({
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useRouter } from "next/router";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useConfig } from "../../../../hooks/useConfig";
|
|
4
|
-
import { buildClassesOutline } from "../../components/Outline/utils";
|
|
5
|
-
import { useTable } from "../../components/Table/hook";
|
|
6
|
-
export const useDataDictionary = () => {
|
|
7
|
-
const { config: { dataDictionaries: dataDictionaryConfigs }, } = useConfig();
|
|
8
|
-
// Dynamic paths must be resolved at this point otherwise the initial settings
|
|
9
|
-
// passed to useTable on subsequent renders will be ignored (as the table will have
|
|
10
|
-
// already been initialized).
|
|
11
|
-
const router = useRouter();
|
|
12
|
-
const query = router.query;
|
|
13
|
-
const { dictionary } = query;
|
|
14
|
-
// Get dictionary config by matching the current path with the data dictionary path
|
|
15
|
-
const dataDictionaryConfig = useMemo(() => {
|
|
16
|
-
if (!dataDictionaryConfigs?.length)
|
|
17
|
-
return undefined;
|
|
18
|
-
// Find the data dictionary with a path that matches the current route
|
|
19
|
-
// We check if the current path starts with the dictionary path to handle nested routes
|
|
20
|
-
return dataDictionaryConfigs.find((config) => config.path === dictionary);
|
|
21
|
-
}, [dataDictionaryConfigs, dictionary]);
|
|
22
|
-
// Get configured dictionary classes, column definitions and table options.
|
|
23
|
-
const { classes, columnDefs, tableOptions, title } = useMemo(() => {
|
|
24
|
-
return {
|
|
25
|
-
classes: dataDictionaryConfig?.dataDictionary?.classes || [],
|
|
26
|
-
columnDefs: dataDictionaryConfig?.columnDefs || [],
|
|
27
|
-
tableOptions: dataDictionaryConfig?.tableOptions || {},
|
|
28
|
-
title: dataDictionaryConfig?.dataDictionary?.title || "",
|
|
29
|
-
};
|
|
30
|
-
}, [dataDictionaryConfig]);
|
|
31
|
-
// Build table instance.
|
|
32
|
-
const table = useTable(classes, columnDefs, tableOptions);
|
|
33
|
-
// Build outline.
|
|
34
|
-
const outline = buildClassesOutline(table);
|
|
35
|
-
return { outline, table, title };
|
|
36
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RowData, Table } from "@tanstack/react-table";
|
|
2
|
-
import { Attribute } from "../../../../common/entities";
|
|
3
|
-
import { OutlineItem } from "../../../Layout/components/Outline/types";
|
|
4
|
-
export interface UseDataDictionary<T extends RowData = Attribute> {
|
|
5
|
-
outline: OutlineItem[];
|
|
6
|
-
table: Table<T>;
|
|
7
|
-
title: string;
|
|
8
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { RowData } from "@tanstack/react-table";
|
|
2
|
-
import { useRouter } from "next/router";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { Attribute, DataDictionaryConfig } from "../../../../common/entities";
|
|
5
|
-
import { useConfig } from "../../../../hooks/useConfig";
|
|
6
|
-
import { buildClassesOutline } from "../../components/Outline/utils";
|
|
7
|
-
import { useTable } from "../../components/Table/hook";
|
|
8
|
-
import { UseDataDictionary } from "./types";
|
|
9
|
-
|
|
10
|
-
export const useDataDictionary = <
|
|
11
|
-
T extends RowData = Attribute
|
|
12
|
-
>(): UseDataDictionary<T> => {
|
|
13
|
-
const {
|
|
14
|
-
config: { dataDictionaries: dataDictionaryConfigs },
|
|
15
|
-
} = useConfig();
|
|
16
|
-
// Dynamic paths must be resolved at this point otherwise the initial settings
|
|
17
|
-
// passed to useTable on subsequent renders will be ignored (as the table will have
|
|
18
|
-
// already been initialized).
|
|
19
|
-
const router = useRouter();
|
|
20
|
-
const query = router.query;
|
|
21
|
-
const { dictionary } = query;
|
|
22
|
-
|
|
23
|
-
// Get dictionary config by matching the current path with the data dictionary path
|
|
24
|
-
const dataDictionaryConfig = useMemo(() => {
|
|
25
|
-
if (!dataDictionaryConfigs?.length) return undefined;
|
|
26
|
-
|
|
27
|
-
// Find the data dictionary with a path that matches the current route
|
|
28
|
-
// We check if the current path starts with the dictionary path to handle nested routes
|
|
29
|
-
return dataDictionaryConfigs.find(
|
|
30
|
-
(config) => config.path === dictionary
|
|
31
|
-
) as DataDictionaryConfig<T> | undefined;
|
|
32
|
-
}, [dataDictionaryConfigs, dictionary]);
|
|
33
|
-
|
|
34
|
-
// Get configured dictionary classes, column definitions and table options.
|
|
35
|
-
const { classes, columnDefs, tableOptions, title } = useMemo(() => {
|
|
36
|
-
return {
|
|
37
|
-
classes: dataDictionaryConfig?.dataDictionary?.classes || [],
|
|
38
|
-
columnDefs: dataDictionaryConfig?.columnDefs || [],
|
|
39
|
-
tableOptions: dataDictionaryConfig?.tableOptions || {},
|
|
40
|
-
title: dataDictionaryConfig?.dataDictionary?.title || "",
|
|
41
|
-
};
|
|
42
|
-
}, [dataDictionaryConfig]);
|
|
43
|
-
|
|
44
|
-
// Build table instance.
|
|
45
|
-
const table = useTable<T>(classes, columnDefs, tableOptions);
|
|
46
|
-
|
|
47
|
-
// Build outline.
|
|
48
|
-
const outline = buildClassesOutline<T>(table);
|
|
49
|
-
|
|
50
|
-
return { outline, table, title };
|
|
51
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RowData, Table } from "@tanstack/react-table";
|
|
2
|
-
import { Attribute } from "../../../../common/entities";
|
|
3
|
-
import { OutlineItem } from "../../../Layout/components/Outline/types";
|
|
4
|
-
|
|
5
|
-
export interface UseDataDictionary<T extends RowData = Attribute> {
|
|
6
|
-
outline: OutlineItem[];
|
|
7
|
-
table: Table<T>;
|
|
8
|
-
title: string;
|
|
9
|
-
}
|