feat: save edited custom object (#2204)

Closes #2153

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
Thaïs
2023-10-24 08:33:35 +02:00
committed by GitHub
parent 291feae595
commit 7a3338b4de
4 changed files with 104 additions and 30 deletions

View File

@ -23,16 +23,16 @@ export const SettingsNewObject = () => {
const [customFormValues, setCustomFormValues] = useState<
Partial<{
pluralName: string;
singularName: string;
labelPlural: string;
labelSingular: string;
description: string;
}>
>({});
const canSave =
selectedObjectType === 'Custom' &&
!!customFormValues.pluralName &&
!!customFormValues.singularName;
!!customFormValues.labelPlural &&
!!customFormValues.labelSingular;
return (
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
@ -64,10 +64,10 @@ export const SettingsNewObject = () => {
</Section>
{selectedObjectType === 'Custom' && (
<>
<SettingsObjectIconSection label={customFormValues.pluralName} />
<SettingsObjectIconSection label={customFormValues.labelPlural} />
<SettingsObjectFormSection
singularName={customFormValues.singularName}
pluralName={customFormValues.pluralName}
singularName={customFormValues.labelSingular}
pluralName={customFormValues.labelPlural}
description={customFormValues.description}
onChange={(formValues) => {
setCustomFormValues((previousValues) => ({