[fix] Re-introduce beforeUpdateOneObject hook (#5495)

... and disable name edition in object edition form. This feature will
be introduced by #5491
This commit is contained in:
Marie
2024-05-21 10:46:49 +02:00
committed by GitHub
parent eb78be6c61
commit 0d16051ded
5 changed files with 23 additions and 8 deletions

View File

@ -22,6 +22,7 @@ type SettingsDataModelObjectAboutFormValues = z.infer<
type SettingsDataModelObjectAboutFormProps = {
disabled?: boolean;
disableNameEdit?: boolean;
objectMetadataItem?: ObjectMetadataItem;
};
@ -46,6 +47,7 @@ const StyledInputContainer = styled.div`
export const SettingsDataModelObjectAboutForm = ({
disabled,
disableNameEdit,
objectMetadataItem,
}: SettingsDataModelObjectAboutFormProps) => {
const { control } = useFormContext<SettingsDataModelObjectAboutFormValues>();
@ -93,7 +95,7 @@ export const SettingsDataModelObjectAboutForm = ({
placeholder={placeholder}
value={value}
onChange={onChange}
disabled={disabled}
disabled={disabled || disableNameEdit}
fullWidth
/>
)}