[fix] Support non latin characters in schema names (#5063)

Fixes #4943

## How was it tested?
Local (front + /metadata)
Unit tests for utils

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Marie
2024-04-23 13:37:29 +02:00
committed by GitHub
parent 824786ff04
commit ff39ba5a15
16 changed files with 236 additions and 13 deletions

View File

@ -3,6 +3,7 @@ import styled from '@emotion/styled';
import { z } from 'zod';
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { validateMetadataLabel } from '@/object-metadata/utils/validateMetadataLabel';
import { objectMetadataItemSchema } from '@/object-metadata/validation-schemas/objectMetadataItemSchema';
import { IconPicker } from '@/ui/input/components/IconPicker';
import { TextArea } from '@/ui/input/components/TextArea';
@ -92,7 +93,11 @@ export const SettingsDataModelObjectAboutForm = ({
label={label}
placeholder={placeholder}
value={value}
onChange={onChange}
onChange={(value) => {
if (!value || validateMetadataLabel(value)) {
onChange?.(value);
}
}}
disabled={disabled}
fullWidth
/>