From e9f03649bd7b4a31d3f81a841a7865e643f0c086 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 13 Mar 2024 16:37:32 +0100 Subject: [PATCH] Send maximum to dropzone --- packages/bbui/src/Form/Core/Dropzone.svelte | 4 +++- .../src/components/grid/cells/AttachmentCell.svelte | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 2bd95df516..3d803c0961 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -197,7 +197,9 @@ > - + {#if maximum !== 1} + + {/if} {:else if value?.length} {#each value as file} diff --git a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte b/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte index e6c9e53c75..a1f5c4f2aa 100644 --- a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte @@ -9,6 +9,7 @@ export let api export let invertX = false export let invertY = false + export let schema const { API, notifications } = getContext("grid") const imageExtensions = ["png", "tiff", "gif", "raw", "jpg", "jpeg"] @@ -97,6 +98,7 @@ {value} compact on:change={e => onChange(e.detail)} + maximum={schema.constraints?.length?.maximum} {processFiles} {deleteAttachments} {handleFileTooLarge}