Set createdAt and updatedAt as readonly on the frontend (#13096)
This is not the prettiest fix but it's the 5th time I get the feedback from a user that these fields should be readonly, let's have a special case for them --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -65,6 +65,16 @@ export const isFieldValueReadOnly = ({
|
||||
return true;
|
||||
}
|
||||
|
||||
const isFieldDateOrDateTime =
|
||||
fieldType === FieldMetadataType.DATE ||
|
||||
fieldType === FieldMetadataType.DATE_TIME;
|
||||
const isFieldCreatedAtOrUpdatedAt =
|
||||
fieldName === 'createdAt' || fieldName === 'updatedAt';
|
||||
|
||||
if (isFieldDateOrDateTime && isFieldCreatedAtOrUpdatedAt) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
isDefined(fieldType) &&
|
||||
(isFieldActor({ type: fieldType }) || isFieldRichText({ type: fieldType }))
|
||||
|
||||
Reference in New Issue
Block a user