[REFACTOR][FRONT]: Remove objectMetadata and fieldMetadata sluggification (#9441)

# Introduction
For motivations and context please have a look to
https://github.com/twentyhq/twenty/pull/9394 whom this PR results from.
In this pull-request we remove any `metadataField` and `objectMetadata`
sluggification. We directly consume `objectMetadata.namePlural` and
`metadataField.name`, ***it seems like that historically the consumed
`metadataField.name`*** are we sure that we wanna change this behavior ?

## Notes
Unless I'm mistaken by reverting the `kebabcase` url formatting we might
be creating deadlinks that user could have save beforehand => Discussed
with Charles said it's controlled risk.

---------

Co-authored-by: Paul Rastoin <paulrastoin@Pauls-MacBook-Pro.local>
This commit is contained in:
Paul Rastoin
2025-01-08 11:31:53 +01:00
committed by GitHub
parent 00a9646d68
commit aa0d8546a8
31 changed files with 98 additions and 156 deletions

View File

@ -26,7 +26,7 @@ type SettingsObjectNewFieldSelectorProps = {
'defaultValue' | 'options' | 'type'
>;
objectSlug: string;
objectNamePlural: string;
};
const StyledTypeSelectContainer = styled.div`
@ -58,7 +58,7 @@ const StyledSearchInput = styled(TextInput)`
export const SettingsObjectNewFieldSelector = ({
excludedFieldTypes = [],
fieldMetadataItem,
objectSlug,
objectNamePlural,
}: SettingsObjectNewFieldSelectorProps) => {
const theme = useTheme();
const { control, setValue } =
@ -128,7 +128,7 @@ export const SettingsObjectNewFieldSelector = ({
.map(([key, config]) => (
<StyledCardContainer key={key}>
<UndecoratedLink
to={`/settings/objects/${objectSlug}/new-field/configure?fieldType=${key}`}
to={`/settings/objects/${objectNamePlural}/new-field/configure?fieldType=${key}`}
fullWidth
onClick={() => {
setValue('type', key as SettingsFieldType);