Deleted at improvement (#16732)

Disable Deactivate option for all standard fields

#16706 

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Prevents deactivation UI for standard system fields on the field edit
page.
> 
> - Introduces `canFieldBeDeactivated` to flag standard fields
(`createdAt`, `createdBy`, `deletedAt`, `updatedAt`)
> - Hides the "Danger zone" (deactivate/activate/delete controls) when
`!isLabelIdentifier && !readonly && !canFieldBeDeactivated`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b309815700555c8e0f28324936e4ddd313a24fb6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
BOHEUS
2025-12-30 16:52:17 +00:00
committed by GitHub
parent 61addf8b62
commit a2872b02ed
@@ -142,6 +142,17 @@ export const SettingsObjectFieldEdit = () => {
objectMetadataItem: objectMetadataItem,
});
const fieldNamesThatCannotBeDeactivated = [
'createdAt',
'createdBy',
'deletedAt',
'updatedAt',
];
const fieldCanBeDeactivated = !fieldNamesThatCannotBeDeactivated.includes(
fieldMetadataItem.name,
);
const handleSave = async (
formValues: SettingsDataModelFieldEditFormValues,
) => {
@@ -372,7 +383,7 @@ export const SettingsObjectFieldEdit = () => {
/>
</Section>
{!isLabelIdentifier && !readonly && (
{!isLabelIdentifier && !readonly && fieldCanBeDeactivated && (
<Section>
<H2Title
title={t`Danger zone`}