From 382079df690f0cc55b0f83da974f47678c498c63 Mon Sep 17 00:00:00 2001 From: jaggarnaut Date: Wed, 20 Nov 2024 16:18:58 +0100 Subject: [PATCH 01/10] moved error alert into form wrapper and hide close button on error --- src/components/form/KlasseForm.vue | 120 ++++---- src/components/form/RolleForm.vue | 296 ++++++++++--------- src/views/admin/KlasseCreationView.vue | 31 +- src/views/admin/PersonCreationView.vue | 225 +++++++------- src/views/admin/PersonDetailsView.vue | 31 +- src/views/admin/SchuleCreationView.vue | 185 ++++++------ src/views/admin/rollen/RolleCreationView.vue | 32 +- 7 files changed, 468 insertions(+), 452 deletions(-) diff --git a/src/components/form/KlasseForm.vue b/src/components/form/KlasseForm.vue index 29276c8d8..fab343086 100644 --- a/src/components/form/KlasseForm.vue +++ b/src/components/form/KlasseForm.vue @@ -14,6 +14,7 @@ const personenkontextStore: PersonenkontextStore = usePersonenkontextStore(); type Props = { + errorCode?: string; schulen?: Array<{ value: string; title: string }>; readonly?: boolean; selectedSchuleProps?: BaseFieldProps & { error: boolean; 'error-messages': Array }; @@ -82,70 +83,75 @@ :confirmUnsavedChangesAction="onHandleConfirmUnsavedChanges" :createButtonLabel="$t('admin.klasse.create')" :discardButtonLabel="$t('admin.klasse.discard')" - :hideActions="readonly" + :hideActions="readonly || !!props.errorCode" id="klasse-form" :onDiscard="onHandleDiscard" @onShowDialogChange="onShowDialogChange" :onSubmit="onSubmit" :showUnsavedChangesDialog="showUnsavedChangesDialog" > - - -

1. {{ $t('admin.schule.assignSchule') }}

-
- - - + + - - -

2. {{ $t('admin.klasse.enterKlassenname') }}

-
- - - + diff --git a/src/components/form/RolleForm.vue b/src/components/form/RolleForm.vue index c4cc3d8be..0c085b4f0 100644 --- a/src/components/form/RolleForm.vue +++ b/src/components/form/RolleForm.vue @@ -9,6 +9,7 @@ type Props = { administrationsebenen?: Array<{ value: string; title: string }>; readonly?: boolean; + errorCode?: string; selectedAdministrationsebeneProps?: BaseFieldProps & { error: boolean; 'error-messages': Array }; selectedRollenArtProps?: BaseFieldProps & { error: boolean; 'error-messages': Array }; selectedRollenNameProps?: BaseFieldProps & { error: boolean; 'error-messages': Array }; @@ -27,7 +28,7 @@ onSubmit: () => void; }; - defineProps(); + const props: Props = defineProps(); // Define the V-model for each field so the parent component can pass in the values for it. const selectedAdministrationsebene: ModelRef = @@ -44,7 +45,7 @@ :confirmUnsavedChangesAction="onHandleConfirmUnsavedChanges" :createButtonLabel="$t('admin.rolle.create')" :discardButtonLabel="$t('admin.rolle.discard')" - :hideActions="readonly" + :hideActions="readonly || !!props.errorCode" id="rolle-form" :onDiscard="onHandleDiscard" @onShowDialogChange="onShowDialogChange" @@ -52,177 +53,182 @@ ref="form-wrapper" :showUnsavedChangesDialog="showUnsavedChangesDialog" > - - -

1. {{ $t('admin.administrationsebene.assignAdministrationsebene') }}

-
- - - + + - - -

2. {{ $t('admin.rolle.assignRollenart') }}

-
- - - - - diff --git a/src/views/admin/KlasseCreationView.vue b/src/views/admin/KlasseCreationView.vue index 51ff76f52..aee31555e 100644 --- a/src/views/admin/KlasseCreationView.vue +++ b/src/views/admin/KlasseCreationView.vue @@ -155,27 +155,16 @@ {{ $t('admin.headline') }} - - - -