From c0ddb3ac925dd791fff3633de9d1c68a5f44ee97 Mon Sep 17 00:00:00 2001 From: Mansvini Aggarwal Date: Sun, 7 Apr 2024 18:41:11 +0530 Subject: [PATCH 1/2] Update UI of error state in form Signed-off-by: Mansvini Aggarwal --- .../src/components/Form.svelte | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/login-resources/src/components/Form.svelte b/plugins/login-resources/src/components/Form.svelte index 7f86b7a642a..c709f9f2ad1 100644 --- a/plugins/login-resources/src/components/Form.svelte +++ b/plugins/login-resources/src/components/Form.svelte @@ -66,7 +66,7 @@ $: $themeStore.language && validate($themeStore.language) - async function validate (language: string): Promise { + async function validate(language: string): Promise { if (ignoreInitialValidation) return true for (const field of fields) { const v = object[field.name] @@ -106,7 +106,7 @@ let inAction = false - function performAction (action: Action): void { + function performAction(action: Action): void { for (const field of fields) { trim(field.name) } @@ -117,7 +117,7 @@ } onMount(() => (ignoreInitialValidation = false)) - function trim (field: string): void { + function trim(field: string): void { object[field] = (object[field] as string).trim() } @@ -175,9 +175,6 @@ {/if}
{/if} -
- -
{#each fields as field (field.name)}
@@ -194,6 +191,10 @@
{/each} +
+ +
+