feat: create custom object and update edited object names (#2220)

Closes #2155, Closes #2153
This commit is contained in:
Thaïs
2023-10-26 11:04:16 +02:00
committed by GitHub
parent 0b33880cc9
commit 2b1945a3e1
22 changed files with 214 additions and 73 deletions

View File

@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import { validateMetadataObjectLabel } from '@/metadata/utils/validateMetadataObjectLabel';
import { H2Title } from '@/ui/display/typography/components/H2Title';
import { TextArea } from '@/ui/input/components/TextArea';
import { TextInput } from '@/ui/input/components/TextInput';
@ -43,7 +44,11 @@ export const SettingsObjectFormSection = ({
label="Singular"
placeholder="Investor"
value={singularName}
onChange={(value) => onChange?.({ labelSingular: value })}
onChange={(value) => {
if (!value || validateMetadataObjectLabel(value)) {
onChange?.({ labelSingular: value });
}
}}
disabled={disabled}
fullWidth
/>
@ -51,7 +56,11 @@ export const SettingsObjectFormSection = ({
label="Plural"
placeholder="Investors"
value={pluralName}
onChange={(value) => onChange?.({ labelPlural: value })}
onChange={(value) => {
if (!value || validateMetadataObjectLabel(value)) {
onChange?.({ labelPlural: value });
}
}}
disabled={disabled}
fullWidth
/>