fix: made standard object labels editable (#15388)
Fixes #15302 ## Video ( Fixed ) : [Uploading IssueFixed.mov…](https://drive.google.com/file/d/1XNk3i3ae9Wafelqgbj5GujaPAJRQRcQh/view?usp=sharing) --------- Co-authored-by: prastoin <paul@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ export const SettingsUpdateDataModelObjectAboutForm = ({
|
||||
<FormProvider {...formConfig}>
|
||||
<SettingsDataModelObjectAboutForm
|
||||
onNewDirtyField={() => formConfig.handleSubmit(handleSave)()}
|
||||
disableEdition={!objectMetadataItem.isCustom || readonly}
|
||||
disableEdition={readonly}
|
||||
objectMetadataItem={objectMetadataItem}
|
||||
/>
|
||||
</FormProvider>
|
||||
|
||||
+9
-15
@@ -81,6 +81,8 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
const isLabelSyncedWithName = watch('isLabelSyncedWithName');
|
||||
const labelSingular = watch('labelSingular');
|
||||
const labelPlural = watch('labelPlural');
|
||||
const isStandardObject =
|
||||
isDefined(objectMetadataItem?.isCustom) && !objectMetadataItem.isCustom;
|
||||
watch('nameSingular');
|
||||
watch('namePlural');
|
||||
watch('description');
|
||||
@@ -173,12 +175,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
}
|
||||
}}
|
||||
onBlur={() => onNewDirtyField?.()}
|
||||
disabled={
|
||||
disableEdition ||
|
||||
(objectMetadataItem &&
|
||||
!objectMetadataItem?.isCustom &&
|
||||
isLabelSyncedWithName)
|
||||
}
|
||||
disabled={disableEdition}
|
||||
fullWidth
|
||||
maxLength={OBJECT_NAME_MAXIMUM_LENGTH}
|
||||
/>
|
||||
@@ -205,12 +202,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
}
|
||||
}}
|
||||
onBlur={() => onNewDirtyField?.()}
|
||||
disabled={
|
||||
disableEdition ||
|
||||
(objectMetadataItem &&
|
||||
!objectMetadataItem?.isCustom &&
|
||||
isLabelSyncedWithName)
|
||||
}
|
||||
disabled={disableEdition}
|
||||
fullWidth
|
||||
maxLength={OBJECT_NAME_MAXIMUM_LENGTH}
|
||||
/>
|
||||
@@ -242,7 +234,8 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
'nameSingular' as const satisfies StringKeyOf<ObjectMetadataItem>,
|
||||
placeholder: `listing`,
|
||||
defaultValue: objectMetadataItem?.nameSingular ?? '',
|
||||
disableEdition: disableEdition || isLabelSyncedWithName,
|
||||
disableEdition:
|
||||
isStandardObject || disableEdition || isLabelSyncedWithName,
|
||||
tooltip: apiNameTooltipText,
|
||||
},
|
||||
{
|
||||
@@ -251,7 +244,8 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
'namePlural' as const satisfies StringKeyOf<ObjectMetadataItem>,
|
||||
placeholder: `listings`,
|
||||
defaultValue: objectMetadataItem?.namePlural ?? '',
|
||||
disableEdition: disableEdition || isLabelSyncedWithName,
|
||||
disableEdition:
|
||||
isStandardObject || disableEdition || isLabelSyncedWithName,
|
||||
tooltip: apiNameTooltipText,
|
||||
},
|
||||
].map(
|
||||
@@ -319,7 +313,7 @@ export const SettingsDataModelObjectAboutForm = ({
|
||||
</AdvancedSettingsWrapper>
|
||||
),
|
||||
)}
|
||||
{(!objectMetadataItem || objectMetadataItem?.isCustom) && (
|
||||
{!isStandardObject && (
|
||||
<AdvancedSettingsWrapper>
|
||||
<Controller
|
||||
name="isLabelSyncedWithName"
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ const coreObjectNames = [
|
||||
'billingSubscriptionItems',
|
||||
'featureFlag',
|
||||
'featureFlags',
|
||||
'job',
|
||||
'jobs',
|
||||
'keyValuePair',
|
||||
'keyValuePairs',
|
||||
'postgresCredential',
|
||||
|
||||
Reference in New Issue
Block a user