[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:
@ -3,7 +3,6 @@ import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
|
||||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
||||
import { getObjectSlug } from '@/object-metadata/utils/getObjectSlug';
|
||||
import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { viewObjectMetadataIdComponentState } from '@/views/states/viewObjectMetadataIdComponentState';
|
||||
@ -36,9 +35,9 @@ export const useGetAvailableFieldsForKanban = () => {
|
||||
|
||||
if (isDefined(objectMetadataItem?.namePlural)) {
|
||||
navigate(
|
||||
`/settings/objects/${getObjectSlug(
|
||||
objectMetadataItem,
|
||||
)}/new-field/configure?fieldType=${FieldMetadataType.Select}`,
|
||||
`/settings/objects/${
|
||||
objectMetadataItem.namePlural
|
||||
}/new-field/configure?fieldType=${FieldMetadataType.Select}`,
|
||||
);
|
||||
} else {
|
||||
navigate(`/settings/objects`);
|
||||
|
||||
Reference in New Issue
Block a user