[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:
@ -1,8 +0,0 @@
|
||||
import { getFieldSlug } from '@/object-metadata/utils/getFieldSlug';
|
||||
|
||||
describe('getFieldSlug', () => {
|
||||
it('should work as expected', () => {
|
||||
const res = getFieldSlug({ label: 'Pipeline Step' });
|
||||
expect(res).toBe('pipeline-step');
|
||||
});
|
||||
});
|
||||
@ -1,13 +0,0 @@
|
||||
import { getObjectSlug } from '@/object-metadata/utils/getObjectSlug';
|
||||
import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';
|
||||
|
||||
describe('getObjectSlug', () => {
|
||||
it('should work as expected', () => {
|
||||
const objectMetadataItem = generatedMockObjectMetadataItems.find(
|
||||
(item) => item.nameSingular === 'person',
|
||||
)!;
|
||||
|
||||
const res = getObjectSlug(objectMetadataItem);
|
||||
expect(res).toBe('people');
|
||||
});
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import toKebabCase from 'lodash.kebabcase';
|
||||
|
||||
import { Field } from '~/generated-metadata/graphql';
|
||||
|
||||
export const getFieldSlug = (metadataField: Pick<Field, 'label'>) =>
|
||||
toKebabCase(metadataField.label);
|
||||
@ -1,7 +0,0 @@
|
||||
import toKebabCase from 'lodash.kebabcase';
|
||||
|
||||
import { ObjectMetadataItem } from '../types/ObjectMetadataItem';
|
||||
|
||||
export const getObjectSlug = (
|
||||
objectMetadataItem: Pick<ObjectMetadataItem, 'namePlural'>,
|
||||
) => toKebabCase(objectMetadataItem.namePlural);
|
||||
Reference in New Issue
Block a user