diff --git a/packages/twenty-server/src/database/commands/compute-twenty-standard-workspace-migration.command.ts b/packages/twenty-server/src/database/commands/compute-twenty-standard-workspace-migration.command.ts index 46127dea94..345173f64e 100644 --- a/packages/twenty-server/src/database/commands/compute-twenty-standard-workspace-migration.command.ts +++ b/packages/twenty-server/src/database/commands/compute-twenty-standard-workspace-migration.command.ts @@ -50,7 +50,6 @@ export class ComputeTwentyStandardWorkspaceMigrationCommand extends CommandRunne isSystemBuild: true, }, fromToAllFlatEntityMaps: { - // Should be dynamic flatObjectMetadataMaps: { from: createEmptyFlatEntityMaps(), to: twentyStandardAllFlatEntityMaps.flatObjectMetadataMaps, @@ -63,6 +62,22 @@ export class ComputeTwentyStandardWorkspaceMigrationCommand extends CommandRunne from: createEmptyFlatEntityMaps(), to: twentyStandardAllFlatEntityMaps.flatIndexMaps, }, + flatViewFieldMaps: { + from: createEmptyFlatEntityMaps(), + to: twentyStandardAllFlatEntityMaps.flatViewFieldMaps, + }, + flatViewFilterMaps: { + from: createEmptyFlatEntityMaps(), + to: twentyStandardAllFlatEntityMaps.flatViewFilterMaps, + }, + flatViewGroupMaps: { + from: createEmptyFlatEntityMaps(), + to: twentyStandardAllFlatEntityMaps.flatViewGroupMaps, + }, + flatViewMaps: { + from: createEmptyFlatEntityMaps(), + to: twentyStandardAllFlatEntityMaps.flatViewMaps, + }, }, workspaceId, }) diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant.ts index f952fe846d..58c9511c6a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant.ts @@ -96,7 +96,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '14d0f5a9-6c81-4e3b-5f2a-8d9e0c1b2f36', }, }, - views: {}, }, blocklist: { universalIdentifier: STANDARD_OBJECT_IDS.blocklist, @@ -121,7 +120,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '25e1a6b0-7d92-4f4c-6a3b-9e0f1d2c3a47', }, }, - views: {}, }, calendarChannelEventAssociation: { universalIdentifier: STANDARD_OBJECT_IDS.calendarChannelEventAssociation, @@ -163,7 +161,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '47a3c8d2-9f14-4b6e-8c5d-1a2b3f4e5c69', }, }, - views: {}, }, calendarChannel: { universalIdentifier: STANDARD_OBJECT_IDS.calendarChannel, @@ -229,7 +226,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '58b4d9e3-0a25-4c7f-9d6e-2b3c4a5f6d70', }, }, - views: {}, }, calendarEventParticipant: { universalIdentifier: STANDARD_OBJECT_IDS.calendarEventParticipant, @@ -286,7 +282,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '81e7a2b6-3d58-4f0c-2a9b-5e6f7d8c9003', }, }, - views: {}, }, calendarEvent: { universalIdentifier: STANDARD_OBJECT_IDS.calendarEvent, @@ -542,7 +537,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: 'c5c1e6f0-7b92-4d4a-6e3f-9c0d1b2a3447', }, }, - views: {}, }, dashboard: { universalIdentifier: STANDARD_OBJECT_IDS.dashboard, @@ -676,7 +670,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '8783e8f2-9114-4d6a-8e5f-12c3d1465673', }, }, - views: {}, }, favoriteFolder: { universalIdentifier: STANDARD_OBJECT_IDS.favoriteFolder, @@ -700,7 +693,6 @@ export const STANDARD_OBJECTS = { }, }, indexes: {}, - views: {}, }, messageChannelMessageAssociation: { universalIdentifier: STANDARD_OBJECT_IDS.messageChannelMessageAssociation, @@ -752,7 +744,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '1a16b1c5-2447-4a9d-1b8c-45f6a47989a6', }, }, - views: {}, }, messageChannel: { universalIdentifier: STANDARD_OBJECT_IDS.messageChannel, @@ -838,7 +829,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '2b27c2d6-3558-4b0e-2c9d-56a7b58a9ab7', }, }, - views: {}, }, messageFolder: { universalIdentifier: STANDARD_OBJECT_IDS.messageFolder, @@ -882,7 +872,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '3c38d3e7-4669-4c1f-3d0e-67b8c69b0bc8', }, }, - views: {}, }, messageParticipant: { universalIdentifier: STANDARD_OBJECT_IDS.messageParticipant, @@ -928,7 +917,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '6f61a6b0-7992-4f4c-6a3b-90e1f92e3ef1', }, }, - views: {}, }, messageThread: { universalIdentifier: STANDARD_OBJECT_IDS.messageThread, @@ -1126,7 +1114,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '2527a2b6-3558-4f0c-2a9b-56e7f58e9e57', }, }, - views: {}, }, opportunity: { universalIdentifier: STANDARD_OBJECT_IDS.opportunity, @@ -1543,7 +1530,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '5850b5c9-6881-4a3d-5b2c-89f0a81f2f80', }, }, - views: {}, }, timelineActivity: { universalIdentifier: STANDARD_OBJECT_IDS.timelineActivity, @@ -1766,7 +1752,6 @@ export const STANDARD_OBJECTS = { universalIdentifier: '7072b7c1-8003-4a5d-7b4c-01f2a03f4f03', }, }, - views: {}, }, workflowRun: { universalIdentifier: STANDARD_OBJECT_IDS.workflowRun, @@ -2056,7 +2041,7 @@ export const STANDARD_OBJECTS = { universalIdentifier: string; fields: Record; indexes: Record; - views: Record< + views?: Record< string, { universalIdentifier: string; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-field-name.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-field-name.type.ts new file mode 100644 index 0000000000..8538afe21c --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-field-name.type.ts @@ -0,0 +1,10 @@ +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type AllStandardObjectView } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type'; + +export type AllStandardObjectViewFieldName< + T extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = AllStandardObjectView[V] extends { viewFields: infer ViewFields } + ? keyof ViewFields + : never; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-filter-name.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-filter-name.type.ts new file mode 100644 index 0000000000..8088c78003 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-filter-name.type.ts @@ -0,0 +1,10 @@ +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type AllStandardObjectView } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type'; + +export type AllStandardObjectViewFilterName< + T extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = AllStandardObjectView[V] extends { viewFilters: infer ViewFilters } + ? keyof ViewFilters + : never; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-group-name.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-group-name.type.ts new file mode 100644 index 0000000000..b4b37fb417 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-group-name.type.ts @@ -0,0 +1,10 @@ +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type AllStandardObjectView } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type'; + +export type AllStandardObjectViewGroupName< + T extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = AllStandardObjectView[V] extends { viewGroups: infer ViewGroups } + ? keyof ViewGroups + : never; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type.ts new file mode 100644 index 0000000000..ca171f2ef3 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type.ts @@ -0,0 +1,7 @@ +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectView } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type'; + +export type AllStandardObjectViewName = + AllStandardObjectView extends never + ? never + : keyof AllStandardObjectView; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type.ts new file mode 100644 index 0000000000..711b611be5 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view.type.ts @@ -0,0 +1,5 @@ +import { type STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; + +export type AllStandardObjectView = + (typeof STANDARD_OBJECTS)[T] extends { views: infer View } ? View : never; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type.ts index 2c88e3dfab..51c4db557e 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type.ts @@ -1,10 +1,10 @@ import { type AllMetadataName } from 'twenty-shared/metadata'; import { type MetadataValidationRelatedFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/metadata-related-types.type'; -import { type StandardFieldMetadataIdByObjectAndFieldName } from 'src/engine/workspace-manager/twenty-standard-application/utils/get-standard-field-metadata-id-by-object-and-field-name.util'; +import { type StandardObjectMetadataRelatedEntityIds } from 'src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util'; import { type ComputeTwentyStandardApplicationAllFlatEntityMapsArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant'; export type StandardBuilderArgs = { - standardFieldMetadataIdByObjectAndFieldName: StandardFieldMetadataIdByObjectAndFieldName; + standardObjectMetadataRelatedEntityIds: StandardObjectMetadataRelatedEntityIds; dependencyFlatEntityMaps: MetadataValidationRelatedFlatEntityMaps; } & ComputeTwentyStandardApplicationAllFlatEntityMapsArgs; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type.ts new file mode 100644 index 0000000000..debe93cc69 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type.ts @@ -0,0 +1,12 @@ +import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type'; + +export type TwentyStandardAllFlatEntityMaps = Pick< + AllFlatEntityMaps, + | 'flatIndexMaps' + | 'flatObjectMetadataMaps' + | 'flatFieldMetadataMaps' + | 'flatViewFieldMaps' + | 'flatViewFilterMaps' + | 'flatViewGroupMaps' + | 'flatViewMaps' +>; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts index 0bf2758832..35a2119f8b 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts @@ -1,3 +1,4 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type'; @@ -75,13 +76,6 @@ const STANDARD_FLAT_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = { [P in AllStandardObjectName]: StandardFieldBuilder

; }; -const createEmptyFlatFieldMetadataMaps = - (): FlatEntityMaps => ({ - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }); - export const buildStandardFlatFieldMetadataMaps = ( args: Omit, ): FlatEntityMaps => { @@ -101,7 +95,7 @@ export const buildStandardFlatFieldMetadataMaps = ( return Object.values(result); }); - let flatFieldMetadataMaps = createEmptyFlatFieldMetadataMaps(); + let flatFieldMetadataMaps = createEmptyFlatEntityMaps(); for (const fieldMetadata of allFieldMetadatas) { flatFieldMetadataMaps = addFlatEntityToFlatEntityMapsOrThrow({ diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-attachment-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-attachment-standard-flat-field-metadata.util.ts index 860f44ea0e..371f9143a9 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-attachment-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-attachment-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -118,7 +118,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ icon: 'IconFileUpload', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -134,7 +134,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ icon: 'IconLink', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -150,7 +150,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ icon: 'IconList', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -192,7 +192,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ { value: 'OTHER', label: 'Other', position: 7, color: 'gray' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -209,7 +209,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -233,7 +233,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'authorId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -256,7 +256,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'activityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -278,7 +278,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'taskId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -300,7 +300,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'noteId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -322,7 +322,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -344,7 +344,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -366,7 +366,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'opportunityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -388,7 +388,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'dashboardId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -410,7 +410,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -433,7 +433,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({ joinColumnName: 'customId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-blocklist-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-blocklist-standard-flat-field-metadata.util.ts index 8f6e52f836..58e4d8fdf2 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-blocklist-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-blocklist-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -118,7 +118,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ icon: 'IconAt', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -142,7 +142,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({ joinColumnName: 'workspaceMemberId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-event-association-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-event-association-standard-flat-field-metadata.util.ts index 35f4892f5a..5949c7b19a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-event-association-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-event-association-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -40,7 +40,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -78,7 +78,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -96,7 +96,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -112,7 +112,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ icon: 'IconCalendar', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -128,7 +128,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -150,7 +150,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ joinColumnName: 'calendarChannelId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -172,7 +172,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({ joinColumnName: 'calendarEventId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-standard-flat-field-metadata.util.ts index 1a8a78265f..2cc7a2481d 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ icon: 'IconAt', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -135,7 +135,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -152,7 +152,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -191,7 +191,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ { value: 'NONE', label: 'None', color: 'red', position: 3 }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -208,7 +208,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -225,7 +225,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ icon: 'IconReload', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -263,7 +263,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -325,7 +325,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -341,7 +341,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -357,7 +357,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -374,7 +374,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -396,7 +396,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ joinColumnName: 'connectedAccountId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -416,7 +416,7 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-participant-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-participant-standard-flat-field-metadata.util.ts index a29f4c2317..23a64b6740 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-participant-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-participant-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -40,7 +40,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -78,7 +78,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -96,7 +96,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -112,7 +112,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ icon: 'IconMail', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -128,7 +128,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ icon: 'IconUser', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -145,7 +145,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -178,7 +178,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ { value: 'ACCEPTED', label: 'Accepted', position: 3, color: 'green' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -200,7 +200,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'calendarEventId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -222,7 +222,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -244,7 +244,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'workspaceMemberId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-standard-flat-field-metadata.util.ts index 425f508a43..a5937a9fcd 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -33,7 +33,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -52,7 +52,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -89,7 +89,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -105,7 +105,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconH1', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -122,7 +122,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -139,7 +139,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -155,7 +155,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconCalendarClock', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -171,7 +171,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconCalendarClock', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -187,7 +187,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconCalendarPlus', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -203,7 +203,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconCalendarCog', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -219,7 +219,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconFileDescription', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -235,7 +235,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconMapPin', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -251,7 +251,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconKey', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -267,7 +267,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconScreenShare', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -283,7 +283,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ icon: 'IconLink', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -303,7 +303,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -323,7 +323,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util.ts index 35e95719dc..9e76d96c86 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -118,7 +118,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconBuildingSkyscraper', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -139,7 +139,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ maxNumberOfValues: 1, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -155,7 +155,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconMap', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -172,7 +172,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconMap', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -188,7 +188,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconUsers', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -204,7 +204,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconBrandLinkedin', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -220,7 +220,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconBrandX', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -237,7 +237,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ icon: 'IconMoneybag', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -255,7 +255,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -273,7 +273,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -290,7 +290,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -307,7 +307,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -329,7 +329,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -352,7 +352,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ joinColumnName: 'accountOwnerId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -373,7 +373,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -394,7 +394,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -414,7 +414,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -435,7 +435,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -456,7 +456,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -477,7 +477,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-connected-account-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-connected-account-standard-flat-field-metadata.util.ts index aa6ea65c35..b01ddcc234 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-connected-account-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-connected-account-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconMail', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -126,7 +126,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: "'google'", }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -142,7 +142,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconKey', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -158,7 +158,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconKey', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -174,7 +174,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -190,7 +190,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconX', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -206,7 +206,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -222,7 +222,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconMail', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -238,7 +238,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconSettings', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -254,7 +254,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ icon: 'IconSettings', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -276,7 +276,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ joinColumnName: 'accountOwnerId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -296,7 +296,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -316,7 +316,7 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util.ts index 0131adadaa..39285cd4df 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -34,7 +34,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -53,7 +53,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -72,7 +72,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -90,7 +90,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -108,7 +108,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ icon: 'IconNotes', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -126,7 +126,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -143,7 +143,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isNullable: true, isUIReadOnly: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -160,7 +160,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -177,7 +177,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -200,7 +200,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -221,7 +221,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -242,7 +242,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-folder-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-folder-standard-flat-field-metadata.util.ts index b258f06080..0e6fea584c 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-folder-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-folder-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -34,7 +34,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -53,7 +53,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -72,7 +72,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -90,7 +90,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -110,7 +110,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -126,7 +126,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ icon: 'IconText', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -148,7 +148,7 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-standard-flat-field-metadata.util.ts index 86d116b8ce..5ad22c3d98 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -57,7 +57,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -94,7 +94,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -114,7 +114,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -130,7 +130,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ icon: 'IconView', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -154,7 +154,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'forWorkspaceMemberId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -176,7 +176,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -198,7 +198,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -220,7 +220,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'opportunityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -242,7 +242,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -264,7 +264,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowVersionId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -286,7 +286,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowRunId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -308,7 +308,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'taskId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -330,7 +330,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'noteId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -352,7 +352,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'dashboardId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -374,7 +374,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'favoriteFolderId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -396,7 +396,7 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({ joinColumnName: 'customId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util.ts index 80147c4265..8b91bd91c4 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util.ts @@ -18,7 +18,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -42,7 +42,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -61,7 +61,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -98,7 +98,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -114,7 +114,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = icon: 'IconHash', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -130,7 +130,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = icon: 'IconHash', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -161,7 +161,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -183,7 +183,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = joinColumnName: 'messageChannelId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -205,7 +205,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = joinColumnName: 'messageThreadId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -227,7 +227,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas = joinColumnName: 'messageId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-standard-flat-field-metadata.util.ts index b748f539d0..46365a18e2 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-standard-flat-field-metadata.util.ts @@ -17,7 +17,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -57,7 +57,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -94,7 +94,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -121,7 +121,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -137,7 +137,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ icon: 'IconAt', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -168,7 +168,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -185,7 +185,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -213,7 +213,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ { value: 'NONE', label: 'None', position: 2, color: 'red' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -244,7 +244,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -261,7 +261,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -278,7 +278,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -310,7 +310,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ { value: 'NONE', label: 'None', position: 2, color: 'blue' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -327,7 +327,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -343,7 +343,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -359,7 +359,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -397,7 +397,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -459,7 +459,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -475,7 +475,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -492,7 +492,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -514,7 +514,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ joinColumnName: 'connectedAccountId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -534,7 +534,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -554,7 +554,7 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-folder-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-folder-standard-flat-field-metadata.util.ts index 714deaf67c..303825525d 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-folder-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-folder-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ icon: 'IconFolder', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -125,7 +125,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ icon: 'IconHash', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -142,7 +142,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -159,7 +159,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -175,7 +175,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ icon: 'IconFolder', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -191,7 +191,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ icon: 'IconHash', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -217,7 +217,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ { value: 'NONE', label: 'None', position: 1, color: 'blue' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -239,7 +239,7 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({ joinColumnName: 'messageChannelId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts index 20e9a15e80..b21056602a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts @@ -17,7 +17,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -57,7 +57,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -94,7 +94,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -137,7 +137,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -153,7 +153,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ icon: 'IconAt', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -169,7 +169,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ icon: 'IconUser', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -191,7 +191,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'messageId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -213,7 +213,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -235,7 +235,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({ joinColumnName: 'workspaceMemberId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts index d88aa623f3..f388a9c3b5 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ icon: 'IconHash', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -130,7 +130,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ { value: 'OUTGOING', label: 'Outgoing', position: 1, color: 'blue' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -146,7 +146,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ icon: 'IconMessage', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -162,7 +162,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ icon: 'IconMessage', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -178,7 +178,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ icon: 'IconCalendar', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -200,7 +200,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ joinColumnName: 'messageThreadId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -220,7 +220,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -240,7 +240,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-thread-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-thread-standard-flat-field-metadata.util.ts index 0116f66812..efc81bade4 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-thread-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-thread-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -33,7 +33,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -52,7 +52,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -89,7 +89,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -129,7 +129,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-standard-flat-field-metadata.util.ts index 0df2093fc2..7e4a59b807 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -34,7 +34,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -55,7 +55,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -96,7 +96,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -116,7 +116,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -132,7 +132,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ icon: 'IconNotes', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -148,7 +148,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ icon: 'IconFilePencil', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -164,7 +164,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ icon: 'IconFilePencil', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -181,7 +181,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -198,7 +198,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -221,7 +221,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -242,7 +242,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -263,7 +263,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -284,7 +284,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-target-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-target-standard-flat-field-metadata.util.ts index fd744263b2..01601ecde2 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-target-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-note-target-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -124,7 +124,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'noteId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -146,7 +146,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -168,7 +168,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -190,7 +190,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'opportunityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -213,7 +213,7 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'customId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-opportunity-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-opportunity-standard-flat-field-metadata.util.ts index 3e5d2dee91..ff9694287c 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-opportunity-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-opportunity-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -118,7 +118,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ icon: 'IconTargetArrow', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -134,7 +134,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ icon: 'IconCurrencyDollar', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -150,7 +150,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ icon: 'IconCalendarEvent', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -184,7 +184,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ { value: 'CUSTOMER', label: 'Customer', position: 4, color: 'yellow' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -202,7 +202,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -219,7 +219,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -236,7 +236,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -260,7 +260,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ joinColumnName: 'pointOfContactId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -282,7 +282,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -303,7 +303,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -324,7 +324,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -345,7 +345,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -366,7 +366,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -387,7 +387,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts index 3c75c55aee..6c851a3179 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -118,7 +118,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconUser', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -134,7 +134,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconMail', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -154,7 +154,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ maxNumberOfValues: 1, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -170,7 +170,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconBrandLinkedin', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -186,7 +186,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconBrandX', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -202,7 +202,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconBriefcase', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -218,7 +218,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconPhone', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -237,7 +237,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ maxNumberOfValues: 1, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -253,7 +253,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ icon: 'IconMap', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -270,7 +270,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -288,7 +288,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -305,7 +305,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -329,7 +329,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -350,7 +350,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -371,7 +371,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -392,7 +392,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -413,7 +413,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -434,7 +434,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -455,7 +455,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -476,7 +476,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -497,7 +497,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -514,7 +514,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-standard-flat-field-metadata.util.ts index 4a101938eb..694c6e2095 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -120,7 +120,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -136,7 +136,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ icon: 'IconNotes', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -152,7 +152,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ icon: 'IconFilePencil', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -168,7 +168,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ icon: 'IconFilePencil', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -184,7 +184,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ icon: 'IconCalendarEvent', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -211,7 +211,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ { value: 'DONE', label: 'Done', position: 2, color: 'green' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -228,7 +228,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -245,7 +245,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -268,7 +268,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -289,7 +289,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -311,7 +311,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ joinColumnName: 'assigneeId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -332,7 +332,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -353,7 +353,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-target-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-target-standard-flat-field-metadata.util.ts index 98beb86a00..858c62f68e 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-target-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-task-target-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -80,7 +80,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -100,7 +100,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ displayFormat: 'RELATIVE', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -124,7 +124,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'taskId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -146,7 +146,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -168,7 +168,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -190,7 +190,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'opportunityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -213,7 +213,7 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({ joinColumnName: 'customId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts index c530d71872..3d3f55cd22 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -57,7 +57,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -94,7 +94,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -113,7 +113,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 'now', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -129,7 +129,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ icon: 'IconAbc', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -145,7 +145,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ icon: 'IconListDetails', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -161,7 +161,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ icon: 'IconAbc', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -177,7 +177,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ icon: 'IconAbc', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -193,7 +193,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ icon: 'IconAbc', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -217,7 +217,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'workspaceMemberId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -239,7 +239,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'personId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -261,7 +261,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'companyId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -283,7 +283,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'opportunityId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -305,7 +305,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'noteId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -327,7 +327,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'taskId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -349,7 +349,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -371,7 +371,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowVersionId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -393,7 +393,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowRunId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -415,7 +415,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'dashboardId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -437,7 +437,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({ joinColumnName: 'customId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-automated-trigger-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-automated-trigger-standard-flat-field-metadata.util.ts index cab8174fa6..34723ba93e 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-automated-trigger-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-automated-trigger-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -40,7 +40,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -78,7 +78,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -96,7 +96,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -121,7 +121,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ { value: 'CRON', label: 'Cron', position: 1, color: 'blue' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -137,7 +137,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ icon: 'IconSettings', isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -159,7 +159,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-run-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-run-standard-flat-field-metadata.util.ts index a0a857e6ff..3d45243753 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-run-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-run-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconSettingsAutomation', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -125,7 +125,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -141,7 +141,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -157,7 +157,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHistory', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -188,7 +188,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ { value: 'STOPPED', label: 'Stopped', position: 6, color: 'gray' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -204,7 +204,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconCreativeCommonsSa', isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -220,7 +220,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHierarchy2', isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -236,7 +236,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHierarchy2', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -252,7 +252,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ icon: 'IconHierarchy2', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -270,7 +270,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -287,7 +287,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -309,7 +309,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowVersionId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -331,7 +331,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -352,7 +352,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -373,7 +373,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-standard-flat-field-metadata.util.ts index 936dbba99a..01f1f381e9 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-standard-flat-field-metadata.util.ts @@ -12,7 +12,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -33,7 +33,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -52,7 +52,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -89,7 +89,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -105,7 +105,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ icon: 'IconSettingsAutomation', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -122,7 +122,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isNullable: true, isUIReadOnly: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -149,7 +149,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -167,7 +167,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -184,7 +184,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isUIReadOnly: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -201,7 +201,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -222,7 +222,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -243,7 +243,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -265,7 +265,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -287,7 +287,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -308,7 +308,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -329,7 +329,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -350,7 +350,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-version-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-version-standard-flat-field-metadata.util.ts index 4e1e745ee5..5d519ad1a4 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-version-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workflow-version-standard-flat-field-metadata.util.ts @@ -16,7 +16,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -37,7 +37,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -56,7 +56,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -75,7 +75,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -93,7 +93,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -109,7 +109,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ icon: 'IconSettingsAutomation', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -125,7 +125,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ icon: 'IconSettingsAutomation', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -141,7 +141,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ icon: 'IconSettingsAutomation', isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -169,7 +169,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ { value: 'ARCHIVED', label: 'Archived', position: 3, color: 'gray' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -187,7 +187,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -204,7 +204,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -226,7 +226,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ joinColumnName: 'workflowId', }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -246,7 +246,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -267,7 +267,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -288,7 +288,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workspace-member-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workspace-member-standard-flat-field-metadata.util.ts index c89529ddf1..ce7bf2912a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workspace-member-standard-flat-field-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-workspace-member-standard-flat-field-metadata.util.ts @@ -17,7 +17,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -38,7 +38,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isUIReadOnly: true, defaultValue: 'uuid', }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -57,7 +57,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -76,7 +76,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ defaultValue: 'now', settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -94,7 +94,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isUIReadOnly: true, settings: { displayFormat: 'RELATIVE' }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -112,7 +112,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: 0, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -128,7 +128,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ icon: 'IconCircleUser', isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -146,7 +146,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: "'System'", }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -164,7 +164,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: "'en'", }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -181,7 +181,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -199,7 +199,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isNullable: true, isUnique: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -220,7 +220,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ dataType: NumberDataType.INT, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -237,7 +237,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -255,7 +255,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isNullable: false, defaultValue: "'system'", }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -289,7 +289,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ { value: 'YEAR_FIRST', label: 'Year First', position: 3, color: 'sky' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -312,7 +312,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ { value: 'HOUR_12', label: '12HRS', position: 2, color: 'purple' }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -362,7 +362,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ }, ], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -379,7 +379,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ isSystem: true, isNullable: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -399,7 +399,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -419,7 +419,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -439,7 +439,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -460,7 +460,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -480,7 +480,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -500,7 +500,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -520,7 +520,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -540,7 +540,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -561,7 +561,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({ relationType: RelationType.ONE_TO_MANY, }, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util.ts index 6891ed5391..f924f597ba 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util.ts @@ -54,25 +54,23 @@ export const createStandardFieldFlatMetadata = < settings = null, options: fieldOptions = null, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }: CreateStandardFieldArgs): FlatFieldMetadata => { const objectFields = STANDARD_OBJECTS[objectName].fields; const fieldDefinition = objectFields[fieldName as keyof typeof objectFields]; - const fieldIds = - standardFieldMetadataIdByObjectAndFieldName[objectName].fields; + const fieldIds = standardObjectMetadataRelatedEntityIds[objectName].fields; const name = fieldName.toString(); return { - id: fieldIds[fieldName], + id: fieldIds[fieldName].id, universalIdentifier: fieldDefinition.universalIdentifier, standardId: null, applicationId: twentyStandardApplicationId, workspaceId, - objectMetadataId: - standardFieldMetadataIdByObjectAndFieldName[objectName].id, + objectMetadataId: standardObjectMetadataRelatedEntityIds[objectName].id, type, name, label, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts index a915b3b92c..dacc51a35f 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts @@ -58,26 +58,24 @@ export const createStandardRelationFieldFlatMetadata = < settings, options: fieldOptions = null, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }: CreateStandardRelationFieldArgs): FlatFieldMetadata => { const objectFields = STANDARD_OBJECTS[objectName].fields; const fieldDefinition = objectFields[fieldName as keyof typeof objectFields]; - const fieldIds = - standardFieldMetadataIdByObjectAndFieldName[objectName].fields; + const fieldIds = standardObjectMetadataRelatedEntityIds[objectName].fields; const targetFieldIds = - standardFieldMetadataIdByObjectAndFieldName[targetObjectName].fields; + standardObjectMetadataRelatedEntityIds[targetObjectName].fields; return { - id: fieldIds[fieldName as keyof typeof fieldIds], + id: fieldIds[fieldName as keyof typeof fieldIds].id, universalIdentifier: fieldDefinition.universalIdentifier, standardId: null, applicationId: twentyStandardApplicationId, workspaceId, - objectMetadataId: - standardFieldMetadataIdByObjectAndFieldName[objectName].id, + objectMetadataId: standardObjectMetadataRelatedEntityIds[objectName].id, type: FieldMetadataType.RELATION, name: fieldName.toString(), label, @@ -94,9 +92,9 @@ export const createStandardRelationFieldFlatMetadata = < defaultValue, settings, options: fieldOptions, - relationTargetFieldMetadataId: targetFieldIds[targetFieldName], + relationTargetFieldMetadataId: targetFieldIds[targetFieldName].id, relationTargetObjectMetadataId: - standardFieldMetadataIdByObjectAndFieldName[targetObjectName].id, + standardObjectMetadataRelatedEntityIds[targetObjectName].id, morphId: null, viewFieldIds: [], viewFilterIds: [], diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-field-metadata-id-by-object-and-field-name.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-field-metadata-id-by-object-and-field-name.util.ts deleted file mode 100644 index a238935867..0000000000 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-field-metadata-id-by-object-and-field-name.util.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { v4 } from 'uuid'; - -import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; -import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; -import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; - -export type StandardFieldMetadataIdByObjectAndFieldName = { - [O in AllStandardObjectName]: { - id: string; - fields: Record, string>; - }; -}; - -// TODO remove once we have refactored the builder to iterate over universalIdentifier only -export const getStandardFieldMetadataIdByObjectAndFieldName = - (): StandardFieldMetadataIdByObjectAndFieldName => { - const result = {} as StandardFieldMetadataIdByObjectAndFieldName; - - for (const objectName of Object.keys( - STANDARD_OBJECTS, - ) as AllStandardObjectName[]) { - const fieldNames = Object.keys( - STANDARD_OBJECTS[objectName].fields, - ) as AllStandardObjectFieldName[]; - - const fieldIds = {} as Record< - AllStandardObjectFieldName, - string - >; - - for (const fieldName of fieldNames) { - fieldIds[fieldName] = v4(); - } - - result[objectName] = { - // @ts-expect-error ignore this - fields: fieldIds, - id: v4(), - }; - } - - return result; - }; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts new file mode 100644 index 0000000000..6e8692e681 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts @@ -0,0 +1,127 @@ +import { v4 } from 'uuid'; + +import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-field-name.type'; +import { type AllStandardObjectViewGroupName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-group-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; + +type StandardObjectViewIds = { + [V in AllStandardObjectViewName]: { + id: string; + viewGroups: Record, { id: string }>; + viewFields: Record, { id: string }>; + }; +}; + +export type StandardObjectMetadataRelatedEntityIds = { + [O in AllStandardObjectName]: { + id: string; + fields: Record, { id: string }>; + views: StandardObjectViewIds; + }; +}; + +const computeStandardViewObjectIds = ({ + objectName, +}: { + objectName: O; +}): StandardObjectViewIds | undefined => { + const objectDefinition = STANDARD_OBJECTS[objectName]; + + if (!Object.prototype.hasOwnProperty.call(objectDefinition, 'views')) { + return undefined; + } + + // @ts-expect-error ignore + const viewDefinitions = objectDefinition.views; + const viewNames = Object.keys( + viewDefinitions, + ) as AllStandardObjectViewName[]; + + const viewIds = {} as StandardObjectViewIds; + + for (const viewName of viewNames) { + const viewDefinition = + viewDefinitions[viewName as keyof typeof viewDefinitions]; + + const viewFieldNames = Object.keys(viewDefinition.viewFields); + const viewFieldIds = {} as Record< + AllStandardObjectViewFieldName, + { id: string } + >; + + for (const viewFieldName of viewFieldNames) { + viewFieldIds[ + viewFieldName as AllStandardObjectViewFieldName + ] = { + id: v4(), + }; + } + + const viewGroupIds = {} as Record< + AllStandardObjectViewGroupName, + { id: string } + >; + + if (Object.prototype.hasOwnProperty.call(viewDefinition, 'viewGroups')) { + const viewGroupNames = Object.keys( + (viewDefinition as { viewGroups: Record }).viewGroups, + ); + + for (const viewGroupName of viewGroupNames) { + viewGroupIds[ + viewGroupName as AllStandardObjectViewGroupName + ] = { + id: v4(), + }; + } + } + + viewIds[viewName] = { + id: v4(), + viewFields: viewFieldIds, + viewGroups: viewGroupIds, + }; + } + + return viewIds; +}; + +// TODO remove once we have refactored the builder to iterate over universalIdentifier only +export const getStandardObjectMetadataRelatedEntityIds = + (): StandardObjectMetadataRelatedEntityIds => { + const result = {} as StandardObjectMetadataRelatedEntityIds; + + for (const objectName of Object.keys( + STANDARD_OBJECTS, + ) as AllStandardObjectName[]) { + const fieldNames = Object.keys( + STANDARD_OBJECTS[objectName].fields, + ) as AllStandardObjectFieldName[]; + + const fieldIds = {} as Record< + AllStandardObjectFieldName, + { id: string } + >; + + for (const fieldName of fieldNames) { + fieldIds[fieldName] = { id: v4() }; + } + + const viewIds = computeStandardViewObjectIds({ + objectName, + }); + + result[objectName] = { + // @ts-expect-error ignore this + fields: fieldIds, + id: v4(), + // @ts-expect-error ignore this + views: viewIds, + }; + } + + return result; + }; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts index 168470e9ff..458f3c6887 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts @@ -1,3 +1,4 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; import { type FlatIndexMetadata } from 'src/engine/metadata-modules/flat-index-metadata/types/flat-index-metadata.type'; @@ -69,13 +70,6 @@ const STANDARD_FLAT_INDEX_METADATA_BUILDERS_BY_OBJECT_NAME = { [P in AllStandardObjectName]?: StandardIndexBuilder

; }; -const createEmptyFlatIndexMetadataMaps = - (): FlatEntityMaps => ({ - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }); - export const buildStandardFlatIndexMetadataMaps = ( args: Omit, ): FlatEntityMaps => { @@ -95,7 +89,7 @@ export const buildStandardFlatIndexMetadataMaps = ( return Object.values(result); }); - let flatIndexMetadataMaps = createEmptyFlatIndexMetadataMaps(); + let flatIndexMetadataMaps = createEmptyFlatEntityMaps(); for (const indexMetadata of allIndexMetadatas) { flatIndexMetadataMaps = addFlatEntityToFlatEntityMapsOrThrow({ diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-attachment-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-attachment-standard-flat-index-metadata.util.ts index bc5047592a..33ac210125 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-attachment-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-attachment-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'authorIdIndex', relatedFieldNames: ['author'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'taskIdIndex', relatedFieldNames: ['task'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'noteIdIndex', relatedFieldNames: ['note'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -83,7 +83,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'opportunityIdIndex', relatedFieldNames: ['opportunity'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -95,7 +95,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'dashboardIdIndex', relatedFieldNames: ['dashboard'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -107,7 +107,7 @@ export const buildAttachmentStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-blocklist-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-blocklist-standard-flat-index-metadata.util.ts index 3557f2f7e0..3723ec4085 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-blocklist-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-blocklist-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildBlocklistStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildBlocklistStandardFlatIndexMetadatas = ({ indexName: 'workspaceMemberIdIndex', relatedFieldNames: ['workspaceMember'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-event-association-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-event-association-standard-flat-index-metadata.util.ts index ad774db9d1..4861c9d369 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-event-association-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-event-association-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildCalendarChannelEventAssociationStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -26,7 +26,7 @@ export const buildCalendarChannelEventAssociationStandardFlatIndexMetadatas = ({ indexName: 'calendarChannelIdIndex', relatedFieldNames: ['calendarChannel'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -38,7 +38,7 @@ export const buildCalendarChannelEventAssociationStandardFlatIndexMetadatas = ({ indexName: 'calendarEventIdIndex', relatedFieldNames: ['calendarEvent'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-standard-flat-index-metadata.util.ts index 00cc078993..b3487bc36a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-channel-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildCalendarChannelStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildCalendarChannelStandardFlatIndexMetadatas = ({ indexName: 'connectedAccountIdIndex', relatedFieldNames: ['connectedAccount'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-event-participant-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-event-participant-standard-flat-index-metadata.util.ts index 86f25102d8..30e9dbb756 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-event-participant-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-calendar-event-participant-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildCalendarEventParticipantStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -26,7 +26,7 @@ export const buildCalendarEventParticipantStandardFlatIndexMetadatas = ({ indexName: 'calendarEventIdIndex', relatedFieldNames: ['calendarEvent'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -38,7 +38,7 @@ export const buildCalendarEventParticipantStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -50,7 +50,7 @@ export const buildCalendarEventParticipantStandardFlatIndexMetadatas = ({ indexName: 'workspaceMemberIdIndex', relatedFieldNames: ['workspaceMember'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util.ts index 7fc810e22a..82d744b624 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildCompanyStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildCompanyStandardFlatIndexMetadatas = ({ indexName: 'accountOwnerIdIndex', relatedFieldNames: ['accountOwner'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -37,7 +37,7 @@ export const buildCompanyStandardFlatIndexMetadatas = ({ relatedFieldNames: ['domainName'], isUnique: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -50,7 +50,7 @@ export const buildCompanyStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-connected-account-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-connected-account-standard-flat-index-metadata.util.ts index d6fb860f9b..75d72f1e14 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-connected-account-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-connected-account-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildConnectedAccountStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildConnectedAccountStandardFlatIndexMetadatas = ({ indexName: 'accountOwnerIdIndex', relatedFieldNames: ['accountOwner'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util.ts index 7b456ba201..6460523fda 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildDashboardStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -25,7 +25,7 @@ export const buildDashboardStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-favorite-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-favorite-standard-flat-index-metadata.util.ts index 4f0d03abb9..4c3c9e4b4e 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-favorite-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-favorite-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'forWorkspaceMemberIdIndex', relatedFieldNames: ['forWorkspaceMember'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'favoriteFolderIdIndex', relatedFieldNames: ['favoriteFolder'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'opportunityIdIndex', relatedFieldNames: ['opportunity'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -83,7 +83,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -95,7 +95,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'workflowVersionIdIndex', relatedFieldNames: ['workflowVersion'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -107,7 +107,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'workflowRunIdIndex', relatedFieldNames: ['workflowRun'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -119,7 +119,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'taskIdIndex', relatedFieldNames: ['task'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -131,7 +131,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'noteIdIndex', relatedFieldNames: ['note'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -143,7 +143,7 @@ export const buildFavoriteStandardFlatIndexMetadatas = ({ indexName: 'dashboardIdIndex', relatedFieldNames: ['dashboard'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util.ts index 6924d4a898..173e91f0ec 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildMessageChannelMessageAssociationStandardFlatIndexMetadatas = now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -27,7 +27,7 @@ export const buildMessageChannelMessageAssociationStandardFlatIndexMetadatas = indexName: 'messageChannelIdIndex', relatedFieldNames: ['messageChannel'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -39,7 +39,7 @@ export const buildMessageChannelMessageAssociationStandardFlatIndexMetadatas = indexName: 'messageIdIndex', relatedFieldNames: ['message'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -52,7 +52,7 @@ export const buildMessageChannelMessageAssociationStandardFlatIndexMetadatas = relatedFieldNames: ['messageChannel', 'message'], isUnique: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-standard-flat-index-metadata.util.ts index 797da5572b..7735020bd2 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildMessageChannelStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildMessageChannelStandardFlatIndexMetadatas = ({ indexName: 'connectedAccountIdIndex', relatedFieldNames: ['connectedAccount'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-folder-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-folder-standard-flat-index-metadata.util.ts index f824960dbd..2962e8b532 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-folder-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-folder-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildMessageFolderStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildMessageFolderStandardFlatIndexMetadatas = ({ indexName: 'messageChannelIdIndex', relatedFieldNames: ['messageChannel'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts index 10a5a29841..7a53f40f47 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildMessageParticipantStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildMessageParticipantStandardFlatIndexMetadatas = ({ indexName: 'messageIdIndex', relatedFieldNames: ['message'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildMessageParticipantStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildMessageParticipantStandardFlatIndexMetadatas = ({ indexName: 'workspaceMemberIdIndex', relatedFieldNames: ['workspaceMember'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts index 2503758c51..a5290e5ca1 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildMessageStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildMessageStandardFlatIndexMetadatas = ({ indexName: 'messageThreadIdIndex', relatedFieldNames: ['messageThread'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-standard-flat-index-metadata.util.ts index 5a4652fb77..cd0c6fb980 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildNoteStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -25,7 +25,7 @@ export const buildNoteStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-target-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-target-standard-flat-index-metadata.util.ts index 75f7d9078a..3018c1c627 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-target-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-target-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildNoteTargetStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildNoteTargetStandardFlatIndexMetadatas = ({ indexName: 'noteIdIndex', relatedFieldNames: ['note'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildNoteTargetStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildNoteTargetStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildNoteTargetStandardFlatIndexMetadatas = ({ indexName: 'opportunityIdIndex', relatedFieldNames: ['opportunity'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-opportunity-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-opportunity-standard-flat-index-metadata.util.ts index ad6b470dd9..a029a59fc6 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-opportunity-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-opportunity-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildOpportunityStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildOpportunityStandardFlatIndexMetadatas = ({ indexName: 'pointOfContactIdIndex', relatedFieldNames: ['pointOfContact'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -36,7 +36,7 @@ export const buildOpportunityStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -48,7 +48,7 @@ export const buildOpportunityStandardFlatIndexMetadatas = ({ indexName: 'stageIndex', relatedFieldNames: ['stage'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -61,7 +61,7 @@ export const buildOpportunityStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-person-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-person-standard-flat-index-metadata.util.ts index 7c81134151..e931b27e8f 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-person-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-person-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildPersonStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildPersonStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -37,7 +37,7 @@ export const buildPersonStandardFlatIndexMetadatas = ({ relatedFieldNames: ['emails'], isUnique: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -50,7 +50,7 @@ export const buildPersonStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-standard-flat-index-metadata.util.ts index 52042ab4ba..783c2d6a12 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildTaskStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildTaskStandardFlatIndexMetadatas = ({ indexName: 'assigneeIdIndex', relatedFieldNames: ['assignee'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -37,7 +37,7 @@ export const buildTaskStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-target-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-target-standard-flat-index-metadata.util.ts index b051a8777a..526c5ef845 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-target-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-task-target-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildTaskTargetStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildTaskTargetStandardFlatIndexMetadatas = ({ indexName: 'taskIdIndex', relatedFieldNames: ['task'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildTaskTargetStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildTaskTargetStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildTaskTargetStandardFlatIndexMetadatas = ({ indexName: 'opportunityIdIndex', relatedFieldNames: ['opportunity'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-timeline-activity-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-timeline-activity-standard-flat-index-metadata.util.ts index 41a5475660..fbd5c2189b 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-timeline-activity-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-timeline-activity-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -23,7 +23,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'workspaceMemberIdIndex', relatedFieldNames: ['workspaceMember'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -35,7 +35,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'personIdIndex', relatedFieldNames: ['person'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -47,7 +47,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'companyIdIndex', relatedFieldNames: ['company'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'opportunityIdIndex', relatedFieldNames: ['opportunity'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -71,7 +71,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'noteIdIndex', relatedFieldNames: ['note'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -83,7 +83,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'taskIdIndex', relatedFieldNames: ['task'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -95,7 +95,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -107,7 +107,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'workflowVersionIdIndex', relatedFieldNames: ['workflowVersion'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -119,7 +119,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'workflowRunIdIndex', relatedFieldNames: ['workflowRun'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -131,7 +131,7 @@ export const buildTimelineActivityStandardFlatIndexMetadatas = ({ indexName: 'dashboardIdIndex', relatedFieldNames: ['dashboard'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-automated-trigger-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-automated-trigger-standard-flat-index-metadata.util.ts index 2f8de7f345..e97bbd7b7d 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-automated-trigger-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-automated-trigger-standard-flat-index-metadata.util.ts @@ -9,7 +9,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit< @@ -26,7 +26,7 @@ export const buildWorkflowAutomatedTriggerStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-run-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-run-standard-flat-index-metadata.util.ts index 09c2120e3a..a0f6d06b08 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-run-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-run-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildWorkflowRunStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildWorkflowRunStandardFlatIndexMetadatas = ({ indexName: 'workflowVersionIdIndex', relatedFieldNames: ['workflowVersion'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -36,7 +36,7 @@ export const buildWorkflowRunStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -49,7 +49,7 @@ export const buildWorkflowRunStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-standard-flat-index-metadata.util.ts index 4f28649579..1619256873 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildWorkflowStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -25,7 +25,7 @@ export const buildWorkflowStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-version-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-version-standard-flat-index-metadata.util.ts index e258e1b0bf..fbfc37afb0 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-version-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workflow-version-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildWorkflowVersionStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -24,7 +24,7 @@ export const buildWorkflowVersionStandardFlatIndexMetadatas = ({ indexName: 'workflowIdIndex', relatedFieldNames: ['workflow'], }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -37,7 +37,7 @@ export const buildWorkflowVersionStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workspace-member-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workspace-member-standard-flat-index-metadata.util.ts index ee25143304..a8809eb5d1 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workspace-member-standard-flat-index-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-workspace-member-standard-flat-index-metadata.util.ts @@ -10,7 +10,7 @@ export const buildWorkspaceMemberStandardFlatIndexMetadatas = ({ now, objectName, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, }: Omit, 'context'>): Record< @@ -25,7 +25,7 @@ export const buildWorkspaceMemberStandardFlatIndexMetadatas = ({ relatedFieldNames: ['userEmail'], isUnique: true, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, @@ -38,7 +38,7 @@ export const buildWorkspaceMemberStandardFlatIndexMetadatas = ({ relatedFieldNames: ['searchVector'], indexType: IndexType.GIN, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps, twentyStandardApplicationId, now, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util.ts index 693a3872e4..205ad1b973 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util.ts @@ -41,7 +41,7 @@ export const createStandardIndexFlatMetadata = < indexWhereClause = null, isUnique = false, }, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps: { flatFieldMetadataMaps, flatObjectMetadataMaps }, twentyStandardApplicationId, now, @@ -59,7 +59,7 @@ export const createStandardIndexFlatMetadata = < }; const objectMetadataId = - standardFieldMetadataIdByObjectAndFieldName[objectName].id; + standardObjectMetadataRelatedEntityIds[objectName].id; const flatObjectMetadata = findFlatEntityByIdInFlatEntityMapsOrThrow({ flatEntityId: objectMetadataId, flatEntityMaps: flatObjectMetadataMaps, @@ -67,7 +67,7 @@ export const createStandardIndexFlatMetadata = < const relatedFieldIds = relatedFieldNames.map( (fieldName) => - standardFieldMetadataIdByObjectAndFieldName[objectName].fields[fieldName], + standardObjectMetadataRelatedEntityIds[objectName].fields[fieldName].id, ); const flatFieldMetadatas = findManyFlatEntityByIdInFlatEntityMapsOrThrow({ flatEntityIds: relatedFieldIds, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util.ts index 1282469b2e..a91a9d0255 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util.ts @@ -1,26 +1,18 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type'; import { STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util'; import { type CreateStandardObjectArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util'; -const createEmptyFlatObjectMetadataMaps = - (): FlatEntityMaps => ({ - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }); - export const buildStandardFlatObjectMetadataMaps = ( args: Omit, ): FlatEntityMaps => { - // Collect all object metadatas from all standard objects const allObjectMetadatas: FlatObjectMetadata[] = Object.values( STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME, ).map((builder) => builder(args)); - // Build maps using addFlatEntityToFlatEntityMapsOrThrow to prevent duplicate IDs - let flatObjectMetadataMaps = createEmptyFlatObjectMetadataMaps(); + let flatObjectMetadataMaps = createEmptyFlatEntityMaps(); for (const objectMetadata of allObjectMetadatas) { flatObjectMetadataMaps = addFlatEntityToFlatEntityMapsOrThrow({ diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts index b018e4c5b2..776abac0ea 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts @@ -10,7 +10,7 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { attachment: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -30,14 +30,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), blocklist: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -57,14 +57,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), calendarChannelEventAssociation: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -90,14 +90,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), calendarChannel: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -122,14 +122,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), calendarEventParticipant: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -155,14 +155,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), calendarEvent: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -187,14 +187,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'title', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), company: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -215,14 +215,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), connectedAccount: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -247,14 +247,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), dashboard: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -275,14 +275,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'title', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), favorite: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -302,14 +302,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), favoriteFolder: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -333,14 +333,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), messageChannelMessageAssociation: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -366,14 +366,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), messageChannel: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -398,14 +398,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), messageFolder: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -429,14 +429,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), messageParticipant: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -461,14 +461,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'handle', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), messageThread: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -493,14 +493,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), message: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -522,14 +522,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'subject', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), note: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -550,14 +550,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'title', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), noteTarget: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -577,14 +577,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), opportunity: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -605,14 +605,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), person: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -633,14 +633,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), task: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -661,14 +661,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'title', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), taskTarget: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -688,14 +688,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), timelineActivity: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -720,14 +720,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), workflow: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -748,14 +748,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), workflowAutomatedTrigger: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -780,14 +780,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'id', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), workflowRun: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit, 'context' | 'objectName'>) => @@ -807,14 +807,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), workflowVersion: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -838,14 +838,14 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), workspaceMember: ({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps, }: Omit< @@ -869,7 +869,7 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = { labelIdentifierFieldMetadataName: 'name', }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }), diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts index 8304bef00e..41fd10b123 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts @@ -47,7 +47,7 @@ export const createStandardObjectFlatMetadata = < labelIdentifierFieldMetadataName, }, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, now, }: CreateStandardObjectArgs): FlatObjectMetadata => ({ @@ -73,9 +73,9 @@ export const createStandardObjectFlatMetadata = < duplicateCriteria: null, shortcut, labelIdentifierFieldMetadataId: - standardFieldMetadataIdByObjectAndFieldName[nameSingular].fields[ + standardObjectMetadataRelatedEntityIds[nameSingular].fields[ labelIdentifierFieldMetadataName - ], + ].id, imageIdentifierFieldMetadataId: null, targetTableName: 'DEPRECATED', fieldMetadataIds: [], @@ -83,5 +83,5 @@ export const createStandardObjectFlatMetadata = < viewIds: [], createdAt: now, updatedAt: now, - id: standardFieldMetadataIdByObjectAndFieldName[nameSingular].id, + id: standardObjectMetadataRelatedEntityIds[nameSingular].id, }); diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant.ts index 76f213ed5d..4e4b4ffcd5 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant.ts @@ -1,9 +1,13 @@ import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; -import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type'; +import { type TwentyStandardAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type'; import { buildStandardFlatFieldMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util'; -import { getStandardFieldMetadataIdByObjectAndFieldName } from 'src/engine/workspace-manager/twenty-standard-application/utils/get-standard-field-metadata-id-by-object-and-field-name.util'; +import { getStandardObjectMetadataRelatedEntityIds } from 'src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util'; import { buildStandardFlatIndexMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util'; import { buildStandardFlatObjectMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util'; +import { buildStandardFlatViewFieldMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/build-standard-flat-view-field-metadata-maps.util'; +import { buildStandardFlatViewFilterMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-filter/build-standard-flat-view-filter-metadata-maps.util'; +import { buildStandardFlatViewGroupMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-group/build-standard-flat-view-group-metadata-maps.util'; +import { buildStandardFlatViewMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/build-standard-flat-view-metadata-maps.util'; export type ComputeTwentyStandardApplicationAllFlatEntityMapsArgs = { now: string; @@ -15,14 +19,14 @@ export const computeTwentyStandardApplicationAllFlatEntityMaps = ({ now, workspaceId, twentyStandardApplicationId, -}: ComputeTwentyStandardApplicationAllFlatEntityMapsArgs): AllFlatEntityMaps => { - const standardFieldMetadataIdByObjectAndFieldName = - getStandardFieldMetadataIdByObjectAndFieldName(); +}: ComputeTwentyStandardApplicationAllFlatEntityMapsArgs): TwentyStandardAllFlatEntityMaps => { + const standardObjectMetadataRelatedEntityIds = + getStandardObjectMetadataRelatedEntityIds(); const flatObjectMetadataMaps = buildStandardFlatObjectMetadataMaps({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, twentyStandardApplicationId, dependencyFlatEntityMaps: { flatFieldMetadataMaps: createEmptyFlatEntityMaps(), @@ -32,7 +36,7 @@ export const computeTwentyStandardApplicationAllFlatEntityMaps = ({ const flatFieldMetadataMaps = buildStandardFlatFieldMetadataMaps({ now, workspaceId, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, dependencyFlatEntityMaps: { flatObjectMetadataMaps, }, @@ -45,84 +49,63 @@ export const computeTwentyStandardApplicationAllFlatEntityMaps = ({ flatObjectMetadataMaps, }, now, - standardFieldMetadataIdByObjectAndFieldName, + standardObjectMetadataRelatedEntityIds, workspaceId, twentyStandardApplicationId, }); + const flatViewMaps = buildStandardFlatViewMetadataMaps({ + dependencyFlatEntityMaps: { + flatFieldMetadataMaps, + flatObjectMetadataMaps, + }, + now, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + workspaceId, + }); + + const flatViewGroupMaps = buildStandardFlatViewGroupMetadataMaps({ + dependencyFlatEntityMaps: { + flatFieldMetadataMaps, + flatViewMaps, + }, + now, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + workspaceId, + }); + + const flatViewFilterMaps = buildStandardFlatViewFilterMetadataMaps({ + dependencyFlatEntityMaps: { + flatFieldMetadataMaps, + flatViewMaps, + }, + now, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + workspaceId, + }); + + const flatViewFieldMaps = buildStandardFlatViewFieldMetadataMaps({ + dependencyFlatEntityMaps: { + flatObjectMetadataMaps, + flatFieldMetadataMaps, + flatViewMaps, + }, + now, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + workspaceId, + }); + return { - flatAgentMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatCronTriggerMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatDatabaseEventTriggerMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatFieldMetadataMaps, + flatViewFieldMaps, + flatViewFilterMaps, + flatViewGroupMaps, + flatViewMaps, flatIndexMaps, + flatFieldMetadataMaps, flatObjectMetadataMaps, - flatRoleMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatRoleTargetMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatRouteTriggerMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatServerlessFunctionMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatViewFieldMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatViewFilterMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatViewGroupMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatViewMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatPageLayoutMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatPageLayoutWidgetMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, - flatPageLayoutTabMaps: { - byId: {}, - idByUniversalIdentifier: {}, - universalIdentifiersByApplicationId: {}, - }, }; }; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/build-standard-flat-view-field-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/build-standard-flat-view-field-metadata-maps.util.ts new file mode 100644 index 0000000000..677b50b98a --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/build-standard-flat-view-field-metadata-maps.util.ts @@ -0,0 +1,48 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; +import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; +import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; +import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { computeStandardTaskViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-view-fields.util'; +import { type CreateStandardViewFieldArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util'; + +type StandardViewFieldBuilder

= ( + args: Omit, 'context'>, +) => Record; + +const STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = { + task: computeStandardTaskViewFields, +} as const satisfies { + [P in AllStandardObjectName]?: StandardViewFieldBuilder

; +}; + +export const buildStandardFlatViewFieldMetadataMaps = ( + args: Omit, +): FlatEntityMaps => { + const allViewFieldMetadatas: FlatViewField[] = ( + Object.keys( + STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME, + ) as (keyof typeof STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME)[] + ).flatMap((objectName) => { + const builder: StandardViewFieldBuilder = + STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME[objectName]; + + const result = builder({ + ...args, + objectName, + }); + + return Object.values(result); + }); + + let flatViewFieldMaps = createEmptyFlatEntityMaps(); + + for (const viewFieldMetadata of allViewFieldMetadatas) { + flatViewFieldMaps = addFlatEntityToFlatEntityMapsOrThrow({ + flatEntity: viewFieldMetadata, + flatEntityMaps: flatViewFieldMaps, + }); + } + + return flatViewFieldMaps; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-view-fields.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-view-fields.util.ts new file mode 100644 index 0000000000..3d752f2591 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-view-fields.util.ts @@ -0,0 +1,257 @@ +import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type'; +import { + createStandardViewFieldFlatMetadata, + type CreateStandardViewFieldArgs, +} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util'; + +export const computeStandardTaskViewFields = ( + args: Omit, 'context'>, +): Record => { + return { + // allTasks view fields + allTasksTitle: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'title', + fieldName: 'title', + position: 0, + isVisible: true, + size: 210, + }, + }), + allTasksStatus: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'status', + fieldName: 'status', + position: 2, + isVisible: true, + size: 150, + }, + }), + allTasksTaskTargets: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'taskTargets', + fieldName: 'taskTargets', + position: 3, + isVisible: true, + size: 150, + }, + }), + allTasksCreatedBy: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'createdBy', + fieldName: 'createdBy', + position: 4, + isVisible: true, + size: 150, + }, + }), + allTasksDueAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'dueAt', + fieldName: 'dueAt', + position: 5, + isVisible: true, + size: 150, + }, + }), + allTasksAssignee: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'assignee', + fieldName: 'assignee', + position: 6, + isVisible: true, + size: 150, + }, + }), + allTasksBodyV2: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'bodyV2', + fieldName: 'bodyV2', + position: 7, + isVisible: true, + size: 150, + }, + }), + allTasksCreatedAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + viewFieldName: 'createdAt', + fieldName: 'createdAt', + position: 8, + isVisible: true, + size: 150, + }, + }), + + // byStatus view fields + byStatusTitle: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewFieldName: 'title', + fieldName: 'title', + position: 0, + isVisible: true, + size: 210, + }, + }), + byStatusStatus: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewFieldName: 'status', + fieldName: 'status', + position: 2, + isVisible: true, + size: 150, + }, + }), + byStatusDueAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewFieldName: 'dueAt', + fieldName: 'dueAt', + position: 3, + isVisible: true, + size: 150, + }, + }), + byStatusAssignee: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewFieldName: 'assignee', + fieldName: 'assignee', + position: 4, + isVisible: true, + size: 150, + }, + }), + byStatusCreatedAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewFieldName: 'createdAt', + fieldName: 'createdAt', + position: 6, + isVisible: true, + size: 150, + }, + }), + + // assignedToMe view fields + assignedToMeTitle: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'title', + fieldName: 'title', + position: 0, + isVisible: true, + size: 210, + }, + }), + assignedToMeTaskTargets: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'taskTargets', + fieldName: 'taskTargets', + position: 3, + isVisible: true, + size: 150, + }, + }), + assignedToMeCreatedBy: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'createdBy', + fieldName: 'createdBy', + position: 4, + isVisible: true, + size: 150, + }, + }), + assignedToMeDueAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'dueAt', + fieldName: 'dueAt', + position: 5, + isVisible: true, + size: 150, + }, + }), + assignedToMeAssignee: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'assignee', + fieldName: 'assignee', + position: 6, + isVisible: true, + size: 150, + }, + }), + assignedToMeBodyV2: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'bodyV2', + fieldName: 'bodyV2', + position: 7, + isVisible: true, + size: 150, + }, + }), + assignedToMeCreatedAt: createStandardViewFieldFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFieldName: 'createdAt', + fieldName: 'createdAt', + position: 8, + isVisible: true, + size: 150, + }, + }), + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util.ts new file mode 100644 index 0000000000..895fc60cb7 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util.ts @@ -0,0 +1,82 @@ +import { isDefined } from 'twenty-shared/utils'; +import { v4 } from 'uuid'; + +import { type AggregateOperations } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant'; +import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type'; +import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-field-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type'; + +export type CreateStandardViewFieldOptions< + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = { + viewName: V; + viewFieldName: AllStandardObjectViewFieldName; + fieldName: AllStandardObjectFieldName; + position: number; + isVisible: boolean; + size: number; + aggregateOperation?: AggregateOperations | null; +}; + +export type CreateStandardViewFieldArgs< + O extends AllStandardObjectName = AllStandardObjectName, + V extends AllStandardObjectViewName = AllStandardObjectViewName, +> = StandardBuilderArgs<'viewField'> & { + objectName: O; + context: CreateStandardViewFieldOptions; +}; + +export const createStandardViewFieldFlatMetadata = < + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +>({ + workspaceId, + objectName, + context: { + viewName, + viewFieldName, + fieldName, + position, + isVisible, + size, + aggregateOperation = null, + }, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + now, +}: CreateStandardViewFieldArgs): FlatViewField => { + // @ts-expect-error ignore + const viewFieldDefinition = STANDARD_OBJECTS[objectName].views[viewName] + .viewFields[viewFieldName] as { + universalIdentifier: string; + }; + + if (!isDefined(viewFieldDefinition)) { + throw new Error( + `Invalid configuration ${objectName} ${viewName.toString()} ${viewFieldName}`, + ); + } + + return { + id: v4(), + universalIdentifier: viewFieldDefinition.universalIdentifier, + applicationId: twentyStandardApplicationId, + workspaceId, + viewId: + standardObjectMetadataRelatedEntityIds[objectName].views[viewName].id, + fieldMetadataId: + standardObjectMetadataRelatedEntityIds[objectName].fields[fieldName].id, + position, + isVisible, + size, + aggregateOperation, + createdAt: now, + updatedAt: now, + deletedAt: null, + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/build-standard-flat-view-filter-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/build-standard-flat-view-filter-metadata-maps.util.ts new file mode 100644 index 0000000000..5d922ae079 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/build-standard-flat-view-filter-metadata-maps.util.ts @@ -0,0 +1,48 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; +import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; +import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; +import { type FlatViewFilter } from 'src/engine/metadata-modules/flat-view-filter/types/flat-view-filter.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { computeStandardTaskViewFilters } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-filter/compute-standard-task-view-filters.util'; +import { type CreateStandardViewFilterArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-filter/create-standard-view-filter-flat-metadata.util'; + +type StandardViewFilterBuilder

= ( + args: Omit, 'context'>, +) => Record; + +const STANDARD_FLAT_VIEW_FILTER_METADATA_BUILDERS_BY_OBJECT_NAME = { + task: computeStandardTaskViewFilters, +} as const satisfies { + [P in AllStandardObjectName]?: StandardViewFilterBuilder

; +}; + +export const buildStandardFlatViewFilterMetadataMaps = ( + args: Omit, +): FlatEntityMaps => { + const allViewFilterMetadatas: FlatViewFilter[] = ( + Object.keys( + STANDARD_FLAT_VIEW_FILTER_METADATA_BUILDERS_BY_OBJECT_NAME, + ) as (keyof typeof STANDARD_FLAT_VIEW_FILTER_METADATA_BUILDERS_BY_OBJECT_NAME)[] + ).flatMap((objectName) => { + const builder: StandardViewFilterBuilder = + STANDARD_FLAT_VIEW_FILTER_METADATA_BUILDERS_BY_OBJECT_NAME[objectName]; + + const result = builder({ + ...args, + objectName, + }); + + return Object.values(result); + }); + + let flatViewFilterMaps = createEmptyFlatEntityMaps(); + + for (const viewFilterMetadata of allViewFilterMetadatas) { + flatViewFilterMaps = addFlatEntityToFlatEntityMapsOrThrow({ + flatEntity: viewFilterMetadata, + flatEntityMaps: flatViewFilterMaps, + }); + } + + return flatViewFilterMaps; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/compute-standard-task-view-filters.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/compute-standard-task-view-filters.util.ts new file mode 100644 index 0000000000..65e872f0e8 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/compute-standard-task-view-filters.util.ts @@ -0,0 +1,28 @@ +import { ViewFilterOperand } from 'twenty-shared/types'; + +import { type FlatViewFilter } from 'src/engine/metadata-modules/flat-view-filter/types/flat-view-filter.type'; +import { + createStandardViewFilterFlatMetadata, + type CreateStandardViewFilterArgs, +} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-filter/create-standard-view-filter-flat-metadata.util'; + +export const computeStandardTaskViewFilters = ( + args: Omit, 'context'>, +): Record => { + return { + assignedToMeAssigneeIsMe: createStandardViewFilterFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewFilterName: 'assigneeIsMe', + fieldName: 'assignee', + operand: ViewFilterOperand.IS, + value: JSON.stringify({ + isCurrentWorkspaceMemberSelected: true, + selectedRecordIds: [], + }), + }, + }), + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/create-standard-view-filter-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/create-standard-view-filter-flat-metadata.util.ts new file mode 100644 index 0000000000..387b3b2520 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-filter/create-standard-view-filter-flat-metadata.util.ts @@ -0,0 +1,85 @@ +import { type ViewFilterOperand } from 'twenty-shared/types'; +import { isDefined } from 'twenty-shared/utils'; +import { v4 } from 'uuid'; + +import { type FlatViewFilter } from 'src/engine/metadata-modules/flat-view-filter/types/flat-view-filter.type'; +import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewFilterName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-filter-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type'; + +export type CreateStandardViewFilterOptions< + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = { + viewName: V; + viewFilterName: AllStandardObjectViewFilterName; + fieldName: AllStandardObjectFieldName; + operand: ViewFilterOperand; + value: string; + subFieldName?: string | null; + viewFilterGroupId?: string | null; + positionInViewFilterGroup?: number | null; +}; + +export type CreateStandardViewFilterArgs< + O extends AllStandardObjectName = AllStandardObjectName, + V extends AllStandardObjectViewName = AllStandardObjectViewName, +> = StandardBuilderArgs<'viewFilter'> & { + objectName: O; + context: CreateStandardViewFilterOptions; +}; + +export const createStandardViewFilterFlatMetadata = < + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +>({ + workspaceId, + objectName, + context: { + viewName, + viewFilterName, + fieldName, + operand, + value, + subFieldName = null, + viewFilterGroupId = null, + positionInViewFilterGroup = null, + }, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + now, +}: CreateStandardViewFilterArgs): FlatViewFilter => { + // @ts-expect-error ignore + const viewFilterDefinition = STANDARD_OBJECTS[objectName].views[viewName] + .viewFilters[viewFilterName] as { + universalIdentifier: string; + }; + + if (!isDefined(viewFilterDefinition)) { + throw new Error( + `Invalid configuration ${objectName} ${viewName.toString()} ${viewFilterName}`, + ); + } + + return { + id: v4(), + universalIdentifier: viewFilterDefinition.universalIdentifier, + applicationId: twentyStandardApplicationId, + workspaceId, + viewId: + standardObjectMetadataRelatedEntityIds[objectName].views[viewName].id, + fieldMetadataId: + standardObjectMetadataRelatedEntityIds[objectName].fields[fieldName].id, + operand, + value, + subFieldName, + viewFilterGroupId, + positionInViewFilterGroup, + createdAt: now, + updatedAt: now, + deletedAt: null, + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/build-standard-flat-view-group-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/build-standard-flat-view-group-metadata-maps.util.ts new file mode 100644 index 0000000000..5835b2f5a8 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/build-standard-flat-view-group-metadata-maps.util.ts @@ -0,0 +1,48 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; +import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; +import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; +import { type FlatViewGroup } from 'src/engine/metadata-modules/flat-view-group/types/flat-view-group.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type CreateStandardViewGroupArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-group/create-standard-view-group-flat-metadata.util'; +import { computeStandardTaskViewGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-group/compute-standard-task-view-groups.util'; + +type StandardViewGroupBuilder

= ( + args: Omit, 'context'>, +) => Record; + +const STANDARD_FLAT_VIEW_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME = { + task: computeStandardTaskViewGroups, +} as const satisfies { + [P in AllStandardObjectName]?: StandardViewGroupBuilder

; +}; + +export const buildStandardFlatViewGroupMetadataMaps = ( + args: Omit, +): FlatEntityMaps => { + const allViewGroupMetadatas: FlatViewGroup[] = ( + Object.keys( + STANDARD_FLAT_VIEW_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME, + ) as (keyof typeof STANDARD_FLAT_VIEW_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME)[] + ).flatMap((objectName) => { + const builder: StandardViewGroupBuilder = + STANDARD_FLAT_VIEW_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME[objectName]; + + const result = builder({ + ...args, + objectName, + }); + + return Object.values(result); + }); + + let flatViewGroupMaps = createEmptyFlatEntityMaps(); + + for (const viewGroupMetadata of allViewGroupMetadatas) { + flatViewGroupMaps = addFlatEntityToFlatEntityMapsOrThrow({ + flatEntity: viewGroupMetadata, + flatEntityMaps: flatViewGroupMaps, + }); + } + + return flatViewGroupMaps; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/compute-standard-task-view-groups.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/compute-standard-task-view-groups.util.ts new file mode 100644 index 0000000000..f26b3f4558 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/compute-standard-task-view-groups.util.ts @@ -0,0 +1,96 @@ +import { type FlatViewGroup } from 'src/engine/metadata-modules/flat-view-group/types/flat-view-group.type'; +import { + createStandardViewGroupFlatMetadata, + type CreateStandardViewGroupArgs, +} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-group/create-standard-view-group-flat-metadata.util'; + +export const computeStandardTaskViewGroups = ( + args: Omit, 'context'>, +): Record => { + return { + assignedToMeTodo: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewGroupName: 'todo', + fieldName: 'status', + isVisible: true, + fieldValue: 'TODO', + position: 0, + }, + }), + assignedToMeInProgress: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewGroupName: 'inProgress', + fieldName: 'status', + isVisible: true, + fieldValue: 'IN_PROGRESS', + position: 1, + }, + }), + assignedToMeDone: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewGroupName: 'done', + fieldName: 'status', + isVisible: true, + fieldValue: 'DONE', + position: 2, + }, + }), + assignedToMeEmpty: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + viewGroupName: 'empty', + fieldName: 'status', + isVisible: true, + fieldValue: '', + position: 3, + }, + }), + byStatusTodo: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewGroupName: 'todo', + fieldName: 'status', + isVisible: true, + fieldValue: 'TODO', + position: 0, + }, + }), + byStatusInProgress: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewGroupName: 'inProgress', + fieldName: 'status', + isVisible: true, + fieldValue: 'IN_PROGRESS', + position: 1, + }, + }), + byStatusDone: createStandardViewGroupFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + viewGroupName: 'done', + fieldName: 'status', + isVisible: true, + fieldValue: 'DONE', + position: 2, + }, + }), + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/create-standard-view-group-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/create-standard-view-group-flat-metadata.util.ts new file mode 100644 index 0000000000..f910b35dd0 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-group/create-standard-view-group-flat-metadata.util.ts @@ -0,0 +1,78 @@ +import { isDefined } from 'twenty-shared/utils'; +import { v4 } from 'uuid'; + +import { type FlatViewGroup } from 'src/engine/metadata-modules/flat-view-group/types/flat-view-group.type'; +import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewGroupName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-group-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type'; + +export type CreateStandardViewGroupOptions< + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +> = { + viewName: V; + viewGroupName: AllStandardObjectViewGroupName; + fieldName: AllStandardObjectFieldName; + isVisible: boolean; + fieldValue: string; + position: number; +}; + +export type CreateStandardViewGroupArgs< + O extends AllStandardObjectName = AllStandardObjectName, + V extends AllStandardObjectViewName = AllStandardObjectViewName, +> = StandardBuilderArgs<'viewGroup'> & { + objectName: O; + context: CreateStandardViewGroupOptions; +}; + +export const createStandardViewGroupFlatMetadata = < + O extends AllStandardObjectName, + V extends AllStandardObjectViewName, +>({ + workspaceId, + objectName, + context: { + viewName, + viewGroupName, + fieldName, + isVisible, + fieldValue, + position, + }, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + now, +}: CreateStandardViewGroupArgs): FlatViewGroup => { + // @ts-expect-error ignore + const viewGroupDefinition = STANDARD_OBJECTS[objectName].views[viewName] + .viewGroups[viewGroupName] as { + universalIdentifier: string; + }; + + if (!isDefined(viewGroupDefinition)) { + throw new Error( + `Invalid configuration ${objectName} ${viewName.toString()} ${viewGroupName}`, + ); + } + + return { + id: v4(), + universalIdentifier: viewGroupDefinition.universalIdentifier, + applicationId: twentyStandardApplicationId, + workspaceId, + viewId: + standardObjectMetadataRelatedEntityIds[objectName].views[viewName].id, + fieldMetadataId: + standardObjectMetadataRelatedEntityIds[objectName].fields[fieldName].id, + isVisible, + fieldValue, + position, + createdAt: now, + updatedAt: now, + deletedAt: null, + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/build-standard-flat-view-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/build-standard-flat-view-metadata-maps.util.ts new file mode 100644 index 0000000000..ff6435ffe1 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/build-standard-flat-view-metadata-maps.util.ts @@ -0,0 +1,48 @@ +import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; +import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; +import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util'; +import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { computeStandardTaskViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-views.util'; +import { type CreateStandardViewArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util'; + +type StandardViewBuilder

= ( + args: Omit, 'context'>, +) => Record; + +const STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME = { + task: computeStandardTaskViews, +} as const satisfies { + [P in AllStandardObjectName]?: StandardViewBuilder

; +}; + +export const buildStandardFlatViewMetadataMaps = ( + args: Omit, +): FlatEntityMaps => { + const allViewMetadatas: FlatView[] = ( + Object.keys( + STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME, + ) as (keyof typeof STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME)[] + ).flatMap((objectName) => { + const builder: StandardViewBuilder = + STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME[objectName]; + + const result = builder({ + ...args, + objectName, + }); + + return Object.values(result); + }); + + let flatViewMaps = createEmptyFlatEntityMaps(); + + for (const viewMetadata of allViewMetadatas) { + flatViewMaps = addFlatEntityToFlatEntityMapsOrThrow({ + flatEntity: viewMetadata, + flatEntityMaps: flatViewMaps, + }); + } + + return flatViewMaps; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-views.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-views.util.ts new file mode 100644 index 0000000000..0a186e68d6 --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-views.util.ts @@ -0,0 +1,52 @@ +import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type'; +import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum'; +import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum'; +import { + createStandardViewFlatMetadata, + type CreateStandardViewArgs, +} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util'; + +export const computeStandardTaskViews = ( + args: Omit, 'context'>, +): Record => { + return { + allTasks: createStandardViewFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'allTasks', + name: 'All Tasks', + type: ViewType.TABLE, + key: ViewKey.INDEX, + position: 0, + icon: 'IconList', + }, + }), + byStatus: createStandardViewFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'byStatus', + name: 'By Status', + type: ViewType.KANBAN, + key: null, + position: 1, + icon: 'IconLayoutKanban', + mainGroupByFieldName: 'status', + }, + }), + assignedToMe: createStandardViewFlatMetadata({ + ...args, + objectName: 'task', + context: { + viewName: 'assignedToMe', + name: 'Assigned to Me', + type: ViewType.TABLE, + key: null, + position: 2, + icon: 'IconUserCircle', + mainGroupByFieldName: 'status', + }, + }), + }; +}; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util.ts new file mode 100644 index 0000000000..72f083396f --- /dev/null +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util.ts @@ -0,0 +1,122 @@ +import { isDefined } from 'class-validator'; + +import { type AggregateOperations } from 'src/engine/api/graphql/graphql-query-runner/constants/aggregate-operations.constant'; +import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type'; +import { type ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum'; +import { ViewOpenRecordIn } from 'src/engine/metadata-modules/view/enums/view-open-record-in'; +import { type ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum'; +import { ViewVisibility } from 'src/engine/metadata-modules/view/enums/view-visibility.enum'; +import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant'; +import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type'; +import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type'; +import { type AllStandardObjectViewName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-view-name.type'; +import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type'; + +export type CreateStandardViewOptions = { + viewName: AllStandardObjectViewName; + name: string; + type: ViewType; + key: ViewKey | null; + position: number; + icon: string; + isCompact?: boolean; + isCustom?: boolean; + openRecordIn?: ViewOpenRecordIn; + kanbanAggregateOperation?: AggregateOperations | null; + kanbanAggregateOperationFieldName?: AllStandardObjectFieldName; + mainGroupByFieldName?: AllStandardObjectFieldName; + calendarFieldName?: AllStandardObjectFieldName; +}; + +export type CreateStandardViewArgs< + O extends AllStandardObjectName = AllStandardObjectName, +> = StandardBuilderArgs<'view'> & { + objectName: O; + context: CreateStandardViewOptions; +}; + +export const createStandardViewFlatMetadata = < + O extends AllStandardObjectName, +>({ + workspaceId, + objectName, + context: { + viewName, + name, + type, + key, + position, + icon, + isCompact = false, + isCustom = false, + openRecordIn = ViewOpenRecordIn.SIDE_PANEL, + kanbanAggregateOperation = null, + kanbanAggregateOperationFieldName, + mainGroupByFieldName, + calendarFieldName, + }, + standardObjectMetadataRelatedEntityIds, + twentyStandardApplicationId, + now, +}: CreateStandardViewArgs): FlatView => { + // @ts-expect-error ignore + const viewDefinition = STANDARD_OBJECTS[objectName].views[viewName] as { + universalIdentifier: string; + }; + + if (!isDefined(viewDefinition)) { + throw new Error(`Invalid configuration ${objectName} ${viewName.toString}`); + } + + const objectMetadataId = + standardObjectMetadataRelatedEntityIds[objectName].id; + + const kanbanAggregateOperationFieldMetadataId = + kanbanAggregateOperationFieldName + ? standardObjectMetadataRelatedEntityIds[objectName].fields[ + kanbanAggregateOperationFieldName + ].id + : null; + + const mainGroupByFieldMetadataId = mainGroupByFieldName + ? standardObjectMetadataRelatedEntityIds[objectName].fields[ + mainGroupByFieldName + ].id + : null; + + const calendarFieldMetadataId = calendarFieldName + ? standardObjectMetadataRelatedEntityIds[objectName].fields[ + calendarFieldName + ].id + : null; + + return { + id: standardObjectMetadataRelatedEntityIds[objectName].views[viewName].id, + universalIdentifier: viewDefinition.universalIdentifier, + applicationId: twentyStandardApplicationId, + workspaceId, + objectMetadataId, + name, + type, + key, + icon, + position, + isCompact, + isCustom, + openRecordIn, + kanbanAggregateOperation, + kanbanAggregateOperationFieldMetadataId, + mainGroupByFieldMetadataId, + calendarLayout: null, + calendarFieldMetadataId, + anyFieldFilterValue: null, + visibility: ViewVisibility.WORKSPACE, + createdByUserWorkspaceId: null, + viewFieldIds: [], + viewFilterIds: [], + viewGroupIds: [], + createdAt: now, + updatedAt: now, + deletedAt: null, + }; +};