From baa088049a98d9814134fc07b9e992838e9f18d5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 27 Sep 2024 08:33:09 +0100 Subject: [PATCH] Account for both shapes of the required constraint and ensure required trumps default values --- .../backend/DataTable/modals/CreateEditColumn.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index c4c3d661a3..05e0eba042 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -137,7 +137,9 @@ $: initialiseField(field, savingColumn) $: checkConstraints(editableColumn) $: required = - primaryDisplay || (!hasDefault && !!editableColumn?.constraints?.presence) + primaryDisplay || + editableColumn?.constraints?.presence === true || + editableColumn?.constraints?.presence?.allowEmpty === false $: uneditable = $tables.selected?._id === TableNames.USERS && UNEDITABLE_USER_FIELDS.includes(editableColumn.name)