From 2e95fca8ad4b6d9837a603c2e0c7fcadef38ae4f Mon Sep 17 00:00:00 2001 From: lexx Date: Tue, 26 Mar 2024 01:58:05 +0200 Subject: [PATCH] edit form refactor --- front/js/svelte/common/OffCanvas.svelte | 7 +- front/js/svelte/records/Edit.svelte | 4 +- front/js/svelte/records/PreviewCard.svelte | 95 +++++++++++-------- front/js/svelte/records/form/Form.svelte | 17 ++-- front/js/svelte/records/form/FormField.svelte | 1 + .../records/form/references/EdgeData.svelte | 2 +- src/Http/Controller/RecordController.php | 1 - 7 files changed, 72 insertions(+), 55 deletions(-) diff --git a/front/js/svelte/common/OffCanvas.svelte b/front/js/svelte/common/OffCanvas.svelte index 7ed610b..035210e 100644 --- a/front/js/svelte/common/OffCanvas.svelte +++ b/front/js/svelte/common/OffCanvas.svelte @@ -1,9 +1,8 @@ -
{title}
diff --git a/front/js/svelte/records/Edit.svelte b/front/js/svelte/records/Edit.svelte index 6fe0a73..17e9978 100644 --- a/front/js/svelte/records/Edit.svelte +++ b/front/js/svelte/records/Edit.svelte @@ -20,7 +20,7 @@ function save(e) { e.preventDefault(); - + let status = e.detail.status console.log("SAVE: Attempt"); validationErrors = null; return new Promise(function (resolve, reject) { @@ -37,7 +37,7 @@ id: record.id, data: record.data, edges: replaceEdges, - status: record.status, + status: status, isCreateMode: isCreateMode, }) .then(function (response) { diff --git a/front/js/svelte/records/PreviewCard.svelte b/front/js/svelte/records/PreviewCard.svelte index d6b95bc..a3d2d53 100644 --- a/front/js/svelte/records/PreviewCard.svelte +++ b/front/js/svelte/records/PreviewCard.svelte @@ -32,55 +32,68 @@ } +
+ {#if editable} +
+
+ Edge Data +
+ +
+
+
-
+ {/if} - class="card mb-2 bg-light {classes}" - style="border-color:{schema.color ?? '#ccc'}; border-width: 1px;" -> -
- - {#if editable} - - {/if} - - - - - - - - - - - - - - - - - -
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ + {#if hasDelete} +
- {#if hasDelete} -
- {#if editable} - {/if} - -
- {/if} +
+ {/if} +