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)
|
$: initialiseField(field, savingColumn)
|
||||||
$: checkConstraints(editableColumn)
|
$: checkConstraints(editableColumn)
|
||||||
$: required =
|
$: required =
|
||||||
primaryDisplay || (!hasDefault && !!editableColumn?.constraints?.presence)
|
primaryDisplay ||
|
||||||
|
editableColumn?.constraints?.presence === true ||
|
||||||
|
editableColumn?.constraints?.presence?.allowEmpty === false
|
||||||
$: uneditable =
|
$: uneditable =
|
||||||
$tables.selected?._id === TableNames.USERS &&
|
$tables.selected?._id === TableNames.USERS &&
|
||||||
UNEDITABLE_USER_FIELDS.includes(editableColumn.name)
|
UNEDITABLE_USER_FIELDS.includes(editableColumn.name)
|
||||||
|
|
Loading…
Reference in New Issue