From b5ab4b90a03a264dc37dc1b03fab7b06df41d5df Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 13 Mar 2024 15:46:22 +0100 Subject: [PATCH] Multiple attachments flags --- .../DataTable/modals/CreateEditColumn.svelte | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index c866f45e46..0aeaa105de 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -170,6 +170,10 @@ relationshipPart1 = part1 relationshipPart2 = part2 } + } else if (editableColumn.type === FieldType.ATTACHMENT) { + editableColumn.constraints ??= { length: {} } + editableColumn.constraints.length ??= {} + editableColumn.constraints.length.maximum = 1 } } @@ -710,6 +714,21 @@ thin text="Allow multiple users" /> + {:else if editableColumn.type === FieldType.ATTACHMENT} + { + if (!e.detail) { + editableColumn.constraints ??= { length: {} } + editableColumn.constraints.length ??= {} + editableColumn.constraints.length.maximum = 1 + } else { + delete editableColumn.constraints?.length?.maximum + } + }} + thin + text="Multiple attachments" + /> {/if} {#if editableColumn.type === AUTO_TYPE || editableColumn.autocolumn}