Fix object model settings label synchronization (#11708)
# Introduction Closes https://github.com/twentyhq/twenty/issues/11150
This commit is contained in:
@ -100,7 +100,9 @@ export const SettingsDataModelObjectAboutForm = ({
|
|||||||
setValue('labelPlural', labelPluralFromSingularLabel, {
|
setValue('labelPlural', labelPluralFromSingularLabel, {
|
||||||
shouldDirty: true,
|
shouldDirty: true,
|
||||||
});
|
});
|
||||||
fillNamePluralFromLabelPlural(labelPluralFromSingularLabel);
|
if (isLabelSyncedWithName) {
|
||||||
|
fillNamePluralFromLabelPlural(labelPluralFromSingularLabel);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fillNameSingularFromLabelSingular = (
|
const fillNameSingularFromLabelSingular = (
|
||||||
@ -318,17 +320,19 @@ export const SettingsDataModelObjectAboutForm = ({
|
|||||||
advancedMode
|
advancedMode
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
onChange(value);
|
onChange(value);
|
||||||
onNewDirtyField?.();
|
const isCustomObject =
|
||||||
|
isDefined(objectMetadataItem) &&
|
||||||
|
objectMetadataItem.isCustom;
|
||||||
|
const isbeingCreatedObject =
|
||||||
|
!isDefined(objectMetadataItem);
|
||||||
if (
|
if (
|
||||||
value === true &&
|
value === true &&
|
||||||
((isDefined(objectMetadataItem) &&
|
(isCustomObject || isbeingCreatedObject)
|
||||||
objectMetadataItem.isCustom) ||
|
|
||||||
!isDefined(objectMetadataItem))
|
|
||||||
) {
|
) {
|
||||||
fillNamePluralFromLabelPlural(labelPlural);
|
fillNamePluralFromLabelPlural(labelPlural);
|
||||||
fillNameSingularFromLabelSingular(labelSingular);
|
fillNameSingularFromLabelSingular(labelSingular);
|
||||||
}
|
}
|
||||||
|
onNewDirtyField?.();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user