Skip to content

Commit

Permalink
Hide favorites,MessageParticipant and calendareventattendees from dat…
Browse files Browse the repository at this point in the history
…amodel (#4392)

hide favorites, MessageParticipant and calendareventattendees from datamodel
  • Loading branch information
brendanlaschke authored Mar 12, 2024
1 parent a122a7f commit 1b485c2
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions packages/twenty-front/src/testing/mock-data/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
workspaceId: workspaceId,
isCustom: false,
isActive: true,
isSystem: true,
type: FieldMetadataType.RELATION,
name: 'favorites',
label: 'Favorites',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class CustomObjectMetadata extends BaseObjectMetadata {
onDelete: RelationOnDeleteAction.CASCADE,
})
@IsNullable()
@IsSystem()
favorites: FavoriteObjectMetadata[];

@FieldMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata {
onDelete: RelationOnDeleteAction.CASCADE,
})
@IsNullable()
@IsSystem()
favorites: FavoriteObjectMetadata[];

@FieldMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata {
onDelete: RelationOnDeleteAction.CASCADE,
})
@IsNullable()
@IsSystem()
favorites: FavoriteObjectMetadata[];

@FieldMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
inverseSideTarget: () => FavoriteObjectMetadata,
onDelete: RelationOnDeleteAction.CASCADE,
})
@IsSystem()
favorites: FavoriteObjectMetadata[];

@FieldMetadata({
Expand All @@ -180,6 +181,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
inverseSideTarget: () => MessageParticipantObjectMetadata,
inverseSideFieldKey: 'person',
})
@IsSystem()
messageParticipants: MessageParticipantObjectMetadata[];

@FieldMetadata({
Expand All @@ -195,5 +197,6 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
@Gate({
featureFlag: 'IS_CALENDAR_ENABLED',
})
@IsSystem()
calendarEventAttendees: CalendarEventAttendeeObjectMetadata[];
}

0 comments on commit 1b485c2

Please sign in to comment.