@databiosphere/findable-ui 25.0.0 → 26.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 +56 -0
- package/lib/common/entities.d.ts +25 -0
- package/lib/components/DataDictionary/common/utils.js +10 -8
- package/lib/components/DataDictionary/components/Entities/entities.d.ts +1 -1
- package/lib/components/DataDictionary/components/Entities/entities.js +2 -2
- package/lib/components/DataDictionary/components/Entities/types.d.ts +3 -1
- package/lib/components/DataDictionary/components/Entity/entity.d.ts +1 -1
- package/lib/components/DataDictionary/components/Entity/entity.js +2 -2
- package/lib/components/DataDictionary/components/Entity/types.d.ts +3 -1
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +1 -2
- package/lib/components/DataDictionary/components/Table/hook.d.ts +2 -2
- package/lib/components/DataDictionary/components/Table/hook.js +2 -3
- package/lib/components/DataDictionary/dataDictionary.js +2 -2
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +7 -2
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +3 -1
- package/lib/components/Detail/components/Table/stories/args.d.ts +27 -0
- package/lib/components/Detail/components/Table/stories/args.js +100 -0
- package/lib/components/Detail/components/Table/stories/constants.d.ts +4 -0
- package/lib/components/Detail/components/Table/stories/constants.js +11 -0
- package/lib/components/Detail/components/Table/stories/filter/args.d.ts +5 -0
- package/lib/components/Detail/components/Table/stories/filter/args.js +50 -0
- package/lib/components/Detail/components/Table/stories/filter/filter.stories.d.ts +11 -0
- package/lib/components/Detail/components/Table/stories/filter/filter.stories.js +78 -0
- package/lib/components/Detail/components/Table/stories/table.stories.d.ts +6 -0
- package/lib/components/Detail/components/Table/stories/table.stories.js +19 -0
- package/lib/components/Detail/components/Table/table.js +2 -0
- package/lib/components/Export/components/ExportMethod/exportMethod.d.ts +2 -2
- package/lib/components/Export/components/ExportMethod/exportMethod.styles.js +1 -1
- package/lib/components/Filter/components/ClearAllFilters/clearAllFilters.js +2 -1
- package/lib/components/Filter/components/Filter/filter.js +2 -1
- package/lib/components/Filter/components/FilterRange/constants.d.ts +8 -0
- package/lib/components/Filter/components/FilterRange/constants.js +27 -0
- package/lib/components/Filter/components/FilterRange/filterRange.d.ts +2 -0
- package/lib/components/Filter/components/FilterRange/filterRange.js +26 -0
- package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +4 -0
- package/lib/components/Filter/components/FilterRange/filterRange.styles.js +66 -0
- package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.d.ts +2 -0
- package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.js +14 -0
- package/lib/components/Filter/components/FilterRange/hooks/UseFilterRange/types.d.ts +8 -0
- package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.d.ts +6 -0
- package/lib/components/Filter/components/FilterRange/stories/filterRange.stories.js +9 -0
- package/lib/components/Filter/components/FilterRange/types.d.ts +8 -0
- package/lib/components/Filter/components/FilterRange/types.js +6 -0
- package/lib/components/Filter/components/Filters/filters.js +2 -1
- package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.d.ts +3 -2
- package/lib/components/Filter/components/HighlightedLabel/highlightedLabel.js +2 -2
- package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.js +3 -2
- package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +2 -1
- package/lib/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.js +1 -2
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +3 -2
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.d.ts +1 -1
- package/lib/components/Index/components/EntitiesView/components/ChartView/chartView.js +5 -2
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.d.ts +2 -1
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.js +2 -1
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.js +10 -7
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.d.ts +6 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.js +4 -4
- package/lib/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.js +1 -2
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/args.js +1 -0
- package/lib/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.js +0 -1
- package/lib/components/Index/components/EntitiesView/components/ChartView/types.d.ts +2 -0
- package/lib/components/Index/components/EntitiesView/entitiesView.d.ts +1 -1
- package/lib/components/Index/components/EntitiesView/entitiesView.js +3 -2
- package/lib/components/Index/components/EntitiesView/types.d.ts +2 -2
- package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +2 -1
- package/lib/components/Layout/components/Header/components/Content/components/Slogan/slogan.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.js +1 -2
- package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -1
- package/lib/components/Layout/components/Sidebar/sidebar.js +4 -1
- package/lib/components/Loading/loading.styles.js +2 -1
- package/lib/components/Login/components/Button/constants.js +2 -3
- package/lib/components/Login/components/Button/types.d.ts +1 -1
- package/lib/components/Login/components/Buttons/types.d.ts +1 -1
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.styles.js +4 -4
- package/lib/components/Support/components/ViewSupport/viewSupport.styles.js +2 -2
- package/lib/components/Table/columnDef/columnFilters/filterFn.d.ts +13 -0
- package/lib/components/Table/columnDef/columnFilters/filterFn.js +22 -0
- package/lib/components/Table/common/columnDef.js +2 -0
- package/lib/components/Table/common/utils.d.ts +1 -13
- package/lib/components/Table/common/utils.js +1 -23
- package/lib/components/Table/components/Pagination/pagination.js +3 -2
- package/lib/components/Table/components/PaginationSummary/paginationSummary.js +2 -1
- package/lib/components/Table/components/TableRows/tableRows.js +7 -3
- package/lib/components/Table/table.js +3 -1
- package/lib/components/TableCreator/tableCreator.js +12 -3
- package/lib/components/common/Button/components/ButtonOutline/buttonOutline.styles.js +7 -7
- package/lib/components/common/Button/constants.d.ts +2 -0
- package/lib/components/common/Button/constants.js +21 -0
- package/lib/components/common/LoginDialog/loginDialog.styles.js +2 -3
- package/lib/components/types.d.ts +3 -0
- package/lib/config/entities.d.ts +3 -3
- package/lib/config/utils.js +1 -1
- package/lib/hooks/useEntityList.js +2 -1
- package/lib/hooks/useEntityService.js +1 -1
- package/lib/hooks/useExploreMode/types.d.ts +6 -0
- package/lib/hooks/useExploreMode/types.js +6 -0
- package/lib/hooks/{useExploreMode.d.ts → useExploreMode/useExploreMode.d.ts} +1 -6
- package/lib/hooks/{useExploreMode.js → useExploreMode/useExploreMode.js} +1 -7
- package/lib/hooks/useFetchEntity.js +2 -1
- package/lib/styles/common/constants/colorMixes.d.ts +18 -0
- package/lib/styles/common/constants/colorMixes.js +19 -0
- package/lib/styles/common/constants/shadows.d.ts +5 -0
- package/lib/styles/common/constants/shadows.js +5 -0
- package/lib/styles/common/mui/button.d.ts +10 -2
- package/lib/styles/common/mui/button.js +12 -2
- package/lib/tests/mui/constants.d.ts +1 -0
- package/lib/tests/mui/constants.js +1 -0
- package/lib/tests/testIds.d.ts +19 -0
- package/lib/tests/testIds.js +19 -0
- package/lib/theme/common/components.d.ts +2 -3
- package/lib/theme/common/components.js +47 -51
- package/lib/theme/common/palette.d.ts +0 -44
- package/lib/theme/common/palette.js +27 -82
- package/lib/theme/common/shadows.d.ts +2 -28
- package/lib/theme/common/shadows.js +27 -32
- package/lib/theme/components/muiAlert.js +5 -5
- package/lib/theme/theme.js +7 -7
- package/lib/views/ExploreView/exploreView.js +4 -3
- package/package.json +4 -4
- package/src/common/entities.ts +30 -0
- package/src/components/DataDictionary/common/utils.ts +12 -8
- package/src/components/DataDictionary/components/Entities/entities.tsx +11 -2
- package/src/components/DataDictionary/components/Entities/types.ts +3 -1
- package/src/components/DataDictionary/components/Entity/entity.tsx +2 -1
- package/src/components/DataDictionary/components/Entity/types.ts +3 -1
- package/src/components/DataDictionary/components/Table/components/BasicCell/types.ts +1 -2
- package/src/components/DataDictionary/components/Table/hook.ts +6 -4
- package/src/components/DataDictionary/dataDictionary.tsx +2 -2
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +8 -2
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +3 -1
- package/src/components/Detail/components/Table/stories/args.ts +104 -0
- package/src/components/Detail/components/Table/stories/constants.ts +15 -0
- package/src/components/Detail/components/Table/stories/filter/args.ts +54 -0
- package/src/components/Detail/components/Table/stories/filter/filter.stories.tsx +90 -0
- package/src/components/Detail/components/Table/stories/table.stories.tsx +32 -0
- package/src/components/Detail/components/Table/table.tsx +2 -0
- package/src/components/Export/components/ExportMethod/exportMethod.styles.ts +1 -1
- package/src/components/Export/components/ExportMethod/exportMethod.tsx +3 -2
- package/src/components/Filter/components/ClearAllFilters/clearAllFilters.tsx +7 -1
- package/src/components/Filter/components/Filter/filter.tsx +2 -0
- package/src/components/Filter/components/FilterRange/constants.ts +41 -0
- package/src/components/Filter/components/FilterRange/filterRange.styles.ts +71 -0
- package/src/components/Filter/components/FilterRange/filterRange.tsx +71 -0
- package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook.ts +20 -0
- package/src/components/Filter/components/FilterRange/hooks/UseFilterRange/types.ts +9 -0
- package/src/components/Filter/components/FilterRange/stories/filterRange.stories.tsx +15 -0
- package/src/components/Filter/components/FilterRange/types.ts +9 -0
- package/src/components/Filter/components/Filters/filters.tsx +7 -1
- package/src/components/Filter/components/HighlightedLabel/highlightedLabel.tsx +4 -2
- package/src/components/Filter/components/SearchAllFilters/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
- package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +2 -0
- package/src/components/Filter/components/SearchAllFiltersSearch/searchAllFiltersSearch.styles.ts +1 -2
- package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +14 -2
- package/src/components/Index/components/EntitiesView/components/ChartView/chartView.tsx +2 -1
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/constants.ts +3 -1
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/plot.ts +10 -7
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils.ts +10 -4
- package/src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories.tsx +1 -2
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/args.ts +1 -0
- package/src/components/Index/components/EntitiesView/components/ChartView/stories/chartView.stories.tsx +0 -1
- package/src/components/Index/components/EntitiesView/components/ChartView/types.ts +2 -0
- package/src/components/Index/components/EntitiesView/entitiesView.tsx +2 -2
- package/src/components/Index/components/EntitiesView/types.ts +2 -2
- package/src/components/Index/components/Hero/components/ExportButton/exportButton.tsx +2 -0
- package/src/components/Layout/components/Outline/outline.styles.ts +1 -2
- package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -0
- package/src/components/Layout/components/Sidebar/sidebar.tsx +4 -1
- package/src/components/Loading/loading.styles.ts +2 -1
- package/src/components/Login/components/Button/constants.ts +2 -3
- package/src/components/Login/components/Button/types.ts +1 -1
- package/src/components/Login/components/Buttons/types.ts +1 -1
- package/src/components/Support/components/SupportRequest/components/Dialog/dialog.styles.ts +4 -4
- package/src/components/Support/components/ViewSupport/viewSupport.styles.ts +2 -2
- package/src/components/Table/columnDef/columnFilters/filterFn.ts +27 -0
- package/src/components/Table/common/columnDef.ts +2 -0
- package/src/components/Table/common/utils.ts +1 -27
- package/src/components/Table/components/Pagination/pagination.tsx +3 -2
- package/src/components/Table/components/PaginationSummary/paginationSummary.tsx +2 -1
- package/src/components/Table/components/TableRows/tableRows.tsx +10 -3
- package/src/components/Table/table.tsx +3 -1
- package/src/components/TableCreator/tableCreator.tsx +17 -3
- package/src/components/common/Button/components/ButtonOutline/buttonOutline.styles.ts +7 -7
- package/src/components/common/Button/constants.ts +23 -0
- package/src/components/common/LoginDialog/loginDialog.styles.ts +2 -3
- package/src/components/types.ts +4 -0
- package/src/config/entities.ts +3 -3
- package/src/config/utils.ts +1 -1
- package/src/hooks/useEntityList.ts +2 -1
- package/src/hooks/useEntityService.ts +1 -1
- package/src/hooks/useExploreMode/types.ts +7 -0
- package/src/hooks/{useExploreMode.ts → useExploreMode/useExploreMode.ts} +2 -9
- package/src/hooks/useFetchEntity.tsx +2 -1
- package/src/styles/common/constants/colorMixes.ts +20 -0
- package/src/styles/common/constants/shadows.ts +5 -0
- package/src/styles/common/mui/button.ts +20 -2
- package/src/tests/mui/constants.ts +1 -0
- package/src/tests/testIds.ts +19 -0
- package/src/theme/common/components.ts +47 -59
- package/src/theme/common/palette.ts +27 -86
- package/src/theme/common/shadows.ts +28 -33
- package/src/theme/components/muiAlert.ts +5 -5
- package/src/theme/theme.ts +50 -51
- package/src/views/ExploreView/exploreView.tsx +8 -3
- package/tests/chart.test.tsx +113 -22
- package/tests/chartView.test.tsx +12 -0
- package/tests/entitiesView.test.tsx +7 -11
- package/tests/filterRange.test.tsx +87 -0
- package/tests/filterRangeMock.test.tsx +38 -0
- package/tests/tableFilter.test.tsx +90 -0
- package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +0 -6
- package/lib/components/DataDictionary/components/Table/columns/columnDef.js +0 -33
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +0 -5
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +0 -5
- package/lib/components/DataDictionary/components/Table/columns/types.d.ts +0 -2
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
- package/lib/components/Index/components/Cell/cell.d.ts +0 -7
- package/lib/components/Index/components/Cell/cell.js +0 -10
- package/lib/components/Index/components/EntitiesView/constants.d.ts +0 -1
- package/lib/components/Index/components/EntitiesView/constants.js +0 -1
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +0 -8
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +0 -57
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +0 -4
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +0 -10
- package/lib/components/Index/components/NTag/nTag.d.ts +0 -10
- package/lib/components/Index/components/NTag/nTag.js +0 -8
- package/lib/components/Index/components/NTagCell/nTagCell.d.ts +0 -11
- package/lib/components/Index/components/NTagCell/nTagCell.js +0 -29
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +0 -5
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +0 -16
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
- package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +0 -6
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +0 -10
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +0 -5
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +0 -29
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
- package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
- package/lib/components/Layout/components/Outline/common/constants.js +0 -1
- package/lib/components/Login/login.stories.d.ts +0 -6
- package/lib/components/Login/login.stories.js +0 -31
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +0 -16
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +0 -28
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +0 -5
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +0 -46
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +0 -3
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +0 -21
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
- package/lib/components/TableCreator/common/constants.d.ts +0 -6
- package/lib/components/TableCreator/common/constants.js +0 -19
- package/lib/components/TableCreator/common/entities.d.ts +0 -5
- package/lib/components/TableCreator/common/entities.js +0 -1
- package/lib/components/TableCreator/tableCreator.styles.d.ts +0 -4
- package/lib/components/TableCreator/tableCreator.styles.js +0 -4
- package/lib/components/common/Alert/alert.stories.d.ts +0 -6
- package/lib/components/common/Alert/alert.stories.js +0 -36
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
- package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +0 -3
- package/lib/components/common/Button/components/LoginButton/loginButton.js +0 -6
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +0 -7
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +0 -11
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
- package/lib/hooks/useAuthentication/common/constants.d.ts +0 -4
- package/lib/hooks/useAuthentication/common/constants.js +0 -19
- package/lib/hooks/useAuthentication/common/entities.d.ts +0 -25
- package/lib/hooks/useAuthentication/common/entities.js +0 -11
- package/lib/hooks/useAuthentication/common/utils.d.ts +0 -15
- package/lib/hooks/useAuthentication/common/utils.js +0 -25
- package/lib/hooks/useAuthentication/useAuthentication.d.ts +0 -6
- package/lib/hooks/useAuthentication/useAuthentication.js +0 -9
- package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +0 -6
- package/lib/hooks/useAuthentication/useAuthenticationComplete.js +0 -55
- package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +0 -20
- package/lib/hooks/useAuthentication/useAuthenticationForm.js +0 -88
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +0 -18
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +0 -50
- package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +0 -20
- package/lib/hooks/useAuthentication/useAuthenticationStatus.js +0 -32
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +0 -21
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +0 -41
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +0 -18
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +0 -62
- package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +0 -24
- package/lib/hooks/useAuthentication/useFetchTerraProfile.js +0 -62
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +0 -15
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +0 -62
- package/lib/hooks/useAuthentication/useTokenClient.d.ts +0 -11
- package/lib/hooks/useAuthentication/useTokenClient.js +0 -29
- package/lib/hooks/useAuthenticationConfig.d.ts +0 -6
- package/lib/hooks/useAuthenticationConfig.js +0 -14
- package/lib/hooks/useCategoryConfigs.d.ts +0 -6
- package/lib/hooks/useCategoryConfigs.js +0 -17
- package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
- package/lib/hooks/useEntityListRelatedView.js +0 -62
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -27
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
- package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -9
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -37
- package/lib/hooks/useLayoutState.d.ts +0 -6
- package/lib/hooks/useLayoutState.js +0 -9
- package/lib/hooks/useMenu.d.ts +0 -10
- package/lib/hooks/useMenu.js +0 -17
- package/lib/hooks/useMenuWithPosition.d.ts +0 -14
- package/lib/hooks/useMenuWithPosition.js +0 -33
- package/lib/hooks/useSessionTimeout.d.ts +0 -11
- package/lib/hooks/useSessionTimeout.js +0 -28
- package/lib/providers/authentication.d.ts +0 -51
- package/lib/providers/authentication.js +0 -110
- package/lib/providers/layoutState.d.ts +0 -40
- package/lib/providers/layoutState.js +0 -47
- package/lib/styles/common/mixins/shadows.d.ts +0 -3
- package/lib/styles/common/mixins/shadows.js +0 -4
- package/lib/theme/common/entities.d.ts +0 -6
- package/lib/theme/common/entities.js +0 -1
- package/src/components/DataDictionary/components/Table/columns/columnDef.ts +0 -47
- package/src/components/DataDictionary/components/Table/columns/columnIdentifier.ts +0 -5
- package/src/components/DataDictionary/components/Table/columns/types.ts +0 -3
- package/src/components/Index/components/EntitiesView/constants.ts +0 -1
- package/src/styles/common/mixins/shadows.ts +0 -7
- package/src/theme/common/entities.ts +0 -7
- /package/lib/components/{DataDictionary/components/Table/columns → Filter/components/FilterRange/hooks/UseFilterRange}/types.js +0 -0
- /package/lib/styles/common/{mui → constants}/palette.d.ts +0 -0
- /package/lib/styles/common/{mui → constants}/palette.js +0 -0
- /package/src/styles/common/{mui → constants}/palette.ts +0 -0
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
* Elevation
|
|
3
|
-
*/
|
|
4
|
-
enum ELEVATION {
|
|
5
|
-
E00 = "none",
|
|
6
|
-
E01 = "0 1px 4px 0 #00000012",
|
|
7
|
-
E02 = "0 8px 8px -4px #10182808, 0 20px 24px -4px #10182814",
|
|
8
|
-
}
|
|
1
|
+
import { Shadows } from "@mui/material";
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
export const shadows: Shadows = [
|
|
4
|
+
"none",
|
|
5
|
+
"0 1px 4px 0 #00000012",
|
|
6
|
+
"0 8px 8px -4px #10182808, 0 20px 24px -4px #10182814",
|
|
7
|
+
"none",
|
|
8
|
+
"none",
|
|
9
|
+
"none",
|
|
10
|
+
"none",
|
|
11
|
+
"none",
|
|
12
|
+
"none",
|
|
13
|
+
"none",
|
|
14
|
+
"none",
|
|
15
|
+
"none",
|
|
16
|
+
"none",
|
|
17
|
+
"none",
|
|
18
|
+
"none",
|
|
19
|
+
"none",
|
|
20
|
+
"none",
|
|
21
|
+
"none",
|
|
22
|
+
"none",
|
|
23
|
+
"none",
|
|
24
|
+
"none",
|
|
25
|
+
"none",
|
|
26
|
+
"none",
|
|
27
|
+
"none",
|
|
28
|
+
"none",
|
|
29
|
+
];
|
|
@@ -3,10 +3,10 @@ import { ErrorIcon } from "../../components/common/CustomIcon/components/ErrorIc
|
|
|
3
3
|
import { InfoIcon } from "../../components/common/CustomIcon/components/InfoIcon/infoIcon";
|
|
4
4
|
import { SuccessIcon } from "../../components/common/CustomIcon/components/SuccessIcon/successIcon";
|
|
5
5
|
import { WarningIcon } from "../../components/common/CustomIcon/components/WarningIcon/warningIcon";
|
|
6
|
+
import { COLOR_MIXES } from "../../styles/common/constants/colorMixes";
|
|
6
7
|
import { SIZE } from "../../styles/common/constants/size";
|
|
7
8
|
import { COLOR, SEVERITY, VARIANT } from "../../styles/common/mui/alert";
|
|
8
9
|
import { FONT_SIZE } from "../../styles/common/mui/icon";
|
|
9
|
-
import { alpha32 } from "../common/palette";
|
|
10
10
|
import { TEXT_BODY_500 } from "../common/typography";
|
|
11
11
|
|
|
12
12
|
export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
@@ -42,7 +42,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
|
42
42
|
props: { severity: SEVERITY.ERROR },
|
|
43
43
|
style: {
|
|
44
44
|
backgroundColor: theme.palette.alert.lightest,
|
|
45
|
-
border: `1px solid ${
|
|
45
|
+
border: `1px solid ${COLOR_MIXES.ALERT_MAIN_32}`,
|
|
46
46
|
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
47
47
|
"& .MuiAlert-icon": {
|
|
48
48
|
color: theme.palette.alert.main,
|
|
@@ -53,7 +53,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
|
53
53
|
props: { severity: SEVERITY.INFO },
|
|
54
54
|
style: {
|
|
55
55
|
backgroundColor: theme.palette.info.lightest,
|
|
56
|
-
border: `1px solid ${
|
|
56
|
+
border: `1px solid ${COLOR_MIXES.INFO_MAIN_32}`,
|
|
57
57
|
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
58
58
|
"& .MuiAlert-icon": {
|
|
59
59
|
color: theme.palette.info.main,
|
|
@@ -64,7 +64,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
|
64
64
|
props: { severity: SEVERITY.SUCCESS },
|
|
65
65
|
style: {
|
|
66
66
|
backgroundColor: theme.palette.success.lightest,
|
|
67
|
-
border: `1px solid ${
|
|
67
|
+
border: `1px solid ${COLOR_MIXES.SUCCESS_MAIN_32}`,
|
|
68
68
|
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
69
69
|
"& .MuiAlert-icon": {
|
|
70
70
|
color: theme.palette.success.main,
|
|
@@ -75,7 +75,7 @@ export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
|
75
75
|
props: { severity: SEVERITY.WARNING },
|
|
76
76
|
style: {
|
|
77
77
|
backgroundColor: theme.palette.warning.lightest,
|
|
78
|
-
border: `1px solid ${
|
|
78
|
+
border: `1px solid ${COLOR_MIXES.WARNING_MAIN_32}`,
|
|
79
79
|
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
80
80
|
"& .MuiAlert-icon": {
|
|
81
81
|
color: theme.palette.warning.main,
|
package/src/theme/theme.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createTheme,
|
|
1
|
+
import { createTheme, Theme, ThemeOptions } from "@mui/material";
|
|
2
|
+
import { deepmerge } from "@mui/utils";
|
|
2
3
|
import * as B from "./common/breakpoints";
|
|
3
4
|
import * as C from "./common/components";
|
|
4
5
|
import * as P from "./common/palette";
|
|
@@ -15,60 +16,58 @@ export interface ThemeProps {
|
|
|
15
16
|
* @param customOptions - Custom theme option overrides.
|
|
16
17
|
* @returns theme with custom theme overrides.
|
|
17
18
|
*/
|
|
18
|
-
export function createAppTheme(customOptions
|
|
19
|
+
export function createAppTheme(customOptions: ThemeOptions = {}): Theme {
|
|
19
20
|
// Generate default theme with custom overrides.
|
|
20
21
|
const theme = createTheme(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
deepmerge(
|
|
23
|
+
{
|
|
24
|
+
breakpoints: {
|
|
25
|
+
values: {
|
|
26
|
+
lg: B.desktop,
|
|
27
|
+
md: B.desktopSm,
|
|
28
|
+
sm: B.tablet,
|
|
29
|
+
xs: B.mobile,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
cssVariables: true,
|
|
33
|
+
palette: {
|
|
34
|
+
alert: P.alert,
|
|
35
|
+
background: P.background,
|
|
36
|
+
common: P.common,
|
|
37
|
+
info: P.info,
|
|
38
|
+
ink: P.ink,
|
|
39
|
+
primary: P.primary,
|
|
40
|
+
smoke: P.smoke,
|
|
41
|
+
success: P.success,
|
|
42
|
+
text: P.text,
|
|
43
|
+
warning: P.warning,
|
|
44
|
+
},
|
|
45
|
+
shadows,
|
|
46
|
+
spacing: 4,
|
|
47
|
+
typography: {
|
|
48
|
+
[T.TEXT_BODY_400]: T.textBody400,
|
|
49
|
+
[T.TEXT_BODY_400_2_LINES]: T.textBody4002Lines,
|
|
50
|
+
[T.TEXT_BODY_500]: T.textBody500,
|
|
51
|
+
[T.TEXT_BODY_500_2_LINES]: T.textBody5002Lines,
|
|
52
|
+
[T.TEXT_BODY_LARGE_400]: T.textBodyLarge400,
|
|
53
|
+
[T.TEXT_BODY_LARGE_400_2_LINES]: T.textBodyLarge4002Lines,
|
|
54
|
+
[T.TEXT_BODY_LARGE_500]: T.textBodyLarge500,
|
|
55
|
+
[T.TEXT_BODY_SMALL_400]: T.textBodySmall400,
|
|
56
|
+
[T.TEXT_BODY_SMALL_400_2_LINES]: T.textBodySmall4002Lines,
|
|
57
|
+
[T.TEXT_BODY_SMALL_500]: T.textBodySmall500,
|
|
58
|
+
[T.TEXT_HEADING]: T.textHeading,
|
|
59
|
+
[T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
|
|
60
|
+
[T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
|
|
61
|
+
[T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
|
|
62
|
+
[T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
|
|
63
|
+
[T.TEXT_UPPERCASE_500]: T.textUppercase500,
|
|
64
|
+
fontFamily: T.fontFamily,
|
|
28
65
|
},
|
|
29
66
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
alert: P.alert,
|
|
33
|
-
background: P.background,
|
|
34
|
-
common: P.common,
|
|
35
|
-
info: P.info,
|
|
36
|
-
ink: P.ink,
|
|
37
|
-
primary: P.primary,
|
|
38
|
-
smoke: P.smoke,
|
|
39
|
-
success: P.success,
|
|
40
|
-
text: P.text,
|
|
41
|
-
warning: P.warning,
|
|
42
|
-
},
|
|
43
|
-
spacing: 4,
|
|
44
|
-
typography: {
|
|
45
|
-
[T.TEXT_BODY_400]: T.textBody400,
|
|
46
|
-
[T.TEXT_BODY_400_2_LINES]: T.textBody4002Lines,
|
|
47
|
-
[T.TEXT_BODY_500]: T.textBody500,
|
|
48
|
-
[T.TEXT_BODY_500_2_LINES]: T.textBody5002Lines,
|
|
49
|
-
[T.TEXT_BODY_LARGE_400]: T.textBodyLarge400,
|
|
50
|
-
[T.TEXT_BODY_LARGE_400_2_LINES]: T.textBodyLarge4002Lines,
|
|
51
|
-
[T.TEXT_BODY_LARGE_500]: T.textBodyLarge500,
|
|
52
|
-
[T.TEXT_BODY_SMALL_400]: T.textBodySmall400,
|
|
53
|
-
[T.TEXT_BODY_SMALL_400_2_LINES]: T.textBodySmall4002Lines,
|
|
54
|
-
[T.TEXT_BODY_SMALL_500]: T.textBodySmall500,
|
|
55
|
-
[T.TEXT_HEADING]: T.textHeading,
|
|
56
|
-
[T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
|
|
57
|
-
[T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
|
|
58
|
-
[T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
|
|
59
|
-
[T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
|
|
60
|
-
[T.TEXT_UPPERCASE_500]: T.textUppercase500,
|
|
61
|
-
fontFamily: T.fontFamily,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{ ...customOptions }
|
|
67
|
+
customOptions
|
|
68
|
+
)
|
|
65
69
|
);
|
|
66
70
|
|
|
67
|
-
// Default shadow overrides.
|
|
68
|
-
theme.shadows = [...theme.shadows].map(
|
|
69
|
-
(shadow, s) => shadows[s] || shadow
|
|
70
|
-
) as Shadows;
|
|
71
|
-
|
|
72
71
|
// Theme components.
|
|
73
72
|
theme.components = {
|
|
74
73
|
MuiAccordion: C.MuiAccordion(theme),
|
|
@@ -77,7 +76,7 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
|
|
|
77
76
|
MuiAlert: M.MuiAlert(theme),
|
|
78
77
|
MuiAlertTitle: M.MuiAlertTitle,
|
|
79
78
|
MuiAppBar: C.MuiAppBar,
|
|
80
|
-
MuiBackdrop: C.MuiBackdrop
|
|
79
|
+
MuiBackdrop: C.MuiBackdrop,
|
|
81
80
|
MuiBreadcrumbs: C.MuiBreadcrumbs(theme),
|
|
82
81
|
MuiButton: C.MuiButton(theme),
|
|
83
82
|
MuiButtonBase: C.MuiButtonBase(theme),
|
|
@@ -87,7 +86,7 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
|
|
|
87
86
|
MuiChip: C.MuiChip(theme),
|
|
88
87
|
MuiCircularProgress: C.MuiCircularProgress(theme),
|
|
89
88
|
MuiCssBaseline: C.MuiCssBaseline(theme),
|
|
90
|
-
MuiDialog: C.MuiDialog
|
|
89
|
+
MuiDialog: C.MuiDialog,
|
|
91
90
|
MuiDialogActions: C.MuiDialogActions,
|
|
92
91
|
MuiDialogContent: C.MuiDialogContent(theme),
|
|
93
92
|
MuiDialogTitle: C.MuiDialogTitle(theme),
|
|
@@ -40,6 +40,7 @@ import { useExploreState } from "../../hooks/useExploreState";
|
|
|
40
40
|
import { useSummary } from "../../hooks/useSummary";
|
|
41
41
|
import { ExploreActionKind } from "../../providers/exploreState";
|
|
42
42
|
import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
|
|
43
|
+
import { TEST_IDS } from "../../tests/testIds";
|
|
43
44
|
import { DESKTOP_SM } from "../../theme/common/breakpoints";
|
|
44
45
|
|
|
45
46
|
export interface ExploreViewProps extends AzulEntitiesStaticResponse {
|
|
@@ -52,7 +53,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
52
53
|
const { config, entityConfig } = useConfig(); // Get app level config.
|
|
53
54
|
const { exploreDispatch, exploreState } = useExploreState(); // Get the useReducer state and dispatch for "Explore".
|
|
54
55
|
const { explorerTitle, summaryConfig, trackingConfig } = config;
|
|
55
|
-
const { listView } = entityConfig;
|
|
56
|
+
const { label, listView } = entityConfig;
|
|
56
57
|
const { listHero, subTitleHero } = listView || {};
|
|
57
58
|
const { categoryGroups, categoryViews, filterCount, loading } = exploreState;
|
|
58
59
|
const { response: summaryResponse } = useSummary(); // Fetch summary.
|
|
@@ -145,7 +146,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
145
146
|
<>
|
|
146
147
|
{categoryViews && !!categoryViews.length && (
|
|
147
148
|
<Sidebar drawerOpen={isDrawerOpen} onDrawerClose={onCloseDrawer}>
|
|
148
|
-
<SidebarTools>
|
|
149
|
+
<SidebarTools data-testid={TEST_IDS.FILTER_CONTROLS}>
|
|
149
150
|
<SidebarLabel label={"Filters"} />
|
|
150
151
|
<ClearAllFilters />
|
|
151
152
|
<SearchAllFilters
|
|
@@ -165,7 +166,11 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
165
166
|
<IndexView
|
|
166
167
|
className={props.className}
|
|
167
168
|
chart={
|
|
168
|
-
<ChartView
|
|
169
|
+
<ChartView
|
|
170
|
+
categoryFilters={categoryFilters}
|
|
171
|
+
entityName={label}
|
|
172
|
+
loading={loading}
|
|
173
|
+
/>
|
|
169
174
|
}
|
|
170
175
|
list={<EntityList entityListType={entityListType} />}
|
|
171
176
|
ListHero={renderComponent(listHero)}
|
package/tests/chart.test.tsx
CHANGED
|
@@ -2,9 +2,15 @@ import { composeStories } from "@storybook/react";
|
|
|
2
2
|
import { render, screen } from "@testing-library/react";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { SelectCategoryValueView } from "../src/common/entities";
|
|
5
|
+
import { parseTranslate } from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/barX/utils";
|
|
5
6
|
import { CHART_TEST_ID } from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/constants";
|
|
6
7
|
import * as stories from "../src/components/Index/components/EntitiesView/components/ChartView/components/Chart/stories/chart.stories";
|
|
7
|
-
import { PALETTE } from "../src/styles/common/
|
|
8
|
+
import { PALETTE } from "../src/styles/common/constants/palette";
|
|
9
|
+
|
|
10
|
+
const CLASSNAMES = {
|
|
11
|
+
TEXT_CATEGORY_LABEL: "text-category-label",
|
|
12
|
+
TEXT_COUNT: "text-count",
|
|
13
|
+
};
|
|
8
14
|
|
|
9
15
|
const { Default, Selected } = composeStories(stories);
|
|
10
16
|
|
|
@@ -29,30 +35,35 @@ describe("Chart", () => {
|
|
|
29
35
|
});
|
|
30
36
|
|
|
31
37
|
describe("category labels and counts", () => {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
38
|
+
const counts = DATA.map(mapCount);
|
|
39
|
+
const labels = DATA.map(mapLabel);
|
|
34
40
|
let countTextEls: NodeListOf<SVGElement>;
|
|
35
41
|
let labelTextEls: NodeListOf<SVGElement>;
|
|
42
|
+
let titleTextEls: NodeListOf<SVGElement>;
|
|
36
43
|
|
|
37
44
|
beforeEach(() => {
|
|
38
45
|
render(<Default testId={CHART_TEST_ID} />);
|
|
39
|
-
countTextEls = getEls(
|
|
40
|
-
labelTextEls = getEls(
|
|
46
|
+
countTextEls = getEls(CLASSNAMES.TEXT_COUNT, "text");
|
|
47
|
+
labelTextEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "text");
|
|
48
|
+
titleTextEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "title");
|
|
41
49
|
});
|
|
42
50
|
|
|
43
|
-
it("renders category labels", () => {
|
|
44
|
-
expect(labelTextEls.length).toEqual(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
it("renders category labels and matching titles", () => {
|
|
52
|
+
expect(labelTextEls.length).toEqual(labels.length);
|
|
53
|
+
expect(titleTextEls.length).toEqual(labels.length);
|
|
54
|
+
labelTextEls.forEach((el, i) => {
|
|
55
|
+
const labelText = getLabelText(el);
|
|
56
|
+
const titleText = titleTextEls[i].textContent || "";
|
|
57
|
+
expect(labels.some((l) => l.includes(labelText))).toBeTruthy();
|
|
58
|
+
expect(labels.includes(titleText)).toBeTruthy();
|
|
48
59
|
});
|
|
49
60
|
});
|
|
50
61
|
|
|
51
62
|
it("renders category counts", () => {
|
|
52
|
-
expect(countTextEls.length).toEqual(
|
|
63
|
+
expect(countTextEls.length).toEqual(counts.length);
|
|
53
64
|
countTextEls.forEach(({ textContent }) => {
|
|
54
65
|
expect(textContent).toBeDefined();
|
|
55
|
-
expect(
|
|
66
|
+
expect(counts.includes(textContent || "")).toBeTruthy();
|
|
56
67
|
});
|
|
57
68
|
});
|
|
58
69
|
});
|
|
@@ -60,18 +71,21 @@ describe("Chart", () => {
|
|
|
60
71
|
describe("category labels with selected values", () => {
|
|
61
72
|
it("renders selected category labels with '(selected)'", () => {
|
|
62
73
|
render(<Selected testId={CHART_TEST_ID} />);
|
|
63
|
-
const textEls = getEls(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
74
|
+
const textEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "text");
|
|
75
|
+
const titleEls = getEls(CLASSNAMES.TEXT_CATEGORY_LABEL, "title");
|
|
76
|
+
SELECTED_DATA.forEach((selectedData, i) => {
|
|
77
|
+
const labelText = getLabelText(textEls[i]);
|
|
78
|
+
const titleText = titleEls[i].textContent || "";
|
|
67
79
|
if (selectedData.selected) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
71
|
-
|
|
80
|
+
const expected = `${selectedData.label} (selected)`;
|
|
81
|
+
expect(titleText).toEqual(expected);
|
|
82
|
+
expect(expected.includes(labelText)).toBeTruthy();
|
|
83
|
+
return;
|
|
72
84
|
}
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
const expected = selectedData.label;
|
|
86
|
+
expect(titleText).toEqual(expected);
|
|
87
|
+
expect(expected.includes(labelText)).toBeTruthy();
|
|
88
|
+
});
|
|
75
89
|
});
|
|
76
90
|
});
|
|
77
91
|
|
|
@@ -108,8 +122,31 @@ describe("Chart", () => {
|
|
|
108
122
|
expect([...barEls].some(isFillPrimaryMain)).toBeTruthy();
|
|
109
123
|
});
|
|
110
124
|
});
|
|
125
|
+
|
|
126
|
+
describe("bars sorted by count", () => {
|
|
127
|
+
it("renders bars in descending order of count", () => {
|
|
128
|
+
render(<Default testId={CHART_TEST_ID} />);
|
|
129
|
+
// Order data by count in descending order.
|
|
130
|
+
const counts = [...DATA].sort(sortByCount).map(mapCount);
|
|
131
|
+
// Sort count <text> elements by their transform’s translate‑Y (vertical) value, since they’re rendered in data order.
|
|
132
|
+
const countTextEls = getEls(CLASSNAMES.TEXT_COUNT, "text");
|
|
133
|
+
const textContents = [...countTextEls]
|
|
134
|
+
.sort(sortByTransform)
|
|
135
|
+
.map(mapTextContent);
|
|
136
|
+
expect(textContents).toEqual(counts);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
111
139
|
});
|
|
112
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Finds the first text node within the given SVGElement.
|
|
143
|
+
* @param el - The SVG element to search for a text node.
|
|
144
|
+
* @returns The first text node found within the element.
|
|
145
|
+
*/
|
|
146
|
+
function findTextNode(el: SVGElement): Node | undefined {
|
|
147
|
+
return [...el.childNodes].find(({ nodeType }) => nodeType === Node.TEXT_NODE);
|
|
148
|
+
}
|
|
149
|
+
|
|
113
150
|
/**
|
|
114
151
|
* Get the SVG group element for a given class name.
|
|
115
152
|
* @param className - Class name.
|
|
@@ -133,6 +170,17 @@ function getEls(className: string, selectors: string): NodeListOf<SVGElement> {
|
|
|
133
170
|
return gEls[0].querySelectorAll(selectors);
|
|
134
171
|
}
|
|
135
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Retrieves the label text from a given SVGElement by extracting and processing its text content.
|
|
175
|
+
* @param el - The SVGElement from which the label text is to be retrieved.
|
|
176
|
+
* @returns The processed label text derived from the SVGElement.
|
|
177
|
+
*/
|
|
178
|
+
function getLabelText(el: SVGElement): string {
|
|
179
|
+
const labelText = stripTrailingEllipsis(findTextNode(el)?.textContent);
|
|
180
|
+
expect(labelText).toBeDefined();
|
|
181
|
+
return labelText || "";
|
|
182
|
+
}
|
|
183
|
+
|
|
136
184
|
/**
|
|
137
185
|
* Check if the fill attribute of the element is #C5E3FC.
|
|
138
186
|
* @param element - Element to check.
|
|
@@ -168,3 +216,46 @@ function mapCount(categoryValueView: SelectCategoryValueView): string {
|
|
|
168
216
|
function mapLabel(categoryValueView: SelectCategoryValueView): string {
|
|
169
217
|
return categoryValueView.label;
|
|
170
218
|
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Maps the text content of an SVG element to a string.
|
|
222
|
+
* @param el - SVG element.
|
|
223
|
+
* @returns Text content as a string.
|
|
224
|
+
*/
|
|
225
|
+
function mapTextContent(el: SVGElement): string | null {
|
|
226
|
+
return el.textContent;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Sorts category value views by count in descending order.
|
|
231
|
+
* @param a - First category value view.
|
|
232
|
+
* @param b - Second category value view.
|
|
233
|
+
* @returns Sorted category value views.
|
|
234
|
+
*/
|
|
235
|
+
function sortByCount(
|
|
236
|
+
a: SelectCategoryValueView,
|
|
237
|
+
b: SelectCategoryValueView
|
|
238
|
+
): number {
|
|
239
|
+
return b.count - a.count;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Sorts SVG elements by their "y" transform attribute.
|
|
244
|
+
* @param a - First SVG element.
|
|
245
|
+
* @param b - Second SVG element.
|
|
246
|
+
* @returns Sorted SVG elements.
|
|
247
|
+
*/
|
|
248
|
+
function sortByTransform(a: SVGElement, b: SVGElement): number {
|
|
249
|
+
const aTransform = parseTranslate(a.getAttribute("transform"));
|
|
250
|
+
const bTransform = parseTranslate(b.getAttribute("transform"));
|
|
251
|
+
return aTransform[1] - bTransform[1];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Strips trailing ellipsis from a string.
|
|
256
|
+
* @param text - The input string.
|
|
257
|
+
* @returns The string without trailing ellipsis.
|
|
258
|
+
*/
|
|
259
|
+
function stripTrailingEllipsis(text?: string | null): string {
|
|
260
|
+
return (text || "").replace(/…{1,3}$/, "");
|
|
261
|
+
}
|
package/tests/chartView.test.tsx
CHANGED
|
@@ -28,6 +28,18 @@ describe("ChartView", () => {
|
|
|
28
28
|
expect(categoryLabels.length).toBe(2);
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
it("renders chart titles correctly", () => {
|
|
32
|
+
render(<Default />);
|
|
33
|
+
const {
|
|
34
|
+
args: { entityName },
|
|
35
|
+
} = Default;
|
|
36
|
+
["Biological Sex", "Genus Species"].forEach((category) => {
|
|
37
|
+
expect(
|
|
38
|
+
screen.getByText(new RegExp(`${entityName} per ${category}`))
|
|
39
|
+
).toBeDefined();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
31
43
|
it("renders charts for each category", () => {
|
|
32
44
|
render(<Default />);
|
|
33
45
|
const svgEls = document.querySelectorAll("svg");
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import { composeStories } from "@storybook/react";
|
|
2
2
|
import { render, screen } from "@testing-library/react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { ENTITIES_VIEW_TEST_ID } from "../src/components/Index/components/EntitiesView/constants";
|
|
5
4
|
import { VIEW_MODE } from "../src/components/Index/components/EntitiesView/hooks/UseEntitiesView/types";
|
|
6
5
|
import * as stories from "../src/components/Index/components/EntitiesView/stories/entitiesView.stories";
|
|
6
|
+
import { TEST_IDS } from "../src/tests/testIds";
|
|
7
7
|
|
|
8
8
|
const { Default } = composeStories(stories);
|
|
9
9
|
|
|
10
10
|
describe("EntitiesView", () => {
|
|
11
11
|
it("renders correctly", () => {
|
|
12
|
-
render(<Default
|
|
13
|
-
const viewEl = screen.getByTestId(
|
|
12
|
+
render(<Default />);
|
|
13
|
+
const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
|
|
14
14
|
expect(viewEl).not.toBeNull();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
it("does not render toggle buttons when disabled", () => {
|
|
18
|
-
render(<Default
|
|
19
|
-
const viewEl = screen.getByTestId(
|
|
18
|
+
render(<Default />);
|
|
19
|
+
const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
|
|
20
20
|
const buttonsEl = viewEl.getElementsByClassName("MuiToggleButton-root");
|
|
21
21
|
expect(buttonsEl.length).toEqual(0);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it("renders toggle buttons when enabled", () => {
|
|
25
25
|
render(
|
|
26
|
-
<Default
|
|
27
|
-
testId={ENTITIES_VIEW_TEST_ID}
|
|
28
|
-
viewMode={VIEW_MODE.TABLE}
|
|
29
|
-
viewStatus={{ disabled: false }}
|
|
30
|
-
/>
|
|
26
|
+
<Default viewMode={VIEW_MODE.TABLE} viewStatus={{ disabled: false }} />
|
|
31
27
|
);
|
|
32
|
-
const viewEl = screen.getByTestId(
|
|
28
|
+
const viewEl = screen.getByTestId(TEST_IDS.ENTITIES_VIEW);
|
|
33
29
|
const buttonsEl = viewEl.getElementsByClassName("MuiToggleButton-root");
|
|
34
30
|
expect(buttonsEl.length).toEqual(2);
|
|
35
31
|
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { composeStories } from "@storybook/react";
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as stories from "../src/components/Filter/components/FilterRange/stories/filterRange.stories";
|
|
5
|
+
import { MUI_CLASSES } from "../src/tests/mui/constants";
|
|
6
|
+
import { TEST_IDS } from "../src/tests/testIds";
|
|
7
|
+
import { getClassNames } from "../src/utils/tests";
|
|
8
|
+
|
|
9
|
+
const BETWEEN = "Between";
|
|
10
|
+
const GREATER_THAN = "Greater Than";
|
|
11
|
+
const LESS_THAN = "Less Than";
|
|
12
|
+
|
|
13
|
+
const { Default } = composeStories(stories);
|
|
14
|
+
|
|
15
|
+
describe("FilterRange", () => {
|
|
16
|
+
let filterEl: HTMLFormElement;
|
|
17
|
+
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
render(<Default />);
|
|
20
|
+
filterEl = screen.getByTestId(TEST_IDS.FILTER_RANGE);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe("Operator BETWEEN", () => {
|
|
24
|
+
it("renders the toggle buttons with correct text", () => {
|
|
25
|
+
expect(screen.getByRole("button", { name: BETWEEN })).toBeDefined();
|
|
26
|
+
expect(screen.getByRole("button", { name: LESS_THAN })).toBeDefined();
|
|
27
|
+
expect(screen.getByRole("button", { name: GREATER_THAN })).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("renders BETWEEN toggle button as selected", () => {
|
|
31
|
+
expect(
|
|
32
|
+
getClassNames(screen.getByRole("button", { name: BETWEEN }))
|
|
33
|
+
).toContain(MUI_CLASSES.SELECTED);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("renders BETWEEN input fields with correct labels", () => {
|
|
37
|
+
expect(filterEl.querySelectorAll("label")).toHaveLength(2);
|
|
38
|
+
expect(filterEl.querySelectorAll("input")).toHaveLength(2);
|
|
39
|
+
expect(filterEl.querySelector('label[for="between"]')).toBeDefined();
|
|
40
|
+
expect(filterEl.querySelector('label[for="between-to"]')).toBeDefined();
|
|
41
|
+
expect(filterEl.querySelector('input[name="between"]')).toBeDefined();
|
|
42
|
+
expect(filterEl.querySelector('input[name="between-to"]')).toBeDefined();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("renders filter button", () => {
|
|
46
|
+
expect(screen.getByText("Filter")).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("Operator LESS THAN", () => {
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
fireEvent.click(screen.getByRole("button", { name: LESS_THAN }));
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("renders LESS THAN toggle button as selected", () => {
|
|
56
|
+
expect(
|
|
57
|
+
getClassNames(screen.getByRole("button", { name: LESS_THAN }))
|
|
58
|
+
).toContain(MUI_CLASSES.SELECTED);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("renders LESS THAN input field with correct label", () => {
|
|
62
|
+
expect(filterEl.querySelectorAll("label")).toHaveLength(1);
|
|
63
|
+
expect(filterEl.querySelectorAll("input")).toHaveLength(1);
|
|
64
|
+
expect(filterEl.querySelector('label[for="lessThan"]')).toBeDefined();
|
|
65
|
+
expect(filterEl.querySelector('input[name="lessThan"]')).toBeDefined();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe("Operator GREATER THAN", () => {
|
|
70
|
+
beforeEach(() => {
|
|
71
|
+
fireEvent.click(screen.getByRole("button", { name: GREATER_THAN }));
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("renders GREATER THAN toggle button as selected", () => {
|
|
75
|
+
expect(
|
|
76
|
+
getClassNames(screen.getByRole("button", { name: GREATER_THAN }))
|
|
77
|
+
).toContain(MUI_CLASSES.SELECTED);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("renders GREATER THAN input field with correct label", () => {
|
|
81
|
+
expect(filterEl.querySelectorAll("label")).toHaveLength(1);
|
|
82
|
+
expect(filterEl.querySelectorAll("input")).toHaveLength(1);
|
|
83
|
+
expect(filterEl.querySelector('label[for="greaterThan"]')).toBeDefined();
|
|
84
|
+
expect(filterEl.querySelector('input[name="greaterThan"]')).toBeDefined();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jest } from "@jest/globals";
|
|
2
|
+
import { composeStories } from "@storybook/react";
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import React, { FormEvent } from "react";
|
|
5
|
+
import { RANGE_OPERATOR } from "../src/components/Filter/components/FilterRange/types";
|
|
6
|
+
|
|
7
|
+
const ON_SUBMIT = jest.fn();
|
|
8
|
+
|
|
9
|
+
jest.unstable_mockModule(
|
|
10
|
+
"../src/components/Filter/components/FilterRange/hooks/UseFilterRange/hook",
|
|
11
|
+
() => ({
|
|
12
|
+
useFilterRange: jest.fn(() => ({
|
|
13
|
+
onChange: jest.fn(),
|
|
14
|
+
onSubmit: (e: FormEvent): void => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
ON_SUBMIT(e);
|
|
17
|
+
},
|
|
18
|
+
value: RANGE_OPERATOR.BETWEEN,
|
|
19
|
+
})),
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const stories = await import(
|
|
24
|
+
"../src/components/Filter/components/FilterRange/stories/filterRange.stories"
|
|
25
|
+
);
|
|
26
|
+
const { Default } = composeStories(stories);
|
|
27
|
+
|
|
28
|
+
describe("FilterRangeWithMockedHook", () => {
|
|
29
|
+
describe("submit button", () => {
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
render(<Default />);
|
|
32
|
+
});
|
|
33
|
+
it("has a submit button that can be clicked", () => {
|
|
34
|
+
screen.getByText("Filter").click();
|
|
35
|
+
expect(ON_SUBMIT).toHaveBeenCalledTimes(1);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|