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:
Félix Malfait
2025-07-08 12:29:46 +02:00
committed by GitHub
parent a5deddaffd
commit 4a3a897a65

View File

@ -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 }))