Account for both shapes of the required constraint and ensure required trumps default values
This commit is contained in:
parent
40372841d8
commit
baa088049a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue