From 689f58c442bd34916101b6ef82daa84b2eb24b2c Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 10 Feb 2024 16:36:36 -0600 Subject: [PATCH] Simplify admin checklist --- src/components/Checklist.tsx | 10 ++++++--- src/components/ChecklistRow.tsx | 1 - src/site/SiteChecklistClient.tsx | 37 +++++++++++++++++--------------- src/site/config.ts | 4 ++-- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/components/Checklist.tsx b/src/components/Checklist.tsx index 811e9b46..cb80dded 100644 --- a/src/components/Checklist.tsx +++ b/src/components/Checklist.tsx @@ -4,10 +4,12 @@ import { clsx } from 'clsx/lite'; export default function Checklist({ title, icon, + optional, children, }: { title: string icon?: ReactNode + optional?: boolean children: ReactNode }) { return ( @@ -15,11 +17,13 @@ export default function Checklist({
{icon} -
- {title} +
+
{title}
+ {optional && +
(Optional)
}
{title} - {optional && ' (optional)'}
{children} diff --git a/src/site/SiteChecklistClient.tsx b/src/site/SiteChecklistClient.tsx index e69b363d..7b08db87 100644 --- a/src/site/SiteChecklistClient.tsx +++ b/src/site/SiteChecklistClient.tsx @@ -29,7 +29,7 @@ export default function SiteChecklistClient({ hasAwsS3Storage, hasMultipleStorageProviders, currentStorage, - hasAuth, + hasAuthSecret, hasAdminUser, hasTitle, hasDomain, @@ -198,26 +198,27 @@ export default function SiteChecklistClient({ > Store auth secret in environment variable: -
- -
- {secret} -
- {renderCopyButton('Secret', secret)} - } - onClick={refreshSecret} - isLoading={isPendingSecret} - spinnerColor="text" - /> + {!hasAuthSecret && +
+ +
+ {secret} +
+ {renderCopyButton('Secret', secret)} + } + onClick={refreshSecret} + isLoading={isPendingSecret} + spinnerColor="text" + /> +
-
- -
+ +
} {renderEnvVars(['AUTH_SECRET'])} } + optional > } + optional > 0, + hasAuthSecret: (process.env.AUTH_SECRET ?? '').length > 0, hasAdminUser: ( (process.env.ADMIN_EMAIL ?? '').length > 0 && (process.env.ADMIN_PASSWORD ?? '').length > 0 @@ -134,5 +134,5 @@ export type ConfigChecklistStatus = typeof CONFIG_CHECKLIST_STATUS; export const IS_SITE_READY = CONFIG_CHECKLIST_STATUS.hasPostgres && CONFIG_CHECKLIST_STATUS.hasStorage && - CONFIG_CHECKLIST_STATUS.hasAuth && + CONFIG_CHECKLIST_STATUS.hasAuthSecret && CONFIG_CHECKLIST_STATUS.hasAdminUser;