The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
feat(server): give the message object a standard record page layout (#26153)
Félix Malfait7a83d0eef007
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/__tests__/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/__tests__/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.spec.tsindex 3e25cc07a56..b6d8550a143 100644--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/__tests__/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.spec.ts+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/__tests__/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.spec.ts@@ -8,7 +8,7 @@ import { PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNI// Standard record-page layouts added AFTER 2.31 are born on the derived// scheme and need no pre-2.31 literal: list them here to keep the// completeness check green.-const POST_2_28_RECORD_PAGE_KEYS: string[] = [];+const POST_2_28_RECORD_PAGE_KEYS: string[] = ['messageRecordPage'];describe('PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER', () => {// A missing entry would make the standard reconcile silently skip thatdiff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-upgrade-version-command.module.tsindex 44067d63baf..27cbab38d13 100644--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-upgrade-version-command.module.ts+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-upgrade-version-command.module.ts@@ -8,6 +8,8 @@ import { WorkspaceIteratorModule } from 'src/database/commands/command-runners/wimport { UnpinCreationCommandsOnRecordSelectionCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789634112046-unpin-creation-commands-on-record-selection.command';import { BackfillMissingSystemRelationIndexesCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789663454000-backfill-missing-system-relation-indexes.command';import { RelinkWorkflowVersionsToCoreWorkflowsCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789645879295-relink-workflow-versions-to-core-workflows.command';+import { SyncMessageRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500000-sync-message-record-page.command';+import { SetMessageTextDisplayedMaxRowsCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command';import { ApplicationModule } from 'src/engine/core-modules/application/application.module';import { WorkspaceSchemaManagerModule } from 'src/engine/twenty-orm/workspace-schema-manager/workspace-schema-manager.module';import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache.module';@@ -33,6 +35,8 @@ import { WorkspaceSchemaMigrationRunnerActionHandlersModule } from 'src/engine/wMakeWorkflowRunProjectionRelationsNullableCommand,BackfillMissingSystemRelationIndexesCommand,PurgeSoftDeletedViewsCommand,+ SyncMessageRecordPageCommand,+ SetMessageTextDisplayedMaxRowsCommand,],exports: [RelinkWorkflowVersionsToCoreWorkflowsCommand],})diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500000-sync-message-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500000-sync-message-record-page.command.tsnew file mode 100644index 00000000000..e6bc078f7cc--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500000-sync-message-record-page.command.ts@@ -0,0 +1,291 @@+import { Command } from 'nest-commander';+import {+ STANDARD_OBJECTS,+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,+} from 'twenty-shared/metadata';+import { isDefined } from 'twenty-shared/utils';++import { ProvisionedWorkspaceCommandRunner } from 'src/database/commands/command-runners/provisioned-workspace.command-runner';+import { WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';+import { type RunOnWorkspaceArgs } from 'src/database/commands/command-runners/workspace.command-runner';+import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';+import { bindFieldsWidgetToExistingView } from 'src/database/commands/upgrade-version-command/2-42/utils/bind-fields-widget-to-existing-view.util';+import { ApplicationService } from 'src/engine/core-modules/application/application.service';+import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';+import { type FlatPageLayoutTab } from 'src/engine/metadata-modules/flat-page-layout-tab/types/flat-page-layout-tab.type';+import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';+import { type FlatPageLayout } from 'src/engine/metadata-modules/flat-page-layout/types/flat-page-layout.type';+import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group.type';+import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';+import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';+import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';++const MESSAGE = STANDARD_OBJECTS.message;+const MESSAGE_RECORD_PAGE =+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage;++const FIELDS_VIEW_UNIVERSAL_IDENTIFIER =+ MESSAGE.views.messageRecordPageFields.universalIdentifier;++const FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS = Object.values(+ MESSAGE.views.messageRecordPageFields.viewFieldGroups,+).map((viewFieldGroup) => viewFieldGroup.universalIdentifier);++const FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS = Object.values(+ MESSAGE.views.messageRecordPageFields.viewFields,+).map((viewField) => viewField.universalIdentifier);++const PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.universalIdentifier;++const HOME_TAB_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.tabs.home.universalIdentifier;++const PAGE_LAYOUT_TAB_UNIVERSAL_IDENTIFIERS = [HOME_TAB_UNIVERSAL_IDENTIFIER];++const FIELDS_WIDGET_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.tabs.home.widgets.fields.universalIdentifier;++const PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIERS = [+ FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+];++@RegisteredWorkspaceCommand('2.42.0', 1789757500000)+@Command({+ name: 'upgrade:2-42:sync-message-record-page',+ description:+ 'Create the Message record page layout and its fields view in existing workspaces, so opening a message record shows its fields instead of an empty page.',+})+export class SyncMessageRecordPageCommand extends ProvisionedWorkspaceCommandRunner {+ constructor(+ protected readonly workspaceIteratorService: WorkspaceIteratorService,+ private readonly applicationService: ApplicationService,+ private readonly workspaceCacheService: WorkspaceCacheService,+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,+ ) {+ super(workspaceIteratorService);+ }++ override async runOnWorkspace({+ workspaceId,+ options,+ }: RunOnWorkspaceArgs): Promise<void> {+ const isDryRun = options.dryRun ?? false;++ const {+ flatObjectMetadataMaps,+ flatViewMaps,+ flatViewFieldMaps,+ flatViewFieldGroupMaps,+ flatPageLayoutMaps,+ flatPageLayoutTabMaps,+ flatPageLayoutWidgetMaps,+ } = await this.workspaceCacheService.getOrRecompute(workspaceId, [+ 'flatObjectMetadataMaps',+ 'flatViewMaps',+ 'flatViewFieldMaps',+ 'flatViewFieldGroupMaps',+ 'flatPageLayoutMaps',+ 'flatPageLayoutTabMaps',+ 'flatPageLayoutWidgetMaps',+ ]);++ if (+ !isDefined(+ flatObjectMetadataMaps.byUniversalIdentifier[+ MESSAGE.universalIdentifier+ ],+ )+ ) {+ this.logger.log(+ `message object metadata does not exist for workspace ${workspaceId}, skipping`,+ );++ return;+ }++ const existingFieldsView =+ flatViewMaps.byUniversalIdentifier[FIELDS_VIEW_UNIVERSAL_IDENTIFIER];++ // A soft-deleted fields view cannot be recreated under its identifier, and+ // a widget pointing at it would render nothing, so the workspace keeps the+ // record page it has.+ if (isDefined(existingFieldsView?.deletedAt)) {+ this.logger.warn(+ `The message fields view was deleted in workspace ${workspaceId}, leaving the record page untouched`,+ );++ return;+ }++ // getStandardFlatEntitiesToCreateOrThrow treats a soft-deleted row as+ // present, so it would leave a deleted parent in place and still create the+ // children under it. The workspace cache loads with withDeleted, so the+ // check has to be explicit.+ const softDeletedParent = [+ {+ label: 'record page layout',+ flatEntity:+ flatPageLayoutMaps.byUniversalIdentifier[+ PAGE_LAYOUT_UNIVERSAL_IDENTIFIER+ ],+ },+ {+ label: 'home tab',+ flatEntity:+ flatPageLayoutTabMaps.byUniversalIdentifier[+ HOME_TAB_UNIVERSAL_IDENTIFIER+ ],+ },+ ].find(({ flatEntity }) => isDefined(flatEntity?.deletedAt));++ if (isDefined(softDeletedParent)) {+ this.logger.warn(+ `The message ${softDeletedParent.label} was deleted in workspace ${workspaceId}, leaving the record page untouched`,+ );++ return;+ }++ const { twentyStandardFlatApplication } =+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(+ { workspaceId },+ );++ const { allFlatEntityMaps: standardAllFlatEntityMaps } =+ computeTwentyStandardApplicationAllFlatEntityMaps({+ now: new Date().toISOString(),+ workspaceId,+ twentyStandardApplicationId: twentyStandardFlatApplication.id,+ });++ const viewsToCreate = getStandardFlatEntitiesToCreateOrThrow<FlatView>({+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatViewMaps,+ existingFlatEntityMaps: flatViewMaps,+ universalIdentifiers: [FIELDS_VIEW_UNIVERSAL_IDENTIFIER],+ });++ const viewFieldGroupsToCreate =+ getStandardFlatEntitiesToCreateOrThrow<FlatViewFieldGroup>({+ standardFlatEntityMaps:+ standardAllFlatEntityMaps.flatViewFieldGroupMaps,+ existingFlatEntityMaps: flatViewFieldGroupMaps,+ universalIdentifiers: FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS,+ });++ const viewFieldsToCreate =+ getStandardFlatEntitiesToCreateOrThrow<FlatViewField>({+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatViewFieldMaps,+ existingFlatEntityMaps: flatViewFieldMaps,+ universalIdentifiers: FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS,+ });++ const pageLayoutsToCreate =+ getStandardFlatEntitiesToCreateOrThrow<FlatPageLayout>({+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatPageLayoutMaps,+ existingFlatEntityMaps: flatPageLayoutMaps,+ universalIdentifiers: [PAGE_LAYOUT_UNIVERSAL_IDENTIFIER],+ });++ const pageLayoutTabsToCreate =+ getStandardFlatEntitiesToCreateOrThrow<FlatPageLayoutTab>({+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatPageLayoutTabMaps,+ existingFlatEntityMaps: flatPageLayoutTabMaps,+ universalIdentifiers: PAGE_LAYOUT_TAB_UNIVERSAL_IDENTIFIERS,+ });++ const pageLayoutWidgetsToCreate =+ getStandardFlatEntitiesToCreateOrThrow<FlatPageLayoutWidget>({+ standardFlatEntityMaps:+ standardAllFlatEntityMaps.flatPageLayoutWidgetMaps,+ existingFlatEntityMaps: flatPageLayoutWidgetMaps,+ universalIdentifiers: PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIERS,+ }).map((flatPageLayoutWidget) =>+ bindFieldsWidgetToExistingView({+ flatPageLayoutWidget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView,+ }),+ );++ const totalOperationCount =+ viewsToCreate.length ++ viewFieldGroupsToCreate.length ++ viewFieldsToCreate.length ++ pageLayoutsToCreate.length ++ pageLayoutTabsToCreate.length ++ pageLayoutWidgetsToCreate.length;++ if (totalOperationCount === 0) {+ this.logger.log(+ `message record page already up to date for workspace ${workspaceId}, skipping`,+ );++ return;+ }++ this.logger.log(+ `${isDryRun ? '[DRY RUN] ' : ''}Workspace ${workspaceId}: ${viewsToCreate.length} view(s), ${viewFieldGroupsToCreate.length} field group(s), ${viewFieldsToCreate.length} view field(s), ${pageLayoutsToCreate.length} layout(s), ${pageLayoutTabsToCreate.length} tab(s), ${pageLayoutWidgetsToCreate.length} widget(s)`,+ );++ if (isDryRun) {+ return;+ }++ const result =+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(+ {+ isSystemBuild: true,+ workspaceId,+ applicationUniversalIdentifier:+ twentyStandardFlatApplication.universalIdentifier,+ allFlatEntityOperationByMetadataName: {+ view: {+ flatEntityToCreate: viewsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ viewFieldGroup: {+ flatEntityToCreate: viewFieldGroupsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ viewField: {+ flatEntityToCreate: viewFieldsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ pageLayout: {+ flatEntityToCreate: pageLayoutsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ pageLayoutTab: {+ flatEntityToCreate: pageLayoutTabsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ pageLayoutWidget: {+ flatEntityToCreate: pageLayoutWidgetsToCreate,+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ },+ },+ },+ );++ if (result.status === 'fail') {+ throw new WorkspaceMigrationBuilderException(+ result,+ `Failed to sync the message record page for workspace ${workspaceId}`,+ );+ }++ this.logger.log(+ `Synced the message record page for workspace ${workspaceId}`,+ );+ }+}diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.tsnew file mode 100644index 00000000000..4c1e90ab178--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.ts@@ -0,0 +1,133 @@+import { Command } from 'nest-commander';+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';+import {+ FieldMetadataType,+ type FieldMetadataSettings,+} from 'twenty-shared/types';+import { isDefined } from 'twenty-shared/utils';++import { ProvisionedWorkspaceCommandRunner } from 'src/database/commands/command-runners/provisioned-workspace.command-runner';+import { WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';+import { type RunOnWorkspaceArgs } from 'src/database/commands/command-runners/workspace.command-runner';+import { ApplicationService } from 'src/engine/core-modules/application/application.service';+import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';+import { findFlatEntityByUniversalIdentifier } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-universal-identifier.util';+import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';+import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';++const DISPLAYED_MAX_ROWS = 99;++@RegisteredWorkspaceCommand('2.42.0', 1789757500001)+@Command({+ name: 'upgrade:2-42:set-message-text-displayed-max-rows',+ description:+ 'Set displayedMaxRows setting on message.text field, so an email body renders over multiple lines instead of one clamped line.',+})+export class SetMessageTextDisplayedMaxRowsCommand extends ProvisionedWorkspaceCommandRunner {+ constructor(+ protected readonly workspaceIteratorService: WorkspaceIteratorService,+ private readonly applicationService: ApplicationService,+ private readonly workspaceCacheService: WorkspaceCacheService,+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,+ ) {+ super(workspaceIteratorService);+ }++ override async runOnWorkspace({+ workspaceId,+ options,+ }: RunOnWorkspaceArgs): Promise<void> {+ const isDryRun = options.dryRun ?? false;++ const { flatFieldMetadataMaps } =+ await this.workspaceCacheService.getOrRecompute(workspaceId, [+ 'flatFieldMetadataMaps',+ ]);++ const textField = findFlatEntityByUniversalIdentifier<FlatFieldMetadata>({+ flatEntityMaps: flatFieldMetadataMaps,+ universalIdentifier:+ STANDARD_OBJECTS.message.fields.text.universalIdentifier,+ });++ if (!isDefined(textField)) {+ this.logger.log(+ `message.text field not found for workspace ${workspaceId}, skipping`,+ );++ return;+ }++ const textSettings =+ textField.settings as FieldMetadataSettings<FieldMetadataType.TEXT>;+ const universalTextSettings =+ textField.universalSettings as FieldMetadataSettings<FieldMetadataType.TEXT>;++ if (+ textSettings?.displayedMaxRows === DISPLAYED_MAX_ROWS &&+ universalTextSettings?.displayedMaxRows === DISPLAYED_MAX_ROWS+ ) {+ this.logger.log(+ `message.text displayedMaxRows already set for workspace ${workspaceId}, skipping`,+ );++ return;+ }++ if (isDryRun) {+ this.logger.log(+ `[DRY RUN] Would set displayedMaxRows on message.text for workspace ${workspaceId}`,+ );++ return;+ }++ const { twentyStandardFlatApplication } =+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(+ { workspaceId },+ );++ const updatedSettings = {+ ...textSettings,+ displayedMaxRows: DISPLAYED_MAX_ROWS,+ };++ // the builder diffs universal properties and the runner writes the settings+ // column from universalSettings, so an update that only moves settings+ // builds no action at all and reports success having changed nothing+ const fieldToUpdate = {+ ...textField,+ settings: updatedSettings,+ universalSettings: updatedSettings,+ };++ const result =+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(+ {+ allFlatEntityOperationByMetadataName: {+ fieldMetadata: {+ flatEntityToCreate: [],+ flatEntityToDelete: [],+ flatEntityToUpdate: [fieldToUpdate],+ },+ },+ workspaceId,+ applicationUniversalIdentifier:+ twentyStandardFlatApplication.universalIdentifier,+ },+ );++ if (result.status === 'fail') {+ throw new WorkspaceMigrationBuilderException(+ result,+ `Failed to set displayedMaxRows on message.text for workspace ${workspaceId}`,+ );+ }++ this.logger.log(+ `Set displayedMaxRows on message.text for workspace ${workspaceId}`,+ );+ }+}diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500000-sync-message-record-page.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500000-sync-message-record-page.command.spec.tsnew file mode 100644index 00000000000..c60968248aa--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500000-sync-message-record-page.command.spec.ts@@ -0,0 +1,452 @@+import {+ STANDARD_OBJECTS,+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,+} from 'twenty-shared/metadata';++import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';+import { SyncMessageRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500000-sync-message-record-page.command';+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';+import { type WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';++jest.mock(+ 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant',+);++const computeTwentyStandardApplicationAllFlatEntityMapsMock = jest.mocked(+ computeTwentyStandardApplicationAllFlatEntityMaps,+);++const WORKSPACE_ID = '20202020-0000-0000-0000-000000000001';+const STANDARD_APPLICATION = {+ id: '20202020-0000-0000-0000-0000000000aa',+ universalIdentifier: '20202020-0000-0000-0000-0000000000bb',+};++const MESSAGE = STANDARD_OBJECTS.message;+const MESSAGE_RECORD_PAGE =+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage;++const FIELDS_VIEW_UNIVERSAL_IDENTIFIER =+ MESSAGE.views.messageRecordPageFields.universalIdentifier;+const FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS = Object.values(+ MESSAGE.views.messageRecordPageFields.viewFieldGroups,+).map((viewFieldGroup) => viewFieldGroup.universalIdentifier);+const FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS = Object.values(+ MESSAGE.views.messageRecordPageFields.viewFields,+).map((viewField) => viewField.universalIdentifier);++const PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.universalIdentifier;+const HOME_TAB_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.tabs.home.universalIdentifier;+const FIELDS_WIDGET_UNIVERSAL_IDENTIFIER =+ MESSAGE_RECORD_PAGE.tabs.home.widgets.fields.universalIdentifier;++const STANDARD_FIELDS_VIEW_ID = '20202020-0000-0000-0000-000000000010';+const EXISTING_FIELDS_VIEW_ID = '20202020-0000-0000-0000-000000000011';++const buildMaps = <TEntity extends { universalIdentifier: string }>(+ entities: TEntity[],+) => ({+ byUniversalIdentifier: Object.fromEntries(+ entities.map((entity) => [entity.universalIdentifier, entity]),+ ),+});++const buildStandardFieldsWidget = () => ({+ universalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ pageLayoutTabUniversalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,+ configuration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewId: STANDARD_FIELDS_VIEW_ID,+ newFieldDefaultVisibility: true,+ },+ universalConfiguration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewUniversalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ newFieldDefaultVisibility: true,+ },+});++describe('SyncMessageRecordPageCommand', () => {+ let command: SyncMessageRecordPageCommand;+ let getOrRecomputeMock: jest.Mock;+ let validateBuildAndRunLegacyWorkspaceMigrationMock: jest.Mock;+ let loggerLogMock: jest.SpyInstance;+ let loggerWarnMock: jest.SpyInstance;++ beforeEach(() => {+ jest.clearAllMocks();++ getOrRecomputeMock = jest.fn();+ validateBuildAndRunLegacyWorkspaceMigrationMock = jest+ .fn()+ .mockResolvedValue({ status: 'success' });++ computeTwentyStandardApplicationAllFlatEntityMapsMock.mockReturnValue({+ allFlatEntityMaps: {+ flatViewMaps: buildMaps([+ {+ id: STANDARD_FIELDS_VIEW_ID,+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ },+ ]),+ flatViewFieldGroupMaps: buildMaps(+ FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS.map(+ (universalIdentifier) => ({ universalIdentifier }),+ ),+ ),+ flatViewFieldMaps: buildMaps(+ FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS.map(+ (universalIdentifier) => ({ universalIdentifier }),+ ),+ ),+ flatPageLayoutMaps: buildMaps([+ { universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER },+ ]),+ flatPageLayoutTabMaps: buildMaps([+ { universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER },+ ]),+ flatPageLayoutWidgetMaps: buildMaps([buildStandardFieldsWidget()]),+ },+ } as unknown as ReturnType<+ typeof computeTwentyStandardApplicationAllFlatEntityMaps+ >);++ command = new SyncMessageRecordPageCommand(+ {} as WorkspaceIteratorService,+ {+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest+ .fn()+ .mockResolvedValue({+ twentyStandardFlatApplication: STANDARD_APPLICATION,+ }),+ } as unknown as ApplicationService,+ {+ getOrRecompute: getOrRecomputeMock,+ } as unknown as WorkspaceCacheService,+ {+ validateBuildAndRunLegacyWorkspaceMigration:+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ } as unknown as WorkspaceMigrationValidateBuildAndRunService,+ );++ loggerLogMock = jest.spyOn(command['logger'], 'log').mockImplementation();+ loggerWarnMock = jest.spyOn(command['logger'], 'warn').mockImplementation();+ });++ const runOnWorkspace = (dryRun = false) =>+ command.runOnWorkspace({+ workspaceId: WORKSPACE_ID,+ options: { dryRun },+ index: 0,+ total: 1,+ });++ const mockWorkspaceCache = ({+ hasMessageObject = true,+ existingViews = [] as {+ id: string;+ universalIdentifier: string;+ deletedAt?: string;+ }[],+ existingViewFieldGroups = [] as string[],+ existingViewFields = [] as string[],+ existingPageLayouts = [] as {+ universalIdentifier: string;+ deletedAt?: string;+ }[],+ existingPageLayoutTabs = [] as {+ universalIdentifier: string;+ deletedAt?: string;+ }[],+ existingPageLayoutWidgets = [] as string[],+ } = {}) => {+ getOrRecomputeMock.mockResolvedValue({+ flatObjectMetadataMaps: buildMaps(+ hasMessageObject+ ? [{ universalIdentifier: MESSAGE.universalIdentifier }]+ : [],+ ),+ flatViewMaps: buildMaps(existingViews),+ flatViewFieldGroupMaps: buildMaps(+ existingViewFieldGroups.map((universalIdentifier) => ({+ universalIdentifier,+ })),+ ),+ flatViewFieldMaps: buildMaps(+ existingViewFields.map((universalIdentifier) => ({+ universalIdentifier,+ })),+ ),+ flatPageLayoutMaps: buildMaps(existingPageLayouts),+ flatPageLayoutTabMaps: buildMaps(existingPageLayoutTabs),+ flatPageLayoutWidgetMaps: buildMaps(+ existingPageLayoutWidgets.map((universalIdentifier) => ({+ universalIdentifier,+ })),+ ),+ });+ };++ const getMigrationPayload = () =>+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls[0][0]+ .allFlatEntityOperationByMetadataName;++ it('creates the whole record page on a workspace that has none of it', async () => {+ mockWorkspaceCache();++ await runOnWorkspace();++ const payload = getMigrationPayload();++ expect(payload.view.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ }),+ ]);+ expect(+ payload.viewFieldGroup.flatEntityToCreate.map(+ ({ universalIdentifier }: { universalIdentifier: string }) =>+ universalIdentifier,+ ),+ ).toEqual(FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS);+ expect(+ payload.viewField.flatEntityToCreate.map(+ ({ universalIdentifier }: { universalIdentifier: string }) =>+ universalIdentifier,+ ),+ ).toEqual(FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS);+ expect(payload.pageLayout.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,+ }),+ ]);+ expect(payload.pageLayoutTab.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,+ }),+ ]);+ expect(payload.pageLayoutWidget.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ }),+ ]);+ });++ it('never deletes or updates anything', async () => {+ mockWorkspaceCache();++ await runOnWorkspace();++ for (const operation of Object.values(getMigrationPayload())) {+ expect(operation).toMatchObject({+ flatEntityToDelete: [],+ flatEntityToUpdate: [],+ });+ }+ });++ it('binds the fields widget to the fields view the workspace already holds', async () => {+ mockWorkspaceCache({+ existingViews: [+ {+ id: EXISTING_FIELDS_VIEW_ID,+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ },+ ],+ existingViewFieldGroups: FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS,+ existingViewFields: FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS,+ });++ await runOnWorkspace();++ const payload = getMigrationPayload();++ expect(payload.view.flatEntityToCreate).toEqual([]);+ expect(payload.pageLayoutWidget.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ configuration: expect.objectContaining({+ viewId: EXISTING_FIELDS_VIEW_ID,+ }),+ }),+ ]);+ });++ it('creates only what a partially provisioned workspace is missing', async () => {+ mockWorkspaceCache({+ existingViews: [+ {+ id: EXISTING_FIELDS_VIEW_ID,+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ },+ ],+ existingViewFieldGroups: FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS,+ existingViewFields: FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS,+ existingPageLayouts: [+ { universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER },+ ],+ existingPageLayoutTabs: [+ { universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER },+ ],+ });++ await runOnWorkspace();++ const payload = getMigrationPayload();++ expect(payload.view.flatEntityToCreate).toEqual([]);+ expect(payload.viewFieldGroup.flatEntityToCreate).toEqual([]);+ expect(payload.viewField.flatEntityToCreate).toEqual([]);+ expect(payload.pageLayout.flatEntityToCreate).toEqual([]);+ expect(payload.pageLayoutTab.flatEntityToCreate).toEqual([]);+ expect(payload.pageLayoutWidget.flatEntityToCreate).toEqual([+ expect.objectContaining({+ universalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ }),+ ]);+ });++ it('is a no-op on a workspace that already has the record page', async () => {+ mockWorkspaceCache({+ existingViews: [+ {+ id: EXISTING_FIELDS_VIEW_ID,+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ },+ ],+ existingViewFieldGroups: FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS,+ existingViewFields: FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS,+ existingPageLayouts: [+ { universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER },+ ],+ existingPageLayoutTabs: [+ { universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER },+ ],+ existingPageLayoutWidgets: [FIELDS_WIDGET_UNIVERSAL_IDENTIFIER],+ });++ await runOnWorkspace();++ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ it('skips a workspace without the message object', async () => {+ mockWorkspaceCache({ hasMessageObject: false });++ await runOnWorkspace();++ expect(+ computeTwentyStandardApplicationAllFlatEntityMapsMock,+ ).not.toHaveBeenCalled();+ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ // A widget pointing at a soft-deleted view renders nothing, which is the very+ // blank page this command exists to fix.+ it('leaves the record page untouched when the fields view was soft deleted', async () => {+ mockWorkspaceCache({+ existingViews: [+ {+ id: EXISTING_FIELDS_VIEW_ID,+ universalIdentifier: FIELDS_VIEW_UNIVERSAL_IDENTIFIER,+ deletedAt: '2026-01-01T00:00:00.000Z',+ },+ ],+ });++ await runOnWorkspace();++ expect(loggerWarnMock).toHaveBeenCalledWith(+ expect.stringContaining('was deleted'),+ );+ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ // getStandardFlatEntitiesToCreateOrThrow counts a soft-deleted row as+ // present, so without an explicit guard the command would create a tab and a+ // widget hanging off a deleted parent.+ it('leaves the record page untouched when the layout itself was soft deleted', async () => {+ mockWorkspaceCache({+ existingPageLayouts: [+ {+ universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,+ deletedAt: '2026-01-01T00:00:00.000Z',+ },+ ],+ });++ await runOnWorkspace();++ expect(loggerWarnMock).toHaveBeenCalledWith(+ expect.stringContaining('record page layout was deleted'),+ );+ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ it('leaves the record page untouched when the home tab was soft deleted', async () => {+ mockWorkspaceCache({+ existingPageLayouts: [+ { universalIdentifier: PAGE_LAYOUT_UNIVERSAL_IDENTIFIER },+ ],+ existingPageLayoutTabs: [+ {+ universalIdentifier: HOME_TAB_UNIVERSAL_IDENTIFIER,+ deletedAt: '2026-01-01T00:00:00.000Z',+ },+ ],+ });++ await runOnWorkspace();++ expect(loggerWarnMock).toHaveBeenCalledWith(+ expect.stringContaining('home tab was deleted'),+ );+ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ it('reports what it would do on a dry run without running the migration', async () => {+ mockWorkspaceCache();++ await runOnWorkspace(true);++ expect(loggerLogMock).toHaveBeenCalledWith(+ expect.stringContaining('[DRY RUN]'),+ );+ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ });++ it('throws when the migration fails, so the upgrade does not record success', async () => {+ const failedResult = { status: 'fail' };++ mockWorkspaceCache();+ validateBuildAndRunLegacyWorkspaceMigrationMock.mockResolvedValue(+ failedResult,+ );++ await expect(runOnWorkspace()).rejects.toThrow(+ `Failed to sync the message record page for workspace ${WORKSPACE_ID}`,+ );+ // the typed exception is what carries the failed build result to callers+ await expect(runOnWorkspace()).rejects.toMatchObject({+ name: 'WorkspaceMigrationBuilderException',+ failedWorkspaceMigrationBuildResult: failedResult,+ });+ });+});diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.spec.tsnew file mode 100644index 00000000000..30c56bf92ea--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/__tests__/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command.spec.ts@@ -0,0 +1,214 @@+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';++import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';+import { SetMessageTextDisplayedMaxRowsCommand } from 'src/database/commands/upgrade-version-command/2-42/2-42-workspace-command-1789757500001-set-message-text-displayed-max-rows.command';+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';+import { type WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';++const WORKSPACE_ID = '20202020-0000-0000-0000-000000000001';+const STANDARD_APPLICATION = {+ id: '20202020-0000-0000-0000-0000000000aa',+ universalIdentifier: '20202020-0000-0000-0000-0000000000bb',+};++const TEXT_FIELD_UNIVERSAL_IDENTIFIER =+ STANDARD_OBJECTS.message.fields.text.universalIdentifier;+const TEXT_FIELD_ID = '20202020-0000-0000-0000-000000000010';++const DISPLAYED_MAX_ROWS = 99;++describe('SetMessageTextDisplayedMaxRowsCommand', () => {+ let command: SetMessageTextDisplayedMaxRowsCommand;+ let getOrRecomputeMock: jest.Mock;+ let validateBuildAndRunLegacyWorkspaceMigrationMock: jest.Mock;+ let loggerLogMock: jest.SpyInstance;++ beforeEach(() => {+ jest.clearAllMocks();++ getOrRecomputeMock = jest.fn();+ validateBuildAndRunLegacyWorkspaceMigrationMock = jest+ .fn()+ .mockResolvedValue({ status: 'success' });++ command = new SetMessageTextDisplayedMaxRowsCommand(+ {} as WorkspaceIteratorService,+ {+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest+ .fn()+ .mockResolvedValue({+ twentyStandardFlatApplication: STANDARD_APPLICATION,+ }),+ } as unknown as ApplicationService,+ {+ getOrRecompute: getOrRecomputeMock,+ } as unknown as WorkspaceCacheService,+ {+ validateBuildAndRunLegacyWorkspaceMigration:+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ } as unknown as WorkspaceMigrationValidateBuildAndRunService,+ );++ loggerLogMock = jest.spyOn(command['logger'], 'log').mockImplementation();+ });++ const runOnWorkspace = (dryRun = false) =>+ command.runOnWorkspace({+ workspaceId: WORKSPACE_ID,+ options: { dryRun },+ index: 0,+ total: 1,+ });++ const mockWorkspaceCache = (+ textField: {+ id: string;+ universalIdentifier: string;+ settings?: Record<string, unknown>;+ universalSettings?: Record<string, unknown>;+ } | null = {+ id: TEXT_FIELD_ID,+ universalIdentifier: TEXT_FIELD_UNIVERSAL_IDENTIFIER,+ },+ ) => {+ getOrRecomputeMock.mockResolvedValue({+ flatFieldMetadataMaps: {+ byUniversalIdentifier: textField+ ? { [textField.universalIdentifier]: textField }+ : {},+ },+ });+ };++ const getUpdatedField = () =>+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls[0][0]+ .allFlatEntityOperationByMetadataName.fieldMetadata.flatEntityToUpdate[0];++ it('sets displayedMaxRows on the message text field', async () => {+ mockWorkspaceCache();++ await runOnWorkspace();++ expect(validateBuildAndRunLegacyWorkspaceMigrationMock).toHaveBeenCalledWith(+ expect.objectContaining({+ workspaceId: WORKSPACE_ID,+ applicationUniversalIdentifier:+ STANDARD_APPLICATION.universalIdentifier,+ }),+ );+ expect(getUpdatedField()).toMatchObject({+ id: TEXT_FIELD_ID,+ settings: { displayedMaxRows: DISPLAYED_MAX_ROWS },+ // the runner writes the settings column from universalSettings, and the+ // builder only diffs universal properties, so settings alone changes+ // nothing+ universalSettings: { displayedMaxRows: DISPLAYED_MAX_ROWS },+ });+ });++ it('keeps the other text settings a workspace already has', async () => {+ mockWorkspaceCache({+ id: TEXT_FIELD_ID,+ universalIdentifier: TEXT_FIELD_UNIVERSAL_IDENTIFIER,+ settings: { displayedMaxRows: 1, someOtherSetting: 'kept' },+ });++ await runOnWorkspace();++ expect(getUpdatedField().settings).toEqual({+ displayedMaxRows: DISPLAYED_MAX_ROWS,+ someOtherSetting: 'kept',+ });+ expect(getUpdatedField().universalSettings).toEqual({+ displayedMaxRows: DISPLAYED_MAX_ROWS,+ someOtherSetting: 'kept',+ });+ });++ it('creates and deletes nothing', async () => {+ mockWorkspaceCache();++ await runOnWorkspace();++ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls[0][0]+ .allFlatEntityOperationByMetadataName.fieldMetadata,+ ).toMatchObject({ flatEntityToCreate: [], flatEntityToDelete: [] });+ });++ it('is a no-op when the setting is already applied', async () => {+ mockWorkspaceCache({+ id: TEXT_FIELD_ID,+ universalIdentifier: TEXT_FIELD_UNIVERSAL_IDENTIFIER,+ settings: { displayedMaxRows: DISPLAYED_MAX_ROWS },+ universalSettings: { displayedMaxRows: DISPLAYED_MAX_ROWS },+ });++ await runOnWorkspace();++ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ expect(loggerLogMock).toHaveBeenCalledWith(+ expect.stringContaining('already set'),+ );+ });++ // a workspace whose settings column was written without universalSettings+ // still renders one line on the next build, so it is not done yet+ it('still runs when only the settings column carries the value', async () => {+ mockWorkspaceCache({+ id: TEXT_FIELD_ID,+ universalIdentifier: TEXT_FIELD_UNIVERSAL_IDENTIFIER,+ settings: { displayedMaxRows: DISPLAYED_MAX_ROWS },+ });++ await runOnWorkspace();++ expect(getUpdatedField().universalSettings).toEqual({+ displayedMaxRows: DISPLAYED_MAX_ROWS,+ });+ });++ it('skips a workspace without the message text field', async () => {+ mockWorkspaceCache(null);++ await runOnWorkspace();++ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ expect(loggerLogMock).toHaveBeenCalledWith(+ expect.stringContaining('not found'),+ );+ });++ it('does not run the migration on a dry run', async () => {+ mockWorkspaceCache();++ await runOnWorkspace(true);++ expect(+ validateBuildAndRunLegacyWorkspaceMigrationMock,+ ).not.toHaveBeenCalled();+ expect(loggerLogMock).toHaveBeenCalledWith(+ expect.stringContaining('[DRY RUN]'),+ );+ });++ it('throws the typed migration exception when the migration fails', async () => {+ mockWorkspaceCache();+ validateBuildAndRunLegacyWorkspaceMigrationMock.mockResolvedValue({+ status: 'fail',+ });++ await expect(runOnWorkspace()).rejects.toThrow(+ WorkspaceMigrationBuilderException,+ );+ await expect(runOnWorkspace()).rejects.toThrow(+ `Failed to set displayedMaxRows on message.text for workspace ${WORKSPACE_ID}`,+ );+ });+});diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/__tests__/bind-fields-widget-to-existing-view.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/__tests__/bind-fields-widget-to-existing-view.util.spec.tsnew file mode 100644index 00000000000..243622a2140--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/__tests__/bind-fields-widget-to-existing-view.util.spec.ts@@ -0,0 +1,115 @@+import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';+import { bindFieldsWidgetToExistingView } from 'src/database/commands/upgrade-version-command/2-42/utils/bind-fields-widget-to-existing-view.util';++const FIELDS_WIDGET_UNIVERSAL_IDENTIFIER =+ '20202020-0000-0000-0000-0000000000f1';+const OTHER_WIDGET_UNIVERSAL_IDENTIFIER =+ '20202020-0000-0000-0000-0000000000f2';++const STANDARD_VIEW_ID = '20202020-0000-0000-0000-000000000010';+const EXISTING_VIEW_ID = '20202020-0000-0000-0000-000000000011';++const EXISTING_FIELDS_VIEW = { id: EXISTING_VIEW_ID };++const buildFieldsWidget = (+ overrides: Partial<FlatPageLayoutWidget> = {},+): FlatPageLayoutWidget =>+ ({+ universalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ configuration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewId: STANDARD_VIEW_ID,+ newFieldDefaultVisibility: true,+ },+ universalConfiguration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewUniversalIdentifier: '20202020-0000-0000-0000-0000000000aa',+ newFieldDefaultVisibility: true,+ },+ ...overrides,+ }) as unknown as FlatPageLayoutWidget;++describe('bindFieldsWidgetToExistingView', () => {+ it('rebinds the fields widget to the view the workspace already holds', () => {+ const result = bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: buildFieldsWidget(),+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: EXISTING_FIELDS_VIEW,+ });++ expect(result.configuration).toEqual({+ configurationType: WidgetConfigurationType.FIELDS,+ viewId: EXISTING_VIEW_ID,+ newFieldDefaultVisibility: true,+ });+ });++ it('keeps the universal configuration untouched, since it is id independent', () => {+ const widget = buildFieldsWidget();++ const result = bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: widget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: EXISTING_FIELDS_VIEW,+ });++ expect(result.universalConfiguration).toEqual(+ widget.universalConfiguration,+ );+ });++ it('leaves the widget alone when the workspace has no fields view yet', () => {+ const widget = buildFieldsWidget();++ const result = bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: widget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: undefined,+ });++ expect(result).toBe(widget);+ });++ it('leaves a widget that is not the fields widget alone', () => {+ const widget = buildFieldsWidget({+ universalIdentifier: OTHER_WIDGET_UNIVERSAL_IDENTIFIER,+ });++ const result = bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: widget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: EXISTING_FIELDS_VIEW,+ });++ expect(result).toBe(widget);+ });++ it('leaves a widget whose configuration is not a fields configuration alone', () => {+ const widget = buildFieldsWidget({+ configuration: {+ configurationType: WidgetConfigurationType.TIMELINE,+ },+ } as unknown as Partial<FlatPageLayoutWidget>);++ const result = bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: widget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: EXISTING_FIELDS_VIEW,+ });++ expect(result).toBe(widget);+ });++ it('does not mutate the widget it is given', () => {+ const widget = buildFieldsWidget();++ bindFieldsWidgetToExistingView({+ flatPageLayoutWidget: widget,+ fieldsWidgetUniversalIdentifier: FIELDS_WIDGET_UNIVERSAL_IDENTIFIER,+ existingFieldsView: EXISTING_FIELDS_VIEW,+ });++ expect(widget.configuration).toMatchObject({ viewId: STANDARD_VIEW_ID });+ });+});diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/bind-fields-widget-to-existing-view.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/bind-fields-widget-to-existing-view.util.tsnew file mode 100644index 00000000000..b458df23c0c--- /dev/null+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-42/utils/bind-fields-widget-to-existing-view.util.ts@@ -0,0 +1,36 @@+import { isDefined } from 'twenty-shared/utils';++import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';+import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';++// The standard application maps mint a fresh id for a record page fields view+// on every call, so a workspace that already holds that view would otherwise+// get a widget pointing at an id nothing in it resolves to.+export const bindFieldsWidgetToExistingView = ({+ flatPageLayoutWidget,+ fieldsWidgetUniversalIdentifier,+ existingFieldsView,+}: {+ flatPageLayoutWidget: FlatPageLayoutWidget;+ fieldsWidgetUniversalIdentifier: string;+ existingFieldsView: Pick<FlatView, 'id'> | undefined;+}): FlatPageLayoutWidget => {+ if (+ !isDefined(existingFieldsView) ||+ flatPageLayoutWidget.universalIdentifier !==+ fieldsWidgetUniversalIdentifier ||+ flatPageLayoutWidget.configuration.configurationType !==+ WidgetConfigurationType.FIELDS+ ) {+ return flatPageLayoutWidget;+ }++ return {+ ...flatPageLayoutWidget,+ configuration: {+ ...flatPageLayoutWidget.configuration,+ viewId: existingFieldsView.id,+ },+ };+};diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.tsindex e0a5ecf7b54..fae955cc7c1 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts@@ -7,6 +7,7 @@ import {STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG,STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG,+ STANDARD_MESSAGE_PAGE_LAYOUT_CONFIG,STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG,@@ -33,6 +34,7 @@ export const STANDARD_PAGE_LAYOUTS = {STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG,callRecordingRecordPage: STANDARD_CALL_RECORDING_PAGE_LAYOUT_CONFIG,companyRecordPage: STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,+ messageRecordPage: STANDARD_MESSAGE_PAGE_LAYOUT_CONFIG,messageCampaignRecordPage: STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG,messageChannelMessageAssociationRecordPage:STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snapindex 6791c8f1dfe..5346096ea98 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap@@ -1020,7 +1020,7 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"id": "00000000-0000-0000-0000-000000000505",},},- "id": "00000000-0000-0000-0000-000000000525",+ "id": "00000000-0000-0000-0000-000000000535","views": {"allMessages": {"id": "00000000-0000-0000-0000-000000000524",@@ -1050,6 +1050,41 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object},"viewGroups": {},},+ "messageRecordPageFields": {+ "id": "00000000-0000-0000-0000-000000000534",+ "viewFieldGroups": {+ "general": {+ "id": "00000000-0000-0000-0000-000000000532",+ },+ "system": {+ "id": "00000000-0000-0000-0000-000000000533",+ },+ },+ "viewFields": {+ "createdAt": {+ "id": "00000000-0000-0000-0000-000000000530",+ },+ "createdBy": {+ "id": "00000000-0000-0000-0000-000000000531",+ },+ "headerMessageId": {+ "id": "00000000-0000-0000-0000-000000000529",+ },+ "messageParticipants": {+ "id": "00000000-0000-0000-0000-000000000526",+ },+ "messageThread": {+ "id": "00000000-0000-0000-0000-000000000525",+ },+ "receivedAt": {+ "id": "00000000-0000-0000-0000-000000000527",+ },+ "text": {+ "id": "00000000-0000-0000-0000-000000000528",+ },+ },+ "viewGroups": {},+ },},},"messageCampaign": {@@ -1764,85 +1799,85 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"note": {"fields": {"attachments": {- "id": "00000000-0000-0000-0000-000000000537",+ "id": "00000000-0000-0000-0000-000000000547",},"bodyV2": {- "id": "00000000-0000-0000-0000-000000000535",+ "id": "00000000-0000-0000-0000-000000000545",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000527",+ "id": "00000000-0000-0000-0000-000000000537",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000530",+ "id": "00000000-0000-0000-0000-000000000540",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000529",+ "id": "00000000-0000-0000-0000-000000000539",},"id": {- "id": "00000000-0000-0000-0000-000000000526",+ "id": "00000000-0000-0000-0000-000000000536",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000536",+ "id": "00000000-0000-0000-0000-000000000546",},"position": {- "id": "00000000-0000-0000-0000-000000000532",+ "id": "00000000-0000-0000-0000-000000000542",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000533",+ "id": "00000000-0000-0000-0000-000000000543",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000538",+ "id": "00000000-0000-0000-0000-000000000548",},"title": {- "id": "00000000-0000-0000-0000-000000000534",+ "id": "00000000-0000-0000-0000-000000000544",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000528",+ "id": "00000000-0000-0000-0000-000000000538",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000531",+ "id": "00000000-0000-0000-0000-000000000541",},},- "id": "00000000-0000-0000-0000-000000000550",+ "id": "00000000-0000-0000-0000-000000000560","views": {"allNotes": {- "id": "00000000-0000-0000-0000-000000000544",+ "id": "00000000-0000-0000-0000-000000000554","viewFieldGroups": {},"viewFields": {"bodyV2": {- "id": "00000000-0000-0000-0000-000000000541",+ "id": "00000000-0000-0000-0000-000000000551",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000543",+ "id": "00000000-0000-0000-0000-000000000553",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000542",+ "id": "00000000-0000-0000-0000-000000000552",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000540",+ "id": "00000000-0000-0000-0000-000000000550",},"title": {- "id": "00000000-0000-0000-0000-000000000539",+ "id": "00000000-0000-0000-0000-000000000549",},},"viewGroups": {},},"noteRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000549",+ "id": "00000000-0000-0000-0000-000000000559","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000548",+ "id": "00000000-0000-0000-0000-000000000558",},},"viewFields": {"attachments": {- "id": "00000000-0000-0000-0000-000000000546",+ "id": "00000000-0000-0000-0000-000000000556",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000545",+ "id": "00000000-0000-0000-0000-000000000555",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000547",+ "id": "00000000-0000-0000-0000-000000000557",},},"viewGroups": {},@@ -1852,62 +1887,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"noteTarget": {"fields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000552",+ "id": "00000000-0000-0000-0000-000000000562",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000555",+ "id": "00000000-0000-0000-0000-000000000565",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000554",+ "id": "00000000-0000-0000-0000-000000000564",},"id": {- "id": "00000000-0000-0000-0000-000000000551",+ "id": "00000000-0000-0000-0000-000000000561",},"note": {- "id": "00000000-0000-0000-0000-000000000559",+ "id": "00000000-0000-0000-0000-000000000569",},"position": {- "id": "00000000-0000-0000-0000-000000000557",+ "id": "00000000-0000-0000-0000-000000000567",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000558",+ "id": "00000000-0000-0000-0000-000000000568",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000561",+ "id": "00000000-0000-0000-0000-000000000571",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000562",+ "id": "00000000-0000-0000-0000-000000000572",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000560",+ "id": "00000000-0000-0000-0000-000000000570",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000553",+ "id": "00000000-0000-0000-0000-000000000563",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000556",+ "id": "00000000-0000-0000-0000-000000000566",},},- "id": "00000000-0000-0000-0000-000000000569",+ "id": "00000000-0000-0000-0000-000000000579","views": {"allNoteTargets": {- "id": "00000000-0000-0000-0000-000000000568",+ "id": "00000000-0000-0000-0000-000000000578","viewFieldGroups": {},"viewFields": {"id": {- "id": "00000000-0000-0000-0000-000000000563",+ "id": "00000000-0000-0000-0000-000000000573",},"note": {- "id": "00000000-0000-0000-0000-000000000564",+ "id": "00000000-0000-0000-0000-000000000574",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000566",+ "id": "00000000-0000-0000-0000-000000000576",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000567",+ "id": "00000000-0000-0000-0000-000000000577",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000565",+ "id": "00000000-0000-0000-0000-000000000575",},},"viewGroups": {},@@ -1917,192 +1952,192 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"opportunity": {"fields": {"amount": {- "id": "00000000-0000-0000-0000-000000000579",+ "id": "00000000-0000-0000-0000-000000000589",},"attachments": {- "id": "00000000-0000-0000-0000-000000000589",+ "id": "00000000-0000-0000-0000-000000000599",},"calendarEventTargets": {- "id": "00000000-0000-0000-0000-000000000587",+ "id": "00000000-0000-0000-0000-000000000597",},"closeDate": {- "id": "00000000-0000-0000-0000-000000000580",+ "id": "00000000-0000-0000-0000-000000000590",},"company": {- "id": "00000000-0000-0000-0000-000000000583",+ "id": "00000000-0000-0000-0000-000000000593",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000571",+ "id": "00000000-0000-0000-0000-000000000581",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000574",+ "id": "00000000-0000-0000-0000-000000000584",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000573",+ "id": "00000000-0000-0000-0000-000000000583",},"id": {- "id": "00000000-0000-0000-0000-000000000570",+ "id": "00000000-0000-0000-0000-000000000580",},"messageThreadTargets": {- "id": "00000000-0000-0000-0000-000000000588",+ "id": "00000000-0000-0000-0000-000000000598",},"name": {- "id": "00000000-0000-0000-0000-000000000578",+ "id": "00000000-0000-0000-0000-000000000588",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000586",+ "id": "00000000-0000-0000-0000-000000000596",},"owner": {- "id": "00000000-0000-0000-0000-000000000584",+ "id": "00000000-0000-0000-0000-000000000594",},"pointOfContact": {- "id": "00000000-0000-0000-0000-000000000582",+ "id": "00000000-0000-0000-0000-000000000592",},"position": {- "id": "00000000-0000-0000-0000-000000000576",+ "id": "00000000-0000-0000-0000-000000000586",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000577",+ "id": "00000000-0000-0000-0000-000000000587",},"stage": {- "id": "00000000-0000-0000-0000-000000000581",+ "id": "00000000-0000-0000-0000-000000000591",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000585",+ "id": "00000000-0000-0000-0000-000000000595",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000590",+ "id": "00000000-0000-0000-0000-000000000600",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000572",+ "id": "00000000-0000-0000-0000-000000000582",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000575",+ "id": "00000000-0000-0000-0000-000000000585",},},- "id": "00000000-0000-0000-0000-000000000628",+ "id": "00000000-0000-0000-0000-000000000638","views": {"allOpportunities": {- "id": "00000000-0000-0000-0000-000000000597",+ "id": "00000000-0000-0000-0000-000000000607","viewFieldGroups": {},"viewFields": {"amount": {- "id": "00000000-0000-0000-0000-000000000592",+ "id": "00000000-0000-0000-0000-000000000602",},"closeDate": {- "id": "00000000-0000-0000-0000-000000000594",+ "id": "00000000-0000-0000-0000-000000000604",},"company": {- "id": "00000000-0000-0000-0000-000000000595",+ "id": "00000000-0000-0000-0000-000000000605",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000593",+ "id": "00000000-0000-0000-0000-000000000603",},"name": {- "id": "00000000-0000-0000-0000-000000000591",+ "id": "00000000-0000-0000-0000-000000000601",},"pointOfContact": {- "id": "00000000-0000-0000-0000-000000000596",+ "id": "00000000-0000-0000-0000-000000000606",},},"viewGroups": {},},"byStage": {- "id": "00000000-0000-0000-0000-000000000609",+ "id": "00000000-0000-0000-0000-000000000619","viewFieldGroups": {},"viewFields": {"amount": {- "id": "00000000-0000-0000-0000-000000000599",+ "id": "00000000-0000-0000-0000-000000000609",},"closeDate": {- "id": "00000000-0000-0000-0000-000000000601",+ "id": "00000000-0000-0000-0000-000000000611",},"company": {- "id": "00000000-0000-0000-0000-000000000602",+ "id": "00000000-0000-0000-0000-000000000612",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000600",+ "id": "00000000-0000-0000-0000-000000000610",},"name": {- "id": "00000000-0000-0000-0000-000000000598",+ "id": "00000000-0000-0000-0000-000000000608",},"pointOfContact": {- "id": "00000000-0000-0000-0000-000000000603",+ "id": "00000000-0000-0000-0000-000000000613",},},"viewGroups": {"customer": {- "id": "00000000-0000-0000-0000-000000000608",+ "id": "00000000-0000-0000-0000-000000000618",},"meeting": {- "id": "00000000-0000-0000-0000-000000000606",+ "id": "00000000-0000-0000-0000-000000000616",},"new": {- "id": "00000000-0000-0000-0000-000000000604",+ "id": "00000000-0000-0000-0000-000000000614",},"proposal": {- "id": "00000000-0000-0000-0000-000000000607",+ "id": "00000000-0000-0000-0000-000000000617",},"screening": {- "id": "00000000-0000-0000-0000-000000000605",+ "id": "00000000-0000-0000-0000-000000000615",},},},"opportunityRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000627",+ "id": "00000000-0000-0000-0000-000000000637","viewFieldGroups": {"deal": {- "id": "00000000-0000-0000-0000-000000000624",+ "id": "00000000-0000-0000-0000-000000000634",},"relations": {- "id": "00000000-0000-0000-0000-000000000625",+ "id": "00000000-0000-0000-0000-000000000635",},"system": {- "id": "00000000-0000-0000-0000-000000000626",+ "id": "00000000-0000-0000-0000-000000000636",},},"viewFields": {"amount": {- "id": "00000000-0000-0000-0000-000000000610",+ "id": "00000000-0000-0000-0000-000000000620",},"attachments": {- "id": "00000000-0000-0000-0000-000000000622",+ "id": "00000000-0000-0000-0000-000000000632",},"closeDate": {- "id": "00000000-0000-0000-0000-000000000611",+ "id": "00000000-0000-0000-0000-000000000621",},"company": {- "id": "00000000-0000-0000-0000-000000000613",+ "id": "00000000-0000-0000-0000-000000000623",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000616",+ "id": "00000000-0000-0000-0000-000000000626",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000617",+ "id": "00000000-0000-0000-0000-000000000627",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000621",+ "id": "00000000-0000-0000-0000-000000000631",},"owner": {- "id": "00000000-0000-0000-0000-000000000615",+ "id": "00000000-0000-0000-0000-000000000625",},"pointOfContact": {- "id": "00000000-0000-0000-0000-000000000614",+ "id": "00000000-0000-0000-0000-000000000624",},"stage": {- "id": "00000000-0000-0000-0000-000000000612",+ "id": "00000000-0000-0000-0000-000000000622",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000620",+ "id": "00000000-0000-0000-0000-000000000630",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000623",+ "id": "00000000-0000-0000-0000-000000000633",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000618",+ "id": "00000000-0000-0000-0000-000000000628",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000619",+ "id": "00000000-0000-0000-0000-000000000629",},},"viewGroups": {},@@ -2112,203 +2147,203 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"person": {"fields": {"attachments": {- "id": "00000000-0000-0000-0000-000000000650",+ "id": "00000000-0000-0000-0000-000000000660",},"avatarFile": {- "id": "00000000-0000-0000-0000-000000000643",+ "id": "00000000-0000-0000-0000-000000000653",},"avatarUrl": {- "id": "00000000-0000-0000-0000-000000000642",+ "id": "00000000-0000-0000-0000-000000000652",},"calendarEventParticipants": {- "id": "00000000-0000-0000-0000-000000000652",+ "id": "00000000-0000-0000-0000-000000000662",},"calendarEventTargets": {- "id": "00000000-0000-0000-0000-000000000648",+ "id": "00000000-0000-0000-0000-000000000658",},"company": {- "id": "00000000-0000-0000-0000-000000000644",+ "id": "00000000-0000-0000-0000-000000000654",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000630",+ "id": "00000000-0000-0000-0000-000000000640",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000633",+ "id": "00000000-0000-0000-0000-000000000643",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000632",+ "id": "00000000-0000-0000-0000-000000000642",},"emails": {- "id": "00000000-0000-0000-0000-000000000638",+ "id": "00000000-0000-0000-0000-000000000648",},"id": {- "id": "00000000-0000-0000-0000-000000000629",+ "id": "00000000-0000-0000-0000-000000000639",},"jobTitle": {- "id": "00000000-0000-0000-0000-000000000640",+ "id": "00000000-0000-0000-0000-000000000650",},"linkedinLink": {- "id": "00000000-0000-0000-0000-000000000639",+ "id": "00000000-0000-0000-0000-000000000649",},"listMemberships": {- "id": "00000000-0000-0000-0000-000000000654",+ "id": "00000000-0000-0000-0000-000000000664",},"messageParticipants": {- "id": "00000000-0000-0000-0000-000000000651",+ "id": "00000000-0000-0000-0000-000000000661",},"messageThreadTargets": {- "id": "00000000-0000-0000-0000-000000000649",+ "id": "00000000-0000-0000-0000-000000000659",},"name": {- "id": "00000000-0000-0000-0000-000000000637",+ "id": "00000000-0000-0000-0000-000000000647",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000647",+ "id": "00000000-0000-0000-0000-000000000657",},"phones": {- "id": "00000000-0000-0000-0000-000000000641",+ "id": "00000000-0000-0000-0000-000000000651",},"pointOfContactForOpportunities": {- "id": "00000000-0000-0000-0000-000000000645",+ "id": "00000000-0000-0000-0000-000000000655",},"position": {- "id": "00000000-0000-0000-0000-000000000635",+ "id": "00000000-0000-0000-0000-000000000645",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000636",+ "id": "00000000-0000-0000-0000-000000000646",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000646",+ "id": "00000000-0000-0000-0000-000000000656",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000653",+ "id": "00000000-0000-0000-0000-000000000663",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000631",+ "id": "00000000-0000-0000-0000-000000000641",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000634",+ "id": "00000000-0000-0000-0000-000000000644",},},- "id": "00000000-0000-0000-0000-000000000691",+ "id": "00000000-0000-0000-0000-000000000701","views": {"allPeople": {- "id": "00000000-0000-0000-0000-000000000663",+ "id": "00000000-0000-0000-0000-000000000673","viewFieldGroups": {},"viewFields": {"company": {- "id": "00000000-0000-0000-0000-000000000658",+ "id": "00000000-0000-0000-0000-000000000668",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000660",+ "id": "00000000-0000-0000-0000-000000000670",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000657",+ "id": "00000000-0000-0000-0000-000000000667",},"emails": {- "id": "00000000-0000-0000-0000-000000000656",+ "id": "00000000-0000-0000-0000-000000000666",},"jobTitle": {- "id": "00000000-0000-0000-0000-000000000661",+ "id": "00000000-0000-0000-0000-000000000671",},"linkedinLink": {- "id": "00000000-0000-0000-0000-000000000662",+ "id": "00000000-0000-0000-0000-000000000672",},"name": {- "id": "00000000-0000-0000-0000-000000000655",+ "id": "00000000-0000-0000-0000-000000000665",},"phones": {- "id": "00000000-0000-0000-0000-000000000659",+ "id": "00000000-0000-0000-0000-000000000669",},},"viewGroups": {},},"messageListRecordPageMembers": {- "id": "00000000-0000-0000-0000-000000000690",+ "id": "00000000-0000-0000-0000-000000000700","viewFieldGroups": {},"viewFields": {"company": {- "id": "00000000-0000-0000-0000-000000000689",+ "id": "00000000-0000-0000-0000-000000000699",},"emails": {- "id": "00000000-0000-0000-0000-000000000688",+ "id": "00000000-0000-0000-0000-000000000698",},"name": {- "id": "00000000-0000-0000-0000-000000000687",+ "id": "00000000-0000-0000-0000-000000000697",},},"viewGroups": {},},"personRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000686",+ "id": "00000000-0000-0000-0000-000000000696","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000682",+ "id": "00000000-0000-0000-0000-000000000692",},"social": {- "id": "00000000-0000-0000-0000-000000000684",+ "id": "00000000-0000-0000-0000-000000000694",},"system": {- "id": "00000000-0000-0000-0000-000000000685",+ "id": "00000000-0000-0000-0000-000000000695",},"work": {- "id": "00000000-0000-0000-0000-000000000683",+ "id": "00000000-0000-0000-0000-000000000693",},},"viewFields": {"attachments": {- "id": "00000000-0000-0000-0000-000000000678",+ "id": "00000000-0000-0000-0000-000000000688",},"avatarFile": {- "id": "00000000-0000-0000-0000-000000000674",+ "id": "00000000-0000-0000-0000-000000000684",},"avatarUrl": {- "id": "00000000-0000-0000-0000-000000000669",+ "id": "00000000-0000-0000-0000-000000000679",},"calendarEventParticipants": {- "id": "00000000-0000-0000-0000-000000000680",+ "id": "00000000-0000-0000-0000-000000000690",},"company": {- "id": "00000000-0000-0000-0000-000000000666",+ "id": "00000000-0000-0000-0000-000000000676",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000670",+ "id": "00000000-0000-0000-0000-000000000680",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000671",+ "id": "00000000-0000-0000-0000-000000000681",},"emails": {- "id": "00000000-0000-0000-0000-000000000664",+ "id": "00000000-0000-0000-0000-000000000674",},"jobTitle": {- "id": "00000000-0000-0000-0000-000000000667",+ "id": "00000000-0000-0000-0000-000000000677",},"linkedinLink": {- "id": "00000000-0000-0000-0000-000000000668",+ "id": "00000000-0000-0000-0000-000000000678",},"messageParticipants": {- "id": "00000000-0000-0000-0000-000000000679",+ "id": "00000000-0000-0000-0000-000000000689",},"noteTargets": {- "id": "00000000-0000-0000-0000-000000000677",+ "id": "00000000-0000-0000-0000-000000000687",},"phones": {- "id": "00000000-0000-0000-0000-000000000665",+ "id": "00000000-0000-0000-0000-000000000675",},"pointOfContactForOpportunities": {- "id": "00000000-0000-0000-0000-000000000675",+ "id": "00000000-0000-0000-0000-000000000685",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000676",+ "id": "00000000-0000-0000-0000-000000000686",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000681",+ "id": "00000000-0000-0000-0000-000000000691",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000672",+ "id": "00000000-0000-0000-0000-000000000682",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000673",+ "id": "00000000-0000-0000-0000-000000000683",},},"viewGroups": {},@@ -2318,236 +2353,236 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"recordShare": {"fields": {"accessLevel": {- "id": "00000000-0000-0000-0000-000000000704",+ "id": "00000000-0000-0000-0000-000000000714",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000693",+ "id": "00000000-0000-0000-0000-000000000703",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000696",+ "id": "00000000-0000-0000-0000-000000000706",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000695",+ "id": "00000000-0000-0000-0000-000000000705",},"id": {- "id": "00000000-0000-0000-0000-000000000692",+ "id": "00000000-0000-0000-0000-000000000702",},"objectMetadataId": {- "id": "00000000-0000-0000-0000-000000000701",+ "id": "00000000-0000-0000-0000-000000000711",},"position": {- "id": "00000000-0000-0000-0000-000000000698",+ "id": "00000000-0000-0000-0000-000000000708",},"principalId": {- "id": "00000000-0000-0000-0000-000000000702",+ "id": "00000000-0000-0000-0000-000000000712",},"principalType": {- "id": "00000000-0000-0000-0000-000000000703",+ "id": "00000000-0000-0000-0000-000000000713",},"recordId": {- "id": "00000000-0000-0000-0000-000000000700",+ "id": "00000000-0000-0000-0000-000000000710",},"rowCause": {- "id": "00000000-0000-0000-0000-000000000705",+ "id": "00000000-0000-0000-0000-000000000715",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000699",+ "id": "00000000-0000-0000-0000-000000000709",},"sourceId": {- "id": "00000000-0000-0000-0000-000000000706",+ "id": "00000000-0000-0000-0000-000000000716",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000694",+ "id": "00000000-0000-0000-0000-000000000704",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000697",+ "id": "00000000-0000-0000-0000-000000000707",},},- "id": "00000000-0000-0000-0000-000000000707",+ "id": "00000000-0000-0000-0000-000000000717","views": {},},"task": {"fields": {"assignee": {- "id": "00000000-0000-0000-0000-000000000722",+ "id": "00000000-0000-0000-0000-000000000732",},"attachments": {- "id": "00000000-0000-0000-0000-000000000721",+ "id": "00000000-0000-0000-0000-000000000731",},"bodyV2": {- "id": "00000000-0000-0000-0000-000000000717",+ "id": "00000000-0000-0000-0000-000000000727",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000709",+ "id": "00000000-0000-0000-0000-000000000719",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000712",+ "id": "00000000-0000-0000-0000-000000000722",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000711",+ "id": "00000000-0000-0000-0000-000000000721",},"dueAt": {- "id": "00000000-0000-0000-0000-000000000718",+ "id": "00000000-0000-0000-0000-000000000728",},"id": {- "id": "00000000-0000-0000-0000-000000000708",+ "id": "00000000-0000-0000-0000-000000000718",},"position": {- "id": "00000000-0000-0000-0000-000000000714",+ "id": "00000000-0000-0000-0000-000000000724",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000715",+ "id": "00000000-0000-0000-0000-000000000725",},"status": {- "id": "00000000-0000-0000-0000-000000000719",+ "id": "00000000-0000-0000-0000-000000000729",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000720",+ "id": "00000000-0000-0000-0000-000000000730",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000723",+ "id": "00000000-0000-0000-0000-000000000733",},"title": {- "id": "00000000-0000-0000-0000-000000000716",+ "id": "00000000-0000-0000-0000-000000000726",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000710",+ "id": "00000000-0000-0000-0000-000000000720",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000713",+ "id": "00000000-0000-0000-0000-000000000723",},},- "id": "00000000-0000-0000-0000-000000000762",+ "id": "00000000-0000-0000-0000-000000000772","views": {"allTasks": {- "id": "00000000-0000-0000-0000-000000000732",+ "id": "00000000-0000-0000-0000-000000000742","viewFieldGroups": {},"viewFields": {"assignee": {- "id": "00000000-0000-0000-0000-000000000729",+ "id": "00000000-0000-0000-0000-000000000739",},"bodyV2": {- "id": "00000000-0000-0000-0000-000000000730",+ "id": "00000000-0000-0000-0000-000000000740",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000731",+ "id": "00000000-0000-0000-0000-000000000741",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000727",+ "id": "00000000-0000-0000-0000-000000000737",},"dueAt": {- "id": "00000000-0000-0000-0000-000000000728",+ "id": "00000000-0000-0000-0000-000000000738",},"status": {- "id": "00000000-0000-0000-0000-000000000725",+ "id": "00000000-0000-0000-0000-000000000735",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000726",+ "id": "00000000-0000-0000-0000-000000000736",},"title": {- "id": "00000000-0000-0000-0000-000000000724",+ "id": "00000000-0000-0000-0000-000000000734",},},"viewGroups": {},},"assignedToMe": {- "id": "00000000-0000-0000-0000-000000000744",+ "id": "00000000-0000-0000-0000-000000000754","viewFieldGroups": {},"viewFields": {"assignee": {- "id": "00000000-0000-0000-0000-000000000737",+ "id": "00000000-0000-0000-0000-000000000747",},"bodyV2": {- "id": "00000000-0000-0000-0000-000000000738",+ "id": "00000000-0000-0000-0000-000000000748",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000739",+ "id": "00000000-0000-0000-0000-000000000749",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000735",+ "id": "00000000-0000-0000-0000-000000000745",},"dueAt": {- "id": "00000000-0000-0000-0000-000000000736",+ "id": "00000000-0000-0000-0000-000000000746",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000734",+ "id": "00000000-0000-0000-0000-000000000744",},"title": {- "id": "00000000-0000-0000-0000-000000000733",+ "id": "00000000-0000-0000-0000-000000000743",},},"viewGroups": {"done": {- "id": "00000000-0000-0000-0000-000000000742",+ "id": "00000000-0000-0000-0000-000000000752",},"empty": {- "id": "00000000-0000-0000-0000-000000000743",+ "id": "00000000-0000-0000-0000-000000000753",},"inProgress": {- "id": "00000000-0000-0000-0000-000000000741",+ "id": "00000000-0000-0000-0000-000000000751",},"todo": {- "id": "00000000-0000-0000-0000-000000000740",+ "id": "00000000-0000-0000-0000-000000000750",},},},"byStatus": {- "id": "00000000-0000-0000-0000-000000000753",+ "id": "00000000-0000-0000-0000-000000000763","viewFieldGroups": {},"viewFields": {"assignee": {- "id": "00000000-0000-0000-0000-000000000748",+ "id": "00000000-0000-0000-0000-000000000758",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000749",+ "id": "00000000-0000-0000-0000-000000000759",},"dueAt": {- "id": "00000000-0000-0000-0000-000000000747",+ "id": "00000000-0000-0000-0000-000000000757",},"status": {- "id": "00000000-0000-0000-0000-000000000746",+ "id": "00000000-0000-0000-0000-000000000756",},"title": {- "id": "00000000-0000-0000-0000-000000000745",+ "id": "00000000-0000-0000-0000-000000000755",},},"viewGroups": {"done": {- "id": "00000000-0000-0000-0000-000000000752",+ "id": "00000000-0000-0000-0000-000000000762",},"inProgress": {- "id": "00000000-0000-0000-0000-000000000751",+ "id": "00000000-0000-0000-0000-000000000761",},"todo": {- "id": "00000000-0000-0000-0000-000000000750",+ "id": "00000000-0000-0000-0000-000000000760",},},},"taskRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000761",+ "id": "00000000-0000-0000-0000-000000000771","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000760",+ "id": "00000000-0000-0000-0000-000000000770",},},"viewFields": {"assignee": {- "id": "00000000-0000-0000-0000-000000000756",+ "id": "00000000-0000-0000-0000-000000000766",},"attachments": {- "id": "00000000-0000-0000-0000-000000000758",+ "id": "00000000-0000-0000-0000-000000000768",},"dueAt": {- "id": "00000000-0000-0000-0000-000000000754",+ "id": "00000000-0000-0000-0000-000000000764",},"status": {- "id": "00000000-0000-0000-0000-000000000755",+ "id": "00000000-0000-0000-0000-000000000765",},"taskTargets": {- "id": "00000000-0000-0000-0000-000000000757",+ "id": "00000000-0000-0000-0000-000000000767",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000759",+ "id": "00000000-0000-0000-0000-000000000769",},},"viewGroups": {},@@ -2557,62 +2592,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"taskTarget": {"fields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000764",+ "id": "00000000-0000-0000-0000-000000000774",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000767",+ "id": "00000000-0000-0000-0000-000000000777",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000766",+ "id": "00000000-0000-0000-0000-000000000776",},"id": {- "id": "00000000-0000-0000-0000-000000000763",+ "id": "00000000-0000-0000-0000-000000000773",},"position": {- "id": "00000000-0000-0000-0000-000000000769",+ "id": "00000000-0000-0000-0000-000000000779",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000770",+ "id": "00000000-0000-0000-0000-000000000780",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000773",+ "id": "00000000-0000-0000-0000-000000000783",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000774",+ "id": "00000000-0000-0000-0000-000000000784",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000772",+ "id": "00000000-0000-0000-0000-000000000782",},"task": {- "id": "00000000-0000-0000-0000-000000000771",+ "id": "00000000-0000-0000-0000-000000000781",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000765",+ "id": "00000000-0000-0000-0000-000000000775",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000768",+ "id": "00000000-0000-0000-0000-000000000778",},},- "id": "00000000-0000-0000-0000-000000000781",+ "id": "00000000-0000-0000-0000-000000000791","views": {"allTaskTargets": {- "id": "00000000-0000-0000-0000-000000000780",+ "id": "00000000-0000-0000-0000-000000000790","viewFieldGroups": {},"viewFields": {"id": {- "id": "00000000-0000-0000-0000-000000000775",+ "id": "00000000-0000-0000-0000-000000000785",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000778",+ "id": "00000000-0000-0000-0000-000000000788",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000779",+ "id": "00000000-0000-0000-0000-000000000789",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000777",+ "id": "00000000-0000-0000-0000-000000000787",},"task": {- "id": "00000000-0000-0000-0000-000000000776",+ "id": "00000000-0000-0000-0000-000000000786",},},"viewGroups": {},@@ -2622,128 +2657,128 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"timelineActivity": {"fields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000783",+ "id": "00000000-0000-0000-0000-000000000793",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000786",+ "id": "00000000-0000-0000-0000-000000000796",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000785",+ "id": "00000000-0000-0000-0000-000000000795",},"happensAt": {- "id": "00000000-0000-0000-0000-000000000792",+ "id": "00000000-0000-0000-0000-000000000802",},"id": {- "id": "00000000-0000-0000-0000-000000000782",+ "id": "00000000-0000-0000-0000-000000000792",},"linkedObjectMetadataId": {- "id": "00000000-0000-0000-0000-000000000808",+ "id": "00000000-0000-0000-0000-000000000818",},"linkedRecordCachedName": {- "id": "00000000-0000-0000-0000-000000000806",+ "id": "00000000-0000-0000-0000-000000000816",},"linkedRecordId": {- "id": "00000000-0000-0000-0000-000000000807",+ "id": "00000000-0000-0000-0000-000000000817",},"position": {- "id": "00000000-0000-0000-0000-000000000788",+ "id": "00000000-0000-0000-0000-000000000798",},"properties": {- "id": "00000000-0000-0000-0000-000000000793",+ "id": "00000000-0000-0000-0000-000000000803",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000789",+ "id": "00000000-0000-0000-0000-000000000799",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000796",+ "id": "00000000-0000-0000-0000-000000000806",},"targetDashboard": {- "id": "00000000-0000-0000-0000-000000000803",+ "id": "00000000-0000-0000-0000-000000000813",},"targetMessageCampaign": {- "id": "00000000-0000-0000-0000-000000000805",+ "id": "00000000-0000-0000-0000-000000000815",},"targetMessageList": {- "id": "00000000-0000-0000-0000-000000000804",+ "id": "00000000-0000-0000-0000-000000000814",},"targetNote": {- "id": "00000000-0000-0000-0000-000000000799",+ "id": "00000000-0000-0000-0000-000000000809",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000797",+ "id": "00000000-0000-0000-0000-000000000807",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000795",+ "id": "00000000-0000-0000-0000-000000000805",},"targetTask": {- "id": "00000000-0000-0000-0000-000000000798",+ "id": "00000000-0000-0000-0000-000000000808",},"targetWorkflow": {- "id": "00000000-0000-0000-0000-000000000800",+ "id": "00000000-0000-0000-0000-000000000810",},"targetWorkflowRun": {- "id": "00000000-0000-0000-0000-000000000802",+ "id": "00000000-0000-0000-0000-000000000812",},"targetWorkflowVersion": {- "id": "00000000-0000-0000-0000-000000000801",+ "id": "00000000-0000-0000-0000-000000000811",},"timelineActivityTypeId": {- "id": "00000000-0000-0000-0000-000000000790",+ "id": "00000000-0000-0000-0000-000000000800",},"timelineActivityTypeSnapshot": {- "id": "00000000-0000-0000-0000-000000000791",+ "id": "00000000-0000-0000-0000-000000000801",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000784",+ "id": "00000000-0000-0000-0000-000000000794",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000787",+ "id": "00000000-0000-0000-0000-000000000797",},"workspaceMember": {- "id": "00000000-0000-0000-0000-000000000794",+ "id": "00000000-0000-0000-0000-000000000804",},},- "id": "00000000-0000-0000-0000-000000000822",+ "id": "00000000-0000-0000-0000-000000000832","views": {"allTimelineActivities": {- "id": "00000000-0000-0000-0000-000000000821",+ "id": "00000000-0000-0000-0000-000000000831","viewFieldGroups": {},"viewFields": {"happensAt": {- "id": "00000000-0000-0000-0000-000000000810",+ "id": "00000000-0000-0000-0000-000000000820",},"linkedRecordCachedName": {- "id": "00000000-0000-0000-0000-000000000809",+ "id": "00000000-0000-0000-0000-000000000819",},"targetCompany": {- "id": "00000000-0000-0000-0000-000000000813",+ "id": "00000000-0000-0000-0000-000000000823",},"targetDashboard": {- "id": "00000000-0000-0000-0000-000000000820",+ "id": "00000000-0000-0000-0000-000000000830",},"targetNote": {- "id": "00000000-0000-0000-0000-000000000816",+ "id": "00000000-0000-0000-0000-000000000826",},"targetOpportunity": {- "id": "00000000-0000-0000-0000-000000000814",+ "id": "00000000-0000-0000-0000-000000000824",},"targetPerson": {- "id": "00000000-0000-0000-0000-000000000812",+ "id": "00000000-0000-0000-0000-000000000822",},"targetTask": {- "id": "00000000-0000-0000-0000-000000000815",+ "id": "00000000-0000-0000-0000-000000000825",},"targetWorkflow": {- "id": "00000000-0000-0000-0000-000000000817",+ "id": "00000000-0000-0000-0000-000000000827",},"targetWorkflowRun": {- "id": "00000000-0000-0000-0000-000000000819",+ "id": "00000000-0000-0000-0000-000000000829",},"targetWorkflowVersion": {- "id": "00000000-0000-0000-0000-000000000818",+ "id": "00000000-0000-0000-0000-000000000828",},"workspaceMember": {- "id": "00000000-0000-0000-0000-000000000811",+ "id": "00000000-0000-0000-0000-000000000821",},},"viewGroups": {},@@ -2753,80 +2788,80 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"workflow": {"fields": {"attachments": {- "id": "00000000-0000-0000-0000-000000000839",+ "id": "00000000-0000-0000-0000-000000000849",},"automatedTriggers": {- "id": "00000000-0000-0000-0000-000000000837",+ "id": "00000000-0000-0000-0000-000000000847",},"coreWorkflowId": {- "id": "00000000-0000-0000-0000-000000000833",+ "id": "00000000-0000-0000-0000-000000000843",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000824",+ "id": "00000000-0000-0000-0000-000000000834",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000827",+ "id": "00000000-0000-0000-0000-000000000837",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000826",+ "id": "00000000-0000-0000-0000-000000000836",},"id": {- "id": "00000000-0000-0000-0000-000000000823",+ "id": "00000000-0000-0000-0000-000000000833",},"lastPublishedVersionId": {- "id": "00000000-0000-0000-0000-000000000832",+ "id": "00000000-0000-0000-0000-000000000842",},"name": {- "id": "00000000-0000-0000-0000-000000000831",+ "id": "00000000-0000-0000-0000-000000000841",},"position": {- "id": "00000000-0000-0000-0000-000000000829",+ "id": "00000000-0000-0000-0000-000000000839",},"runs": {- "id": "00000000-0000-0000-0000-000000000836",+ "id": "00000000-0000-0000-0000-000000000846",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000830",+ "id": "00000000-0000-0000-0000-000000000840",},"statuses": {- "id": "00000000-0000-0000-0000-000000000834",+ "id": "00000000-0000-0000-0000-000000000844",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000838",+ "id": "00000000-0000-0000-0000-000000000848",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000825",+ "id": "00000000-0000-0000-0000-000000000835",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000828",+ "id": "00000000-0000-0000-0000-000000000838",},"versions": {- "id": "00000000-0000-0000-0000-000000000835",+ "id": "00000000-0000-0000-0000-000000000845",},},- "id": "00000000-0000-0000-0000-000000000847",+ "id": "00000000-0000-0000-0000-000000000857","views": {"allWorkflows": {- "id": "00000000-0000-0000-0000-000000000846",+ "id": "00000000-0000-0000-0000-000000000856","viewFieldGroups": {},"viewFields": {"createdBy": {- "id": "00000000-0000-0000-0000-000000000843",+ "id": "00000000-0000-0000-0000-000000000853",},"name": {- "id": "00000000-0000-0000-0000-000000000840",+ "id": "00000000-0000-0000-0000-000000000850",},"runs": {- "id": "00000000-0000-0000-0000-000000000845",+ "id": "00000000-0000-0000-0000-000000000855",},"statuses": {- "id": "00000000-0000-0000-0000-000000000841",+ "id": "00000000-0000-0000-0000-000000000851",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000842",+ "id": "00000000-0000-0000-0000-000000000852",},"versions": {- "id": "00000000-0000-0000-0000-000000000844",+ "id": "00000000-0000-0000-0000-000000000854",},},"viewGroups": {},@@ -2836,79 +2871,79 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"workflowAutomatedTrigger": {"fields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000849",+ "id": "00000000-0000-0000-0000-000000000859",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000852",+ "id": "00000000-0000-0000-0000-000000000862",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000851",+ "id": "00000000-0000-0000-0000-000000000861",},"id": {- "id": "00000000-0000-0000-0000-000000000848",+ "id": "00000000-0000-0000-0000-000000000858",},"position": {- "id": "00000000-0000-0000-0000-000000000854",+ "id": "00000000-0000-0000-0000-000000000864",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000855",+ "id": "00000000-0000-0000-0000-000000000865",},"settings": {- "id": "00000000-0000-0000-0000-000000000857",+ "id": "00000000-0000-0000-0000-000000000867",},"type": {- "id": "00000000-0000-0000-0000-000000000856",+ "id": "00000000-0000-0000-0000-000000000866",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000850",+ "id": "00000000-0000-0000-0000-000000000860",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000853",+ "id": "00000000-0000-0000-0000-000000000863",},"workflow": {- "id": "00000000-0000-0000-0000-000000000858",+ "id": "00000000-0000-0000-0000-000000000868",},},- "id": "00000000-0000-0000-0000-000000000870",+ "id": "00000000-0000-0000-0000-000000000880","views": {"allWorkflowAutomatedTriggers": {- "id": "00000000-0000-0000-0000-000000000862",+ "id": "00000000-0000-0000-0000-000000000872","viewFieldGroups": {},"viewFields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000861",+ "id": "00000000-0000-0000-0000-000000000871",},"type": {- "id": "00000000-0000-0000-0000-000000000859",+ "id": "00000000-0000-0000-0000-000000000869",},"workflow": {- "id": "00000000-0000-0000-0000-000000000860",+ "id": "00000000-0000-0000-0000-000000000870",},},"viewGroups": {},},"workflowAutomatedTriggerRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000869",+ "id": "00000000-0000-0000-0000-000000000879","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000867",+ "id": "00000000-0000-0000-0000-000000000877",},"system": {- "id": "00000000-0000-0000-0000-000000000868",+ "id": "00000000-0000-0000-0000-000000000878",},},"viewFields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000865",+ "id": "00000000-0000-0000-0000-000000000875",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000866",+ "id": "00000000-0000-0000-0000-000000000876",},"type": {- "id": "00000000-0000-0000-0000-000000000863",+ "id": "00000000-0000-0000-0000-000000000873",},"workflow": {- "id": "00000000-0000-0000-0000-000000000864",+ "id": "00000000-0000-0000-0000-000000000874",},},"viewGroups": {},@@ -2918,130 +2953,130 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"workflowRun": {"fields": {"coreWorkflowId": {- "id": "00000000-0000-0000-0000-000000000888",+ "id": "00000000-0000-0000-0000-000000000898",},"coreWorkflowVersionId": {- "id": "00000000-0000-0000-0000-000000000889",+ "id": "00000000-0000-0000-0000-000000000899",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000872",+ "id": "00000000-0000-0000-0000-000000000882",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000875",+ "id": "00000000-0000-0000-0000-000000000885",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000874",+ "id": "00000000-0000-0000-0000-000000000884",},"endedAt": {- "id": "00000000-0000-0000-0000-000000000884",+ "id": "00000000-0000-0000-0000-000000000894",},"enqueuedAt": {- "id": "00000000-0000-0000-0000-000000000882",+ "id": "00000000-0000-0000-0000-000000000892",},"id": {- "id": "00000000-0000-0000-0000-000000000871",+ "id": "00000000-0000-0000-0000-000000000881",},"name": {- "id": "00000000-0000-0000-0000-000000000879",+ "id": "00000000-0000-0000-0000-000000000889",},"position": {- "id": "00000000-0000-0000-0000-000000000877",+ "id": "00000000-0000-0000-0000-000000000887",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000878",+ "id": "00000000-0000-0000-0000-000000000888",},"startedAt": {- "id": "00000000-0000-0000-0000-000000000883",+ "id": "00000000-0000-0000-0000-000000000893",},"state": {- "id": "00000000-0000-0000-0000-000000000886",+ "id": "00000000-0000-0000-0000-000000000896",},"status": {- "id": "00000000-0000-0000-0000-000000000885",+ "id": "00000000-0000-0000-0000-000000000895",},"stepLogs": {- "id": "00000000-0000-0000-0000-000000000887",+ "id": "00000000-0000-0000-0000-000000000897",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000890",+ "id": "00000000-0000-0000-0000-000000000900",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000873",+ "id": "00000000-0000-0000-0000-000000000883",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000876",+ "id": "00000000-0000-0000-0000-000000000886",},"workflow": {- "id": "00000000-0000-0000-0000-000000000881",+ "id": "00000000-0000-0000-0000-000000000891",},"workflowVersion": {- "id": "00000000-0000-0000-0000-000000000880",+ "id": "00000000-0000-0000-0000-000000000890",},},- "id": "00000000-0000-0000-0000-000000000910",+ "id": "00000000-0000-0000-0000-000000000920","views": {"allWorkflowRuns": {- "id": "00000000-0000-0000-0000-000000000894",+ "id": "00000000-0000-0000-0000-000000000904","viewFieldGroups": {},"viewFields": {"name": {- "id": "00000000-0000-0000-0000-000000000891",+ "id": "00000000-0000-0000-0000-000000000901",},"status": {- "id": "00000000-0000-0000-0000-000000000893",+ "id": "00000000-0000-0000-0000-000000000903",},"workflow": {- "id": "00000000-0000-0000-0000-000000000892",+ "id": "00000000-0000-0000-0000-000000000902",},},"viewGroups": {},},"workflowRunRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000909",+ "id": "00000000-0000-0000-0000-000000000919","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000907",+ "id": "00000000-0000-0000-0000-000000000917",},"system": {- "id": "00000000-0000-0000-0000-000000000908",+ "id": "00000000-0000-0000-0000-000000000918",},},"viewFields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000900",+ "id": "00000000-0000-0000-0000-000000000910",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000901",+ "id": "00000000-0000-0000-0000-000000000911",},"endedAt": {- "id": "00000000-0000-0000-0000-000000000899",+ "id": "00000000-0000-0000-0000-000000000909",},"enqueuedAt": {- "id": "00000000-0000-0000-0000-000000000902",+ "id": "00000000-0000-0000-0000-000000000912",},"startedAt": {- "id": "00000000-0000-0000-0000-000000000898",+ "id": "00000000-0000-0000-0000-000000000908",},"state": {- "id": "00000000-0000-0000-0000-000000000903",+ "id": "00000000-0000-0000-0000-000000000913",},"status": {- "id": "00000000-0000-0000-0000-000000000895",+ "id": "00000000-0000-0000-0000-000000000905",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000906",+ "id": "00000000-0000-0000-0000-000000000916",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000904",+ "id": "00000000-0000-0000-0000-000000000914",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000905",+ "id": "00000000-0000-0000-0000-000000000915",},"workflow": {- "id": "00000000-0000-0000-0000-000000000896",+ "id": "00000000-0000-0000-0000-000000000906",},"workflowVersion": {- "id": "00000000-0000-0000-0000-000000000897",+ "id": "00000000-0000-0000-0000-000000000907",},},"viewGroups": {},@@ -3051,118 +3086,118 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"workflowVersion": {"fields": {"coreWorkflowVersionId": {- "id": "00000000-0000-0000-0000-000000000925",+ "id": "00000000-0000-0000-0000-000000000935",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000912",+ "id": "00000000-0000-0000-0000-000000000922",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000915",+ "id": "00000000-0000-0000-0000-000000000925",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000914",+ "id": "00000000-0000-0000-0000-000000000924",},"id": {- "id": "00000000-0000-0000-0000-000000000911",+ "id": "00000000-0000-0000-0000-000000000921",},"name": {- "id": "00000000-0000-0000-0000-000000000919",+ "id": "00000000-0000-0000-0000-000000000929",},"position": {- "id": "00000000-0000-0000-0000-000000000917",+ "id": "00000000-0000-0000-0000-000000000927",},"runs": {- "id": "00000000-0000-0000-0000-000000000923",+ "id": "00000000-0000-0000-0000-000000000933",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000918",+ "id": "00000000-0000-0000-0000-000000000928",},"status": {- "id": "00000000-0000-0000-0000-000000000922",+ "id": "00000000-0000-0000-0000-000000000932",},"steps": {- "id": "00000000-0000-0000-0000-000000000924",+ "id": "00000000-0000-0000-0000-000000000934",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000926",+ "id": "00000000-0000-0000-0000-000000000936",},"trigger": {- "id": "00000000-0000-0000-0000-000000000921",+ "id": "00000000-0000-0000-0000-000000000931",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000913",+ "id": "00000000-0000-0000-0000-000000000923",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000916",+ "id": "00000000-0000-0000-0000-000000000926",},"workflow": {- "id": "00000000-0000-0000-0000-000000000920",+ "id": "00000000-0000-0000-0000-000000000930",},},- "id": "00000000-0000-0000-0000-000000000946",+ "id": "00000000-0000-0000-0000-000000000956","views": {"allWorkflowVersions": {- "id": "00000000-0000-0000-0000-000000000932",+ "id": "00000000-0000-0000-0000-000000000942","viewFieldGroups": {},"viewFields": {"name": {- "id": "00000000-0000-0000-0000-000000000927",+ "id": "00000000-0000-0000-0000-000000000937",},"runs": {- "id": "00000000-0000-0000-0000-000000000931",+ "id": "00000000-0000-0000-0000-000000000941",},"status": {- "id": "00000000-0000-0000-0000-000000000929",+ "id": "00000000-0000-0000-0000-000000000939",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000930",+ "id": "00000000-0000-0000-0000-000000000940",},"workflow": {- "id": "00000000-0000-0000-0000-000000000928",+ "id": "00000000-0000-0000-0000-000000000938",},},"viewGroups": {},},"workflowVersionRecordPageFields": {- "id": "00000000-0000-0000-0000-000000000945",+ "id": "00000000-0000-0000-0000-000000000955","viewFieldGroups": {"general": {- "id": "00000000-0000-0000-0000-000000000943",+ "id": "00000000-0000-0000-0000-000000000953",},"system": {- "id": "00000000-0000-0000-0000-000000000944",+ "id": "00000000-0000-0000-0000-000000000954",},},"viewFields": {"createdAt": {- "id": "00000000-0000-0000-0000-000000000936",+ "id": "00000000-0000-0000-0000-000000000946",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000938",+ "id": "00000000-0000-0000-0000-000000000948",},"runs": {- "id": "00000000-0000-0000-0000-000000000941",+ "id": "00000000-0000-0000-0000-000000000951",},"status": {- "id": "00000000-0000-0000-0000-000000000933",+ "id": "00000000-0000-0000-0000-000000000943",},"steps": {- "id": "00000000-0000-0000-0000-000000000937",+ "id": "00000000-0000-0000-0000-000000000947",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000942",+ "id": "00000000-0000-0000-0000-000000000952",},"trigger": {- "id": "00000000-0000-0000-0000-000000000935",+ "id": "00000000-0000-0000-0000-000000000945",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000939",+ "id": "00000000-0000-0000-0000-000000000949",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000940",+ "id": "00000000-0000-0000-0000-000000000950",},"workflow": {- "id": "00000000-0000-0000-0000-000000000934",+ "id": "00000000-0000-0000-0000-000000000944",},},"viewGroups": {},@@ -3172,110 +3207,110 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object"workspaceMember": {"fields": {"accountOwnerForCompanies": {- "id": "00000000-0000-0000-0000-000000000966",+ "id": "00000000-0000-0000-0000-000000000976",},"assignedTasks": {- "id": "00000000-0000-0000-0000-000000000964",+ "id": "00000000-0000-0000-0000-000000000974",},"avatarUrl": {- "id": "00000000-0000-0000-0000-000000000960",+ "id": "00000000-0000-0000-0000-000000000970",},"blocklist": {- "id": "00000000-0000-0000-0000-000000000968",+ "id": "00000000-0000-0000-0000-000000000978",},"calendarEventParticipants": {- "id": "00000000-0000-0000-0000-000000000969",+ "id": "00000000-0000-0000-0000-000000000979",},"calendarStartDay": {- "id": "00000000-0000-0000-0000-000000000974",+ "id": "00000000-0000-0000-0000-000000000984",},"colorScheme": {- "id": "00000000-0000-0000-0000-000000000956",+ "id": "00000000-0000-0000-0000-000000000966",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000948",+ "id": "00000000-0000-0000-0000-000000000958",},"createdBy": {- "id": "00000000-0000-0000-0000-000000000951",+ "id": "00000000-0000-0000-0000-000000000961",},"dateFormat": {- "id": "00000000-0000-0000-0000-000000000972",+ "id": "00000000-0000-0000-0000-000000000982",},"deletedAt": {- "id": "00000000-0000-0000-0000-000000000950",+ "id": "00000000-0000-0000-0000-000000000960",},"id": {- "id": "00000000-0000-0000-0000-000000000947",+ "id": "00000000-0000-0000-0000-000000000957",},"jobTitle": {- "id": "00000000-0000-0000-0000-000000000962",+ "id": "00000000-0000-0000-0000-000000000972",},"locale": {- "id": "00000000-0000-0000-0000-000000000959",+ "id": "00000000-0000-0000-0000-000000000969",},"messageParticipants": {- "id": "00000000-0000-0000-0000-000000000967",+ "id": "00000000-0000-0000-0000-000000000977",},"name": {- "id": "00000000-0000-0000-0000-000000000955",+ "id": "00000000-0000-0000-0000-000000000965",},"numberFormat": {- "id": "00000000-0000-0000-0000-000000000975",+ "id": "00000000-0000-0000-0000-000000000985",},"openRecordIn": {- "id": "00000000-0000-0000-0000-000000000958",+ "id": "00000000-0000-0000-0000-000000000968",},"ownedOpportunities": {- "id": "00000000-0000-0000-0000-000000000965",+ "id": "00000000-0000-0000-0000-000000000975",},"position": {- "id": "00000000-0000-0000-0000-000000000953",+ "id": "00000000-0000-0000-0000-000000000963",},"searchVector": {- "id": "00000000-0000-0000-0000-000000000954",+ "id": "00000000-0000-0000-0000-000000000964",},"timeFormat": {- "id": "00000000-0000-0000-0000-000000000973",+ "id": "00000000-0000-0000-0000-000000000983",},"timeZone": {- "id": "00000000-0000-0000-0000-000000000971",+ "id": "00000000-0000-0000-0000-000000000981",},"timelineActivities": {- "id": "00000000-0000-0000-0000-000000000970",+ "id": "00000000-0000-0000-0000-000000000980",},"uiScale": {- "id": "00000000-0000-0000-0000-000000000957",+ "id": "00000000-0000-0000-0000-000000000967",},"updatedAt": {- "id": "00000000-0000-0000-0000-000000000949",+ "id": "00000000-0000-0000-0000-000000000959",},"updatedBy": {- "id": "00000000-0000-0000-0000-000000000952",+ "id": "00000000-0000-0000-0000-000000000962",},"userEmail": {- "id": "00000000-0000-0000-0000-000000000961",+ "id": "00000000-0000-0000-0000-000000000971",},"userId": {- "id": "00000000-0000-0000-0000-000000000963",+ "id": "00000000-0000-0000-0000-000000000973",},},- "id": "00000000-0000-0000-0000-000000000981",+ "id": "00000000-0000-0000-0000-000000000991","views": {"allWorkspaceMembers": {- "id": "00000000-0000-0000-0000-000000000980",+ "id": "00000000-0000-0000-0000-000000000990","viewFieldGroups": {},"viewFields": {"assignedTasks": {- "id": "00000000-0000-0000-0000-000000000979",+ "id": "00000000-0000-0000-0000-000000000989",},"createdAt": {- "id": "00000000-0000-0000-0000-000000000977",+ "id": "00000000-0000-0000-0000-000000000987",},"name": {- "id": "00000000-0000-0000-0000-000000000976",+ "id": "00000000-0000-0000-0000-000000000986",},"ownedOpportunities": {- "id": "00000000-0000-0000-0000-000000000978",+ "id": "00000000-0000-0000-0000-000000000988",},},"viewGroups": {},diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snapindex aeb9b37f3bc..6d4c2ec9603 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap@@ -213,124 +213,137 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa},},"messageCampaignRecordPage": {- "id": "00000000-0000-0000-0000-000000000063",+ "id": "00000000-0000-0000-0000-000000000066","tabs": {"composer": {- "id": "00000000-0000-0000-0000-000000000067",+ "id": "00000000-0000-0000-0000-000000000070","widgets": {"messageCampaign": {- "id": "00000000-0000-0000-0000-000000000068",+ "id": "00000000-0000-0000-0000-000000000071",},},},"home": {- "id": "00000000-0000-0000-0000-000000000064",+ "id": "00000000-0000-0000-0000-000000000067","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000066",+ "id": "00000000-0000-0000-0000-000000000069",},"recipients": {- "id": "00000000-0000-0000-0000-000000000065",+ "id": "00000000-0000-0000-0000-000000000068",},},},},},"messageChannelMessageAssociationMessageFolderRecordPage": {- "id": "00000000-0000-0000-0000-000000000074",+ "id": "00000000-0000-0000-0000-000000000077","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000075",+ "id": "00000000-0000-0000-0000-000000000078","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000076",+ "id": "00000000-0000-0000-0000-000000000079",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000077",+ "id": "00000000-0000-0000-0000-000000000080","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000078",+ "id": "00000000-0000-0000-0000-000000000081",},},},},},"messageChannelMessageAssociationRecordPage": {- "id": "00000000-0000-0000-0000-000000000069",+ "id": "00000000-0000-0000-0000-000000000072","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000070",+ "id": "00000000-0000-0000-0000-000000000073","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000071",+ "id": "00000000-0000-0000-0000-000000000074",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000072",+ "id": "00000000-0000-0000-0000-000000000075","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000073",+ "id": "00000000-0000-0000-0000-000000000076",},},},},},"messageListRecordPage": {- "id": "00000000-0000-0000-0000-000000000084",+ "id": "00000000-0000-0000-0000-000000000087","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000085",+ "id": "00000000-0000-0000-0000-000000000088","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000086",+ "id": "00000000-0000-0000-0000-000000000089",},"members": {- "id": "00000000-0000-0000-0000-000000000087",+ "id": "00000000-0000-0000-0000-000000000090",},},},"members": {- "id": "00000000-0000-0000-0000-000000000088",+ "id": "00000000-0000-0000-0000-000000000091","widgets": {"members": {- "id": "00000000-0000-0000-0000-000000000089",+ "id": "00000000-0000-0000-0000-000000000092",},},},},},"messageParticipantRecordPage": {- "id": "00000000-0000-0000-0000-000000000079",+ "id": "00000000-0000-0000-0000-000000000082","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000080",+ "id": "00000000-0000-0000-0000-000000000083","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000081",+ "id": "00000000-0000-0000-0000-000000000084",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000082",+ "id": "00000000-0000-0000-0000-000000000085","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000083",+ "id": "00000000-0000-0000-0000-000000000086",+ },+ },+ },+ },+ },+ "messageRecordPage": {+ "id": "00000000-0000-0000-0000-000000000063",+ "tabs": {+ "home": {+ "id": "00000000-0000-0000-0000-000000000064",+ "widgets": {+ "fields": {+ "id": "00000000-0000-0000-0000-000000000065",},},},},},"messageThreadRecordPage": {- "id": "00000000-0000-0000-0000-000000000090",+ "id": "00000000-0000-0000-0000-000000000093","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000091",+ "id": "00000000-0000-0000-0000-000000000094","widgets": {"emailThread": {- "id": "00000000-0000-0000-0000-000000000092",+ "id": "00000000-0000-0000-0000-000000000095",},},},@@ -371,270 +384,270 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa},},"noteRecordPage": {- "id": "00000000-0000-0000-0000-000000000093",+ "id": "00000000-0000-0000-0000-000000000096","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000094",+ "id": "00000000-0000-0000-0000-000000000097","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000095",+ "id": "00000000-0000-0000-0000-000000000098",},"noteRichText": {- "id": "00000000-0000-0000-0000-000000000096",+ "id": "00000000-0000-0000-0000-000000000099",},},},"note": {- "id": "00000000-0000-0000-0000-000000000097",+ "id": "00000000-0000-0000-0000-000000000100","widgets": {"noteRichText": {- "id": "00000000-0000-0000-0000-000000000098",+ "id": "00000000-0000-0000-0000-000000000101",},},},},},"opportunityRecordPage": {- "id": "00000000-0000-0000-0000-000000000099",+ "id": "00000000-0000-0000-0000-000000000102","tabs": {"calendar": {- "id": "00000000-0000-0000-0000-000000000115",+ "id": "00000000-0000-0000-0000-000000000118","widgets": {"calendar": {- "id": "00000000-0000-0000-0000-000000000116",+ "id": "00000000-0000-0000-0000-000000000119",},},},"emails": {- "id": "00000000-0000-0000-0000-000000000113",+ "id": "00000000-0000-0000-0000-000000000116","widgets": {"emails": {- "id": "00000000-0000-0000-0000-000000000114",+ "id": "00000000-0000-0000-0000-000000000117",},},},"files": {- "id": "00000000-0000-0000-0000-000000000111",+ "id": "00000000-0000-0000-0000-000000000114","widgets": {"files": {- "id": "00000000-0000-0000-0000-000000000112",+ "id": "00000000-0000-0000-0000-000000000115",},},},"home": {- "id": "00000000-0000-0000-0000-000000000100",+ "id": "00000000-0000-0000-0000-000000000103","widgets": {"company": {- "id": "00000000-0000-0000-0000-000000000103",+ "id": "00000000-0000-0000-0000-000000000106",},"fields": {- "id": "00000000-0000-0000-0000-000000000101",+ "id": "00000000-0000-0000-0000-000000000104",},"owner": {- "id": "00000000-0000-0000-0000-000000000104",+ "id": "00000000-0000-0000-0000-000000000107",},"pointOfContact": {- "id": "00000000-0000-0000-0000-000000000102",+ "id": "00000000-0000-0000-0000-000000000105",},},},"notes": {- "id": "00000000-0000-0000-0000-000000000109",+ "id": "00000000-0000-0000-0000-000000000112","widgets": {"notes": {- "id": "00000000-0000-0000-0000-000000000110",+ "id": "00000000-0000-0000-0000-000000000113",},},},"tasks": {- "id": "00000000-0000-0000-0000-000000000107",+ "id": "00000000-0000-0000-0000-000000000110","widgets": {"tasks": {- "id": "00000000-0000-0000-0000-000000000108",+ "id": "00000000-0000-0000-0000-000000000111",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000105",+ "id": "00000000-0000-0000-0000-000000000108","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000106",+ "id": "00000000-0000-0000-0000-000000000109",},},},},},"personRecordPage": {- "id": "00000000-0000-0000-0000-000000000117",+ "id": "00000000-0000-0000-0000-000000000120","tabs": {"calendar": {- "id": "00000000-0000-0000-0000-000000000133",+ "id": "00000000-0000-0000-0000-000000000136","widgets": {"calendar": {- "id": "00000000-0000-0000-0000-000000000134",+ "id": "00000000-0000-0000-0000-000000000137",},},},"emails": {- "id": "00000000-0000-0000-0000-000000000131",+ "id": "00000000-0000-0000-0000-000000000134","widgets": {"emails": {- "id": "00000000-0000-0000-0000-000000000132",+ "id": "00000000-0000-0000-0000-000000000135",},},},"files": {- "id": "00000000-0000-0000-0000-000000000129",+ "id": "00000000-0000-0000-0000-000000000132","widgets": {"files": {- "id": "00000000-0000-0000-0000-000000000130",+ "id": "00000000-0000-0000-0000-000000000133",},},},"home": {- "id": "00000000-0000-0000-0000-000000000118",+ "id": "00000000-0000-0000-0000-000000000121","widgets": {"company": {- "id": "00000000-0000-0000-0000-000000000120",+ "id": "00000000-0000-0000-0000-000000000123",},"fields": {- "id": "00000000-0000-0000-0000-000000000119",+ "id": "00000000-0000-0000-0000-000000000122",},"listMemberships": {- "id": "00000000-0000-0000-0000-000000000122",+ "id": "00000000-0000-0000-0000-000000000125",},"pointOfContactForOpportunities": {- "id": "00000000-0000-0000-0000-000000000121",+ "id": "00000000-0000-0000-0000-000000000124",},},},"notes": {- "id": "00000000-0000-0000-0000-000000000127",+ "id": "00000000-0000-0000-0000-000000000130","widgets": {"notes": {- "id": "00000000-0000-0000-0000-000000000128",+ "id": "00000000-0000-0000-0000-000000000131",},},},"tasks": {- "id": "00000000-0000-0000-0000-000000000125",+ "id": "00000000-0000-0000-0000-000000000128","widgets": {"tasks": {- "id": "00000000-0000-0000-0000-000000000126",+ "id": "00000000-0000-0000-0000-000000000129",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000123",+ "id": "00000000-0000-0000-0000-000000000126","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000124",+ "id": "00000000-0000-0000-0000-000000000127",},},},},},"taskRecordPage": {- "id": "00000000-0000-0000-0000-000000000135",+ "id": "00000000-0000-0000-0000-000000000138","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000136",+ "id": "00000000-0000-0000-0000-000000000139","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000137",+ "id": "00000000-0000-0000-0000-000000000140",},"taskRichText": {- "id": "00000000-0000-0000-0000-000000000138",+ "id": "00000000-0000-0000-0000-000000000141",},},},"note": {- "id": "00000000-0000-0000-0000-000000000139",+ "id": "00000000-0000-0000-0000-000000000142","widgets": {"taskRichText": {- "id": "00000000-0000-0000-0000-000000000140",+ "id": "00000000-0000-0000-0000-000000000143",},},},},},"workflowAutomatedTriggerRecordPage": {- "id": "00000000-0000-0000-0000-000000000144",+ "id": "00000000-0000-0000-0000-000000000147","tabs": {"home": {- "id": "00000000-0000-0000-0000-000000000145",+ "id": "00000000-0000-0000-0000-000000000148","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000146",+ "id": "00000000-0000-0000-0000-000000000149",},},},"timeline": {- "id": "00000000-0000-0000-0000-000000000147",+ "id": "00000000-0000-0000-0000-000000000150","widgets": {"timeline": {- "id": "00000000-0000-0000-0000-000000000148",+ "id": "00000000-0000-0000-0000-000000000151",},},},},},"workflowRecordPage": {- "id": "00000000-0000-0000-0000-000000000141",+ "id": "00000000-0000-0000-0000-000000000144","tabs": {"flow": {- "id": "00000000-0000-0000-0000-000000000142",+ "id": "00000000-0000-0000-0000-000000000145","widgets": {"workflow": {- "id": "00000000-0000-0000-0000-000000000143",+ "id": "00000000-0000-0000-0000-000000000146",},},},},},"workflowRunRecordPage": {- "id": "00000000-0000-0000-0000-000000000155",+ "id": "00000000-0000-0000-0000-000000000158","tabs": {"flow": {- "id": "00000000-0000-0000-0000-000000000159",+ "id": "00000000-0000-0000-0000-000000000162","widgets": {"workflowRun": {- "id": "00000000-0000-0000-0000-000000000160",+ "id": "00000000-0000-0000-0000-000000000163",},},},"home": {- "id": "00000000-0000-0000-0000-000000000156",+ "id": "00000000-0000-0000-0000-000000000159","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000157",+ "id": "00000000-0000-0000-0000-000000000160",},"workflow": {- "id": "00000000-0000-0000-0000-000000000158",+ "id": "00000000-0000-0000-0000-000000000161",},},},},},"workflowVersionRecordPage": {- "id": "00000000-0000-0000-0000-000000000149",+ "id": "00000000-0000-0000-0000-000000000152","tabs": {"flow": {- "id": "00000000-0000-0000-0000-000000000153",+ "id": "00000000-0000-0000-0000-000000000156","widgets": {"workflowVersion": {- "id": "00000000-0000-0000-0000-000000000154",+ "id": "00000000-0000-0000-0000-000000000157",},},},"home": {- "id": "00000000-0000-0000-0000-000000000150",+ "id": "00000000-0000-0000-0000-000000000153","widgets": {"fields": {- "id": "00000000-0000-0000-0000-000000000151",+ "id": "00000000-0000-0000-0000-000000000154",},"workflow": {- "id": "00000000-0000-0000-0000-000000000152",+ "id": "00000000-0000-0000-0000-000000000155",},},},diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-message-standard-metadata.spec.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-message-standard-metadata.spec.tsnew file mode 100644index 00000000000..6fc24292d71--- /dev/null+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-message-standard-metadata.spec.ts@@ -0,0 +1,144 @@+import {+ STANDARD_OBJECTS,+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,+} from 'twenty-shared/metadata';+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';+import { isDefined } from 'twenty-shared/utils';++import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';+import { VERTICAL_LIST_LAYOUT_POSITIONS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';++const WORKSPACE_ID = '20202020-1111-4111-8111-111111111111';+const TWENTY_STANDARD_APPLICATION_ID = '20202020-2222-4222-8222-222222222222';+const NOW = '2024-01-01T00:00:00.000Z';++const MESSAGE_RECORD_PAGE =+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage;++describe('Message standard record page build', () => {+ const { allFlatEntityMaps } =+ computeTwentyStandardApplicationAllFlatEntityMaps({+ now: NOW,+ workspaceId: WORKSPACE_ID,+ twentyStandardApplicationId: TWENTY_STANDARD_APPLICATION_ID,+ });++ it('gives the message object a record page layout', () => {+ const messageObjectMetadata =+ allFlatEntityMaps.flatObjectMetadataMaps.byUniversalIdentifier[+ STANDARD_OBJECTS.message.universalIdentifier+ ];+ const pageLayout =+ allFlatEntityMaps.flatPageLayoutMaps.byUniversalIdentifier[+ MESSAGE_RECORD_PAGE.universalIdentifier+ ];++ expect(pageLayout).toBeDefined();+ expect(pageLayout?.objectMetadataId).toBe(messageObjectMetadata?.id);+ });++ // message is not audit logged and exposes no timelineActivities relation, so+ // a timeline tab would be filtered out of every render it appears in.+ it('lays the message record page out as a single home tab', () => {+ expect(Object.keys(MESSAGE_RECORD_PAGE.tabs)).toEqual(['home']);++ expect(+ allFlatEntityMaps.flatPageLayoutTabMaps.byUniversalIdentifier[+ MESSAGE_RECORD_PAGE.tabs.home.universalIdentifier+ ],+ ).toMatchObject({+ title: 'Home',+ icon: 'IconHome',+ position: 10,+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,+ });+ });++ it('points the home fields widget at the message record page fields view', () => {+ const fieldsView =+ allFlatEntityMaps.flatViewMaps.byUniversalIdentifier[+ STANDARD_OBJECTS.message.views.messageRecordPageFields+ .universalIdentifier+ ];+ const fieldsWidget =+ allFlatEntityMaps.flatPageLayoutWidgetMaps.byUniversalIdentifier[+ MESSAGE_RECORD_PAGE.tabs.home.widgets.fields.universalIdentifier+ ];++ expect(fieldsView).toBeDefined();+ expect(fieldsWidget).toMatchObject({+ title: 'Fields',+ type: WidgetType.FIELDS,+ pageLayoutTabUniversalIdentifier:+ MESSAGE_RECORD_PAGE.tabs.home.universalIdentifier,+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,+ configuration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewId: fieldsView?.id,+ },+ universalConfiguration: {+ configurationType: WidgetConfigurationType.FIELDS,+ viewUniversalIdentifier:+ STANDARD_OBJECTS.message.views.messageRecordPageFields+ .universalIdentifier,+ },+ });+ });++ it('shows the thread, participants and body on the message record page, and keeps the subject to the title', () => {+ const viewFieldFieldUniversalIdentifiers = Object.values(+ allFlatEntityMaps.flatViewFieldMaps.byUniversalIdentifier,+ )+ .filter(isDefined)+ .filter(+ (viewField) =>+ viewField.viewUniversalIdentifier ===+ STANDARD_OBJECTS.message.views.messageRecordPageFields+ .universalIdentifier,+ )+ .map((viewField) => viewField.fieldMetadataUniversalIdentifier);++ expect(viewFieldFieldUniversalIdentifiers).toHaveLength(7);+ expect(viewFieldFieldUniversalIdentifiers).toEqual(+ expect.arrayContaining([+ STANDARD_OBJECTS.message.fields.messageThread.universalIdentifier,+ STANDARD_OBJECTS.message.fields.messageParticipants.universalIdentifier,+ STANDARD_OBJECTS.message.fields.receivedAt.universalIdentifier,+ STANDARD_OBJECTS.message.fields.text.universalIdentifier,+ STANDARD_OBJECTS.message.fields.headerMessageId.universalIdentifier,+ ]),+ );+ // subject is the label identifier, so the record title already carries it+ expect(viewFieldFieldUniversalIdentifiers).not.toContain(+ STANDARD_OBJECTS.message.fields.subject.universalIdentifier,+ );+ });++ // without it the body renders as one clamped line, which is what made the+ // record page look empty of content+ it('displays the message text over multiple rows', () => {+ const textField =+ allFlatEntityMaps.flatFieldMetadataMaps.byUniversalIdentifier[+ STANDARD_OBJECTS.message.fields.text.universalIdentifier+ ];++ expect(textField?.settings).toMatchObject({ displayedMaxRows: 99 });+ });++ it('groups the message record page fields into General and System', () => {+ const generalGroup =+ allFlatEntityMaps.flatViewFieldGroupMaps.byUniversalIdentifier[+ STANDARD_OBJECTS.message.views.messageRecordPageFields.viewFieldGroups+ .general.universalIdentifier+ ];+ const systemGroup =+ allFlatEntityMaps.flatViewFieldGroupMaps.byUniversalIdentifier[+ STANDARD_OBJECTS.message.views.messageRecordPageFields.viewFieldGroups+ .system.universalIdentifier+ ];++ expect(generalGroup).toMatchObject({ position: 0, isVisible: true });+ expect(systemGroup).toMatchObject({ position: 1, isVisible: true });+ });+});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.tsindex d4cbe3280e2..9f3d41668a4 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@@ -293,6 +293,10 @@ export const buildMessageStandardFlatFieldMetadatas = ({icon: 'IconMessage',isNullable: true,isUIEditable: false,+ // an email body is a block of prose, so it needs the same multi-line+ // display as calendarEvent.description rather than the single clamped+ // line a TEXT field falls back to+ settings: { displayedMaxRows: 99 },},standardObjectMetadataRelatedEntityIds,dependencyFlatEntityMaps,diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.tsindex d252786755c..07985e60a22 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts@@ -5,6 +5,7 @@ export { STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standaexport { STANDARD_CALL_RECORDING_PAGE_LAYOUT_CONFIG } from './standard-call-recording-page-layout.config';export { STANDARD_COMPANY_PAGE_LAYOUT_CONFIG } from './standard-company-page-layout.config';export { STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG } from './standard-dashboard-page-layout.config';+export { STANDARD_MESSAGE_PAGE_LAYOUT_CONFIG } from './standard-message-page-layout.config';export { STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG } from './standard-message-campaign-page-layout.config';export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-message-folder-page-layout.config';export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-page-layout.config';diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-page-layout.config.tsnew file mode 100644index 00000000000..5c960326362--- /dev/null+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-page-layout.config.ts@@ -0,0 +1,46 @@+import { msg } from '@lingui/core/macro';+import {+ STANDARD_OBJECTS,+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,+} from 'twenty-shared/metadata';++import { PageLayoutType } from 'twenty-shared/types';+import {+ TAB_PROPS,+ WIDGET_PROPS,+} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';+import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';+import {+ type StandardPageLayoutConfig,+ type StandardPageLayoutTabConfig,+} from 'src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type';++const MESSAGE_PAGE_TABS = {+ home: {+ universalIdentifier:+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage.tabs.home+ .universalIdentifier,+ ...TAB_PROPS.home,+ widgets: {+ fields: {+ universalIdentifier:+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage.tabs.home+ .widgets.fields.universalIdentifier,+ ...WIDGET_PROPS.fields,+ },+ },+ },+} as const satisfies Record<string, StandardPageLayoutTabConfig>;++export const STANDARD_MESSAGE_PAGE_LAYOUT_CONFIG = {+ name: i18nLabel(+ msg({ message: `Default Message Layout`, context: 'pageLayout.name' }),+ ),+ type: PageLayoutType.RECORD_PAGE,+ objectUniversalIdentifier: STANDARD_OBJECTS.message.universalIdentifier,+ universalIdentifier:+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageRecordPage+ .universalIdentifier,+ defaultTabUniversalIdentifier: null,+ tabs: MESSAGE_PAGE_TABS,+} as const satisfies StandardPageLayoutConfig;diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.tsindex 59b1e77cd5d..2c6c3dc477c 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts@@ -84,6 +84,7 @@ const RECORD_PAGE_FIELDS_VIEW_NAME_BY_OBJECT: Partial<calendarEventParticipant: 'calendarEventParticipantRecordPageFields',callRecording: 'callRecordingRecordPageFields',company: 'companyRecordPageFields',+ message: 'messageRecordPageFields',messageCampaign: 'messageCampaignRecordPageFields',messageChannelMessageAssociation:'messageChannelMessageAssociationRecordPageFields',diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/build-standard-flat-view-field-group-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/build-standard-flat-view-field-group-metadata-maps.util.tsindex dd34d63cf0e..a9360c8dde7 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/build-standard-flat-view-field-group-metadata-maps.util.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/build-standard-flat-view-field-group-metadata-maps.util.ts@@ -10,6 +10,7 @@ import { computeStandardCalendarEventParticipantViewFieldGroups } from 'src/engiimport { computeStandardCallRecordingViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-call-recording-view-field-groups.util';import { computeStandardCompanyViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-company-view-field-groups.util';import { computeStandardMessageCampaignViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-campaign-view-field-groups.util';+import { computeStandardMessageViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-view-field-groups.util';import { computeStandardMessageChannelMessageAssociationViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-channel-message-association-view-field-groups.util';import { computeStandardMessageChannelMessageAssociationMessageFolderViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-channel-message-association-message-folder-view-field-groups.util';import { computeStandardMessageParticipantViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-participant-view-field-groups.util';@@ -35,6 +36,7 @@ const STANDARD_FLAT_VIEW_FIELD_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME = {computeStandardCalendarEventParticipantViewFieldGroups,callRecording: computeStandardCallRecordingViewFieldGroups,company: computeStandardCompanyViewFieldGroups,+ message: computeStandardMessageViewFieldGroups,messageCampaign: computeStandardMessageCampaignViewFieldGroups,messageChannelMessageAssociation:computeStandardMessageChannelMessageAssociationViewFieldGroups,diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-view-field-groups.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-view-field-groups.util.tsnew file mode 100644index 00000000000..eec17b752a7--- /dev/null+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-view-field-groups.util.ts@@ -0,0 +1,40 @@+import { msg } from '@lingui/core/macro';+import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';+import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group.type';+import {+ createStandardViewFieldGroupFlatMetadata,+ type CreateStandardViewFieldGroupArgs,+} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util';++export const computeStandardMessageViewFieldGroups = (+ args: Omit<CreateStandardViewFieldGroupArgs<'message'>, 'context'>,+): Record<string, FlatViewFieldGroup> => {+ return {+ messageRecordPageFieldsGeneral: createStandardViewFieldGroupFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldGroupName: 'general',+ name: i18nLabel(+ msg({ message: `General`, context: 'viewFieldGroup.name' }),+ ),+ position: 0,+ isVisible: true,+ },+ }),+ messageRecordPageFieldsSystem: createStandardViewFieldGroupFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldGroupName: 'system',+ name: i18nLabel(+ msg({ message: `System`, context: 'viewFieldGroup.name' }),+ ),+ position: 1,+ isVisible: true,+ },+ }),+ };+};diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-view-fields.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-view-fields.util.tsindex 690110e8c69..97e4028bcbb 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-view-fields.util.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-view-fields.util.ts@@ -92,5 +92,100 @@ export const computeStandardMessageViewFields = (size: 150,},}),++ messageRecordPageFieldsMessageThread: createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'messageThread',+ fieldName: 'messageThread',+ position: 0,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'general',+ },+ }),+ messageRecordPageFieldsMessageParticipants:+ createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'messageParticipants',+ fieldName: 'messageParticipants',+ position: 1,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'general',+ },+ }),+ messageRecordPageFieldsReceivedAt: createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'receivedAt',+ fieldName: 'receivedAt',+ position: 2,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'general',+ },+ }),+ messageRecordPageFieldsText: createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'text',+ fieldName: 'text',+ position: 3,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'general',+ },+ }),+ messageRecordPageFieldsHeaderMessageId: createStandardViewFieldFlatMetadata(+ {+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'headerMessageId',+ fieldName: 'headerMessageId',+ position: 4,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'general',+ },+ },+ ),+ messageRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'createdAt',+ fieldName: 'createdAt',+ position: 0,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'system',+ },+ }),+ messageRecordPageFieldsCreatedBy: createStandardViewFieldFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ viewFieldName: 'createdBy',+ fieldName: 'createdBy',+ position: 1,+ isVisible: true,+ size: 150,+ viewFieldGroupName: 'system',+ },+ }),};};diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-views.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-views.util.tsindex b93ddccf45c..d129957f520 100644--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-views.util.ts+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-views.util.ts@@ -23,5 +23,17 @@ export const computeStandardMessageViews = (icon: 'IconTable',},}),+ messageRecordPageFields: createStandardViewFlatMetadata({+ ...args,+ objectName: 'message',+ context: {+ viewName: 'messageRecordPageFields',+ name: 'Message Record Page Fields',+ type: ViewType.FIELDS_WIDGET,+ key: null,+ position: 0,+ icon: 'IconListDetails',+ },+ }),};};diff --git a/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap b/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snapindex 85acdedb88e..29e989c9063 100644--- a/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap+++ b/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap@@ -1139,6 +1139,40 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e},},},+ "messageRecordPageFields": {+ "universalIdentifier": "3dcb94ca-040a-5ea3-b77a-ae0d161ae997",+ "viewFieldGroups": {+ "general": {+ "universalIdentifier": "9cfcc382-5949-5e3c-9d12-5d25facf9faa",+ },+ "system": {+ "universalIdentifier": "818692c7-0ba3-5ec9-84b4-bfedf1e56353",+ },+ },+ "viewFields": {+ "createdAt": {+ "universalIdentifier": "00f384d1-a224-50ea-8ec5-935490b11d09",+ },+ "createdBy": {+ "universalIdentifier": "944070ce-0436-5bf8-9cb4-0b350f70dc57",+ },+ "headerMessageId": {+ "universalIdentifier": "1f6cc726-d511-56a7-9c67-1e8ec054773e",+ },+ "messageParticipants": {+ "universalIdentifier": "3a255411-1355-5b83-890e-819bd048833f",+ },+ "messageThread": {+ "universalIdentifier": "81f8ca6f-68d0-552b-be97-b162067ce100",+ },+ "receivedAt": {+ "universalIdentifier": "59195b7a-4973-5158-b803-d5cb4ffaabe4",+ },+ "text": {+ "universalIdentifier": "51fc3e29-22a8-5c92-85cd-d96c2f7508db",+ },+ },+ },},},"messageCampaign": {diff --git a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-object.constant.tsindex 0a9d6959d2e..a6350e9f6b7 100644--- a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts+++ b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts@@ -715,6 +715,24 @@ export const STANDARD_OBJECTS = {'createdAt',],}),+ messageRecordPageFields: buildStandardObjectRecordPageFieldsView({+ objectUniversalIdentifier:+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.message,+ fields: STANDARD_OBJECT_FIELDS.message,+ viewFieldNames: [+ 'messageThread',+ 'messageParticipants',+ 'receivedAt',+ 'text',+ 'headerMessageId',+ 'createdAt',+ 'createdBy',+ ],+ viewFieldGroupNames: {+ general: 'General',+ system: 'System',+ },+ }),},},note: {diff --git a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.tsindex 7968d94244f..04e9ace32f5 100644--- a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts+++ b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts@@ -493,6 +493,17 @@ export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {},},}),+ messageRecordPage: buildStandardObjectRecordPageLayout({+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.message,+ tabs: {+ home: {+ title: 'Home',+ widgets: {+ fields: 'Fields',+ },+ },+ },+ }),messageThreadRecordPage: buildStandardObjectRecordPageLayout({objectUniversalIdentifier:STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageThread,