@databiosphere/findable-ui 50.8.0 → 51.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/auth/constants/auth.d.ts +5 -0
- package/lib/{providers/authentication/auth/constants.js → auth/constants/auth.js} +4 -1
- package/lib/auth/constants/authentication.d.ts +5 -0
- package/lib/{providers/authentication/authentication/constants.js → auth/constants/authentication.js} +4 -1
- package/lib/auth/constants/credentials.d.ts +5 -0
- package/lib/{providers/authentication/credentials/constants.js → auth/constants/credentials.js} +3 -0
- package/lib/auth/constants/token.d.ts +5 -0
- package/lib/{providers/authentication/token/constants.js → auth/constants/token.js} +3 -0
- package/lib/{providers/authentication/auth/context.d.ts → auth/contexts/auth.d.ts} +4 -1
- package/lib/{providers/authentication/auth/context.js → auth/contexts/auth.js} +4 -1
- package/lib/auth/contexts/authentication.d.ts +5 -0
- package/lib/{providers/authentication/authentication/context.js → auth/contexts/authentication.js} +4 -1
- package/lib/auth/contexts/credentials.d.ts +5 -0
- package/lib/{providers/authentication/credentials/context.js → auth/contexts/credentials.js} +4 -1
- package/lib/{providers/authentication/auth/dispatch.d.ts → auth/dispatch/auth.d.ts} +2 -2
- package/lib/{providers/authentication/auth/dispatch.js → auth/dispatch/auth.js} +2 -2
- package/lib/{providers/authentication/authentication/dispatch.d.ts → auth/dispatch/authentication.d.ts} +2 -2
- package/lib/{providers/authentication/authentication/dispatch.js → auth/dispatch/authentication.js} +2 -2
- package/lib/auth/dispatch/credentials.d.ts +12 -0
- package/lib/{providers/authentication/credentials/dispatch.js → auth/dispatch/credentials.js} +3 -3
- package/lib/{providers/authentication/token/dispatch.d.ts → auth/dispatch/token.d.ts} +3 -3
- package/lib/{providers/authentication/token/dispatch.js → auth/dispatch/token.js} +3 -3
- package/lib/{providers/authentication/auth/hook.d.ts → auth/hooks/useAuth.d.ts} +1 -1
- package/lib/{providers/authentication/auth/hook.js → auth/hooks/useAuth.js} +1 -1
- package/lib/auth/hooks/useAuthReducer.d.ts +7 -0
- package/lib/auth/hooks/useAuthReducer.js +13 -0
- package/lib/{providers/authentication/authentication/hook.d.ts → auth/hooks/useAuthentication.d.ts} +1 -1
- package/lib/{providers/authentication/authentication/hook.js → auth/hooks/useAuthentication.js} +1 -1
- package/lib/auth/hooks/useAuthenticationReducer.d.ts +7 -0
- package/lib/auth/hooks/useAuthenticationReducer.js +13 -0
- package/lib/{providers/authentication/credentials/hook.d.ts → auth/hooks/useCredentials.d.ts} +1 -1
- package/lib/{providers/authentication/credentials/hook.js → auth/hooks/useCredentials.js} +1 -1
- package/lib/auth/hooks/useCredentialsReducer.d.ts +6 -0
- package/lib/{hooks/authentication/credentials → auth/hooks}/useCredentialsReducer.js +6 -2
- package/lib/{providers/authentication/auth/reducer.d.ts → auth/reducers/auth.d.ts} +1 -1
- package/lib/{providers/authentication/auth/reducer.js → auth/reducers/auth.js} +13 -2
- package/lib/{providers/authentication/authentication/reducer.d.ts → auth/reducers/authentication.d.ts} +1 -1
- package/lib/{providers/authentication/authentication/reducer.js → auth/reducers/authentication.js} +13 -2
- package/lib/{providers/authentication/credentials/reducer.d.ts → auth/reducers/credentials.d.ts} +1 -1
- package/lib/{providers/authentication/credentials/reducer.js → auth/reducers/credentials.js} +14 -3
- package/lib/{providers/authentication/token/reducer.d.ts → auth/reducers/token.d.ts} +1 -1
- package/lib/{providers/authentication/token/reducer.js → auth/reducers/token.js} +2 -2
- package/lib/{providers/authentication/auth/types.d.ts → auth/types/auth.d.ts} +41 -5
- package/lib/{providers/authentication/auth/types.js → auth/types/auth.js} +6 -0
- package/lib/{providers/authentication/authentication/types.d.ts → auth/types/authentication.d.ts} +46 -4
- package/lib/{providers/authentication/authentication/types.js → auth/types/authentication.js} +6 -0
- package/lib/auth/types/common.d.ts +4 -0
- package/lib/{providers/authentication/credentials/types.d.ts → auth/types/credentials.d.ts} +31 -4
- package/lib/{providers/authentication/credentials/types.js → auth/types/credentials.js} +3 -0
- package/lib/auth/types/loginProvider.d.ts +11 -0
- package/lib/{providers/authentication/token/types.d.ts → auth/types/token.d.ts} +29 -5
- package/lib/{providers/authentication/token/types.js → auth/types/token.js} +3 -0
- package/lib/common/chart/sort/utils.d.ts +1 -1
- package/lib/components/ComponentCreator/ComponentCreator.js +1 -1
- package/lib/components/ComponentCreator/components/RenderComponent/renderComponent.d.ts +1 -1
- package/lib/components/ErrorBoundary/errorBoundary.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandForm/downloadCurlCommandForm.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandNotStarted/downloadCurlCommandNotStarted.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/components/DownloadCurlCommandReady/downloadCurlCommandReady.d.ts +1 -1
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/components/ExportButton/exportButton.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/components/ExportExecutionEnvironmentForm/exportExecutionEnvironmentForm.d.ts +1 -1
- package/lib/components/Export/components/ExportForm/exportForm.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraNotStarted/exportToTerraNotStarted.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.js +1 -1
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/terraSetUpForm.js +2 -2
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadNotStarted/manifestDownloadNotStarted.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadReady/manifestDownloadReady.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.d.ts +1 -1
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.js +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/search.d.ts +1 -1
- package/lib/components/Login/components/Buttons/buttons.d.ts +1 -1
- package/lib/components/Login/components/Buttons/buttons.js +1 -1
- package/lib/components/Login/components/Buttons/types.d.ts +5 -5
- package/lib/components/Login/hooks/useUserLogin/types.d.ts +1 -1
- package/lib/components/Login/hooks/useUserLogin/useUserLogin.js +1 -1
- package/lib/components/Login/login.d.ts +1 -1
- package/lib/components/Login/login.js +1 -1
- package/lib/components/Login/types.d.ts +3 -4
- package/lib/components/MarkdownRenderer/components/Anchor/anchor.d.ts +1 -1
- package/lib/components/MarkdownRenderer/components/Table/table.d.ts +1 -1
- package/lib/components/MarkdownRenderer/markdownRenderer.js +2 -2
- package/lib/components/MarkdownRenderer/types.d.ts +1 -1
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.d.ts +1 -1
- package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.d.ts +1 -1
- package/lib/components/common/Button/components/CallToActionButton/callToActionButton.d.ts +1 -1
- package/lib/components/common/Chip/components/Beta/beta.styles.js +1 -1
- package/lib/components/common/IconBadge/iconBadge.d.ts +1 -1
- package/lib/components/common/IconButton/iconButton.d.ts +1 -1
- package/lib/components/common/Input/input.d.ts +1 -1
- package/lib/components/common/KeyValuePairs/keyValuePairs.d.ts +1 -1
- package/lib/components/common/Progress/components/CircularProgress/circularProgress.d.ts +1 -1
- package/lib/components/common/Stack/components/Divider/divider.d.ts +1 -1
- package/lib/components/common/StatusIcon/statusIcon.d.ts +1 -1
- package/lib/config/entities.d.ts +4 -4
- package/lib/google/config.d.ts +7 -0
- package/lib/google/config.js +14 -0
- package/lib/google/constants.d.ts +16 -0
- package/lib/google/constants.js +24 -0
- package/lib/google/hooks/useGoogleSignInService.d.ts +8 -0
- package/lib/{providers/googleSignInAuthentication → google}/hooks/useGoogleSignInService.js +7 -2
- package/lib/{hooks/authentication/token → google/hooks}/useTokenReducer.d.ts +2 -1
- package/lib/{hooks/authentication/token → google/hooks}/useTokenReducer.js +3 -2
- package/lib/google/provider.d.ts +11 -0
- package/lib/{providers/googleSignInAuthentication → google}/provider.js +19 -11
- package/lib/google/service.d.ts +18 -0
- package/lib/{providers/googleSignInAuthentication/service → google}/service.js +20 -9
- package/lib/google/session-controller.d.ts +11 -0
- package/lib/{components/Authentication/components/SessionController/components/GoogleSessionController/SessionController.js → google/session-controller.js} +14 -6
- package/lib/google/types.d.ts +58 -0
- package/lib/{providers/authentication/authentication/utils.d.ts → google/utils/auth.d.ts} +6 -0
- package/lib/{providers/authentication/authentication/utils.js → google/utils/auth.js} +10 -0
- package/lib/{providers/googleSignInAuthentication/profile/utils.d.ts → google/utils/profile.d.ts} +2 -2
- package/lib/{providers/googleSignInAuthentication/profile/utils.js → google/utils/profile.js} +1 -1
- package/lib/hooks/authentication/profile/types.d.ts +1 -1
- package/lib/hooks/authentication/profile/useProfile.js +3 -3
- package/lib/hooks/authentication/providers/types.d.ts +1 -1
- package/lib/hooks/authentication/session/useSessionActive.d.ts +2 -2
- package/lib/hooks/authentication/session/useSessionActive.js +2 -2
- package/lib/hooks/authentication/terra/useAuthenticationForm.js +1 -1
- package/lib/hooks/authentication/terra/useAuthenticationNIHExpiry.js +2 -2
- package/lib/hooks/authentication/token/types.d.ts +1 -1
- package/lib/hooks/authentication/token/useToken.js +1 -1
- package/lib/hooks/useEntityList.js +10 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/constants.d.ts +8 -2
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/constants.js +8 -2
- package/lib/nextauth/hooks/useNextAuthService.d.ts +6 -0
- package/lib/{providers/nextAuthAuthentication → nextauth}/hooks/useNextAuthService.js +7 -3
- package/lib/nextauth/provider.d.ts +12 -0
- package/lib/{providers/nextAuthAuthentication → nextauth}/provider.js +16 -7
- package/lib/nextauth/service.d.ts +20 -0
- package/lib/{providers/nextAuthAuthentication/service → nextauth}/service.js +14 -0
- package/lib/nextauth/session-controller.d.ts +10 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController/SessionController.js → nextauth/session-controller.js} +11 -4
- package/lib/{providers/nextAuthAuthentication → nextauth}/types.d.ts +9 -0
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/utils.d.ts +2 -2
- package/lib/{components/Authentication/components/SessionController/components/NextSessionController → nextauth}/utils.js +2 -2
- package/lib/providers/exploreState.js +1 -10
- package/lib/providers/loginGuard/provider.js +1 -1
- package/lib/terra/constants.d.ts +28 -0
- package/lib/{providers/authentication/terra/hooks/common → terra}/constants.js +16 -1
- package/lib/terra/context.d.ts +5 -0
- package/lib/{providers/authentication/terra → terra}/context.js +4 -1
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchProfiles.d.ts +12 -4
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchProfiles.js +9 -4
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraNIHProfile.d.ts +2 -6
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraNIHProfile.js +4 -5
- package/lib/terra/hooks/useFetchTerraProfile.d.ts +10 -0
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraProfile.js +4 -5
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraTermsOfService.d.ts +2 -7
- package/lib/{providers/authentication/terra → terra}/hooks/useFetchTerraTermsOfService.js +4 -5
- package/lib/{providers/authentication/terra/hook.d.ts → terra/hooks/useTerraProfile.d.ts} +1 -1
- package/lib/{providers/authentication/terra/hook.js → terra/hooks/useTerraProfile.js} +1 -1
- package/lib/terra/provider.d.ts +10 -0
- package/lib/{providers/authentication/terra → terra}/provider.js +13 -6
- package/lib/terra/types/common.d.ts +50 -0
- package/lib/terra/types/common.js +19 -0
- package/lib/terra/types/context.d.ts +12 -0
- package/lib/terra/types/terra-nih.d.ts +8 -0
- package/lib/{providers/authentication/terra/hooks/useFetchTerraProfile.d.ts → terra/types/terra-profile.d.ts} +9 -8
- package/lib/terra/types/terra-tos.d.ts +9 -0
- package/lib/terra/types/terra-tos.js +1 -0
- package/lib/terra/utils.d.ts +47 -0
- package/lib/{providers/authentication/terra → terra}/utils.js +45 -2
- package/lib/utils/mdx/plugins/rehypeSlug.d.ts +1 -1
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.js +2 -3
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.js +1 -1
- package/lib/views/ExploreView/exploreView.js +2 -2
- package/lib/views/LoginView/loginView.d.ts +2 -2
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.js +2 -2
- package/lib/views/ResearchView/assistant/components/Input/input.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/messages.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.js +1 -1
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.js +1 -1
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.js +2 -2
- package/lib/views/ResearchView/assistant/stories/assistant.stories.js +1 -1
- package/lib/views/ResearchView/state/query/hooks/UseSubmit/hook.js +2 -2
- package/package.json +15 -1
- package/types/data-explorer-ui.d.ts +12 -12
- package/lib/components/Authentication/components/SessionController/components/GoogleSessionController/SessionController.d.ts +0 -3
- package/lib/components/Authentication/components/SessionController/components/GoogleSessionController/types.d.ts +0 -6
- package/lib/components/Authentication/components/SessionController/components/NextSessionController/SessionController.d.ts +0 -3
- package/lib/components/Authentication/components/SessionController/components/NextSessionController/types.d.ts +0 -4
- package/lib/hooks/authentication/auth/useAuthReducer.d.ts +0 -2
- package/lib/hooks/authentication/auth/useAuthReducer.js +0 -8
- package/lib/hooks/authentication/authentication/useAuthenticationReducer.d.ts +0 -2
- package/lib/hooks/authentication/authentication/useAuthenticationReducer.js +0 -8
- package/lib/hooks/authentication/credentials/useCredentialsReducer.d.ts +0 -2
- package/lib/providers/authentication/auth/actions.d.ts +0 -8
- package/lib/providers/authentication/auth/actions.js +0 -12
- package/lib/providers/authentication/auth/constants.d.ts +0 -2
- package/lib/providers/authentication/authentication/actions.d.ts +0 -8
- package/lib/providers/authentication/authentication/actions.js +0 -12
- package/lib/providers/authentication/authentication/constants.d.ts +0 -2
- package/lib/providers/authentication/authentication/context.d.ts +0 -2
- package/lib/providers/authentication/common/types.d.ts +0 -1
- package/lib/providers/authentication/credentials/actions.d.ts +0 -8
- package/lib/providers/authentication/credentials/actions.js +0 -12
- package/lib/providers/authentication/credentials/constants.d.ts +0 -2
- package/lib/providers/authentication/credentials/context.d.ts +0 -2
- package/lib/providers/authentication/credentials/dispatch.d.ts +0 -12
- package/lib/providers/authentication/terra/context.d.ts +0 -2
- package/lib/providers/authentication/terra/hooks/common/constants.d.ts +0 -6
- package/lib/providers/authentication/terra/hooks/common/entities.d.ts +0 -21
- package/lib/providers/authentication/terra/hooks/common/entities.js +0 -7
- package/lib/providers/authentication/terra/hooks/common/utils.d.ts +0 -15
- package/lib/providers/authentication/terra/hooks/common/utils.js +0 -25
- package/lib/providers/authentication/terra/hooks/utils.d.ts +0 -16
- package/lib/providers/authentication/terra/hooks/utils.js +0 -19
- package/lib/providers/authentication/terra/provider.d.ts +0 -3
- package/lib/providers/authentication/terra/types.d.ts +0 -20
- package/lib/providers/authentication/terra/types.js +0 -6
- package/lib/providers/authentication/terra/utils.d.ts +0 -19
- package/lib/providers/authentication/token/constants.d.ts +0 -2
- package/lib/providers/googleSignInAuthentication/common/types.d.ts +0 -17
- package/lib/providers/googleSignInAuthentication/constants.d.ts +0 -4
- package/lib/providers/googleSignInAuthentication/constants.js +0 -12
- package/lib/providers/googleSignInAuthentication/hooks/useGoogleSignInService.d.ts +0 -3
- package/lib/providers/googleSignInAuthentication/profile/types.d.ts +0 -14
- package/lib/providers/googleSignInAuthentication/provider.d.ts +0 -3
- package/lib/providers/googleSignInAuthentication/service/constants.d.ts +0 -4
- package/lib/providers/googleSignInAuthentication/service/constants.js +0 -9
- package/lib/providers/googleSignInAuthentication/service/service.d.ts +0 -6
- package/lib/providers/googleSignInAuthentication/types.d.ts +0 -6
- package/lib/providers/nextAuthAuthentication/hooks/useNextAuthService.d.ts +0 -2
- package/lib/providers/nextAuthAuthentication/provider.d.ts +0 -3
- package/lib/providers/nextAuthAuthentication/service/service.d.ts +0 -6
- /package/lib/{hooks/authentication/session → auth/hooks}/useSessionIdleTimer.d.ts +0 -0
- /package/lib/{hooks/authentication/session → auth/hooks}/useSessionIdleTimer.js +0 -0
- /package/lib/{components/Authentication/components/SessionController/components/GoogleSessionController/types.js → auth/types/common.js} +0 -0
- /package/lib/{components/Authentication/components/SessionController/components/NextSessionController/types.js → auth/types/loginProvider.js} +0 -0
- /package/lib/{providers/authentication/common/utils.d.ts → auth/utils/initializer.d.ts} +0 -0
- /package/lib/{providers/authentication/common/utils.js → auth/utils/initializer.js} +0 -0
- /package/lib/{providers/authentication/common → google}/types.js +0 -0
- /package/lib/{providers/googleSignInAuthentication/common → nextauth}/types.js +0 -0
- /package/lib/{providers/googleSignInAuthentication/profile/types.js → terra/types/context.js} +0 -0
- /package/lib/{providers/googleSignInAuthentication/types.js → terra/types/terra-nih.js} +0 -0
- /package/lib/{providers/nextAuthAuthentication/types.js → terra/types/terra-profile.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Chip } from "@mui/material";
|
|
3
|
-
import { PALETTE } from "../../../../../styles/common/constants/palette";
|
|
4
3
|
import { FONT } from "../../../../../styles/common/constants/font";
|
|
4
|
+
import { PALETTE } from "../../../../../styles/common/constants/palette";
|
|
5
5
|
export const StyledChip = styled(Chip) `
|
|
6
6
|
background-color: ${PALETTE.PRIMARY_LIGHTEST};
|
|
7
7
|
border-radius: 4px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconButtonProps as MIconButtonProps, IconProps as MIconProps } from "@mui/material";
|
|
2
|
-
import {
|
|
2
|
+
import { ElementType, JSX } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Basic icon button component.
|
|
5
5
|
* Use IconButtonSecondary styles to render secondary icon button.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CircularProgressProps as MCircularProgressProps } from "@mui/material";
|
|
2
|
-
import {
|
|
2
|
+
import { ElementType, JSX } from "react";
|
|
3
3
|
export interface CircularProgressProps extends MCircularProgressProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
Track?: ElementType<CircularProgressProps>;
|
package/lib/config/entities.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { TabProps as MTabProps, Theme, ThemeOptions } from "@mui/material";
|
|
|
2
2
|
import { CellContext, ColumnDef, ColumnMeta, ColumnSort, GroupingState, RowData, Table, TableOptions } from "@tanstack/react-table";
|
|
3
3
|
import { JSX, JSXElementConstructor, ReactNode } from "react";
|
|
4
4
|
import { AzulSummaryResponse } from "../apis/azul/common/entities";
|
|
5
|
+
import { AuthState } from "../auth/types/auth";
|
|
6
|
+
import { UserProfile } from "../auth/types/authentication";
|
|
7
|
+
import { ProviderId } from "../auth/types/common";
|
|
8
|
+
import { AiConfig } from "../common/ai/config/types";
|
|
5
9
|
import { CategoryConfig } from "../common/categories/config/types";
|
|
6
10
|
import { DataDictionaryAnnotation, DataDictionaryConfig, SelectedFilter } from "../common/entities";
|
|
7
11
|
import { FilterSortConfig } from "../common/filters/sort/config/types";
|
|
8
12
|
import { FooterProps } from "../components/Layout/components/Footer/footer";
|
|
9
13
|
import { HeaderProps } from "../components/Layout/components/Header/header";
|
|
10
14
|
import { ExploreMode } from "../hooks/useExploreMode/types";
|
|
11
|
-
import { AuthState } from "../providers/authentication/auth/types";
|
|
12
|
-
import { UserProfile } from "../providers/authentication/authentication/types";
|
|
13
|
-
import { ProviderId } from "../providers/authentication/common/types";
|
|
14
15
|
import { ExploreState } from "../providers/exploreState";
|
|
15
16
|
import { FileManifestState } from "../providers/fileManifestState";
|
|
16
17
|
import { SystemStatus, SystemStatusResponse } from "../providers/systemStatus";
|
|
17
|
-
import { AiConfig } from "../common/ai/config/types";
|
|
18
18
|
/**
|
|
19
19
|
* Interface to define the analytics configuration for a given site.
|
|
20
20
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OAuthProvider } from "../config/entities";
|
|
2
|
+
import { GoogleProfile } from "./types";
|
|
3
|
+
export { GOOGLE_SIGN_IN_PROVIDER_ID } from "./constants";
|
|
4
|
+
/**
|
|
5
|
+
* Google Sign-In provider configuration.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GOOGLE_SIGN_IN_PROVIDER: Pick<OAuthProvider<GoogleProfile>, "icon" | "id" | "name" | "profile">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GoogleIcon } from "../components/common/CustomIcon/components/GoogleIcon/googleIcon";
|
|
2
|
+
import { GOOGLE_SIGN_IN_PROVIDER_ID } from "./constants";
|
|
3
|
+
import { mapProfile } from "./utils/profile";
|
|
4
|
+
// Re-export for convenience
|
|
5
|
+
export { GOOGLE_SIGN_IN_PROVIDER_ID } from "./constants";
|
|
6
|
+
/**
|
|
7
|
+
* Google Sign-In provider configuration.
|
|
8
|
+
*/
|
|
9
|
+
export const GOOGLE_SIGN_IN_PROVIDER = {
|
|
10
|
+
icon: GoogleIcon({}),
|
|
11
|
+
id: GOOGLE_SIGN_IN_PROVIDER_ID,
|
|
12
|
+
name: "Google",
|
|
13
|
+
profile: mapProfile,
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthState } from "../auth/types/auth";
|
|
2
|
+
import { AuthenticationState } from "../auth/types/authentication";
|
|
3
|
+
/**
|
|
4
|
+
* Google provider ID.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GOOGLE_SIGN_IN_PROVIDER_ID = "google";
|
|
7
|
+
/**
|
|
8
|
+
* Initial auth state for Google Sign-In.
|
|
9
|
+
* Status is settled because there's no initial session check.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AUTH_STATE: AuthState;
|
|
12
|
+
/**
|
|
13
|
+
* Initial authentication state for Google Sign-In.
|
|
14
|
+
* Status is settled because there's no initial session check.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AUTHENTICATION_STATE: AuthenticationState;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DEFAULT_AUTH_STATE } from "../auth/constants/auth";
|
|
2
|
+
import { DEFAULT_AUTHENTICATION_STATE } from "../auth/constants/authentication";
|
|
3
|
+
import { AUTH_STATUS } from "../auth/types/auth";
|
|
4
|
+
import { AUTHENTICATION_STATUS, } from "../auth/types/authentication";
|
|
5
|
+
/**
|
|
6
|
+
* Google provider ID.
|
|
7
|
+
*/
|
|
8
|
+
export const GOOGLE_SIGN_IN_PROVIDER_ID = "google";
|
|
9
|
+
/**
|
|
10
|
+
* Initial auth state for Google Sign-In.
|
|
11
|
+
* Status is settled because there's no initial session check.
|
|
12
|
+
*/
|
|
13
|
+
export const AUTH_STATE = {
|
|
14
|
+
...DEFAULT_AUTH_STATE,
|
|
15
|
+
status: AUTH_STATUS.SETTLED,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Initial authentication state for Google Sign-In.
|
|
19
|
+
* Status is settled because there's no initial session check.
|
|
20
|
+
*/
|
|
21
|
+
export const AUTHENTICATION_STATE = {
|
|
22
|
+
...DEFAULT_AUTHENTICATION_STATE,
|
|
23
|
+
status: AUTHENTICATION_STATUS.SETTLED,
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Service } from "../../auth/types/auth";
|
|
2
|
+
import { SessionReducer } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Google Sign-In service hook.
|
|
5
|
+
* @param reducer - Session reducers.
|
|
6
|
+
* @returns auth service.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useGoogleSignInService: (reducer: SessionReducer) => Service;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { useRouter } from "next/router";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import { useProviders } from "
|
|
4
|
-
import { service } from "../service
|
|
3
|
+
import { useProviders } from "../../hooks/authentication/providers/useProviders";
|
|
4
|
+
import { service } from "../service";
|
|
5
|
+
/**
|
|
6
|
+
* Google Sign-In service hook.
|
|
7
|
+
* @param reducer - Session reducers.
|
|
8
|
+
* @returns auth service.
|
|
9
|
+
*/
|
|
5
10
|
export const useGoogleSignInService = (reducer) => {
|
|
6
11
|
const { findProvider } = useProviders();
|
|
7
12
|
const { basePath } = useRouter();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TokenContextProps } from "
|
|
1
|
+
import { TokenContextProps } from "../../auth/types/token";
|
|
2
2
|
/**
|
|
3
3
|
* Token reducer: Manages the internal state of the token within the OAuth provider.
|
|
4
4
|
* This reducer handles the token locally until certain conditions are met.
|
|
5
5
|
* For releasing the token to the rest of the app, use the credentials reducer.
|
|
6
|
+
* @returns token context props.
|
|
6
7
|
*/
|
|
7
8
|
export declare const useTokenReducer: () => TokenContextProps;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useReducer } from "react";
|
|
2
|
-
import { DEFAULT_TOKEN_STATE } from "
|
|
3
|
-
import { tokenReducer } from "
|
|
2
|
+
import { DEFAULT_TOKEN_STATE } from "../../auth/constants/token";
|
|
3
|
+
import { tokenReducer } from "../../auth/reducers/token";
|
|
4
4
|
/**
|
|
5
5
|
* Token reducer: Manages the internal state of the token within the OAuth provider.
|
|
6
6
|
* This reducer handles the token locally until certain conditions are met.
|
|
7
7
|
* For releasing the token to the rest of the app, use the credentials reducer.
|
|
8
|
+
* @returns token context props.
|
|
8
9
|
*/
|
|
9
10
|
export const useTokenReducer = () => {
|
|
10
11
|
const [tokenState, tokenDispatch] = useReducer(tokenReducer, undefined, () => DEFAULT_TOKEN_STATE);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { GoogleSignInAuthenticationProviderProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Google Sign-In authentication provider.
|
|
5
|
+
* @param props - Provider props.
|
|
6
|
+
* @param props.children - Children components.
|
|
7
|
+
* @param props.SessionController - Custom session controller component.
|
|
8
|
+
* @param props.timeout - Session timeout in milliseconds.
|
|
9
|
+
* @returns authentication provider component.
|
|
10
|
+
*/
|
|
11
|
+
export declare function GoogleSignInAuthenticationProvider({ children, SessionController, timeout, }: GoogleSignInAuthenticationProviderProps): JSX.Element;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useSessionIdleTimer } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { AuthenticationContext } from "../authentication/authentication/context";
|
|
12
|
-
import { CredentialsContext } from "../authentication/credentials/context";
|
|
2
|
+
import { AuthContext } from "../auth/contexts/auth";
|
|
3
|
+
import { AuthenticationContext } from "../auth/contexts/authentication";
|
|
4
|
+
import { CredentialsContext } from "../auth/contexts/credentials";
|
|
5
|
+
import { useAuthenticationReducer } from "../auth/hooks/useAuthenticationReducer";
|
|
6
|
+
import { useAuthReducer } from "../auth/hooks/useAuthReducer";
|
|
7
|
+
import { useCredentialsReducer } from "../auth/hooks/useCredentialsReducer";
|
|
8
|
+
import { useSessionIdleTimer } from "../auth/hooks/useSessionIdleTimer";
|
|
9
|
+
import { useSessionActive } from "../hooks/authentication/session/useSessionActive";
|
|
10
|
+
import { useSessionCallbackUrl } from "../hooks/authentication/session/useSessionCallbackUrl";
|
|
13
11
|
import { AUTH_STATE, AUTHENTICATION_STATE } from "./constants";
|
|
14
12
|
import { useGoogleSignInService } from "./hooks/useGoogleSignInService";
|
|
13
|
+
import { useTokenReducer } from "./hooks/useTokenReducer";
|
|
14
|
+
import { SessionController as DefaultSessionController } from "./session-controller";
|
|
15
|
+
/**
|
|
16
|
+
* Google Sign-In authentication provider.
|
|
17
|
+
* @param props - Provider props.
|
|
18
|
+
* @param props.children - Children components.
|
|
19
|
+
* @param props.SessionController - Custom session controller component.
|
|
20
|
+
* @param props.timeout - Session timeout in milliseconds.
|
|
21
|
+
* @returns authentication provider component.
|
|
22
|
+
*/
|
|
15
23
|
export function GoogleSignInAuthenticationProvider({ children, SessionController = DefaultSessionController, timeout, }) {
|
|
16
24
|
const authReducer = useAuthReducer(AUTH_STATE);
|
|
17
25
|
const authenticationReducer = useAuthenticationReducer(AUTHENTICATION_STATE);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OAuthProvider } from "../config/entities";
|
|
2
|
+
import { SessionDispatch } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Google Sign-In service.
|
|
5
|
+
*/
|
|
6
|
+
export declare const service: {
|
|
7
|
+
/**
|
|
8
|
+
* Login with Google OAuth.
|
|
9
|
+
* @param provider - OAuth provider configuration.
|
|
10
|
+
* @param dispatch - Dispatch functions for auth state.
|
|
11
|
+
*/
|
|
12
|
+
login: (provider: OAuthProvider, dispatch: Pick<SessionDispatch, "authDispatch" | "authenticationDispatch" | "tokenDispatch">) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Logout and clear all auth state.
|
|
15
|
+
* @param dispatch - Dispatch functions for auth state.
|
|
16
|
+
*/
|
|
17
|
+
logout: (dispatch: SessionDispatch) => void;
|
|
18
|
+
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { requestAuth,
|
|
2
|
-
import { requestAuthentication,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getAuthenticationRequestOptions } from "
|
|
7
|
-
|
|
1
|
+
import { requestAuth, resetAuthState } from "../auth/dispatch/auth";
|
|
2
|
+
import { requestAuthentication, resetAuthenticationState, updateAuthentication, } from "../auth/dispatch/authentication";
|
|
3
|
+
import { resetCredentialsState } from "../auth/dispatch/credentials";
|
|
4
|
+
import { resetTokenState, updateToken } from "../auth/dispatch/token";
|
|
5
|
+
import { AUTHENTICATION_STATUS } from "../auth/types/authentication";
|
|
6
|
+
import { fetchProfile, getAuthenticationRequestOptions } from "./utils/auth";
|
|
7
|
+
/**
|
|
8
|
+
* Google Sign-In service.
|
|
9
|
+
*/
|
|
8
10
|
export const service = {
|
|
11
|
+
/**
|
|
12
|
+
* Login with Google OAuth.
|
|
13
|
+
* @param provider - OAuth provider configuration.
|
|
14
|
+
* @param dispatch - Dispatch functions for auth state.
|
|
15
|
+
*/
|
|
9
16
|
login: (provider, dispatch) => {
|
|
10
17
|
const client = google.accounts.oauth2.initTokenClient({
|
|
11
18
|
callback: (response) => {
|
|
@@ -16,7 +23,7 @@ export const service = {
|
|
|
16
23
|
dispatch.tokenDispatch?.(updateToken({ providerId: id, token }));
|
|
17
24
|
fetchProfile(userinfo, getAuthenticationRequestOptions(token), {
|
|
18
25
|
onError: () => {
|
|
19
|
-
dispatch.authDispatch?.(
|
|
26
|
+
dispatch.authDispatch?.(resetAuthState());
|
|
20
27
|
dispatch.authenticationDispatch?.(updateAuthentication({
|
|
21
28
|
profile: undefined,
|
|
22
29
|
status: AUTHENTICATION_STATUS.SETTLED,
|
|
@@ -34,8 +41,12 @@ export const service = {
|
|
|
34
41
|
});
|
|
35
42
|
client.requestAccessToken();
|
|
36
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Logout and clear all auth state.
|
|
46
|
+
* @param dispatch - Dispatch functions for auth state.
|
|
47
|
+
*/
|
|
37
48
|
logout: (dispatch) => {
|
|
38
|
-
dispatch.authDispatch?.(
|
|
49
|
+
dispatch.authDispatch?.(resetAuthState());
|
|
39
50
|
dispatch.authenticationDispatch?.(resetAuthenticationState());
|
|
40
51
|
dispatch.credentialsDispatch?.(resetCredentialsState());
|
|
41
52
|
dispatch.tokenDispatch?.(resetTokenState());
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
2
|
+
import { SessionControllerProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Google session controller.
|
|
5
|
+
* Bridges Google OAuth token to auth contexts.
|
|
6
|
+
* @param props - Session controller props.
|
|
7
|
+
* @param props.children - Children components.
|
|
8
|
+
* @param props.token - OAuth access token.
|
|
9
|
+
* @returns session controller component.
|
|
10
|
+
*/
|
|
11
|
+
export declare function SessionController({ children, token, }: SessionControllerProps): JSX.Element;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useEffect } from "react";
|
|
3
|
-
import { authComplete } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useCredentials } from "
|
|
3
|
+
import { authComplete } from "../auth/dispatch/auth";
|
|
4
|
+
import { authenticationComplete } from "../auth/dispatch/authentication";
|
|
5
|
+
import { updateCredentials } from "../auth/dispatch/credentials";
|
|
6
|
+
import { useAuth } from "../auth/hooks/useAuth";
|
|
7
|
+
import { useAuthentication } from "../auth/hooks/useAuthentication";
|
|
8
|
+
import { useCredentials } from "../auth/hooks/useCredentials";
|
|
9
|
+
/**
|
|
10
|
+
* Google session controller.
|
|
11
|
+
* Bridges Google OAuth token to auth contexts.
|
|
12
|
+
* @param props - Session controller props.
|
|
13
|
+
* @param props.children - Children components.
|
|
14
|
+
* @param props.token - OAuth access token.
|
|
15
|
+
* @returns session controller component.
|
|
16
|
+
*/
|
|
9
17
|
export function SessionController({ children, token, }) {
|
|
10
18
|
const { authDispatch } = useAuth();
|
|
11
19
|
const { authenticationDispatch, authenticationState: { profile }, } = useAuthentication();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Dispatch, ElementType, ReactNode } from "react";
|
|
2
|
+
import { AuthAction, AuthContextProps } from "../auth/types/auth";
|
|
3
|
+
import { AuthenticationAction, AuthenticationContextProps } from "../auth/types/authentication";
|
|
4
|
+
import { CredentialsAction, CredentialsContextProps } from "../auth/types/credentials";
|
|
5
|
+
import { TokenAction, TokenContextProps, TokenState } from "../auth/types/token";
|
|
6
|
+
/**
|
|
7
|
+
* Google Sign-In authentication provider props.
|
|
8
|
+
*/
|
|
9
|
+
export interface GoogleSignInAuthenticationProviderProps {
|
|
10
|
+
children: ReactNode | ReactNode[];
|
|
11
|
+
SessionController?: ElementType;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Google profile from Google's userinfo endpoint.
|
|
16
|
+
*/
|
|
17
|
+
export interface GoogleProfile {
|
|
18
|
+
email: string;
|
|
19
|
+
email_verified: boolean;
|
|
20
|
+
family_name: string;
|
|
21
|
+
given_name: string;
|
|
22
|
+
hd: string;
|
|
23
|
+
locale: string;
|
|
24
|
+
name: string;
|
|
25
|
+
picture: string;
|
|
26
|
+
sub: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Session controller props.
|
|
30
|
+
*/
|
|
31
|
+
export interface SessionControllerProps {
|
|
32
|
+
children: ReactNode | ReactNode[];
|
|
33
|
+
token: TokenState["token"];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Session reducer - all reducers needed for Google Sign-In.
|
|
37
|
+
*/
|
|
38
|
+
export interface SessionReducer {
|
|
39
|
+
authenticationReducer: AuthenticationContextProps;
|
|
40
|
+
authReducer: Omit<AuthContextProps, "service">;
|
|
41
|
+
credentialsReducer: CredentialsContextProps;
|
|
42
|
+
tokenReducer: TokenContextProps;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Session dispatch - all dispatch functions needed for Google Sign-In.
|
|
46
|
+
*/
|
|
47
|
+
export interface SessionDispatch {
|
|
48
|
+
authDispatch: Dispatch<AuthAction> | null;
|
|
49
|
+
authenticationDispatch: Dispatch<AuthenticationAction> | null;
|
|
50
|
+
credentialsDispatch: Dispatch<CredentialsAction> | null;
|
|
51
|
+
tokenDispatch: Dispatch<TokenAction> | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Token set parameters from Google OAuth response.
|
|
55
|
+
*/
|
|
56
|
+
export interface TokenSetParameters {
|
|
57
|
+
access_token: string;
|
|
58
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the options for an authentication request.
|
|
3
|
+
* @param token - Token.
|
|
4
|
+
* @returns request options.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAuthenticationRequestOptions(token: string): RequestInit;
|
|
1
7
|
/**
|
|
2
8
|
* Fetches data from given endpoint and options.
|
|
3
9
|
* @param endpoint - Endpoint.
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the options for an authentication request.
|
|
3
|
+
* @param token - Token.
|
|
4
|
+
* @returns request options.
|
|
5
|
+
*/
|
|
6
|
+
export function getAuthenticationRequestOptions(token) {
|
|
7
|
+
const headers = new Headers();
|
|
8
|
+
headers.append("authorization", "Bearer " + token);
|
|
9
|
+
return { headers };
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
12
|
* Fetches data from given endpoint and options.
|
|
3
13
|
* @param endpoint - Endpoint.
|
package/lib/{providers/googleSignInAuthentication/profile/utils.d.ts → google/utils/profile.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserProfile } from "../../
|
|
2
|
-
import { GoogleProfile } from "
|
|
1
|
+
import { UserProfile } from "../../auth/types/authentication";
|
|
2
|
+
import { GoogleProfile } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Returns user profile from google response.
|
|
5
5
|
* @param profile - Google response.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useAuth } from "../../../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useAuth } from "../../../auth/hooks/useAuth";
|
|
2
|
+
import { useAuthentication } from "../../../auth/hooks/useAuthentication";
|
|
3
|
+
import { AUTH_STATUS } from "../../../auth/types/auth";
|
|
4
4
|
/**
|
|
5
5
|
* Profile hook - returns user profile.
|
|
6
6
|
* @returns user profile.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ProviderId } from "../../../auth/types/common";
|
|
1
2
|
import { OAuthProvider } from "../../../config/entities";
|
|
2
|
-
import { ProviderId } from "../../../providers/authentication/common/types";
|
|
3
3
|
export interface UseProviders {
|
|
4
4
|
findProvider: (providerId: ProviderId) => OAuthProvider | undefined;
|
|
5
5
|
providers: OAuthProvider[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthState } from "../../../
|
|
2
|
-
import { AuthenticationState } from "../../../
|
|
1
|
+
import { AuthState } from "../../../auth/types/auth";
|
|
2
|
+
import { AuthenticationState } from "../../../auth/types/authentication";
|
|
3
3
|
export declare const useSessionActive: (authState: AuthState, authenticationState: AuthenticationState) => void;
|
|
4
4
|
/**
|
|
5
5
|
* Finds the most recent route in the history that is not the login route and removes the inactivity timeout query parameter.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Router from "next/router";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
+
import { AUTH_STATUS } from "../../../auth/types/auth";
|
|
4
|
+
import { AUTHENTICATION_STATUS, } from "../../../auth/types/authentication";
|
|
3
5
|
import { escapeRegExp } from "../../../common/utils";
|
|
4
|
-
import { AUTH_STATUS, } from "../../../providers/authentication/auth/types";
|
|
5
|
-
import { AUTHENTICATION_STATUS, } from "../../../providers/authentication/authentication/types";
|
|
6
6
|
import { ROUTE } from "../../../routes/constants";
|
|
7
7
|
import { useRouteHistory } from "../../useRouteHistory";
|
|
8
8
|
import { INACTIVITY_PARAM } from "./useSessionTimeout";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useTerraProfile } from "../../../
|
|
1
|
+
import { useTerraProfile } from "../../../terra/hooks/useTerraProfile";
|
|
2
2
|
export var ONBOARDING_STEP;
|
|
3
3
|
(function (ONBOARDING_STEP) {
|
|
4
4
|
ONBOARDING_STEP[ONBOARDING_STEP["NIH_ACCOUNT"] = 3] = "NIH_ACCOUNT";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTerraProfile } from "../../../
|
|
2
|
-
import { REQUEST_STATUS } from "../../../
|
|
1
|
+
import { useTerraProfile } from "../../../terra/hooks/useTerraProfile";
|
|
2
|
+
import { REQUEST_STATUS } from "../../../terra/types/common";
|
|
3
3
|
const WARNING_WINDOW_SECONDS = 60 * 60 * 24 * 5; // 5 days.
|
|
4
4
|
/**
|
|
5
5
|
* Handles authentication NIH expiry.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCredentials } from "../../../
|
|
1
|
+
import { useCredentials } from "../../../auth/hooks/useCredentials";
|
|
2
2
|
export const useToken = () => {
|
|
3
3
|
const { credentialsState: { credentials: token }, } = useCredentials();
|
|
4
4
|
return { token };
|
|
@@ -31,6 +31,16 @@ export const useEntityList = (staticResponse) => {
|
|
|
31
31
|
const entities = getEntities(staticData, data);
|
|
32
32
|
const shouldDispatchResponse = isDispatchable(exploreMode, data?.apiPath === apiPath, entityListType === tabValue);
|
|
33
33
|
const isFetching = isIdle || isLoading;
|
|
34
|
+
// Reset explore response when token changes - server-side fetched modes only.
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (exploreMode === EXPLORE_MODE.SS_FETCH_SS_FILTERING ||
|
|
37
|
+
exploreMode === EXPLORE_MODE.SS_FETCH_CS_FILTERING) {
|
|
38
|
+
exploreDispatch({
|
|
39
|
+
payload: undefined,
|
|
40
|
+
type: ExploreActionKind.ResetExploreResponse,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, [exploreDispatch, exploreMode, token]);
|
|
34
44
|
// Fetch entities - on change of filter state - server-side fetching and server-side filtering.
|
|
35
45
|
useEffect(() => {
|
|
36
46
|
if (exploreMode === EXPLORE_MODE.SS_FETCH_SS_FILTERING) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { SessionContextValue } from "next-auth/react";
|
|
2
|
-
import { AUTH_STATUS } from "
|
|
3
|
-
import { AUTHENTICATION_STATUS } from "
|
|
2
|
+
import { AUTH_STATUS } from "../auth/types/auth";
|
|
3
|
+
import { AUTHENTICATION_STATUS } from "../auth/types/authentication";
|
|
4
|
+
/**
|
|
5
|
+
* Map of NextAuth session status to auth status.
|
|
6
|
+
*/
|
|
4
7
|
export declare const AUTH_STATUS_MAP: Record<SessionContextValue["status"], AUTH_STATUS>;
|
|
8
|
+
/**
|
|
9
|
+
* Map of NextAuth session status to authentication status.
|
|
10
|
+
*/
|
|
5
11
|
export declare const AUTHENTICATION_STATUS_MAP: Record<SessionContextValue["status"], AUTHENTICATION_STATUS>;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { AUTH_STATUS } from "
|
|
2
|
-
import { AUTHENTICATION_STATUS } from "
|
|
1
|
+
import { AUTH_STATUS } from "../auth/types/auth";
|
|
2
|
+
import { AUTHENTICATION_STATUS } from "../auth/types/authentication";
|
|
3
|
+
/**
|
|
4
|
+
* Map of NextAuth session status to auth status.
|
|
5
|
+
*/
|
|
3
6
|
export const AUTH_STATUS_MAP = {
|
|
4
7
|
authenticated: AUTH_STATUS.SETTLED,
|
|
5
8
|
loading: AUTH_STATUS.PENDING,
|
|
6
9
|
unauthenticated: AUTH_STATUS.SETTLED,
|
|
7
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Map of NextAuth session status to authentication status.
|
|
13
|
+
*/
|
|
8
14
|
export const AUTHENTICATION_STATUS_MAP = {
|
|
9
15
|
authenticated: AUTHENTICATION_STATUS.SETTLED,
|
|
10
16
|
loading: AUTHENTICATION_STATUS.PENDING,
|