Fix support custom object renaming (#8089)

In this PR
1) (FE) fixing update of name not taken into account if toggle value is
changed in the same transaction
2) (BE) moving same nameSingular and namePlural validation before
effective update
This commit is contained in:
Marie
2024-10-27 14:56:08 +01:00
committed by GitHub
parent 80b831d26c
commit a72f51ae6c
3 changed files with 38 additions and 25 deletions

View File

@ -102,6 +102,8 @@ const StyledLabel = styled.span`
const infoCircleElementId = 'info-circle-id';
export const IS_LABEL_SYNCED_WITH_NAME_LABEL = 'isLabelSyncedWithName';
export const SettingsDataModelObjectAboutForm = ({
disabled,
disableNameEdit,
@ -115,7 +117,7 @@ export const SettingsDataModelObjectAboutForm = ({
isAdvancedModeEnabled,
);
const isLabelSyncedWithName = watch('isLabelSyncedWithName');
const isLabelSyncedWithName = watch(IS_LABEL_SYNCED_WITH_NAME_LABEL);
const labelSingular = watch('labelSingular');
const labelPlural = watch('labelPlural');
const apiNameTooltipText = isLabelSyncedWithName
@ -318,7 +320,7 @@ export const SettingsDataModelObjectAboutForm = ({
),
)}
<Controller
name="isLabelSyncedWithName"
name={IS_LABEL_SYNCED_WITH_NAME_LABEL}
control={control}
defaultValue={
objectMetadataItem?.isLabelSyncedWithName ?? true