From 70690c03bef273ea8c3a8158826c5917e5b4deea Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Tue, 1 Oct 2024 20:07:06 +0200 Subject: [PATCH] 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} -