From e7596ec2dc676344b32155058207c9b4b23c8ddb Mon Sep 17 00:00:00 2001 From: Anna No Date: Fri, 11 Aug 2023 00:46:45 +0700 Subject: [PATCH] EZQMS-236: QE templates >> Have the ability to make a section mandatory 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 f21361d4f00..12a9e2d7b4d 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 7c83b7ff4f6..8c8882966fd 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}