From 281cd65f4a6d5ecef57e63ac3146499214cc0592 Mon Sep 17 00:00:00 2001 From: Anna No Date: Fri, 11 Aug 2023 14:22:56 +0700 Subject: [PATCH] EZQMS-236: QE templates >> Have the ability to make a section mandatory (#3581) Signed-off-by: Anna No --- packages/ui/src/components/Component.svelte | 2 ++ .../src/components/Attachments.svelte | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/ui/src/components/Component.svelte b/packages/ui/src/components/Component.svelte index f21361d4f0..12a9e2d7b4 100644 --- a/packages/ui/src/components/Component.svelte +++ b/packages/ui/src/components/Component.svelte @@ -52,6 +52,7 @@ on:click on:delete on:action + on:valid > @@ -67,6 +68,7 @@ on:click on:delete on:action + on:valid /> {/if} diff --git a/plugins/attachment-resources/src/components/Attachments.svelte b/plugins/attachment-resources/src/components/Attachments.svelte index 7c83b7ff4f..8c8882966f 100644 --- a/plugins/attachment-resources/src/components/Attachments.svelte +++ b/plugins/attachment-resources/src/components/Attachments.svelte @@ -75,6 +75,11 @@ function openFile () { inputFile.click() } + + function updateContent (evt: CustomEvent) { + attachments = evt.detail.length + dispatch('attachments', evt.detail) + }
(wSection = element.clientWidth)}> @@ -151,9 +156,7 @@ options={{ sort: { pinned: -1 } }} query={{ ...query, attachedTo: objectId }} loadingProps={{ length: attachments ?? 0 }} - on:content={(evt) => { - attachments = evt.detail.length - }} + on:content={updateContent} {readonly} /> @@ -175,9 +178,7 @@ options={{ sort: { pinned: -1 } }} query={{ ...query, attachedTo: objectId }} loadingProps={{ length: attachments ?? 0 }} - on:content={(evt) => { - attachments = evt.detail.length - }} + on:content={updateContent} {readonly} /> {/if}