From 1b485c2984725fff0ff43897fbf9b5daee8a1f06 Mon Sep 17 00:00:00 2001 From: brendanlaschke Date: Tue, 12 Mar 2024 11:47:27 +0100 Subject: [PATCH] Hide favorites,MessageParticipant and calendareventattendees from datamodel (#4392) hide favorites, MessageParticipant and calendareventattendees from datamodel --- .../object-metadata/utils/getObjectMetadataItemsMock.ts | 6 +++--- packages/twenty-front/src/testing/mock-data/metadata.ts | 4 ++-- .../src/testing/mock-data/objectMetadataItems.ts | 2 +- .../src/metadata/object-metadata/object-metadata.service.ts | 1 + .../custom-objects/custom.object-metadata.ts | 1 + .../standard-objects/company.object-metadata.ts | 1 + .../standard-objects/opportunity.object-metadata.ts | 1 + .../standard-objects/person.object-metadata.ts | 3 +++ 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts b/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts index d6b0c4350942..69202da6b0e0 100644 --- a/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts +++ b/packages/twenty-front/src/modules/object-metadata/utils/getObjectMetadataItemsMock.ts @@ -819,7 +819,7 @@ export const getObjectMetadataItemsMock = () => { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-11-30T11:13:15.331Z', updatedAt: '2023-11-30T11:13:15.331Z', @@ -1065,7 +1065,7 @@ export const getObjectMetadataItemsMock = () => { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-11-30T11:13:15.392Z', updatedAt: '2023-11-30T11:13:15.392Z', @@ -3011,7 +3011,7 @@ export const getObjectMetadataItemsMock = () => { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-11-30T11:13:15.292Z', updatedAt: '2023-11-30T11:13:15.292Z', diff --git a/packages/twenty-front/src/testing/mock-data/metadata.ts b/packages/twenty-front/src/testing/mock-data/metadata.ts index bae6812fd9c8..8a6371bed94d 100644 --- a/packages/twenty-front/src/testing/mock-data/metadata.ts +++ b/packages/twenty-front/src/testing/mock-data/metadata.ts @@ -62,7 +62,7 @@ export const mockedPeopleMetadata = { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-12-15T15:29:39.070Z', updatedAt: '2023-12-15T15:29:39.070Z', @@ -687,7 +687,7 @@ export const mockedCompaniesMetadata = { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-12-15T15:29:39.070Z', updatedAt: '2023-12-15T15:29:39.070Z', diff --git a/packages/twenty-front/src/testing/mock-data/objectMetadataItems.ts b/packages/twenty-front/src/testing/mock-data/objectMetadataItems.ts index b18ef59afb31..b2688dfd1568 100644 --- a/packages/twenty-front/src/testing/mock-data/objectMetadataItems.ts +++ b/packages/twenty-front/src/testing/mock-data/objectMetadataItems.ts @@ -362,7 +362,7 @@ export const mockObjectMetadataItem: ObjectMetadataItem = { icon: 'IconHeart', isCustom: false, isActive: true, - isSystem: false, + isSystem: true, isNullable: true, createdAt: '2023-12-19T12:15:28.459Z', updatedAt: '2023-12-19T12:15:28.459Z', diff --git a/packages/twenty-server/src/metadata/object-metadata/object-metadata.service.ts b/packages/twenty-server/src/metadata/object-metadata/object-metadata.service.ts index 85828e8db779..b20d5f30bb69 100644 --- a/packages/twenty-server/src/metadata/object-metadata/object-metadata.service.ts +++ b/packages/twenty-server/src/metadata/object-metadata/object-metadata.service.ts @@ -777,6 +777,7 @@ export class ObjectMetadataService extends TypeOrmQueryService FavoriteObjectMetadata, onDelete: RelationOnDeleteAction.CASCADE, }) + @IsSystem() favorites: FavoriteObjectMetadata[]; @FieldMetadata({ @@ -180,6 +181,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { inverseSideTarget: () => MessageParticipantObjectMetadata, inverseSideFieldKey: 'person', }) + @IsSystem() messageParticipants: MessageParticipantObjectMetadata[]; @FieldMetadata({ @@ -195,5 +197,6 @@ export class PersonObjectMetadata extends BaseObjectMetadata { @Gate({ featureFlag: 'IS_CALENDAR_ENABLED', }) + @IsSystem() calendarEventAttendees: CalendarEventAttendeeObjectMetadata[]; }