-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use banner instead of modal for backup rp notice (#998)
- Loading branch information
Showing
12 changed files
with
102 additions
and
96 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { thunks } from "@app/api"; | ||
import { schema } from "@app/schema"; | ||
import type { NoticeType } from "@app/types"; | ||
|
||
export const readNotice = thunks.create<NoticeType>( | ||
"read-notice", | ||
function* (ctx, next) { | ||
yield* schema.update( | ||
schema.notices.update({ | ||
key: ctx.payload, | ||
value: new Date().toISOString(), | ||
}), | ||
); | ||
yield* next(); | ||
}, | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export enum ModalType { | ||
NONE = "", | ||
BackupRPNotice = "backup-rp-notice", | ||
} | ||
|
||
export interface ModalState { | ||
|
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,4 @@ | ||
export enum NoticeType { | ||
NONE = "", | ||
BackupRPNotice = "backup-rp-notice", | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { readNotice } from "@app/notice"; | ||
import { NoticeType } from "@app/types"; | ||
import { useDispatch } from "starfx/react"; | ||
import { Box } from "./box"; | ||
import { Button } from "./button"; | ||
import { ExternalLink } from "./external-link"; | ||
import { Group } from "./group"; | ||
import { IconInfo } from "./icons"; | ||
import { tokens } from "./tokens"; | ||
|
||
export function NoticeBackupRpBanner() { | ||
const dispatch = useDispatch(); | ||
const gotit = () => { | ||
dispatch(readNotice(NoticeType.BackupRPNotice)); | ||
}; | ||
|
||
return ( | ||
<Box bg="gray-50"> | ||
<Group> | ||
<h4 className={`${tokens.type.h4} flex gap-2 items-center`}> | ||
<IconInfo variant="sm" /> | ||
New Backup Retention Policy | ||
</h4> | ||
<p> | ||
As of <span className="font-bold">07/25/2024</span>, we've changed the | ||
default backup retention policy for newly created environments to: | ||
</p> | ||
<ul className="list-disc list-inside"> | ||
<li> | ||
<strong>30</strong> daily backups, <strong>12</strong> monthly | ||
backups, <strong>6</strong> yearly backups | ||
</li> | ||
<li> | ||
Cross-region copies: <strong>Disabled</strong>, Keep final backups:{" "} | ||
<strong>Enabled</strong> | ||
</li> | ||
</ul> | ||
<p> | ||
For more information,{" "} | ||
<ExternalLink href="https://www.aptible.com/changelog/new-default-backup-retention-policy"> | ||
read the changelog. | ||
</ExternalLink> | ||
</p> | ||
<div> | ||
<Button key="gotit" variant="primary" onClick={gotit}> | ||
Got it! | ||
</Button> | ||
</div> | ||
</Group> | ||
</Box> | ||
); | ||
} |