From a9f869ab6b0525eb8fa9cd8a34f12288e2e038f1 Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Tue, 7 May 2024 17:10:32 +0200 Subject: [PATCH 1/9] Replace disable with deactivate or delete --- .../src/pages/settings/data-model/SettingsObjectEdit.tsx | 4 ++-- .../pages/settings/data-model/SettingsObjectFieldEdit.tsx | 7 +++++-- .../developers/api-keys/SettingsDevelopersApiKeyDetail.tsx | 2 +- .../webhooks/SettingsDevelopersWebhookDetail.tsx | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx index 417b4e8f0f7d..e5665305a72b 100644 --- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx @@ -145,10 +145,10 @@ export const SettingsObjectEdit = () => { />
- +
{!isLabelIdentifier && (
- +
)} diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx index 4ccacc014b02..ddd4528e9f76 100644 --- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx @@ -44,14 +44,14 @@ export const SettingsObjectNewFieldStep1 = () => { const activeObjectMetadataItem = findActiveObjectMetadataItemBySlug(objectSlug); - const { activateMetadataField, disableMetadataField } = + const { activateMetadataField, deactivateMetadataField } = useFieldMetadataItem(); const [metadataFields, setMetadataFields] = useState( activeObjectMetadataItem?.fields ?? [], ); const activeMetadataFields = metadataFields.filter((field) => field.isActive); - const disabledMetadataFields = metadataFields.filter( + const deactivatedMetadataFields = metadataFields.filter( (field) => !field.isActive, ); @@ -93,7 +93,7 @@ export const SettingsObjectNewFieldStep1 = () => { return metadataField.isActive ? activateMetadataField(metadataField) - : disableMetadataField(metadataField); + : deactivateMetadataField(metadataField); }), ); @@ -124,8 +124,8 @@ export const SettingsObjectNewFieldStep1 = () => { @@ -159,18 +159,18 @@ export const SettingsObjectNewFieldStep1 = () => { ))} )} - {!!disabledMetadataFields.length && ( + {!!deactivatedMetadataFields.length && ( - {disabledMetadataFields.map((disabledMetadataField) => ( + {deactivatedMetadataFields.map((deactivatedMetadataField) => ( - handleToggleField(disabledMetadataField.id) + handleToggleField(deactivatedMetadataField.id) } /> } From 0ad89ef01a8123bd4537ed50ae33eb141b04a479 Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Fri, 10 May 2024 16:31:36 +0200 Subject: [PATCH 4/9] Add relationId to payload and use it for relation delation --- packages/twenty-front/src/generated-metadata/gql.ts | 4 ++-- .../twenty-front/src/generated-metadata/graphql.ts | 5 +++-- .../src/modules/object-metadata/graphql/queries.ts | 1 + .../object-metadata/hooks/useFieldMetadataItem.ts | 11 +++-------- .../object-metadata/types/FieldMetadataItem.ts | 2 ++ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/twenty-front/src/generated-metadata/gql.ts b/packages/twenty-front/src/generated-metadata/gql.ts index df704d711798..015c5054fd6a 100644 --- a/packages/twenty-front/src/generated-metadata/gql.ts +++ b/packages/twenty-front/src/generated-metadata/gql.ts @@ -31,7 +31,7 @@ const documents = { "\n mutation DeleteOneObjectMetadataItem($idToDelete: UUID!) {\n deleteOneObject(input: { id: $idToDelete }) {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isActive\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n }\n }\n": types.DeleteOneObjectMetadataItemDocument, "\n mutation DeleteOneFieldMetadataItem($idToDelete: UUID!) {\n deleteOneField(input: { id: $idToDelete }) {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isNullable\n createdAt\n updatedAt\n }\n }\n": types.DeleteOneFieldMetadataItemDocument, "\n mutation DeleteOneRelationMetadataItem($idToDelete: UUID!) {\n deleteOneRelation(input: { id: $idToDelete }) {\n id\n }\n }\n": types.DeleteOneRelationMetadataItemDocument, - "\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n": types.ObjectMetadataItemsDocument, + "\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n": types.ObjectMetadataItemsDocument, }; /** @@ -123,7 +123,7 @@ export function graphql(source: "\n mutation DeleteOneRelationMetadataItem($idT /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"): (typeof documents)["\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"]; +export function graphql(source: "\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"): (typeof documents)["\n query ObjectMetadataItems(\n $objectFilter: objectFilter\n $fieldFilter: fieldFilter\n ) {\n objects(paging: { first: 1000 }, filter: $objectFilter) {\n edges {\n node {\n id\n dataSourceId\n nameSingular\n namePlural\n labelSingular\n labelPlural\n description\n icon\n isCustom\n isRemote\n isActive\n isSystem\n createdAt\n updatedAt\n labelIdentifierFieldMetadataId\n imageIdentifierFieldMetadataId\n fields(paging: { first: 1000 }, filter: $fieldFilter) {\n edges {\n node {\n id\n type\n name\n label\n description\n icon\n isCustom\n isActive\n isSystem\n isNullable\n createdAt\n updatedAt\n fromRelationMetadata {\n id\n relationType\n toObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n toFieldMetadataId\n }\n toRelationMetadata {\n id\n relationType\n fromObjectMetadata {\n id\n dataSourceId\n nameSingular\n namePlural\n isSystem\n isRemote\n }\n fromFieldMetadataId\n }\n defaultValue\n options\n relationDefinition {\n relationId\n direction\n sourceObjectMetadata {\n id\n nameSingular\n namePlural\n }\n sourceFieldMetadata {\n id\n name\n }\n targetObjectMetadata {\n id\n nameSingular\n namePlural\n }\n targetFieldMetadata {\n id\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index 08e80ab4d9ee..c1fe719fd4d6 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -756,6 +756,7 @@ export type RelationConnection = { export type RelationDefinition = { __typename?: 'RelationDefinition'; direction: RelationDefinitionType; + relationId: Scalars['UUID']['output']; sourceFieldMetadata: Field; sourceObjectMetadata: Object; targetFieldMetadata: Field; @@ -1366,7 +1367,7 @@ export type ObjectMetadataItemsQueryVariables = Exact<{ }>; -export type ObjectMetadataItemsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', edges: Array<{ __typename?: 'objectEdge', node: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isRemote: boolean, isActive: boolean, isSystem: boolean, createdAt: any, updatedAt: any, labelIdentifierFieldMetadataId?: string | null, imageIdentifierFieldMetadataId?: string | null, fields: { __typename?: 'ObjectFieldsConnection', edges: Array<{ __typename?: 'fieldEdge', node: { __typename?: 'field', id: any, type: FieldMetadataType, name: string, label: string, description?: string | null, icon?: string | null, isCustom?: boolean | null, isActive?: boolean | null, isSystem?: boolean | null, isNullable?: boolean | null, createdAt: any, updatedAt: any, defaultValue?: any | null, options?: any | null, fromRelationMetadata?: { __typename?: 'relation', id: any, relationType: RelationMetadataType, toFieldMetadataId: string, toObjectMetadata: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, isSystem: boolean, isRemote: boolean } } | null, toRelationMetadata?: { __typename?: 'relation', id: any, relationType: RelationMetadataType, fromFieldMetadataId: string, fromObjectMetadata: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, isSystem: boolean, isRemote: boolean } } | null, relationDefinition?: { __typename?: 'RelationDefinition', direction: RelationDefinitionType, sourceObjectMetadata: { __typename?: 'object', id: any, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'field', id: any, name: string }, targetObjectMetadata: { __typename?: 'object', id: any, nameSingular: string, namePlural: string }, targetFieldMetadata: { __typename?: 'field', id: any, name: string } } | null } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } }; +export type ObjectMetadataItemsQuery = { __typename?: 'Query', objects: { __typename?: 'ObjectConnection', edges: Array<{ __typename?: 'objectEdge', node: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, labelSingular: string, labelPlural: string, description?: string | null, icon?: string | null, isCustom: boolean, isRemote: boolean, isActive: boolean, isSystem: boolean, createdAt: any, updatedAt: any, labelIdentifierFieldMetadataId?: string | null, imageIdentifierFieldMetadataId?: string | null, fields: { __typename?: 'ObjectFieldsConnection', edges: Array<{ __typename?: 'fieldEdge', node: { __typename?: 'field', id: any, type: FieldMetadataType, name: string, label: string, description?: string | null, icon?: string | null, isCustom?: boolean | null, isActive?: boolean | null, isSystem?: boolean | null, isNullable?: boolean | null, createdAt: any, updatedAt: any, defaultValue?: any | null, options?: any | null, fromRelationMetadata?: { __typename?: 'relation', id: any, relationType: RelationMetadataType, toFieldMetadataId: string, toObjectMetadata: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, isSystem: boolean, isRemote: boolean } } | null, toRelationMetadata?: { __typename?: 'relation', id: any, relationType: RelationMetadataType, fromFieldMetadataId: string, fromObjectMetadata: { __typename?: 'object', id: any, dataSourceId: string, nameSingular: string, namePlural: string, isSystem: boolean, isRemote: boolean } } | null, relationDefinition?: { __typename?: 'RelationDefinition', relationId: any, direction: RelationDefinitionType, sourceObjectMetadata: { __typename?: 'object', id: any, nameSingular: string, namePlural: string }, sourceFieldMetadata: { __typename?: 'field', id: any, name: string }, targetObjectMetadata: { __typename?: 'object', id: any, nameSingular: string, namePlural: string }, targetFieldMetadata: { __typename?: 'field', id: any, name: string } } | null } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } } }>, pageInfo: { __typename?: 'PageInfo', hasNextPage?: boolean | null, hasPreviousPage?: boolean | null, startCursor?: any | null, endCursor?: any | null } } }; export const RemoteServerFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteServerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteServer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"foreignDataWrapperId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignDataWrapperOptions"}},{"kind":"Field","name":{"kind":"Name","value":"foreignDataWrapperType"}},{"kind":"Field","name":{"kind":"Name","value":"userMappingOptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"schema"}}]}}]} as unknown as DocumentNode; export const RemoteTableFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteTableFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteTable"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"schema"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]} as unknown as DocumentNode; @@ -1386,4 +1387,4 @@ export const UpdateOneObjectMetadataItemDocument = {"kind":"Document","definitio export const DeleteOneObjectMetadataItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneObjectMetadataItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneObject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"labelIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"imageIdentifierFieldMetadataId"}}]}}]}}]} as unknown as DocumentNode; export const DeleteOneFieldMetadataItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneFieldMetadataItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneField"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode; export const DeleteOneRelationMetadataItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteOneRelationMetadataItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteOneRelation"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idToDelete"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; -export const ObjectMetadataItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ObjectMetadataItems"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectFilter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"objectFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fieldFilter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"fieldFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"labelIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"imageIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fieldFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"fromRelationMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"relationType"}},{"kind":"Field","name":{"kind":"Name","value":"toObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toFieldMetadataId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toRelationMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"relationType"}},{"kind":"Field","name":{"kind":"Name","value":"fromObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromFieldMetadataId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"defaultValue"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"relationDefinition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"sourceObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sourceFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const ObjectMetadataItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ObjectMetadataItems"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"objectFilter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"objectFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fieldFilter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"fieldFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"objectFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"labelSingular"}},{"kind":"Field","name":{"kind":"Name","value":"labelPlural"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"labelIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"imageIdentifierFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"fields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"paging"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1000"}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fieldFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isNullable"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"fromRelationMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"relationType"}},{"kind":"Field","name":{"kind":"Name","value":"toObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toFieldMetadataId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"toRelationMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"relationType"}},{"kind":"Field","name":{"kind":"Name","value":"fromObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataSourceId"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isRemote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fromFieldMetadataId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"defaultValue"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"relationDefinition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"relationId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"sourceObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sourceFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"nameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}}]}},{"kind":"Field","name":{"kind":"Name","value":"targetFieldMetadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/twenty-front/src/modules/object-metadata/graphql/queries.ts b/packages/twenty-front/src/modules/object-metadata/graphql/queries.ts index fc2a1754f602..729e1f96bf53 100644 --- a/packages/twenty-front/src/modules/object-metadata/graphql/queries.ts +++ b/packages/twenty-front/src/modules/object-metadata/graphql/queries.ts @@ -68,6 +68,7 @@ export const FIND_MANY_OBJECT_METADATA_ITEMS = gql` defaultValue options relationDefinition { + relationId direction sourceObjectMetadata { id diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts index f703c321d7c0..48b8dc236055 100644 --- a/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts +++ b/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts @@ -1,11 +1,4 @@ -<<<<<<< HEAD -import { v4 } from 'uuid'; - import { useDeleteOneRelationMetadataItem } from '@/object-metadata/hooks/useDeleteOneRelationMetadataItem'; -import { FieldMetadataOption } from '@/object-metadata/types/FieldMetadataOption'; -import { getDefaultValueForBackend } from '@/object-metadata/utils/getDefaultValueForBackend'; -======= ->>>>>>> 7728c09dbaf27eee76745b36fff2b33def307300 import { Field } from '~/generated/graphql'; import { FieldMetadataType } from '~/generated-metadata/graphql'; @@ -55,7 +48,9 @@ export const useFieldMetadataItem = () => { const deleteMetadataField = (metadataField: FieldMetadataItem) => { metadataField.type === FieldMetadataType.Relation - ? deleteOneRelationMetadataItem(metadataField.toRelationMetadata?.id) + ? deleteOneRelationMetadataItem( + metadataField.relationDefinition?.relationId, + ) : deleteOneFieldMetadataItem(metadataField.id); }; diff --git a/packages/twenty-front/src/modules/object-metadata/types/FieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/types/FieldMetadataItem.ts index 5ba74573ee7d..c0c4649e52d4 100644 --- a/packages/twenty-front/src/modules/object-metadata/types/FieldMetadataItem.ts +++ b/packages/twenty-front/src/modules/object-metadata/types/FieldMetadataItem.ts @@ -3,6 +3,7 @@ import { Field, Object as MetadataObject, Relation, + RelationDefinition, RelationDefinitionType, } from '~/generated-metadata/graphql'; @@ -44,6 +45,7 @@ export type FieldMetadataItem = Omit< defaultValue?: any; options?: FieldMetadataItemOption[]; relationDefinition?: { + relationId: RelationDefinition['relationId']; direction: RelationDefinitionType; sourceFieldMetadata: Pick; sourceObjectMetadata: Pick< From 0e4cfa4b00eb39b6d9a713d393d07049362decfe Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Fri, 10 May 2024 16:35:36 +0200 Subject: [PATCH 5/9] Add relationId to RelationDefinitionDTO --- .../field-metadata/dtos/relation-definition.dto.ts | 6 ++++++ .../field-metadata/field-metadata.service.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/packages/twenty-server/src/engine/metadata-modules/field-metadata/dtos/relation-definition.dto.ts b/packages/twenty-server/src/engine/metadata-modules/field-metadata/dtos/relation-definition.dto.ts index c8d3480f987f..f15883179d0d 100644 --- a/packages/twenty-server/src/engine/metadata-modules/field-metadata/dtos/relation-definition.dto.ts +++ b/packages/twenty-server/src/engine/metadata-modules/field-metadata/dtos/relation-definition.dto.ts @@ -2,10 +2,12 @@ import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'; import { IsEnum, IsNotEmpty } from 'class-validator'; import { Relation } from 'typeorm'; +import { IDField } from '@ptc-org/nestjs-query-graphql'; import { FieldMetadataDTO } from 'src/engine/metadata-modules/field-metadata/dtos/field-metadata.dto'; import { ObjectMetadataDTO } from 'src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto'; import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; +import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars'; export enum RelationDefinitionType { ONE_TO_ONE = RelationMetadataType.ONE_TO_ONE, @@ -21,6 +23,10 @@ registerEnumType(RelationDefinitionType, { @ObjectType('RelationDefinition') export class RelationDefinitionDTO { + @IsNotEmpty() + @IDField(() => UUIDScalarType) + relationId: string; + @IsNotEmpty() @Field(() => ObjectMetadataDTO) sourceObjectMetadata: Relation; diff --git a/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.service.ts index 417064b481a0..8098b4f26957 100644 --- a/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.service.ts +++ b/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.service.ts @@ -529,6 +529,7 @@ export class FieldMetadataService extends TypeOrmQueryService Date: Mon, 13 May 2024 15:19:26 +0200 Subject: [PATCH 6/9] Run drop column migration upon relation deletion --- .../relation-metadata.module.ts | 3 +- .../relation-metadata.service.ts | 77 ++++++++++++++++++- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts b/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts index ef218dd36914..a5fc287a5ed4 100644 --- a/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts +++ b/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts @@ -13,6 +13,7 @@ import { WorkspaceMigrationModule } from 'src/engine/metadata-modules/workspace- import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.module'; import { WorkspaceCacheVersionModule } from 'src/engine/metadata-modules/workspace-cache-version/workspace-cache-version.module'; import { RelationMetadataResolver } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.resolver'; +import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; import { RelationMetadataService } from './relation-metadata.service'; import { RelationMetadataEntity } from './relation-metadata.entity'; @@ -25,7 +26,7 @@ import { RelationMetadataDTO } from './dtos/relation-metadata.dto'; NestjsQueryGraphQLModule.forFeature({ imports: [ NestjsQueryTypeOrmModule.forFeature( - [RelationMetadataEntity], + [RelationMetadataEntity, FieldMetadataEntity], 'metadata', ), ObjectMetadataModule, diff --git a/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.service.ts index f885c0e56672..8915b60ab4bf 100644 --- a/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.service.ts +++ b/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.service.ts @@ -16,9 +16,13 @@ import { FieldMetadataService } from 'src/engine/metadata-modules/field-metadata import { CreateRelationInput } from 'src/engine/metadata-modules/relation-metadata/dtos/create-relation.input'; import { WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.service'; import { WorkspaceMigrationService } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.service'; -import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; +import { + FieldMetadataEntity, + FieldMetadataType, +} from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; import { WorkspaceMigrationColumnActionType, + WorkspaceMigrationColumnDrop, WorkspaceMigrationTableActionType, } from 'src/engine/metadata-modules/workspace-migration/workspace-migration.entity'; import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity'; @@ -39,6 +43,8 @@ export class RelationMetadataService extends TypeOrmQueryService, + @InjectRepository(FieldMetadataEntity, 'metadata') + private readonly fieldMetadataRepository: Repository, private readonly objectMetadataService: ObjectMetadataService, private readonly fieldMetadataService: FieldMetadataService, private readonly workspaceMigrationService: WorkspaceMigrationService, @@ -242,7 +248,7 @@ export class RelationMetadataService extends TypeOrmQueryService Date: Mon, 13 May 2024 15:38:40 +0200 Subject: [PATCH 7/9] Add relationId to fieldMetadataItem zod schema --- .../validation-schemas/fieldMetadataItemSchema.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/twenty-front/src/modules/object-metadata/validation-schemas/fieldMetadataItemSchema.ts b/packages/twenty-front/src/modules/object-metadata/validation-schemas/fieldMetadataItemSchema.ts index 924beaac2fd8..7ca55d70f045 100644 --- a/packages/twenty-front/src/modules/object-metadata/validation-schemas/fieldMetadataItemSchema.ts +++ b/packages/twenty-front/src/modules/object-metadata/validation-schemas/fieldMetadataItemSchema.ts @@ -55,6 +55,7 @@ export const fieldMetadataItemSchema = z.object({ relationDefinition: z .object({ __typename: z.literal('RelationDefinition').optional(), + relationId: z.string().uuid(), direction: z.nativeEnum(RelationDefinitionType), sourceFieldMetadata: z.object({ __typename: z.literal('field').optional(), From ed53deec40d1e0e4c2f1ac08a62504f90335d371 Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Mon, 13 May 2024 17:12:25 +0200 Subject: [PATCH 8/9] Adapt tests --- .../hooks/__mocks__/useFieldMetadataItem.ts | 32 ++++-- .../__tests__/useFieldMetadataItem.test.tsx | 74 +++++++++++-- .../hooks/useFieldMetadataItem.ts | 2 +- .../standard-metadata-query-result.ts | 100 ++++++++++++++++++ .../src/testing/mock-data/metadata.ts | 1 + 5 files changed, 196 insertions(+), 13 deletions(-) diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/__mocks__/useFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/__mocks__/useFieldMetadataItem.ts index 4629aaf26b5d..0a73b0d2a42b 100644 --- a/packages/twenty-front/src/modules/object-metadata/hooks/__mocks__/useFieldMetadataItem.ts +++ b/packages/twenty-front/src/modules/object-metadata/hooks/__mocks__/useFieldMetadataItem.ts @@ -1,4 +1,9 @@ import { gql } from '@apollo/client'; +import { FieldMetadataType } from '~/generated/graphql'; + +export const FIELD_METADATA_ID = '2c43466a-fe9e-4005-8d08-c5836067aa6c'; +export const FIELD_RELATION_METADATA_ID = '4da0302d-358a-45cd-9973-9f92723ed3c1'; +export const RELATION_METADATA_ID = 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'; const baseFields = ` id @@ -22,6 +27,13 @@ export const queries = { } } `, + deleteMetadataFieldRelation: gql` + mutation DeleteOneRelationMetadataItem($idToDelete: UUID!) { + deleteOneRelation(input: { id: $idToDelete }) { + id + } + } +`, activateMetadataField: gql` mutation UpdateOneFieldMetadataItem( $idToUpdate: UUID! @@ -43,13 +55,13 @@ export const queries = { `, }; -const fieldId = '2c43466a-fe9e-4005-8d08-c5836067aa6c'; export const objectMetadataId = '25611fce-6637-4089-b0ca-91afeec95784'; export const variables = { - deleteMetadataField: { idToDelete: fieldId }, + deleteMetadataField: { idToDelete: FIELD_METADATA_ID }, + deleteMetadataFieldRelation: { idToDelete: RELATION_METADATA_ID }, activateMetadataField: { - idToUpdate: fieldId, + idToUpdate: FIELD_METADATA_ID, updatePayload: { isActive: true, label: undefined }, }, createMetadataField: { @@ -66,14 +78,14 @@ export const variables = { }, }, }, - disableMetadataField: { - idToUpdate: fieldId, + deactivateMetadataField: { + idToUpdate: FIELD_METADATA_ID, updatePayload: { isActive: false, label: undefined }, } }; const defaultResponseData = { - id: '2c43466a-fe9e-4005-8d08-c5836067aa6c', + id: FIELD_METADATA_ID, type: 'type', name: 'name', label: 'label', @@ -86,11 +98,19 @@ const defaultResponseData = { updatedAt: '1996-10-10T08:27:57.117Z', }; +const fieldRelationResponseData = { + ...defaultResponseData, + id: FIELD_RELATION_METADATA_ID, + type: FieldMetadataType.Relation, +}; + export const responseData = { default: defaultResponseData, + fieldRelation: fieldRelationResponseData, createMetadataField: { ...defaultResponseData, defaultValue: '', options: [], }, }; + diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFieldMetadataItem.test.tsx b/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFieldMetadataItem.test.tsx index f96e7e183580..47b1a6c18c88 100644 --- a/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFieldMetadataItem.test.tsx +++ b/packages/twenty-front/src/modules/object-metadata/hooks/__tests__/useFieldMetadataItem.test.tsx @@ -5,17 +5,20 @@ import { RecoilRoot } from 'recoil'; import { useFieldMetadataItem } from '@/object-metadata/hooks/useFieldMetadataItem'; import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem'; -import { FieldMetadataType } from '~/generated/graphql'; +import { FieldMetadataType, RelationDefinitionType } from '~/generated/graphql'; import { + FIELD_METADATA_ID, + FIELD_RELATION_METADATA_ID, objectMetadataId, queries, + RELATION_METADATA_ID, responseData, variables, } from '../__mocks__/useFieldMetadataItem'; const fieldMetadataItem: FieldMetadataItem = { - id: '2c43466a-fe9e-4005-8d08-c5836067aa6c', + id: FIELD_METADATA_ID, createdAt: '', label: 'label', name: 'name', @@ -23,6 +26,37 @@ const fieldMetadataItem: FieldMetadataItem = { updatedAt: '', }; +const fieldRelationMetadataItem: FieldMetadataItem = { + id: FIELD_RELATION_METADATA_ID, + createdAt: '', + label: 'label', + name: 'name', + type: FieldMetadataType.Relation, + updatedAt: '', + relationDefinition: { + relationId: RELATION_METADATA_ID, + direction: RelationDefinitionType.OneToMany, + sourceFieldMetadata: { + id: 'e5903d91-9b10-4f3e-b761-35c36e93b7c1', + name: 'sourceField', + }, + targetFieldMetadata: { + id: 'd23d82d4-690b-489f-a8e3-fc5ed01a91f6', + name: 'targetField', + }, + sourceObjectMetadata: { + id: 'bf46be8a-7c47-45a7-b2f1-30f49e14fbd9', + nameSingular: 'sourceObject', + namePlural: 'sourceObjects', + }, + targetObjectMetadata: { + id: '987c0489-2855-4a63-bb81-93692e51b2a9', + nameSingular: 'targetObject', + namePlural: 'targetObjects', + }, + }, +}; + const mocks = [ { request: { @@ -35,6 +69,17 @@ const mocks = [ }, })), }, + { + request: { + query: queries.deleteMetadataFieldRelation, + variables: variables.deleteMetadataFieldRelation, + }, + result: jest.fn(() => ({ + data: { + deleteOneRelation: responseData.fieldRelation, + }, + })), + }, { request: { query: queries.activateMetadataField, @@ -60,7 +105,7 @@ const mocks = [ { request: { query: queries.activateMetadataField, - variables: variables.disableMetadataField, + variables: variables.deactivateMetadataField, }, result: jest.fn(() => ({ data: { @@ -111,13 +156,14 @@ describe('useFieldMetadataItem', () => { }); }); - it('should disableMetadataField', async () => { + it('should deactivateMetadataField', async () => { const { result } = renderHook(() => useFieldMetadataItem(), { wrapper: Wrapper, }); await act(async () => { - const res = await result.current.disableMetadataField(fieldMetadataItem); + const res = + await result.current.deactivateMetadataField(fieldMetadataItem); expect(res.data).toEqual({ updateOneField: responseData.default, @@ -125,7 +171,7 @@ describe('useFieldMetadataItem', () => { }); }); - it('should deleteMetadataField', async () => { + it('should deleteOneFieldMetadataItem when calling deleteMetadataField for a non-relation field', async () => { const { result } = renderHook(() => useFieldMetadataItem(), { wrapper: Wrapper, }); @@ -138,4 +184,20 @@ describe('useFieldMetadataItem', () => { }); }); }); + + it('should deleteOneFieldMetadataItem when calling deleteMetadataField for a relation field', async () => { + const { result } = renderHook(() => useFieldMetadataItem(), { + wrapper: Wrapper, + }); + + await act(async () => { + const res = await result.current.deleteMetadataField( + fieldRelationMetadataItem, + ); + + expect(res.data).toEqual({ + deleteOneRelation: responseData.fieldRelation, + }); + }); + }); }); diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts index 48b8dc236055..75f9f5a2e489 100644 --- a/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts +++ b/packages/twenty-front/src/modules/object-metadata/hooks/useFieldMetadataItem.ts @@ -47,7 +47,7 @@ export const useFieldMetadataItem = () => { }); const deleteMetadataField = (metadataField: FieldMetadataItem) => { - metadataField.type === FieldMetadataType.Relation + return metadataField.type === FieldMetadataType.Relation ? deleteOneRelationMetadataItem( metadataField.relationDefinition?.relationId, ) diff --git a/packages/twenty-front/src/testing/mock-data/generated/standard-metadata-query-result.ts b/packages/twenty-front/src/testing/mock-data/generated/standard-metadata-query-result.ts index 649a90913924..b3443c0957d1 100644 --- a/packages/twenty-front/src/testing/mock-data/generated/standard-metadata-query-result.ts +++ b/packages/twenty-front/src/testing/mock-data/generated/standard-metadata-query-result.ts @@ -68,6 +68,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = defaultValue: null, relationDefinition: { __typename: 'RelationDefinition', + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', direction: 'ONE_TO_MANY', sourceObjectMetadata: { __typename: 'object', @@ -129,6 +130,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = defaultValue: null, relationDefinition: { __typename: 'RelationDefinition', + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', direction: 'ONE_TO_MANY', sourceObjectMetadata: { __typename: 'object', @@ -211,6 +213,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -601,6 +604,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -772,6 +776,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -833,6 +838,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1038,6 +1044,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1155,6 +1162,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1326,6 +1334,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1461,6 +1470,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1578,6 +1588,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1683,6 +1694,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1832,6 +1844,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -1981,6 +1994,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.716Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -2042,6 +2056,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -2225,6 +2240,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -2430,6 +2446,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -2701,6 +2718,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -2888,6 +2906,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3072,6 +3091,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3177,6 +3197,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3395,6 +3416,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3478,6 +3500,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3539,6 +3562,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3600,6 +3624,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3686,6 +3711,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -3772,6 +3798,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3867,6 +3894,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.716Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -3972,6 +4000,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.722Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4033,6 +4062,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:54:56.499Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -4116,6 +4146,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:58.429Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4199,6 +4230,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.726Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4282,6 +4314,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.729Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4565,6 +4598,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4692,6 +4726,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -4831,6 +4866,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -4958,6 +4994,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -5097,6 +5134,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -5202,6 +5240,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5307,6 +5346,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5390,6 +5430,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5561,6 +5602,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -5678,6 +5720,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5783,6 +5826,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5913,6 +5957,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -5974,6 +6019,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6035,6 +6081,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6118,6 +6165,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6179,6 +6227,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6240,6 +6289,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6323,6 +6373,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6406,6 +6457,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6467,6 +6519,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6606,6 +6659,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -6711,6 +6765,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7051,6 +7106,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7134,6 +7190,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7283,6 +7340,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7344,6 +7402,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7537,6 +7596,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7598,6 +7658,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.729Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7715,6 +7776,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -7776,6 +7838,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -7859,6 +7922,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -7920,6 +7984,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -8025,6 +8090,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -8302,6 +8368,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -8507,6 +8574,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -8678,6 +8746,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -9074,6 +9143,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -9223,6 +9293,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -9306,6 +9377,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -9549,6 +9621,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -9676,6 +9749,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -9771,6 +9845,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -9854,6 +9929,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -9959,6 +10035,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -10043,6 +10120,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -10126,6 +10204,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -10281,6 +10360,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:54:56.499Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -10342,6 +10422,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -10403,6 +10484,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:58.429Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -10537,6 +10619,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -10875,6 +10958,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -10936,6 +11020,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -11019,6 +11104,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { @@ -11298,6 +11384,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11359,6 +11446,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11442,6 +11530,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11603,6 +11692,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11686,6 +11776,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11812,6 +11903,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11894,6 +11986,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -11954,6 +12047,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.722Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12092,6 +12186,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12362,6 +12457,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = updatedAt: '2024-04-08T12:51:28.726Z', defaultValue: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12483,6 +12579,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = }, }, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12551,6 +12648,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = defaultValue: null, fromRelationMetadata: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12633,6 +12731,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = defaultValue: null, fromRelationMetadata: null, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { @@ -12773,6 +12872,7 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery = }, }, relationDefinition: { + relationId: '6a0aa90c-d7bb-458d-9364-12366fc8683b', __typename: 'RelationDefinition', direction: 'MANY_TO_ONE', sourceObjectMetadata: { diff --git a/packages/twenty-front/src/testing/mock-data/metadata.ts b/packages/twenty-front/src/testing/mock-data/metadata.ts index da7b8fc12bee..b22c88cde2b9 100644 --- a/packages/twenty-front/src/testing/mock-data/metadata.ts +++ b/packages/twenty-front/src/testing/mock-data/metadata.ts @@ -54,6 +54,7 @@ const customObjectMetadataItemEdge: ObjectEdge = { updatedAt: '2024-04-08T12:48:49.538Z', defaultValue: null, relationDefinition: { + relationId: '1ec22b36-9e3c-4f24-8cf6-6c387ec3f243', __typename: 'RelationDefinition', direction: 'ONE_TO_MANY', sourceObjectMetadata: { From 57d4d898c5fb25aa6eee954b1c0c3f82cbf672e2 Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Mon, 13 May 2024 17:34:22 +0200 Subject: [PATCH 9/9] Update expected wording in storybook --- .../SettingsObjectNewFieldStep1.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx index 3353cc492f4f..d54dd9f4db04 100644 --- a/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/__stories__/SettingsObjectNewField/SettingsObjectNewFieldStep1.stories.tsx @@ -33,7 +33,7 @@ export const Default: Story = { await canvas.findByText('Settings'); await canvas.findByText('Objects'); await canvas.findByText('Companies'); - await canvas.findByText('Check disabled fields'); + await canvas.findByText('Check deactivated fields'); await canvas.findByText('Add Custom Field'); }, };