Multiple attachments flags

This commit is contained in:
Adria Navarro 2024-03-13 15:46:22 +01:00
parent fa84b3fbc2
commit b5ab4b90a0
1 changed files with 19 additions and 0 deletions

View File

@ -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}
<Toggle
value={editableColumn.constraints?.length?.maximum !== 1}
on:change={e => {
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}
<Select