From 3110eb833f154ffd00c37db86e375cae3c7bac0b Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Mon, 30 Sep 2024 20:19:50 +0200 Subject: [PATCH 01/13] Fix clicking cancel opens a native confirmation in requirement assessment edit view --- frontend/src/lib/components/Forms/Score.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/lib/components/Forms/Score.svelte b/frontend/src/lib/components/Forms/Score.svelte index d094e05b4..2a85457a8 100644 --- a/frontend/src/lib/components/Forms/Score.svelte +++ b/frontend/src/lib/components/Forms/Score.svelte @@ -26,8 +26,6 @@ export let form: SuperForm>; const { value, errors, constraints } = formFieldProxy(form, field); - $value = $value ?? min_score; - let isScored = formFieldProxy(form, 'is_scored')['value']; if (always_enabled) { From 70690c03bef273ea8c3a8158826c5917e5b4deea Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Tue, 1 Oct 2024 20:07:06 +0200 Subject: [PATCH 02/13] Use new ModelForm structure for enterprise frontend --- .../src/lib/components/Forms/ModelForm.svelte | 1418 ----------------- .../Forms/ModelForm/FolderForm.svelte | 23 + .../src/lib/components/Forms/ModelForm.svelte | 3 + .../Forms/ModelForm/FolderForm.svelte | 4 + 4 files changed, 30 insertions(+), 1418 deletions(-) delete mode 100644 enterprise/frontend/src/lib/components/Forms/ModelForm.svelte create mode 100644 enterprise/frontend/src/lib/components/Forms/ModelForm/FolderForm.svelte create mode 100644 frontend/src/lib/components/Forms/ModelForm/FolderForm.svelte diff --git a/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte b/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte deleted file mode 100644 index 1ca3994eb..000000000 --- a/enterprise/frontend/src/lib/components/Forms/ModelForm.svelte +++ /dev/null @@ -1,1418 +0,0 @@ - - - createModalCache.deleteCache(model.urlModel)} - {...$$restProps} -> - - - - {#if shape.reference_control} - { - if (e.detail) { - await fetch(`/reference-controls/${e.detail}`) - .then((r) => r.json()) - .then((r) => { - form.form.update((currentData) => { - if ( - context === 'edit' && - currentData['reference_control'] === initialData['reference_control'] && - !updated_fields.has('reference_control') - ) { - return currentData; // Keep the current values in the edit form. - } - updated_fields.add('reference_control'); - return { ...currentData, category: r.category, csf_function: r.csf_function }; - }); - }); - } - }} - /> - {/if} - {#if shape.name} - - {/if} - {#if shape.description} -