From 6d5adcf8bb3338e5d6bbd4d362e41d6dff29fa83 Mon Sep 17 00:00:00 2001 From: Sebastian Jeltsch Date: Thu, 13 Nov 2025 13:28:07 +0100 Subject: [PATCH] More consistent layout in admin UI's auth settings. --- .../src/components/settings/AuthSettings.tsx | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/crates/assets/js/admin/src/components/settings/AuthSettings.tsx b/crates/assets/js/admin/src/components/settings/AuthSettings.tsx index 6be4b969..82c30845 100644 --- a/crates/assets/js/admin/src/components/settings/AuthSettings.tsx +++ b/crates/assets/js/admin/src/components/settings/AuthSettings.tsx @@ -1,7 +1,14 @@ import { createMemo, For, Suspense, Switch, Show, Match, JSX } from "solid-js"; import { useQuery } from "@tanstack/solid-query"; import { createForm } from "@tanstack/solid-form"; -import { TbInfoCircle } from "solid-icons/tb"; +import { + TbArrowBackUp, + TbCircle, + TbCircleCheck, + TbCirclePlus, + TbTrash, + TbInfoCircle, +} from "solid-icons/tb"; import { buildOptionalIntegerFormField, @@ -10,13 +17,6 @@ import { buildOptionalSecretFormField, buildOptionalTextFormField, } from "@/components/FormFields"; -import { - TbCircleCheck, - TbCircle, - TbCirclePlus, - TbArrowBackUp, - TbTrash, -} from "solid-icons/tb"; import { Accordion, AccordionContent, @@ -25,6 +25,7 @@ import { } from "@/components/ui/accordion"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; import { Tooltip, TooltipContent, @@ -278,24 +279,6 @@ function ProviderSettingsSubForm(props: { ); } -function InfoTooltip(props: { - label: string; - children: string; - class?: string; -}) { - return ( - - - {props.label} - - - -
{props.children}
-
-
- ); -} - function createAuthSettingsForm(opts: { config: () => Config; values: () => AuthConfigProxy; @@ -394,7 +377,7 @@ function AuthSettingsForm(props: { {buildOptionalIntegerFormField({ placeholder: `${60 * 60}`, label: () => ( - + Tokens older than this TTL are considered invalid. A new AuthToken can be minted given a valid refresh Token. @@ -406,7 +389,7 @@ function AuthSettingsForm(props: { {buildOptionalIntegerFormField({ placeholder: `${30 * 24 * 60 * 60}`, label: () => ( - + Refresh tokens older than this TTL are considered invalid. A refresh token can be renewed by users logging in again. @@ -427,10 +410,7 @@ function AuthSettingsForm(props: { {buildOptionalBoolFormField({ label: () => ( - + When disabled new users will only be able to sign up using OAuth. Existing users can continue to sign in using password-based auth. @@ -444,7 +424,7 @@ function AuthSettingsForm(props: { integer: true, placeholder: "8", label: () => ( - + Minimal length for new passwords. Does not affect existing registrations unless users choose to change their password. @@ -456,7 +436,7 @@ function AuthSettingsForm(props: { {buildOptionalBoolFormField({ label: () => ( - + Passwords must contain both, upper and lower case characters. Does not affect existing registrations unless users choose to change their password. @@ -468,7 +448,7 @@ function AuthSettingsForm(props: { {buildOptionalBoolFormField({ label: () => ( - + Passwords must contain digits. Does not affect existing registrations unless users choose to change their password. @@ -480,7 +460,7 @@ function AuthSettingsForm(props: { {buildOptionalBoolFormField({ label: () => ( - + Passwords must contain special, i.e., non-alphanumeric characters. Does not affect existing registrations unless users choose to change their password. @@ -686,8 +666,32 @@ export function AuthSettings(props: { ); } -function L(props: { children: JSX.Element }) { - return
{props.children}
; +function InfoTooltip(props: { + label: string; + children: string; + class?: string; +}) { + return ( + + +
+ {props.label} + + +
+
+ + +
{props.children}
+
+
+ ); } -const labelStyle = "w-32 h-[44px] flex items-center"; +function L(props: { children: JSX.Element }) { + return ( +
+ +
+ ); +}