From d9619ffea41a45a5bfd5428bb04bcb7597b3cff4 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Thu, 8 Feb 2024 22:02:34 +0000 Subject: [PATCH] Abstract app config to handle old and new schema + remove individual update buttons for core config ui --- shared/studio/tabs/auth/authAdmin.module.scss | 1 + shared/studio/tabs/auth/index.tsx | 490 +++++++---------- shared/studio/tabs/auth/loginUIPreview.tsx | 14 +- shared/studio/tabs/auth/state/index.tsx | 495 ++++++++++++------ 4 files changed, 514 insertions(+), 486 deletions(-) diff --git a/shared/studio/tabs/auth/authAdmin.module.scss b/shared/studio/tabs/auth/authAdmin.module.scss index f1bf5faf..0bac4903 100644 --- a/shared/studio/tabs/auth/authAdmin.module.scss +++ b/shared/studio/tabs/auth/authAdmin.module.scss @@ -288,6 +288,7 @@ input { font-family: inherit; line-height: inherit; + font-size: 14px; border: 0; outline: 0; background: none; diff --git a/shared/studio/tabs/auth/index.tsx b/shared/studio/tabs/auth/index.tsx index 9087feb0..d0a3959d 100644 --- a/shared/studio/tabs/auth/index.tsx +++ b/shared/studio/tabs/auth/index.tsx @@ -31,6 +31,8 @@ import { LocalEmailPasswordProviderData, SMTPSecurity, smtpSecurity, + DraftAppConfig, + AbstractDraftConfig, } from "./state"; import {encodeB64} from "edgedb/dist/primitives/buffer"; @@ -191,6 +193,8 @@ function CopyUrl({url}: {url: string}) { const ConfigPage = observer(function ConfigPage() { const state = useTabState(AuthAdminState); + const coreConfig = state.draftCoreConfig; + return (
@@ -209,243 +213,17 @@ const ConfigPage = observer(function ConfigPage() {
Auth Configuration
-
-
app_name
-
-
- {state.configData ? ( - <> - - state.draftAppName.setValue( - appName.trim() === "" ? null : appName - ) - } - error={state.draftAppName.error} - /> - {state.draftAppName.value != null ? ( - <> -
-
- The name of your application. -
-
-
- -
-
logo_url
-
-
- {state.configData ? ( - <> - - state.draftLogoUrl.setValue( - logoUrl.trim() === "" ? null : logoUrl - ) - } - error={state.draftLogoUrl.error} - /> - {state.draftLogoUrl.value != null ? ( - <> -
-
- A url to an image of your application's logo. -
-
-
- -
-
dark_logo_url
-
-
- {state.configData ? ( - <> - - state.draftDarkLogoUrl.setValue( - logoUrl.trim() === "" ? null : logoUrl - ) - } - error={state.draftDarkLogoUrl.error} - /> - {state.draftDarkLogoUrl.value != null ? ( - <> -
-
- A url to an image of your application's logo to be used with - the dark theme. -
-
-
+ {state.newAppAuthSchema ? ( + + ) : null} -
-
brand_color
-
-
- {state.configData ? ( - <> -
- - state.draftBrandColor.setValue(color.slice(1)) - } - /> -
- - state.draftBrandColor.setValue(color.slice(1)) - } - /> - {state.draftBrandColor.value != null ? ( - <> -
-
- The brand color of your application as a hex string. -
-
-
auth_signing_key
- {state.configData ? ( - state.draftSigningKey.value !== null || - !state.configData.signing_key_exists ? ( - <> - state.draftSigningKey.setValue(key)} - error={state.draftSigningKey.error} - size={32.5} - showGenerateKey - /> -