From 8d383e87b55aa4b46593912905118179c30e9517 Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Thu, 26 Dec 2024 10:37:24 +0700 Subject: [PATCH] =?UTF-8?q?Wohnfl=C3=A4che=20gr=C3=B6=C3=9Fer=20Nutzfl?= =?UTF-8?q?=C3=A4che=20Fehler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Notifications/RawNotification.svelte | 50 +++++++++---------- .../VerbrauchsausweisWohnenModule.svelte | 16 +++--- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/components/Notifications/RawNotification.svelte b/src/components/Notifications/RawNotification.svelte index f63a6150..9b51dfb1 100644 --- a/src/components/Notifications/RawNotification.svelte +++ b/src/components/Notifications/RawNotification.svelte @@ -4,6 +4,29 @@ import { fly } from "svelte/transition"; export let notification: Partial & { uid: string }; + + function focusSelector() { + const element = document.querySelector(notification.selector as string) as HTMLElement | null; + + if (!element) { + return + } + + element.classList.add("bg-red-300") + + element.scrollIntoView({ + behavior: "smooth", + block: "center", + inline: "center" + }) + + element.focus() + deleteNotification(notification.uid) + + setTimeout(() => { + element?.classList.remove("bg-red-300") + }, 3000) + }

{@html notification.message} {#if notification.selector} - + {/if}

diff --git a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte index 92dd68c7..551ec6f1 100644 --- a/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte +++ b/src/modules/VerbrauchsausweisWohnen/VerbrauchsausweisWohnenModule.svelte @@ -339,6 +339,7 @@ xs:grid-cols-2" uid: "WOHNFLAECHE_GLEICH_GESAMTFLAECHE", dismissable: true, type: "warning", + selector: "input[name='nutzflaeche']" }} > Die angegebene Gesamtfläche ist gleich der angegebenen Wohnfläche, in den meisten Fällen sollte die Gesamtfläche größer sein. @@ -579,18 +580,13 @@ xs:grid-cols-2" message: "Plausibilitätsprüfung", timeout: 0, uid: "WOHNFLAECHE_GROESSER_GESAMTFLAECHE", - dismissable: true, - onUserDismiss: () => { - hidden.add(AuditType.WOHNFLAECHE_GROESSER_GESAMTFLAECHE); - gebaeude = gebaeude; - }, - type: "warning", + dismissable: false, + type: "error", + selector: "input[name='nutzflaeche']" + }} > Die Wohnfläche darf nicht größer als die Nutzfläche sein. {/if} - - - + \ No newline at end of file