-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fran McDade
authored and
Fran McDade
committed
Apr 11, 2024
1 parent
02c4e21
commit 77c04fb
Showing
14 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
explorer/app/components/common/Banner/components/Announcements/announcements.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useSessionTimeout } from "@clevercanary/data-explorer-ui/lib/hooks/useSessionTimeout"; | ||
import { useSystemStatus } from "@clevercanary/data-explorer-ui/lib/hooks/useSystemStatus"; | ||
import { ElementType, Fragment } from "react"; | ||
import { SessionTimeout } from "./components/SessionTimeout/sessionTimeout"; | ||
import { SystemIndexing as SystemIndexingBanner } from "./components/SystemIndexing/systemIndexing"; | ||
import { SystemStatus as SystemStatusBanner } from "./components/SystemStatus/systemStatus"; | ||
|
||
interface AnnouncementsProps { | ||
GeneralAnnouncement?: ElementType; | ||
SystemIndexing?: ElementType; | ||
SystemStatus?: ElementType; | ||
} | ||
|
||
export const Announcements = ({ | ||
GeneralAnnouncement, | ||
SystemIndexing = SystemIndexingBanner, | ||
SystemStatus = SystemStatusBanner, | ||
}: AnnouncementsProps): JSX.Element => { | ||
const sessionTimeout = useSessionTimeout(); | ||
const systemStatus = useSystemStatus(); | ||
const { clearSessionTimeout, isSessionTimeout } = sessionTimeout; | ||
const { indexing, loading, ok } = systemStatus; | ||
const isSystemUnavailable = !loading && !ok; | ||
const isSystemIndexing = !loading && ok && indexing; | ||
return ( | ||
<Fragment> | ||
{isSessionTimeout ? ( | ||
<SessionTimeout onClose={clearSessionTimeout} /> | ||
) : isSystemUnavailable ? ( | ||
<SystemStatus /> | ||
) : isSystemIndexing ? ( | ||
<SystemIndexing /> | ||
) : ( | ||
GeneralAnnouncement && <GeneralAnnouncement /> | ||
)} | ||
</Fragment> | ||
); | ||
}; |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...s/common/Banner/components/Announcements/components/BetaAnnouncement/betaAnnouncement.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import { BetaAnnouncement as GeneralAnnouncement } from "../../../../../MDXContent/anvil-cmg"; | ||
import { Banner } from "./betaAnnouncement.styles"; | ||
|
||
export const BetaAnnouncement = ({ ...props }): JSX.Element => { | ||
return ( | ||
<Banner {...props}> | ||
<GeneralAnnouncement /> | ||
</Banner> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
...nents/common/Banner/components/Announcements/components/SessionTimeout/sessionTimeout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Banner } from "@clevercanary/data-explorer-ui/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles"; | ||
import React from "react"; | ||
|
||
export const SessionTimeout = ({ ...props }): JSX.Element => { | ||
return ( | ||
<Banner {...props}> | ||
For your security, you have been logged out due to 15 minutes of | ||
inactivity. | ||
</Banner> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
...nents/common/Banner/components/Announcements/components/SystemIndexing/systemIndexing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BannerPrimary } from "@clevercanary/data-explorer-ui/lib/components/common/Banner/components/BannerPrimary/bannerPrimary"; | ||
import React from "react"; | ||
|
||
export const SystemIndexing = ({ ...props }): JSX.Element => { | ||
return ( | ||
<BannerPrimary {...props}> | ||
Data indexing in progress. Downloads and exports are disabled as search | ||
results may be incomplete. | ||
</BannerPrimary> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
...omponents/common/Banner/components/Announcements/components/SystemStatus/systemStatus.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BannerPrimary } from "@clevercanary/data-explorer-ui/lib/components/common/Banner/components/BannerPrimary/bannerPrimary"; | ||
import React from "react"; | ||
|
||
export const SystemStatus = ({ ...props }): JSX.Element => { | ||
return ( | ||
<BannerPrimary {...props}> | ||
One or more of the system components are currently unavailable. | ||
Functionality may be degraded. | ||
</BannerPrimary> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters