From 0083569606516247e758141a04a4a1854151b39d Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:58:59 +0200 Subject: [PATCH] Fix object model settings label synchronization (#11708) # Introduction Closes https://github.com/twentyhq/twenty/issues/11150 --- .../SettingsDataModelObjectAboutForm.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx index 86f128896..afbc3f9d9 100644 --- a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx @@ -100,7 +100,9 @@ export const SettingsDataModelObjectAboutForm = ({ setValue('labelPlural', labelPluralFromSingularLabel, { shouldDirty: true, }); - fillNamePluralFromLabelPlural(labelPluralFromSingularLabel); + if (isLabelSyncedWithName) { + fillNamePluralFromLabelPlural(labelPluralFromSingularLabel); + } }; const fillNameSingularFromLabelSingular = ( @@ -318,17 +320,19 @@ export const SettingsDataModelObjectAboutForm = ({ advancedMode onChange={(value) => { onChange(value); - onNewDirtyField?.(); - + const isCustomObject = + isDefined(objectMetadataItem) && + objectMetadataItem.isCustom; + const isbeingCreatedObject = + !isDefined(objectMetadataItem); if ( value === true && - ((isDefined(objectMetadataItem) && - objectMetadataItem.isCustom) || - !isDefined(objectMetadataItem)) + (isCustomObject || isbeingCreatedObject) ) { fillNamePluralFromLabelPlural(labelPlural); fillNameSingularFromLabelSingular(labelSingular); } + onNewDirtyField?.(); }} />