Skip to content

The open alternative to Salesforce, designed for AI.

System record page layout (#23651)

Paul Rastoind61114db8aab
diff --git a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer-stage.view-field.ts b/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer-stage.view-field.ts
deleted file mode 100644
index 1cdb3d690f1..00000000000
--- a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer-stage.view-field.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-import { BUYER_STAGE_FIELD_ID } from '../fields/opportunity-buyer-stage.field';
-
-const RECORD_PAGE =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views
- .opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: 'da074d0c-1596-42a5-8f82-e6ead2bd930d',
- viewUniversalIdentifier: RECORD_PAGE.universalIdentifier,
- fieldMetadataUniversalIdentifier: BUYER_STAGE_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- RECORD_PAGE.viewFieldGroups.deal.universalIdentifier,
- position: 10,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer.view-field.ts b/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer.view-field.ts
deleted file mode 100644
index 3be215749bb..00000000000
--- a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-buyer.view-field.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-import { BUYER_ON_OPPORTUNITY_ID } from '../fields/buyer-on-opportunity.field';
-
-const RECORD_PAGE =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views
- .opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: 'ebe94485-ea4e-424a-8fbc-3fec5a23f1e5',
- viewUniversalIdentifier: RECORD_PAGE.universalIdentifier,
- fieldMetadataUniversalIdentifier: BUYER_ON_OPPORTUNITY_ID,
- viewFieldGroupUniversalIdentifier:
- RECORD_PAGE.viewFieldGroups.relations.universalIdentifier,
- position: 10,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-property.view-field.ts b/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-property.view-field.ts
deleted file mode 100644
index bc9aa6c4257..00000000000
--- a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-property.view-field.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-import { PROPERTY_ON_OPPORTUNITY_ID } from '../fields/property-on-opportunity.field';
-
-const RECORD_PAGE =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views
- .opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: '3f690fd5-6d51-4103-89e1-cddf240780f3',
- viewUniversalIdentifier: RECORD_PAGE.universalIdentifier,
- fieldMetadataUniversalIdentifier: PROPERTY_ON_OPPORTUNITY_ID,
- viewFieldGroupUniversalIdentifier:
- RECORD_PAGE.viewFieldGroups.relations.universalIdentifier,
- position: 12,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-seller.view-field.ts b/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-seller.view-field.ts
deleted file mode 100644
index 81a8f95b683..00000000000
--- a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-seller.view-field.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-import { SELLER_ON_OPPORTUNITY_ID } from '../fields/seller-on-opportunity.field';
-
-const RECORD_PAGE =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views
- .opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: '7a308ab9-e1aa-435b-81a2-0299bcf6991b',
- viewUniversalIdentifier: RECORD_PAGE.universalIdentifier,
- fieldMetadataUniversalIdentifier: SELLER_ON_OPPORTUNITY_ID,
- viewFieldGroupUniversalIdentifier:
- RECORD_PAGE.viewFieldGroups.relations.universalIdentifier,
- position: 11,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-showings.view-field.ts b/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-showings.view-field.ts
deleted file mode 100644
index 66623ee7b0d..00000000000
--- a/packages/twenty-apps/internal/real-estate/src/view-fields/opportunity-record-page-showings.view-field.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-import { SHOWINGS_ON_OPPORTUNITY_ID } from '../fields/opportunity-on-showing.field';
-
-const RECORD_PAGE =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views
- .opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: '1db76619-5814-4eee-933a-88f88dc1f70b',
- viewUniversalIdentifier: RECORD_PAGE.universalIdentifier,
- fieldMetadataUniversalIdentifier: SHOWINGS_ON_OPPORTUNITY_ID,
- viewFieldGroupUniversalIdentifier:
- RECORD_PAGE.viewFieldGroups.relations.universalIdentifier,
- position: 13,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-applications.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-applications.view-field.ts
deleted file mode 100644
index 6aa9bdc8318..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-applications.view-field.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { OPPORTUNITY_RECORD_PAGE_APPLICATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
-import { APPLICATIONS_ON_OPPORTUNITY_FIELD_ID } from 'src/modules/application/objects/application.object';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- OPPORTUNITY_RECORD_PAGE_APPLICATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: APPLICATIONS_ON_OPPORTUNITY_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.relations.universalIdentifier,
- position: 4,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-is-listed.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-is-listed.view-field.ts
deleted file mode 100644
index 908ef60b1f0..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-is-listed.view-field.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { OPPORTUNITY_RECORD_PAGE_IS_LISTED_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
-import { OPPORTUNITY_IS_LISTED_FIELD_ID } from 'src/modules/opportunity/fields/opportunity-is-listed.field';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- OPPORTUNITY_RECORD_PAGE_IS_LISTED_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: OPPORTUNITY_IS_LISTED_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.deal.universalIdentifier,
- position: 3,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-need.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-need.view-field.ts
deleted file mode 100644
index 6dd0e48f907..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-need.view-field.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { OPPORTUNITY_RECORD_PAGE_NEED_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
-import { OPPORTUNITY_NEED_FIELD_ID } from 'src/modules/opportunity/fields/opportunity-need.field';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier: OPPORTUNITY_RECORD_PAGE_NEED_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: OPPORTUNITY_NEED_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.deal.universalIdentifier,
- position: 8,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-partner.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-partner.view-field.ts
deleted file mode 100644
index 9b38b121497..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-partner.view-field.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { OPPORTUNITY_RECORD_PAGE_PARTNER_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
-import { PARTNER_ON_OPPORTUNITY_FIELD_ID } from 'src/modules/opportunity/fields/partner-on-opportunity.field';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- OPPORTUNITY_RECORD_PAGE_PARTNER_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: PARTNER_ON_OPPORTUNITY_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.relations.universalIdentifier,
- position: 3,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-referred-by-partner.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-referred-by-partner.view-field.ts
deleted file mode 100644
index 36ff682df25..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-referred-by-partner.view-field.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { REFERRED_BY_PARTNER_ON_OPPORTUNITY_FIELD_ID } from 'src/modules/opportunity/fields/referred-by-partner-on-opportunity.field';
-
-export const OPPORTUNITY_RECORD_PAGE_REFERRED_BY_PARTNER_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
- '894a2b31-9c71-4365-aab1-27b805ac1bf8';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- OPPORTUNITY_RECORD_PAGE_REFERRED_BY_PARTNER_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: REFERRED_BY_PARTNER_ON_OPPORTUNITY_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.relations.universalIdentifier,
- position: 5,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-requirements.view-field.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-requirements.view-field.ts
deleted file mode 100644
index 1b26afba928..00000000000
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/opportunity/view-fields/opportunity-record-page-requirements.view-field.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { OPPORTUNITY_RECORD_PAGE_REQUIREMENTS_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
-import { OPPORTUNITY_REQUIREMENTS_FIELD_ID } from 'src/modules/opportunity/fields/opportunity-requirements.field';
-
-const OPPORTUNITY_RECORD_PAGE_FIELDS =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity.views.opportunityRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- OPPORTUNITY_RECORD_PAGE_REQUIREMENTS_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier: OPPORTUNITY_RECORD_PAGE_FIELDS.universalIdentifier,
- fieldMetadataUniversalIdentifier: OPPORTUNITY_REQUIREMENTS_FIELD_ID,
- viewFieldGroupUniversalIdentifier:
- OPPORTUNITY_RECORD_PAGE_FIELDS.viewFieldGroups.deal.universalIdentifier,
- position: 9,
- isVisible: true,
-});
diff --git a/packages/twenty-apps/public/call-recorder/src/constants/calendar-event-record-page-layout-universal-identifier.ts b/packages/twenty-apps/public/call-recorder/src/constants/calendar-event-record-page-layout-universal-identifier.ts
index a66d22a24f0..1cddb9499a0 100644
--- a/packages/twenty-apps/public/call-recorder/src/constants/calendar-event-record-page-layout-universal-identifier.ts
+++ b/packages/twenty-apps/public/call-recorder/src/constants/calendar-event-record-page-layout-universal-identifier.ts
@@ -1,2 +1,7 @@
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-sdk/define';
+
+// Shared core CalendarEvent record page layout that this app attaches tabs to,
+// resolved from the derived standard identifiers (re-owned in Twenty 2.28).
export const CALENDAR_EVENT_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
- 'b9b10e40-9ce2-4704-8ac6-c6e92e2563c1';
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .universalIdentifier;
diff --git a/packages/twenty-apps/public/call-recorder/src/constants/call-recorder-preference-on-calendar-event-view-field-universal-identifier.ts b/packages/twenty-apps/public/call-recorder/src/constants/call-recorder-preference-on-calendar-event-view-field-universal-identifier.ts
deleted file mode 100644
index b4007f9ed98..00000000000
--- a/packages/twenty-apps/public/call-recorder/src/constants/call-recorder-preference-on-calendar-event-view-field-universal-identifier.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const CALL_RECORDER_PREFERENCE_ON_CALENDAR_EVENT_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
- 'e8c7e9c5-2b4f-4a75-ae46-ea331809106c';
diff --git a/packages/twenty-apps/public/call-recorder/src/view-fields/call-recorder-preference-on-calendar-event.view-field.ts b/packages/twenty-apps/public/call-recorder/src/view-fields/call-recorder-preference-on-calendar-event.view-field.ts
deleted file mode 100644
index be98ec1a1a4..00000000000
--- a/packages/twenty-apps/public/call-recorder/src/view-fields/call-recorder-preference-on-calendar-event.view-field.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {
- defineViewField,
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
-} from 'twenty-sdk/define';
-
-import { CALL_RECORDER_PREFERENCE_ON_CALENDAR_EVENT_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/call-recorder-preference-on-calendar-event-field-universal-identifier';
-import { CALL_RECORDER_PREFERENCE_ON_CALENDAR_EVENT_VIEW_FIELD_UNIVERSAL_IDENTIFIER } from 'src/constants/call-recorder-preference-on-calendar-event-view-field-universal-identifier';
-
-const CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW =
- STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEvent.views
- .calendarEventRecordPageFields;
-
-export default defineViewField({
- universalIdentifier:
- CALL_RECORDER_PREFERENCE_ON_CALENDAR_EVENT_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier:
- CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW.universalIdentifier,
- viewFieldGroupUniversalIdentifier:
- CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW.viewFieldGroups.general
- .universalIdentifier,
- fieldMetadataUniversalIdentifier:
- CALL_RECORDER_PREFERENCE_ON_CALENDAR_EVENT_FIELD_UNIVERSAL_IDENTIFIER,
- position: 8,
- isVisible: true,
- size: 150,
-});
diff --git a/packages/twenty-apps/public/fireflies/src/constants/universal-identifiers.ts b/packages/twenty-apps/public/fireflies/src/constants/universal-identifiers.ts
index 30fc19d570e..91595258427 100644
--- a/packages/twenty-apps/public/fireflies/src/constants/universal-identifiers.ts
+++ b/packages/twenty-apps/public/fireflies/src/constants/universal-identifiers.ts
@@ -1,3 +1,5 @@
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-sdk/define';
+
export const APPLICATION_UNIVERSAL_IDENTIFIER =
'97d24431-ebc7-4156-9705-b6900e73edc8';
@@ -34,9 +36,11 @@ export const FIREFLIES_LIST_CALLS_BY_PARTICIPANT_UNIVERSAL_IDENTIFIER =
export const FIREFLIES_SEARCH_CALLS_UNIVERSAL_IDENTIFIER =
'cb2dd01d-8dca-4222-acce-1d1dbdef9146';
-// Shared core CalendarEvent record page layout that apps attach tabs to.
+// Shared core CalendarEvent record page layout that apps attach tabs to,
+// resolved from the derived standard identifiers (re-owned in Twenty 2.28).
export const CALENDAR_EVENT_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
- 'b9b10e40-9ce2-4704-8ac6-c6e92e2563c1';
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .universalIdentifier;
export const CALENDAR_EVENT_SUMMARY_PAGE_LAYOUT_TAB_UNIVERSAL_IDENTIFIER =
'f4fed96d-1551-40dc-a0c1-0b4d2a782733';
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index f4512620618..9f00375333d 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -596,6 +596,9 @@ enum PermissionFlagType {
type ViewField {
id: UUID!
+ universalIdentifier: UUID!
+ applicationId: UUID!
+ isSystemSideEffect: Boolean!
fieldMetadataId: UUID!
isVisible: Boolean!
size: Float!
@@ -725,6 +728,9 @@ type ViewFieldGroup {
type View {
id: UUID!
+ universalIdentifier: UUID!
+ applicationId: UUID!
+ isSystemSideEffect: Boolean!
name: String!
objectMetadataId: UUID!
type: ViewType!
@@ -951,6 +957,8 @@ type GridPosition {
type PageLayoutWidget {
id: UUID!
+ universalIdentifier: UUID!
+ isSystemSideEffect: Boolean!
applicationId: UUID!
pageLayoutTabId: UUID!
title: String!
@@ -1314,6 +1322,8 @@ type WorkflowVersionConfiguration {
type PageLayoutTab {
id: UUID!
+ universalIdentifier: UUID!
+ isSystemSideEffect: Boolean!
applicationId: UUID!
title: String!
position: Float!
@@ -1336,6 +1346,8 @@ type PageLayout {
tabs: [PageLayoutTab!]
defaultTabToFocusOnMobileAndSidePanelId: UUID
universalIdentifier: UUID!
+ applicationId: UUID!
+ isSystemSideEffect: Boolean!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 527b490e83a..192984fc7ae 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -399,6 +399,9 @@ export type PermissionFlagType = 'API_KEYS_AND_WEBHOOKS' | 'WORKSPACE' | 'WORKSP
export interface ViewField {
id: Scalars['UUID']
+ universalIdentifier: Scalars['UUID']
+ applicationId: Scalars['UUID']
+ isSystemSideEffect: Scalars['Boolean']
fieldMetadataId: Scalars['UUID']
isVisible: Scalars['Boolean']
size: Scalars['Float']
@@ -499,6 +502,9 @@ export interface ViewFieldGroup {
export interface View {
id: Scalars['UUID']
+ universalIdentifier: Scalars['UUID']
+ applicationId: Scalars['UUID']
+ isSystemSideEffect: Scalars['Boolean']
name: Scalars['String']
objectMetadataId: Scalars['UUID']
type: ViewType
@@ -689,6 +695,8 @@ export interface GridPosition {
export interface PageLayoutWidget {
id: Scalars['UUID']
+ universalIdentifier: Scalars['UUID']
+ isSystemSideEffect: Scalars['Boolean']
applicationId: Scalars['UUID']
pageLayoutTabId: Scalars['UUID']
title: Scalars['String']
@@ -996,6 +1004,8 @@ export interface WorkflowVersionConfiguration {
export interface PageLayoutTab {
id: Scalars['UUID']
+ universalIdentifier: Scalars['UUID']
+ isSystemSideEffect: Scalars['Boolean']
applicationId: Scalars['UUID']
title: Scalars['String']
position: Scalars['Float']
@@ -1020,6 +1030,8 @@ export interface PageLayout {
tabs?: PageLayoutTab[]
defaultTabToFocusOnMobileAndSidePanelId?: Scalars['UUID']
universalIdentifier: Scalars['UUID']
+ applicationId: Scalars['UUID']
+ isSystemSideEffect: Scalars['Boolean']
createdAt: Scalars['DateTime']
updatedAt: Scalars['DateTime']
deletedAt?: Scalars['DateTime']
@@ -3638,6 +3650,9 @@ export interface UserWorkspaceGenqlSelection{
export interface ViewFieldGenqlSelection{
id?: boolean | number
+ universalIdentifier?: boolean | number
+ applicationId?: boolean | number
+ isSystemSideEffect?: boolean | number
fieldMetadataId?: boolean | number
isVisible?: boolean | number
size?: boolean | number
@@ -3736,6 +3751,9 @@ export interface ViewFieldGroupGenqlSelection{
export interface ViewGenqlSelection{
id?: boolean | number
+ universalIdentifier?: boolean | number
+ applicationId?: boolean | number
+ isSystemSideEffect?: boolean | number
name?: boolean | number
objectMetadataId?: boolean | number
type?: boolean | number
@@ -3916,6 +3934,8 @@ export interface GridPositionGenqlSelection{
export interface PageLayoutWidgetGenqlSelection{
id?: boolean | number
+ universalIdentifier?: boolean | number
+ isSystemSideEffect?: boolean | number
applicationId?: boolean | number
pageLayoutTabId?: boolean | number
title?: boolean | number
@@ -4252,6 +4272,8 @@ export interface WorkflowVersionConfigurationGenqlSelection{
export interface PageLayoutTabGenqlSelection{
id?: boolean | number
+ universalIdentifier?: boolean | number
+ isSystemSideEffect?: boolean | number
applicationId?: boolean | number
title?: boolean | number
position?: boolean | number
@@ -4277,6 +4299,8 @@ export interface PageLayoutGenqlSelection{
tabs?: PageLayoutTabGenqlSelection
defaultTabToFocusOnMobileAndSidePanelId?: boolean | number
universalIdentifier?: boolean | number
+ applicationId?: boolean | number
+ isSystemSideEffect?: boolean | number
createdAt?: boolean | number
updatedAt?: boolean | number
deletedAt?: boolean | number
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index c3a1e8c498d..789c7d33b36 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -1164,6 +1164,15 @@ export default {
"id": [
4
],
+ "universalIdentifier": [
+ 4
+ ],
+ "applicationId": [
+ 4
+ ],
+ "isSystemSideEffect": [
+ 3
+ ],
"fieldMetadataId": [
4
],
@@ -1396,6 +1405,15 @@ export default {
"id": [
4
],
+ "universalIdentifier": [
+ 4
+ ],
+ "applicationId": [
+ 4
+ ],
+ "isSystemSideEffect": [
+ 3
+ ],
"name": [
1
],
@@ -1859,6 +1877,12 @@ export default {
"id": [
4
],
+ "universalIdentifier": [
+ 4
+ ],
+ "isSystemSideEffect": [
+ 3
+ ],
"applicationId": [
4
],
@@ -2557,6 +2581,12 @@ export default {
"id": [
4
],
+ "universalIdentifier": [
+ 4
+ ],
+ "isSystemSideEffect": [
+ 3
+ ],
"applicationId": [
4
],
@@ -2619,6 +2649,12 @@ export default {
"universalIdentifier": [
4
],
+ "applicationId": [
+ 4
+ ],
+ "isSystemSideEffect": [
+ 3
+ ],
"createdAt": [
6
],
diff --git a/packages/twenty-docs/developers/extend/apps/data/system-fields.mdx b/packages/twenty-docs/developers/extend/apps/data/system-fields.mdx
index 57a3b81cf87..7fcdb09db10 100644
--- a/packages/twenty-docs/developers/extend/apps/data/system-fields.mdx
+++ b/packages/twenty-docs/developers/extend/apps/data/system-fields.mdx
@@ -146,23 +146,26 @@ As with scalar system fields, the resolved id works anywhere a `fieldMetadataUni
2.26 or later.
</Note>
-The server also provisions a **system view** on every object: the main list view (`All {objectLabelPlural}`, keyed on `ViewKey.INDEX`), with one column per displayable field. Like system relation fields, their identifiers are derived **name-free**, so renaming an object or a field never changes them.
+The server also provisions a **system view** on every object: the main list view (`All {objectLabelPlural}`, keyed on `ViewKey.INDEX` (derived with `SYSTEM_VIEW_KEYS.INDEX`)), with one column per displayable field. Like system relation fields, their identifiers are derived **name-free**, so renaming an object or a field never changes them.
Use `getSystemViewUniversalIdentifier` to resolve the view:
```ts
-import { getSystemViewUniversalIdentifier, ViewKey } from 'twenty-sdk/define';
+import {
+ getSystemViewUniversalIdentifier,
+ SYSTEM_VIEW_KEYS,
+} from 'twenty-sdk/define';
const rocketIndexViewId = getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: ROCKET_OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
```
- `objectMetadataApplicationUniversalIdentifier` is the application owning the **object**, which is what the view is namespaced by.
- `objectUniversalIdentifier` is the object the view lists.
-- `viewKey` is the system view key, `ViewKey.INDEX` today.
+- `viewKey` is the system view discriminator: `SYSTEM_VIEW_KEYS.INDEX` for the main list view, `SYSTEM_VIEW_KEYS.FIELDS_WIDGET` for the record-page fields widget view. It keys the derivation; only `INDEX` is also stored on the view row.
The resolved id works anywhere a `viewUniversalIdentifier` is expected, such as a [`NavigationMenuItemType.VIEW`](/developers/extend/apps/layout/navigation-menu-items) sidebar entry. To simply open an object's main list, prefer `NavigationMenuItemType.OBJECT` with `targetObjectUniversalIdentifier`: it needs no derivation.
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 0e4f46e684d..0acf680b8fc 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -4286,10 +4286,12 @@ export type PageInfo = {
export type PageLayout = {
__typename?: 'PageLayout';
+ applicationId: Scalars['UUID']['output'];
createdAt: Scalars['DateTime']['output'];
defaultTabToFocusOnMobileAndSidePanelId?: Maybe<Scalars['UUID']['output']>;
deletedAt?: Maybe<Scalars['DateTime']['output']>;
id: Scalars['UUID']['output'];
+ isSystemSideEffect: Scalars['Boolean']['output'];
name: Scalars['String']['output'];
objectMetadataId?: Maybe<Scalars['UUID']['output']>;
tabs?: Maybe<Array<PageLayoutTab>>;
@@ -4308,10 +4310,12 @@ export type PageLayoutTab = {
isActive: Scalars['Boolean']['output'];
/** @deprecated isOverridden is deprecated */
isOverridden?: Maybe<Scalars['Boolean']['output']>;
+ isSystemSideEffect: Scalars['Boolean']['output'];
layoutMode?: Maybe<PageLayoutTabLayoutMode>;
pageLayoutId: Scalars['UUID']['output'];
position: Scalars['Float']['output'];
title: Scalars['String']['output'];
+ universalIdentifier: Scalars['UUID']['output'];
updatedAt: Scalars['DateTime']['output'];
widgets?: Maybe<Array<PageLayoutWidget>>;
};
@@ -4343,11 +4347,13 @@ export type PageLayoutWidget = {
isActive: Scalars['Boolean']['output'];
/** @deprecated isOverridden is deprecated */
isOverridden?: Maybe<Scalars['Boolean']['output']>;
+ isSystemSideEffect: Scalars['Boolean']['output'];
objectMetadataId?: Maybe<Scalars['UUID']['output']>;
pageLayoutTabId: Scalars['UUID']['output'];
position?: Maybe<PageLayoutWidgetPosition>;
title: Scalars['String']['output'];
type: WidgetType;
+ universalIdentifier: Scalars['UUID']['output'];
updatedAt: Scalars['DateTime']['output'];
};
@@ -6305,6 +6311,7 @@ export type VersionDistributionEntry = {
export type View = {
__typename?: 'View';
anyFieldFilterValue?: Maybe<Scalars['String']['output']>;
+ applicationId: Scalars['UUID']['output'];
calendarEndFieldMetadataId?: Maybe<Scalars['UUID']['output']>;
calendarFieldMetadataId?: Maybe<Scalars['UUID']['output']>;
calendarLayout?: Maybe<ViewCalendarLayout>;
@@ -6316,6 +6323,7 @@ export type View = {
isActive: Scalars['Boolean']['output'];
isCompact: Scalars['Boolean']['output'];
isCustom: Scalars['Boolean']['output'];
+ isSystemSideEffect: Scalars['Boolean']['output'];
kanbanAggregateOperation?: Maybe<AggregateOperations>;
kanbanAggregateOperationFieldMetadataId?: Maybe<Scalars['UUID']['output']>;
kanbanColumnWidth?: Maybe<Scalars['Int']['output']>;
@@ -6328,6 +6336,7 @@ export type View = {
position: Scalars['Float']['output'];
shouldHideEmptyGroups: Scalars['Boolean']['output'];
type: ViewType;
+ universalIdentifier: Scalars['UUID']['output'];
updatedAt: Scalars['DateTime']['output'];
viewFieldGroups: Array<ViewFieldGroup>;
viewFields: Array<ViewField>;
@@ -6353,6 +6362,7 @@ export type ViewConfiguration = {
export type ViewField = {
__typename?: 'ViewField';
aggregateOperation?: Maybe<AggregateOperations>;
+ applicationId: Scalars['UUID']['output'];
createdAt: Scalars['DateTime']['output'];
deletedAt?: Maybe<Scalars['DateTime']['output']>;
fieldMetadataId: Scalars['UUID']['output'];
@@ -6360,9 +6370,11 @@ export type ViewField = {
isActive: Scalars['Boolean']['output'];
/** @deprecated isOverridden is deprecated */
isOverridden?: Maybe<Scalars['Boolean']['output']>;
+ isSystemSideEffect: Scalars['Boolean']['output'];
isVisible: Scalars['Boolean']['output'];
position: Scalars['Float']['output'];
size: Scalars['Float']['output'];
+ universalIdentifier: Scalars['UUID']['output'];
updatedAt: Scalars['DateTime']['output'];
viewFieldGroupId?: Maybe<Scalars['UUID']['output']>;
viewId: Scalars['UUID']['output'];
@@ -7388,7 +7400,7 @@ export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuI
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null }> };
-export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string, applicationId: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7421,7 +7433,7 @@ export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string
| { __typename?: 'WorkflowVersionConfiguration', configurationType: WidgetConfigurationType }
}> | null }> | null };
-export type PageLayoutTabFragmentFragment = { __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type PageLayoutTabFragmentFragment = { __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7466,7 +7478,7 @@ export type FindOnePageLayoutQueryVariables = Exact<{
}>;
-export type FindOnePageLayoutQuery = { __typename?: 'Query', getPageLayout?: { __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type FindOnePageLayoutQuery = { __typename?: 'Query', getPageLayout?: { __typename?: 'PageLayout', id: string, applicationId: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7843,7 +7855,7 @@ export type GetInviteSuggestionsQueryVariables = Exact<{ [key: string]: never; }
export type GetInviteSuggestionsQuery = { __typename?: 'Query', getInviteSuggestions: Array<{ __typename?: 'InviteSuggestion', email: string, displayName?: string | null }> };
-export type PageLayoutWidgetFragmentFragment = { __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type PageLayoutWidgetFragmentFragment = { __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7881,7 +7893,7 @@ export type ResetPageLayoutTabToDefaultMutationVariables = Exact<{
}>;
-export type ResetPageLayoutTabToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutTabToDefault: { __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type ResetPageLayoutTabToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutTabToDefault: { __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7919,7 +7931,7 @@ export type ResetPageLayoutToDefaultMutationVariables = Exact<{
}>;
-export type ResetPageLayoutToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutToDefault: { __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type ResetPageLayoutToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutToDefault: { __typename?: 'PageLayout', id: string, applicationId: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7957,7 +7969,7 @@ export type ResetPageLayoutWidgetToDefaultMutationVariables = Exact<{
}>;
-export type ResetPageLayoutWidgetToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutWidgetToDefault: { __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type ResetPageLayoutWidgetToDefaultMutation = { __typename?: 'Mutation', resetPageLayoutWidgetToDefault: { __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7996,7 +8008,7 @@ export type UpdatePageLayoutWithTabsAndWidgetsMutationVariables = Exact<{
}>;
-export type UpdatePageLayoutWithTabsAndWidgetsMutation = { __typename?: 'Mutation', updatePageLayoutWithTabsAndWidgets: { __typename?: 'PageLayout', id: string, name: string, type: PageLayoutType, objectMetadataId?: string | null, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, deletedAt?: string | null, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type UpdatePageLayoutWithTabsAndWidgetsMutation = { __typename?: 'Mutation', updatePageLayoutWithTabsAndWidgets: { __typename?: 'PageLayout', id: string, applicationId: string, name: string, type: PageLayoutType, objectMetadataId?: string | null, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, deletedAt?: string | null, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8046,7 +8058,7 @@ export type UpsertViewWidgetMutation = { __typename?: 'Mutation', upsertViewWidg
export type FindAllPageLayoutsQueryVariables = Exact<{ [key: string]: never; }>;
-export type FindAllPageLayoutsQuery = { __typename?: 'Query', getPageLayouts: Array<{ __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type FindAllPageLayoutsQuery = { __typename?: 'Query', getPageLayouts: Array<{ __typename?: 'PageLayout', id: string, applicationId: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8082,7 +8094,7 @@ export type FindAllPageLayoutsQuery = { __typename?: 'Query', getPageLayouts: Ar
export type FindAllRecordPageLayoutsQueryVariables = Exact<{ [key: string]: never; }>;
-export type FindAllRecordPageLayoutsQuery = { __typename?: 'Query', getPageLayouts: Array<{ __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
+export type FindAllRecordPageLayoutsQuery = { __typename?: 'Query', getPageLayouts: Array<{ __typename?: 'PageLayout', id: string, applicationId: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, universalIdentifier: string, isSystemSideEffect: boolean, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, pageLayoutId: string, isActive: boolean, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, applicationId: string, universalIdentifier: string, isSystemSideEffect: boolean, title: string, type: WidgetType, objectMetadataId?: string | null, createdAt: string, updatedAt: string, isActive: boolean, deletedAt?: string | null, conditionalDisplay?: any | null, conditionalAvailabilityExpression?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -9352,9 +9364,9 @@ export const AuthTokenFragmentFragmentDoc = {"kind":"Document","definitions":[{"
export const AuthTokenPairFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<AuthTokenPairFragmentFragment, unknown>;
export const AvailableSsoIdentityProvidersFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableSSOIdentityProvidersFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FindAvailableSSOIDP"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]} as unknown as DocumentNode<AvailableSsoIdentityProvidersFragmentFragment, unknown>;
export const CommandMenuItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectMetadataCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataItemId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<CommandMenuItemFieldsFragment, unknown>;
-export const PageLayoutWidgetFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutWidgetFragmentFragment, unknown>;
-export const PageLayoutTabFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutTabFragmentFragment, unknown>;
-export const PageLayoutFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<PageLayoutFragmentFragment, unknown>;
+export const PageLayoutWidgetFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutWidgetFragmentFragment, unknown>;
+export const PageLayoutTabFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<PageLayoutTabFragmentFragment, unknown>;
+export const PageLayoutFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<PageLayoutFragmentFragment, unknown>;
export const MarketplaceAppDetailFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MarketplaceAppDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MarketplaceAppDetail"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"sourceType"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePackage"}},{"kind":"Field","name":{"kind":"Name","value":"latestAvailableVersion"}},{"kind":"Field","name":{"kind":"Name","value":"isListed"}},{"kind":"Field","name":{"kind":"Name","value":"isVetted"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"websiteUrl"}},{"kind":"Field","name":{"kind":"Name","value":"aboutDescription"}},{"kind":"Field","name":{"kind":"Name","value":"termsUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailSupport"}},{"kind":"Field","name":{"kind":"Name","value":"issueReportUrl"}},{"kind":"Field","name":{"kind":"Name","value":"galleryImages"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"roles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlagUniversalIdentifiers"}},{"kind":"Field","name":{"kind":"Name","value":"objectPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"objectUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"objectUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"fieldUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"canReadFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateFieldValue"}}]}}]}}]}}]} as unknown as DocumentNode<MarketplaceAppDetailFieldsFragment, unknown>;
export const MarketplaceAppFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MarketplaceAppFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MarketplaceApp"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePackage"}},{"kind":"Field","name":{"kind":"Name","value":"isVetted"}}]}}]} as unknown as DocumentNode<MarketplaceAppFieldsFragment, unknown>;
export const NavigationMenuItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"NavigationMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NavigationMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"targetRecordId"}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"folderId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<NavigationMenuItemFieldsFragment, unknown>;
@@ -9472,7 +9484,7 @@ export const ResetCommandMenuItemDocument = {"kind":"Document","definitions":[{"
export const UpdateCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCommandMenuItemInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectMetadataCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataItemId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<UpdateCommandMenuItemMutation, UpdateCommandMenuItemMutationVariables>;
export const FindManyCommandMenuItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyCommandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"commandMenuItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectMetadataCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataItemId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<FindManyCommandMenuItemsQuery, FindManyCommandMenuItemsQueryVariables>;
export const DuplicateDashboardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DuplicateDashboard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"duplicateDashboard"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<DuplicateDashboardMutation, DuplicateDashboardMutationVariables>;
-export const FindOnePageLayoutDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOnePageLayout"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayout"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindOnePageLayoutQuery, FindOnePageLayoutQueryVariables>;
+export const FindOnePageLayoutDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOnePageLayout"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayout"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindOnePageLayoutQuery, FindOnePageLayoutQueryVariables>;
export const FindOnePageLayoutTypeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindOnePageLayoutType"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayout"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]} as unknown as DocumentNode<FindOnePageLayoutTypeQuery, FindOnePageLayoutTypeQueryVariables>;
export const CompleteFileUploadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CompleteFileUpload"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fileId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"completeFileUpload"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"fileId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fileId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode<CompleteFileUploadMutation, CompleteFileUploadMutationVariables>;
export const CreateFileUploadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateFileUpload"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filename"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"size"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fileFolder"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FileFolder"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"fieldMetadataId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createFileUpload"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filename"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filename"}}},{"kind":"Argument","name":{"kind":"Name","value":"size"},"value":{"kind":"Variable","name":{"kind":"Name","value":"size"}}},{"kind":"Argument","name":{"kind":"Name","value":"fileFolder"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fileFolder"}}},{"kind":"Argument","name":{"kind":"Name","value":"fieldMetadataId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"fieldMetadataId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fileId"}},{"kind":"Field","name":{"kind":"Name","value":"uploadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"contentType"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]}}]} as unknown as DocumentNode<CreateFileUploadMutation, CreateFileUploadMutationVariables>;
@@ -9522,14 +9534,14 @@ export const SkipSyncEmailOnboardingStepDocument = {"kind":"Document","definitio
export const StartWorkspaceSetupChatDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"StartWorkspaceSetupChat"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"companyContext"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startWorkspaceSetupChat"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"companyContext"},"value":{"kind":"Variable","name":{"kind":"Name","value":"companyContext"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"outcome"}},{"kind":"Field","name":{"kind":"Name","value":"thread"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"contextWindowTokens"}},{"kind":"Field","name":{"kind":"Name","value":"conversationSize"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputCredits"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputCredits"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"lastMessageAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<StartWorkspaceSetupChatMutation, StartWorkspaceSetupChatMutationVariables>;
export const TriggerInstallAppsOnboardingStepDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TriggerInstallAppsOnboardingStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifiers"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerInstallAppsOnboardingStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifiers"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifiers"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode<TriggerInstallAppsOnboardingStepMutation, TriggerInstallAppsOnboardingStepMutationVariables>;
export const GetInviteSuggestionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInviteSuggestions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getInviteSuggestions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]} as unknown as DocumentNode<GetInviteSuggestionsQuery, GetInviteSuggestionsQueryVariables>;
-export const ResetPageLayoutTabToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutTabToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutTabToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ResetPageLayoutTabToDefaultMutation, ResetPageLayoutTabToDefaultMutationVariables>;
-export const ResetPageLayoutToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<ResetPageLayoutToDefaultMutation, ResetPageLayoutToDefaultMutationVariables>;
-export const ResetPageLayoutWidgetToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutWidgetToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutWidgetToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<ResetPageLayoutWidgetToDefaultMutation, ResetPageLayoutWidgetToDefaultMutationVariables>;
-export const UpdatePageLayoutWithTabsAndWidgetsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePageLayoutWithTabsAndWidgets"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdatePageLayoutWithTabsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePageLayoutWithTabsAndWidgets"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<UpdatePageLayoutWithTabsAndWidgetsMutation, UpdatePageLayoutWithTabsAndWidgetsMutationVariables>;
+export const ResetPageLayoutTabToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutTabToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutTabToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ResetPageLayoutTabToDefaultMutation, ResetPageLayoutTabToDefaultMutationVariables>;
+export const ResetPageLayoutToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<ResetPageLayoutToDefaultMutation, ResetPageLayoutToDefaultMutationVariables>;
+export const ResetPageLayoutWidgetToDefaultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetPageLayoutWidgetToDefault"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetPageLayoutWidgetToDefault"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}}]} as unknown as DocumentNode<ResetPageLayoutWidgetToDefaultMutation, ResetPageLayoutWidgetToDefaultMutationVariables>;
+export const UpdatePageLayoutWithTabsAndWidgetsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePageLayoutWithTabsAndWidgets"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdatePageLayoutWithTabsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePageLayoutWithTabsAndWidgets"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<UpdatePageLayoutWithTabsAndWidgetsMutation, UpdatePageLayoutWithTabsAndWidgetsMutationVariables>;
export const UpsertFieldsWidgetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertFieldsWidget"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpsertFieldsWidgetInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsertFieldsWidget"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilter"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"relationTargetFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilterGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentViewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"View"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isCompact"}},{"kind":"Field","name":{"kind":"Name","value":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"mainGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"shouldHideEmptyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanColumnWidth"}},{"kind":"Field","name":{"kind":"Name","value":"anyFieldFilterValue"}},{"kind":"Field","name":{"kind":"Name","value":"calendarFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarEndFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarLayout"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdByUserWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewSorts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewSortFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewGroupFragment"}}]}}]}}]} as unknown as DocumentNode<UpsertFieldsWidgetMutation, UpsertFieldsWidgetMutationVariables>;
export const UpsertViewWidgetDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpsertViewWidget"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpsertViewWidgetInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upsertViewWidget"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilter"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"relationTargetFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilterGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentViewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"View"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isCompact"}},{"kind":"Field","name":{"kind":"Name","value":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"mainGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"shouldHideEmptyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanColumnWidth"}},{"kind":"Field","name":{"kind":"Name","value":"anyFieldFilterValue"}},{"kind":"Field","name":{"kind":"Name","value":"calendarFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarEndFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarLayout"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdByUserWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewSorts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewSortFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewGroupFragment"}}]}}]}}]} as unknown as DocumentNode<UpsertViewWidgetMutation, UpsertViewWidgetMutationVariables>;
-export const FindAllPageLayoutsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindAllPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindAllPageLayoutsQuery, FindAllPageLayoutsQueryVariables>;
-export const FindAllRecordPageLayoutsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindAllRecordPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayouts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pageLayoutType"},"value":{"kind":"EnumValue","value":"RECORD_PAGE"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindAllRecordPageLayoutsQuery, FindAllRecordPageLayoutsQueryVariables>;
+export const FindAllPageLayoutsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindAllPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindAllPageLayoutsQuery, FindAllPageLayoutsQueryVariables>;
+export const FindAllRecordPageLayoutsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindAllRecordPageLayouts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPageLayouts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pageLayoutType"},"value":{"kind":"EnumValue","value":"RECORD_PAGE"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutWidgetFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidget"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"gridPosition"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"position"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetGridPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"row"}},{"kind":"Field","name":{"kind":"Name","value":"column"}},{"kind":"Field","name":{"kind":"Name","value":"rowSpan"}},{"kind":"Field","name":{"kind":"Name","value":"columnSpan"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetVerticalListPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutWidgetCanvasPosition"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"configuration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"primaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisGroupByDateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisOrderBy"}},{"kind":"Field","name":{"kind":"Name","value":"secondaryAxisManualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"omitNullValues"}},{"kind":"Field","name":{"kind":"Name","value":"axisNameDisplay"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMin"}},{"kind":"Field","name":{"kind":"Name","value":"rangeMax"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"isStacked"}},{"kind":"Field","name":{"kind":"Name","value":"isCumulative"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"groupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"groupBySubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"dateGranularity"}},{"kind":"Field","name":{"kind":"Name","value":"orderBy"}},{"kind":"Field","name":{"kind":"Name","value":"manualSortOrder"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"displayLegend"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"hideEmptyCategory"}},{"kind":"Field","name":{"kind":"Name","value":"splitMultiValueFields"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AggregateChartConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"displayDataLabel"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"filter"}},{"kind":"Field","name":{"kind":"Name","value":"prefix"}},{"kind":"Field","name":{"kind":"Name","value":"suffix"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"firstDayOfTheWeek"}},{"kind":"Field","name":{"kind":"Name","value":"ratioAggregateConfig"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"optionValue"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"IframeConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StandaloneRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"blocknote"}},{"kind":"Field","name":{"kind":"Name","value":"markdown"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CalendarConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EmailThreadConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingSummaryConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CallRecordingTranscriptConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignBodyConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MessageCampaignDetailsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"fieldDisplayMode"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"nestedRelationFieldMetadataId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldRichTextConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldsConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"newFieldDefaultVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"shouldAllowUserToSeeHiddenFields"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FilesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NotesConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TasksConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TimelineConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RecordTableConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowRunConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkflowVersionConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FrontComponentConfiguration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"configurationType"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutTabId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutTabFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayoutTab"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"layoutMode"}},{"kind":"Field","name":{"kind":"Name","value":"widgets"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutWidgetFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PageLayoutFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PageLayout"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"isSystemSideEffect"}},{"kind":"Field","name":{"kind":"Name","value":"defaultTabToFocusOnMobileAndSidePanelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tabs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PageLayoutTabFragment"}}]}}]}}]} as unknown as DocumentNode<FindAllRecordPageLayoutsQuery, FindAllRecordPageLayoutsQueryVariables>;
export const BarChartDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BarChartData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"BarChartDataInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"barChartData"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"indexBy"}},{"kind":"Field","name":{"kind":"Name","value":"keys"}},{"kind":"Field","name":{"kind":"Name","value":"series"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}}]}},{"kind":"Field","name":{"kind":"Name","value":"xAxisLabel"}},{"kind":"Field","name":{"kind":"Name","value":"yAxisLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showLegend"}},{"kind":"Field","name":{"kind":"Name","value":"showDataLabels"}},{"kind":"Field","name":{"kind":"Name","value":"layout"}},{"kind":"Field","name":{"kind":"Name","value":"groupMode"}},{"kind":"Field","name":{"kind":"Name","value":"hasTooManyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"formattedToRawLookup"}}]}}]}}]} as unknown as DocumentNode<BarChartDataQuery, BarChartDataQueryVariables>;
export const LineChartDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LineChartData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"LineChartDataInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lineChartData"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"series"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"x"}},{"kind":"Field","name":{"kind":"Name","value":"y"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"xAxisLabel"}},{"kind":"Field","name":{"kind":"Name","value":"yAxisLabel"}},{"kind":"Field","name":{"kind":"Name","value":"showLegend"}},{"kind":"Field","name":{"kind":"Name","value":"showDataLabels"}},{"kind":"Field","name":{"kind":"Name","value":"hasTooManyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"formattedToRawLookup"}}]}}]}}]} as unknown as DocumentNode<LineChartDataQuery, LineChartDataQueryVariables>;
export const PieChartDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PieChartData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PieChartDataInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pieChartData"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"showLegend"}},{"kind":"Field","name":{"kind":"Name","value":"showDataLabels"}},{"kind":"Field","name":{"kind":"Name","value":"showCenterMetric"}},{"kind":"Field","name":{"kind":"Name","value":"hasTooManyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"formattedToRawLookup"}}]}}]}}]} as unknown as DocumentNode<PieChartDataQuery, PieChartDataQueryVariables>;
diff --git a/packages/twenty-front/src/modules/app/utils/getPageLayoutIdForLocation.ts b/packages/twenty-front/src/modules/app/utils/getPageLayoutIdForLocation.ts
index a4db09be270..b9623040ed0 100644
--- a/packages/twenty-front/src/modules/app/utils/getPageLayoutIdForLocation.ts
+++ b/packages/twenty-front/src/modules/app/utils/getPageLayoutIdForLocation.ts
@@ -5,7 +5,6 @@ import { isDefined } from 'twenty-shared/utils';
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
import { recordPageLayoutByObjectMetadataIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
const DASHBOARD_NAME_SINGULAR = CoreObjectNameSingular.Dashboard;
@@ -42,11 +41,7 @@ export const getPageLayoutIdForLocation = ({
}),
);
- return isDefined(recordPageLayout)
- ? recordPageLayout.id
- : getDefaultRecordPageLayoutId({
- targetObjectNameSingular: objectNameSingular,
- });
+ return isDefined(recordPageLayout) ? recordPageLayout.id : null;
}
const pageLayoutMatch = matchPath(AppPath.PageLayoutPage, location.pathname);
diff --git a/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutFragment.ts b/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutFragment.ts
index a0171e27207..34d880fac78 100644
--- a/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutFragment.ts
+++ b/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutFragment.ts
@@ -5,10 +5,12 @@ export const PAGE_LAYOUT_FRAGMENT = gql`
${PAGE_LAYOUT_TAB_FRAGMENT}
fragment PageLayoutFragment on PageLayout {
id
+ applicationId
name
objectMetadataId
type
universalIdentifier
+ isSystemSideEffect
defaultTabToFocusOnMobileAndSidePanelId
createdAt
updatedAt
diff --git a/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutTabFragment.ts b/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutTabFragment.ts
index 349fcfa96d6..dec02833be9 100644
--- a/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutTabFragment.ts
+++ b/packages/twenty-front/src/modules/dashboards/graphql/fragments/pageLayoutTabFragment.ts
@@ -6,6 +6,8 @@ export const PAGE_LAYOUT_TAB_FRAGMENT = gql`
fragment PageLayoutTabFragment on PageLayoutTab {
id
applicationId
+ universalIdentifier
+ isSystemSideEffect
title
icon
position
diff --git a/packages/twenty-front/src/modules/layout-customization/hooks/__tests__/useIsLayoutCustomizationDirty.test.tsx b/packages/twenty-front/src/modules/layout-customization/hooks/__tests__/useIsLayoutCustomizationDirty.test.tsx
index e44b12e8b2d..b65f007cae5 100644
--- a/packages/twenty-front/src/modules/layout-customization/hooks/__tests__/useIsLayoutCustomizationDirty.test.tsx
+++ b/packages/twenty-front/src/modules/layout-customization/hooks/__tests__/useIsLayoutCustomizationDirty.test.tsx
@@ -19,10 +19,12 @@ const PAGE_LAYOUT_ID_1 = 'page-layout-1';
const PAGE_LAYOUT_ID_2 = 'page-layout-2';
const MOCK_PAGE_LAYOUT: PageLayout = {
+ applicationId: 'application-id-mock',
__typename: 'PageLayout',
id: PAGE_LAYOUT_ID_1,
name: 'Test Layout',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId: 'obj-1',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [],
diff --git a/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts b/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
index 5f5cbd73d81..2007d493ccb 100644
--- a/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
+++ b/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
@@ -17,7 +17,6 @@ import { type DraftPageLayout } from '@/page-layout/types/DraftPageLayout';
import { type PageLayout } from '@/page-layout/types/PageLayout';
import { convertPageLayoutDraftToUpdateInput } from '@/page-layout/utils/convertPageLayoutDraftToUpdateInput';
import { convertPageLayoutToTabLayouts } from '@/page-layout/utils/convertPageLayoutToTabLayouts';
-import { isDefaultPageLayoutId } from '@/page-layout/utils/isDefaultPageLayoutId';
import { transformPageLayout } from '@/page-layout/utils/transformPageLayout';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useLingui } from '@lingui/react/macro';
@@ -73,10 +72,6 @@ export const useSaveLayoutCustomization = () => {
let hasAnyFailure = false;
for (const pageLayoutId of activePageLayoutIds) {
- if (isDefaultPageLayoutId(pageLayoutId)) {
- continue;
- }
-
const draft = store.get(
pageLayoutDraftComponentState.atomFamily({
instanceId: pageLayoutId,
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutEditModeProvider.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutEditModeProvider.tsx
index ee748c56b2b..4631b377bc6 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutEditModeProvider.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutEditModeProvider.tsx
@@ -25,7 +25,7 @@ export const PageLayoutEditModeProvider = ({
if (layoutType === PageLayoutType.RECORD_PAGE) {
return (
- <RecordPageLayoutEditModeProvider pageLayoutId={pageLayoutId}>
+ <RecordPageLayoutEditModeProvider>
{children}
</RecordPageLayoutEditModeProvider>
);
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordPageCustomizationSessionRegistrationEffect.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordPageCustomizationSessionRegistrationEffect.tsx
index 7a52f11440c..b3b650764c0 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordPageCustomizationSessionRegistrationEffect.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordPageCustomizationSessionRegistrationEffect.tsx
@@ -1,7 +1,6 @@
import { activeCustomizationPageLayoutIdsState } from '@/layout-customization/states/activeCustomizationPageLayoutIdsState';
import { isLayoutCustomizationModeEnabledState } from '@/layout-customization/states/isLayoutCustomizationModeEnabledState';
import { pageLayoutPersistedComponentState } from '@/page-layout/states/pageLayoutPersistedComponentState';
-import { isDefaultPageLayoutId } from '@/page-layout/utils/isDefaultPageLayoutId';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useStore } from 'jotai';
@@ -32,10 +31,6 @@ export const PageLayoutRecordPageCustomizationSessionRegistrationEffect =
return;
}
- if (isDefaultPageLayoutId(pageLayoutPersisted.id)) {
- return;
- }
-
store.set(activeCustomizationPageLayoutIdsState.atom, (activeIds) =>
activeIds.includes(pageLayoutPersisted.id)
? activeIds
diff --git a/packages/twenty-front/src/modules/page-layout/components/RecordPageLayoutEditModeProvider.tsx b/packages/twenty-front/src/modules/page-layout/components/RecordPageLayoutEditModeProvider.tsx
index 309d98b9896..f571bd890cd 100644
--- a/packages/twenty-front/src/modules/page-layout/components/RecordPageLayoutEditModeProvider.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/RecordPageLayoutEditModeProvider.tsx
@@ -1,17 +1,14 @@
import { isLayoutCustomizationModeEnabledState } from '@/layout-customization/states/isLayoutCustomizationModeEnabledState';
import { PageLayoutEditModeProviderContext } from '@/page-layout/contexts/PageLayoutEditModeContext';
-import { isDefaultPageLayoutId } from '@/page-layout/utils/isDefaultPageLayoutId';
import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { type ReactNode } from 'react';
type RecordPageLayoutEditModeProviderProps = {
- pageLayoutId: string;
children: ReactNode;
};
export const RecordPageLayoutEditModeProvider = ({
- pageLayoutId,
children,
}: RecordPageLayoutEditModeProviderProps) => {
const isLayoutCustomizationModeEnabled = useAtomStateValue(
@@ -20,13 +17,10 @@ export const RecordPageLayoutEditModeProvider = ({
const { isInSidePanel } = useLayoutRenderingContext();
- const isEditable = !isDefaultPageLayoutId(pageLayoutId);
-
return (
<PageLayoutEditModeProviderContext
value={{
- isInEditMode:
- isLayoutCustomizationModeEnabled && !isInSidePanel && isEditable,
+ isInEditMode: isLayoutCustomizationModeEnabled && !isInSidePanel,
}}
>
{children}
diff --git a/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutRenderer.stories.tsx b/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutRenderer.stories.tsx
index ebc16b8bda4..b871473af07 100644
--- a/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutRenderer.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutRenderer.stories.tsx
@@ -75,6 +75,8 @@ const mixedGraphsPageLayoutMocks = {
{
__typename: 'PageLayoutWidget',
applicationId: '',
+ universalIdentifier: 'universal-identifier-mock',
+ isSystemSideEffect: false,
isActive: true,
id: 'number-widget',
pageLayoutTabId: 'mixed-tab',
@@ -99,6 +101,8 @@ const mixedGraphsPageLayoutMocks = {
deletedAt: null,
} satisfies PageLayoutWidget,
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -127,6 +131,8 @@ const mixedGraphsPageLayoutMocks = {
deletedAt: null,
} satisfies PageLayoutWidget,
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutTabList.stories.tsx b/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutTabList.stories.tsx
index 988221c2148..22db1b127c8 100644
--- a/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutTabList.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/__stories__/PageLayoutTabList.stories.tsx
@@ -22,6 +22,8 @@ const StyledContainer = styled.div`
const createInitialTabs = (): PageLayoutTab[] => [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
@@ -36,6 +38,8 @@ const createInitialTabs = (): PageLayoutTab[] => [
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
@@ -49,6 +53,8 @@ const createInitialTabs = (): PageLayoutTab[] => [
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
@@ -96,6 +102,8 @@ const PageLayoutTabListPlayground = ({
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: `new-tab-${nextIndex}`,
title: `New Tab ${nextIndex}`,
position: nextIndex,
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayout.ts
deleted file mode 100644
index eb3580f4314..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayout.ts
+++ /dev/null
@@ -1,344 +0,0 @@
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_COMPANY_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Company Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-fields',
- isActive: true,
- pageLayoutTabId: 'company-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'company-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-tasks',
- isActive: true,
- title: 'Tasks',
- icon: 'IconCheckbox',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-tasks',
- isActive: true,
- pageLayoutTabId: 'company-tab-tasks',
- title: 'Tasks',
- type: WidgetType.TASKS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-notes',
- isActive: true,
- title: 'Notes',
- icon: 'IconNotes',
- position: 400,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-notes',
- isActive: true,
- pageLayoutTabId: 'company-tab-notes',
- title: 'Notes',
- type: WidgetType.NOTES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 500,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-files',
- isActive: true,
- pageLayoutTabId: 'company-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-emails',
- isActive: true,
- title: 'Emails',
- icon: 'IconMail',
- position: 600,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-emails',
- isActive: true,
- pageLayoutTabId: 'company-tab-emails',
- title: 'Emails',
- type: WidgetType.EMAILS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'company-tab-calendar',
- isActive: true,
- title: 'Calendar',
- icon: 'IconCalendarEvent',
- position: 700,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'company-widget-calendar',
- isActive: true,
- pageLayoutTabId: 'company-tab-calendar',
- title: 'Calendar',
- type: WidgetType.CALENDAR,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayoutId.ts
deleted file mode 100644
index 7a86f51fa88..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultCompanyRecordPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID =
- 'default-company-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayout.ts
deleted file mode 100644
index 2a7d71dfe51..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayout.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import { DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultMessageThreadRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Message Thread Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'message-thread-tab-home',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'message-thread-widget-email-thread',
- isActive: true,
- pageLayoutTabId: 'message-thread-tab-home',
- title: 'Thread',
- type: WidgetType.EMAIL_THREAD,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayoutId.ts
deleted file mode 100644
index 0f981a999b1..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultMessageThreadRecordPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID =
- 'default-message-thread-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayout.ts
deleted file mode 100644
index 371d811f1ce..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayout.ts
+++ /dev/null
@@ -1,253 +0,0 @@
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_NOTE_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Note Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'note-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'note-widget-fields',
- isActive: true,
- pageLayoutTabId: 'note-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- // Note: Configuration is null by default. For testing purposes,
- // use useTempNoteFieldsConfiguration() hook at runtime to get
- // a configuration with actual field metadata IDs from the backend.
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'note-widget-note',
- isActive: true,
- pageLayoutTabId: 'note-tab-fields',
- title: 'Note',
- type: WidgetType.FIELD_RICH_TEXT,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 12,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 1,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- conditionalDisplay: {
- and: [
- {
- '===': [{ var: 'device' }, 'MOBILE'],
- },
- ],
- },
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'note-tab-note',
- isActive: true,
- title: 'Note',
- icon: 'IconNotes',
- position: 150,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'note-widget-note',
- isActive: true,
- pageLayoutTabId: 'note-tab-note',
- title: 'Note',
- type: WidgetType.FIELD_RICH_TEXT,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 12,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- conditionalDisplay: {
- and: [
- {
- '===': [{ var: 'device' }, 'DESKTOP'],
- },
- ],
- },
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'note-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'note-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'note-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'note-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'note-widget-files',
- isActive: true,
- pageLayoutTabId: 'note-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayoutId.ts
deleted file mode 100644
index 686f4a7e57f..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultNoteRecordPageLayoutId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID = 'default-note-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayout.ts
deleted file mode 100644
index 4b70bb7a087..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayout.ts
+++ /dev/null
@@ -1,344 +0,0 @@
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Opportunity Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-fields',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-tasks',
- isActive: true,
- title: 'Tasks',
- icon: 'IconCheckbox',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-tasks',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-tasks',
- title: 'Tasks',
- type: WidgetType.TASKS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-notes',
- isActive: true,
- title: 'Notes',
- icon: 'IconNotes',
- position: 400,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-notes',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-notes',
- title: 'Notes',
- type: WidgetType.NOTES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 500,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-files',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-emails',
- isActive: true,
- title: 'Emails',
- icon: 'IconMail',
- position: 600,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-emails',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-emails',
- title: 'Emails',
- type: WidgetType.EMAILS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'opportunity-tab-calendar',
- isActive: true,
- title: 'Calendar',
- icon: 'IconCalendarEvent',
- position: 700,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'opportunity-widget-calendar',
- isActive: true,
- pageLayoutTabId: 'opportunity-tab-calendar',
- title: 'Calendar',
- type: WidgetType.CALENDAR,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayoutId.ts
deleted file mode 100644
index 22ff3e1e05e..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultOpportunityRecordPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID =
- 'default-opportunity-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayout.ts
deleted file mode 100644
index 5dbcef9cc9a..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayout.ts
+++ /dev/null
@@ -1,344 +0,0 @@
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_PERSON_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Person Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-fields',
- isActive: true,
- pageLayoutTabId: 'person-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'person-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-tasks',
- isActive: true,
- title: 'Tasks',
- icon: 'IconCheckbox',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-tasks',
- isActive: true,
- pageLayoutTabId: 'person-tab-tasks',
- title: 'Tasks',
- type: WidgetType.TASKS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-notes',
- isActive: true,
- title: 'Notes',
- icon: 'IconNotes',
- position: 400,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-notes',
- isActive: true,
- pageLayoutTabId: 'person-tab-notes',
- title: 'Notes',
- type: WidgetType.NOTES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 500,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-files',
- isActive: true,
- pageLayoutTabId: 'person-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-emails',
- isActive: true,
- title: 'Emails',
- icon: 'IconMail',
- position: 600,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-emails',
- isActive: true,
- pageLayoutTabId: 'person-tab-emails',
- title: 'Emails',
- type: WidgetType.EMAILS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'person-tab-calendar',
- isActive: true,
- title: 'Calendar',
- icon: 'IconCalendarEvent',
- position: 700,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'person-widget-calendar',
- isActive: true,
- pageLayoutTabId: 'person-tab-calendar',
- title: 'Calendar',
- type: WidgetType.CALENDAR,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayoutId.ts
deleted file mode 100644
index 55e015bf144..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID =
- 'default-person-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts
deleted file mode 100644
index 69b64dfaa5a..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts
+++ /dev/null
@@ -1,252 +0,0 @@
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Record Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'default-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'default-widget-fields',
- isActive: true,
- pageLayoutTabId: 'default-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'default-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'default-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'default-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'default-tab-tasks',
- isActive: true,
- title: 'Tasks',
- icon: 'IconCheckbox',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'default-widget-tasks',
- isActive: true,
- pageLayoutTabId: 'default-tab-tasks',
- title: 'Tasks',
- type: WidgetType.TASKS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'default-tab-notes',
- isActive: true,
- title: 'Notes',
- icon: 'IconNotes',
- position: 400,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'default-widget-notes',
- isActive: true,
- pageLayoutTabId: 'default-tab-notes',
- title: 'Notes',
- type: WidgetType.NOTES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'default-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 500,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'default-widget-files',
- isActive: true,
- pageLayoutTabId: 'default-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayoutId.ts
deleted file mode 100644
index e57e4c90272..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayoutId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_RECORD_PAGE_LAYOUT_ID = 'default-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayout.ts
deleted file mode 100644
index 5610767cafe..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayout.ts
+++ /dev/null
@@ -1,250 +0,0 @@
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-export const DEFAULT_TASK_RECORD_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- name: 'Default Task Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'task-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'task-widget-fields',
- isActive: true,
- pageLayoutTabId: 'task-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'task-widget-note',
- isActive: true,
- pageLayoutTabId: 'task-tab-fields',
- title: 'Note',
- type: WidgetType.FIELD_RICH_TEXT,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 12,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 1,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- conditionalDisplay: {
- and: [
- {
- '===': [{ var: 'device' }, 'MOBILE'],
- },
- ],
- },
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'task-tab-note',
- isActive: true,
- title: 'Note',
- icon: 'IconNotes',
- position: 150,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'task-widget-note',
- isActive: true,
- pageLayoutTabId: 'task-tab-note',
- title: 'Note',
- type: WidgetType.FIELD_RICH_TEXT,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 12,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- conditionalDisplay: {
- and: [
- {
- '===': [{ var: 'device' }, 'DESKTOP'],
- },
- ],
- },
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'task-tab-timeline',
- isActive: true,
- title: 'Timeline',
- icon: 'IconTimelineEvent',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'task-widget-timeline',
- isActive: true,
- pageLayoutTabId: 'task-tab-timeline',
- title: 'Timeline',
- type: WidgetType.TIMELINE,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'task-tab-files',
- isActive: true,
- title: 'Files',
- icon: 'IconPaperclip',
- position: 300,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'task-widget-files',
- isActive: true,
- pageLayoutTabId: 'task-tab-files',
- title: 'Files',
- type: WidgetType.FILES,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayoutId.ts
deleted file mode 100644
index e297b908bc3..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultTaskRecordPageLayoutId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID = 'default-task-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayout.ts
deleted file mode 100644
index 3f3091d950c..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayout.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-/**
- * Default Workflow PageLayout.
- * Specialized layout for workflow visualization with a single Flow tab.
- */
-export const DEFAULT_WORKFLOW_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_WORKFLOW_PAGE_LAYOUT_ID,
- name: 'Default Workflow Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- tabs: [
- // Flow tab (position 100)
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'workflow-tab-flow',
- isActive: true,
- title: 'Flow',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- icon: 'IconSettings',
- pageLayoutId: DEFAULT_WORKFLOW_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'workflow-widget-flow',
- isActive: true,
- pageLayoutTabId: 'workflow-tab-flow',
- title: 'Flow',
- type: WidgetType.WORKFLOW,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayoutId.ts
deleted file mode 100644
index 8d3144bf976..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowPageLayoutId.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const DEFAULT_WORKFLOW_PAGE_LAYOUT_ID = 'default-workflow-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayout.ts
deleted file mode 100644
index f4c2e6a188f..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayout.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-/**
- * Default WorkflowRun PageLayout.
- * Specialized layout for workflow run visualization with Fields and Flow tabs.
- */
-export const DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
- name: 'Default Workflow Run Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- defaultTabToFocusOnMobileAndSidePanelId: 'workflow-run-tab-flow',
- tabs: [
- // Fields tab (position 100)
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'workflow-run-tab-fields',
- isActive: true,
- title: 'Home',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- icon: 'IconHome',
- pageLayoutId: DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'workflow-run-widget-fields',
- isActive: true,
- pageLayoutTabId: 'workflow-run-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- // Flow tab (position 200)
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'workflow-run-tab-flow',
- isActive: true,
- title: 'Flow',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- icon: 'IconSettings',
- pageLayoutId: DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'workflow-run-widget-flow',
- isActive: true,
- pageLayoutTabId: 'workflow-run-tab-flow',
- title: 'Flow',
- type: WidgetType.WORKFLOW_RUN,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayoutId.ts
deleted file mode 100644
index 06870226728..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowRunPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID =
- 'default-workflow-run-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayout.ts
deleted file mode 100644
index e6573244de2..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayout.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
-import { type PageLayout } from '@/page-layout/types/PageLayout';
-import {
- PageLayoutTabLayoutMode,
- PageLayoutType,
- WidgetConfigurationType,
- WidgetType,
-} from '~/generated-metadata/graphql';
-
-/**
- * Default WorkflowVersion PageLayout.
- * Specialized layout for workflow version visualization with Fields and Flow tabs.
- */
-export const DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT: PageLayout = {
- __typename: 'PageLayout',
- id: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- name: 'Default Workflow Version Layout',
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: null,
- universalIdentifier: '00000000-0000-0000-0000-000000000000',
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- defaultTabToFocusOnMobileAndSidePanelId: 'workflow-version-tab-flow',
- tabs: [
- // Fields tab (position 100)
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'workflow-version-tab-fields',
- isActive: true,
- title: 'Home',
- icon: 'IconHome',
- position: 100,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'workflow-version-widget-fields',
- isActive: true,
- pageLayoutTabId: 'workflow-version-tab-fields',
- title: 'Fields',
- type: WidgetType.FIELDS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- // Flow tab (position 200)
- {
- __typename: 'PageLayoutTab',
- applicationId: '',
- id: 'workflow-version-tab-flow',
- isActive: true,
- title: 'Flow',
- icon: 'IconSettings',
- position: 200,
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- pageLayoutId: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- applicationId: '',
- id: 'workflow-version-widget-flow',
- isActive: true,
- pageLayoutTabId: 'workflow-version-tab-flow',
- title: 'Flow',
- type: WidgetType.WORKFLOW_VERSION,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- position: {
- __typename: 'PageLayoutWidgetVerticalListPosition',
- layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
- index: 0,
- },
- configuration: {
- __typename: 'FieldsConfiguration',
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: null,
- },
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- ],
-};
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayoutId.ts
deleted file mode 100644
index 8dd0b6b070c..00000000000
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultWorkflowVersionPageLayoutId.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export const DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID =
- 'default-workflow-version-page-layout';
diff --git a/packages/twenty-front/src/modules/page-layout/graphql/fragments/pageLayoutWidgetFragment.ts b/packages/twenty-front/src/modules/page-layout/graphql/fragments/pageLayoutWidgetFragment.ts
index 1fa0daad2f7..fb94e4ffdc2 100644
--- a/packages/twenty-front/src/modules/page-layout/graphql/fragments/pageLayoutWidgetFragment.ts
+++ b/packages/twenty-front/src/modules/page-layout/graphql/fragments/pageLayoutWidgetFragment.ts
@@ -4,6 +4,8 @@ export const PAGE_LAYOUT_WIDGET_FRAGMENT = gql`
fragment PageLayoutWidgetFragment on PageLayoutWidget {
id
applicationId
+ universalIdentifier
+ isSystemSideEffect
title
type
objectMetadataId
diff --git a/packages/twenty-front/src/modules/page-layout/graphql/mutations/updatePageLayoutWithTabsAndWidgets.ts b/packages/twenty-front/src/modules/page-layout/graphql/mutations/updatePageLayoutWithTabsAndWidgets.ts
index e4798b064b5..6bd0fa933e6 100644
--- a/packages/twenty-front/src/modules/page-layout/graphql/mutations/updatePageLayoutWithTabsAndWidgets.ts
+++ b/packages/twenty-front/src/modules/page-layout/graphql/mutations/updatePageLayoutWithTabsAndWidgets.ts
@@ -9,10 +9,12 @@ export const UPDATE_PAGE_LAYOUT_WITH_TABS_AND_WIDGETS = gql`
) {
updatePageLayoutWithTabsAndWidgets(id: $id, input: $input) {
id
+ applicationId
name
type
objectMetadataId
universalIdentifier
+ isSystemSideEffect
defaultTabToFocusOnMobileAndSidePanelId
createdAt
updatedAt
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutGraphWidget.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutGraphWidget.test.tsx
index 95c456d0a76..129205bcd78 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutGraphWidget.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutGraphWidget.test.tsx
@@ -77,6 +77,8 @@ describe('useCreatePageLayoutGraphWidget', () => {
objectMetadataId: null,
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
title: 'Tab 1',
@@ -161,6 +163,8 @@ describe('useCreatePageLayoutGraphWidget', () => {
objectMetadataId: null,
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
title: 'Tab 1',
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tsx
index 5b3390c4e17..98aa1dff844 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useCreatePageLayoutTab.test.tsx
@@ -379,6 +379,8 @@ describe('useCreatePageLayoutTab', () => {
objectMetadataId: null,
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'existing-tab',
applicationId: '',
title: 'Existing Tab',
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useIsPageLayoutInEditMode.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useIsPageLayoutInEditMode.test.tsx
index 6c280116c17..76e9e25884c 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useIsPageLayoutInEditMode.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useIsPageLayoutInEditMode.test.tsx
@@ -70,10 +70,12 @@ describe('useIsPageLayoutInEditMode', () => {
instanceId: PAGE_LAYOUT_TEST_INSTANCE_ID,
}),
{
+ applicationId: 'application-id-mock',
__typename: 'PageLayout',
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
name: 'Record Page',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId: 'company-id',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
createdAt: new Date().toISOString(),
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx
index 20bd14d97f6..fde65f11b8e 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutDraftState.test.tsx
@@ -87,6 +87,8 @@ describe('usePageLayoutDraftState', () => {
objectMetadataId: null,
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
title: 'Tab 1',
@@ -98,6 +100,8 @@ describe('usePageLayoutDraftState', () => {
deletedAt: null,
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'widget-1',
applicationId: '',
pageLayoutTabId: 'tab-1',
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx
index ca7d020c3dd..9cc6f853bc0 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/usePageLayoutRenderableTabs.test.tsx
@@ -7,6 +7,8 @@ let mockIsMobile = false;
let mockIsInSidePanel = false;
const featureFilteredHomeTab: PageLayoutTab = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'home-tab-id',
applicationId: 'application-id',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useSetIsPageLayoutInEditMode.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useSetIsPageLayoutInEditMode.test.tsx
index 48b498b078a..41dfc533c39 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useSetIsPageLayoutInEditMode.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useSetIsPageLayoutInEditMode.test.tsx
@@ -13,10 +13,12 @@ import { type ReactNode } from 'react';
import { PageLayoutType } from '~/generated-metadata/graphql';
const MOCK_DASHBOARD_LAYOUT: PageLayout = {
+ applicationId: 'application-id-mock',
__typename: 'PageLayout',
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
name: 'Dashboard Layout',
type: PageLayoutType.DASHBOARD,
+ isSystemSideEffect: false,
objectMetadataId: 'object-metadata-id',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [],
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useBasePageLayout.ts b/packages/twenty-front/src/modules/page-layout/hooks/useBasePageLayout.ts
index 97f20a40303..0625187c569 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useBasePageLayout.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useBasePageLayout.ts
@@ -1,69 +1,20 @@
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultCompanyRecordPageLayout';
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultMessageThreadRecordPageLayout';
-import { DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultMessageThreadRecordPageLayoutId';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultNoteRecordPageLayout';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultOpportunityRecordPageLayout';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultPersonRecordPageLayout';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultRecordPageLayout';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT } from '@/page-layout/constants/DefaultTaskRecordPageLayout';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT } from '@/page-layout/constants/DefaultWorkflowPageLayout';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT } from '@/page-layout/constants/DefaultWorkflowRunPageLayout';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT } from '@/page-layout/constants/DefaultWorkflowVersionPageLayout';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
import { recordPageLayoutFromIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutFromIdFamilySelector';
import { type PageLayout } from '@/page-layout/types/PageLayout';
-import { isDefaultPageLayoutId } from '@/page-layout/utils/isDefaultPageLayoutId';
import { transformPageLayout } from '@/page-layout/utils/transformPageLayout';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { useQuery } from '@apollo/client/react';
import { isDefined } from 'twenty-shared/utils';
import { FindOnePageLayoutDocument } from '~/generated-metadata/graphql';
-const getDefaultLayoutById = (layoutId: string): PageLayout => {
- switch (layoutId) {
- case DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_COMPANY_RECORD_PAGE_LAYOUT;
- case DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_PERSON_RECORD_PAGE_LAYOUT;
- case DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT;
- case DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_NOTE_RECORD_PAGE_LAYOUT;
- case DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_TASK_RECORD_PAGE_LAYOUT;
- case DEFAULT_WORKFLOW_PAGE_LAYOUT_ID:
- return DEFAULT_WORKFLOW_PAGE_LAYOUT;
- case DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID:
- return DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT;
- case DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID:
- return DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT;
- case DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID:
- return DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT;
- case DEFAULT_RECORD_PAGE_LAYOUT_ID:
- default:
- return DEFAULT_RECORD_PAGE_LAYOUT;
- }
-};
-
export const useBasePageLayout = (
pageLayoutId: string,
): PageLayout | undefined => {
- const isDefaultLayout = isDefaultPageLayoutId(pageLayoutId);
-
const cachedRecordPageLayout = useAtomFamilySelectorValue(
recordPageLayoutFromIdFamilySelector,
{ pageLayoutId },
);
- const shouldSkipQuery = isDefaultLayout || isDefined(cachedRecordPageLayout);
+ const shouldSkipQuery = isDefined(cachedRecordPageLayout);
const { data } = useQuery(FindOnePageLayoutDocument, {
variables: {
@@ -72,10 +23,6 @@ export const useBasePageLayout = (
skip: shouldSkipQuery,
});
- if (isDefaultLayout) {
- return getDefaultLayoutById(pageLayoutId);
- }
-
if (isDefined(cachedRecordPageLayout)) {
return cachedRecordPageLayout;
}
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutTab.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutTab.ts
index 5434d7db5d4..eccc53fc101 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutTab.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutTab.ts
@@ -55,6 +55,8 @@ export const useCreatePageLayoutTab = ({
const newTab: PageLayoutTab = {
id: newTabId,
applicationId: '',
+ universalIdentifier: newTabId,
+ isSystemSideEffect: false,
isActive: true,
title: title || `Tab ${tabsLength + 1}`,
position: maxPosition + 1,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutIdForRecord.ts b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutIdForRecord.ts
index 9913700f7c0..a3962760e66 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutIdForRecord.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/usePageLayoutIdForRecord.ts
@@ -1,11 +1,10 @@
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { CoreObjectNameSingular } from 'twenty-shared/types';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
import { recordPageLayoutByObjectMetadataIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
import { type TargetRecordIdentifier } from '@/ui/layout/contexts/TargetRecordIdentifier';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
export const usePageLayoutIdForRecord = ({
@@ -39,9 +38,7 @@ export const usePageLayoutIdForRecord = ({
};
}
- const pageLayoutId = isDefined(recordPageLayout)
- ? recordPageLayout.id
- : getDefaultRecordPageLayoutId({ targetObjectNameSingular });
+ const pageLayoutId = isDefined(recordPageLayout) ? recordPageLayout.id : null;
return {
pageLayoutId,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useRecordPageLayoutIdFromRecordStoreOrThrow.ts b/packages/twenty-front/src/modules/page-layout/hooks/useRecordPageLayoutIdFromRecordStoreOrThrow.ts
deleted file mode 100644
index ff7c1b15618..00000000000
--- a/packages/twenty-front/src/modules/page-layout/hooks/useRecordPageLayoutIdFromRecordStoreOrThrow.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { recordPageLayoutByObjectMetadataIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
-import { type TargetRecordIdentifier } from '@/ui/layout/contexts/TargetRecordIdentifier';
-import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
-import { isDefined } from 'twenty-shared/utils';
-
-export const useRecordPageLayoutIdFromRecordStoreOrThrow = ({
- targetObjectNameSingular,
-}: Omit<TargetRecordIdentifier, 'id'>) => {
- const { objectMetadataItem } = useObjectMetadataItem({
- objectNameSingular: targetObjectNameSingular,
- });
-
- const recordPageLayout = useAtomFamilySelectorValue(
- recordPageLayoutByObjectMetadataIdFamilySelector,
- { objectMetadataId: objectMetadataItem.id },
- );
-
- const pageLayoutId = isDefined(recordPageLayout)
- ? recordPageLayout.id
- : getDefaultRecordPageLayoutId({ targetObjectNameSingular });
-
- return {
- pageLayoutId,
- };
-};
diff --git a/packages/twenty-front/src/modules/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector.ts b/packages/twenty-front/src/modules/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector.ts
index 77d414b5f5b..897d2852941 100644
--- a/packages/twenty-front/src/modules/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector.ts
+++ b/packages/twenty-front/src/modules/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector.ts
@@ -14,10 +14,16 @@ export const recordPageLayoutByObjectMetadataIdFamilySelector =
({ get }) => {
const pageLayouts = get(pageLayoutsWithRelationsSelector);
- return pageLayouts.find(
+ const recordPageLayouts = pageLayouts.filter(
(pageLayout) =>
pageLayout.type === PageLayoutType.RECORD_PAGE &&
pageLayout.objectMetadataId === objectMetadataId,
);
+
+ const customRecordPageLayout = recordPageLayouts.find(
+ (pageLayout) => !pageLayout.isSystemSideEffect,
+ );
+
+ return customRecordPageLayout ?? recordPageLayouts[0];
},
});
diff --git a/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts b/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts
index 17e5c12610f..dec05215f87 100644
--- a/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts
+++ b/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts
@@ -39,6 +39,8 @@ export const makeTab = (
) => ({
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
title: id,
isActive: true,
position,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/addWidgetToTab.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/addWidgetToTab.test.ts
index aaee11d2638..a3cf0f20535 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/addWidgetToTab.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/addWidgetToTab.test.ts
@@ -9,6 +9,8 @@ import {
describe('addWidgetToTab', () => {
const mockWidget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'widget-1',
applicationId: '',
@@ -31,6 +33,8 @@ describe('addWidgetToTab', () => {
const mockTabs: PageLayoutTab[] = [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -43,6 +47,8 @@ describe('addWidgetToTab', () => {
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-2',
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts
index e8189ea7713..ed5969d275d 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertLayoutsToWidgets.test.ts
@@ -11,6 +11,8 @@ import { convertLayoutsToWidgets } from '@/page-layout/utils/convertLayoutsToWid
describe('convertLayoutsToWidgets', () => {
const mockWidgets: PageLayoutWidget[] = [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'widget-1',
applicationId: '',
isActive: true,
@@ -35,6 +37,8 @@ describe('convertLayoutsToWidgets', () => {
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'widget-2',
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutToTabLayouts.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutToTabLayouts.test.ts
index bcfe9b86cfc..4ea85fef1f3 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutToTabLayouts.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutToTabLayouts.test.ts
@@ -15,12 +15,16 @@ describe('convertPageLayoutToTabLayouts', () => {
it('should convert page layout to tab layouts', () => {
const pageLayout: PageLayout = {
id: 'page-layout-1',
+ applicationId: 'application-id-mock',
name: 'Page Layout 1',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId: 'object-metadata-1',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -29,6 +33,8 @@ describe('convertPageLayoutToTabLayouts', () => {
pageLayoutId: 'page-layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'widget-1',
applicationId: '',
@@ -49,6 +55,8 @@ describe('convertPageLayoutToTabLayouts', () => {
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'widget-2',
applicationId: '',
@@ -100,12 +108,16 @@ describe('convertPageLayoutToTabLayouts', () => {
it('should use default widget size when gridPosition is undefined', () => {
const pageLayout: PageLayout = {
id: 'page-layout-1',
+ applicationId: 'application-id-mock',
name: 'Page Layout 1',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId: 'object-metadata-1',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -114,6 +126,8 @@ describe('convertPageLayoutToTabLayouts', () => {
pageLayoutId: 'page-layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'widget-no-grid-pos',
applicationId: '',
@@ -160,12 +174,16 @@ describe('convertPageLayoutToTabLayouts', () => {
it('should apply STANDALONE_RICH_TEXT minimum size constraints', () => {
const pageLayout: PageLayout = {
id: 'page-layout-1',
+ applicationId: 'application-id-mock',
name: 'Page Layout 1',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId: 'object-metadata-1',
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -174,6 +192,8 @@ describe('convertPageLayoutToTabLayouts', () => {
pageLayoutId: 'page-layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'rich-text-widget',
applicationId: '',
@@ -216,12 +236,16 @@ describe('convertPageLayoutToTabLayouts', () => {
it('should use the widget-type minimum size for iframe widgets', () => {
const pageLayout: PageLayout = {
id: 'page-layout-1',
+ applicationId: 'application-id-mock',
name: 'Page Layout 1',
type: PageLayoutType.DASHBOARD,
+ isSystemSideEffect: false,
objectMetadataId: null,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -230,6 +254,8 @@ describe('convertPageLayoutToTabLayouts', () => {
pageLayoutId: 'page-layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id: 'iframe-widget',
applicationId: '',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/extractFieldMetadataIdsFromWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/extractFieldMetadataIdsFromWidget.test.ts
index b9354d13a7f..4bb7544a8fb 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/extractFieldMetadataIdsFromWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/extractFieldMetadataIdsFromWidget.test.ts
@@ -23,6 +23,8 @@ const createMockWidget = (
): PageLayoutWidget => ({
id: 'widget-1',
applicationId: '',
+ universalIdentifier: 'universal-identifier-mock',
+ isSystemSideEffect: false,
isActive: true,
type: WidgetType.GRAPH,
title: 'Test',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts
index d2304b6dd87..d49bfa04c26 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterPageLayoutTabsByFeatureFlags.test.ts
@@ -9,6 +9,8 @@ const createMockWidget = (
id: string,
type: WidgetType,
): PageLayoutTab['widgets'][0] => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id,
applicationId: '',
@@ -39,6 +41,8 @@ const createMockTab = (
id: string,
widgets: PageLayoutTab['widgets'],
): PageLayoutTab => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
applicationId: '',
id,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterVisibleWidgets.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterVisibleWidgets.test.ts
index 72b8adae625..16c3168cd8b 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterVisibleWidgets.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/filterVisibleWidgets.test.ts
@@ -10,6 +10,8 @@ describe('filterVisibleWidgets', () => {
id: string,
conditionalDisplay?: any,
): PageLayoutTab['widgets'][0] => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id,
applicationId: '',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getDefaultRecordPageLayoutId.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getDefaultRecordPageLayoutId.test.ts
deleted file mode 100644
index 3647317fd79..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getDefaultRecordPageLayoutId.test.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
-
-describe('getDefaultRecordPageLayoutId', () => {
- it('should return Company layout id for Company object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Company,
- }),
- ).toBe(DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Person layout id for Person object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Person,
- }),
- ).toBe(DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Opportunity layout id for Opportunity object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Opportunity,
- }),
- ).toBe(DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Note layout id for Note object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Note,
- }),
- ).toBe(DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Task layout id for Task object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Task,
- }),
- ).toBe(DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Workflow layout id for Workflow object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.Workflow,
- }),
- ).toBe(DEFAULT_WORKFLOW_PAGE_LAYOUT_ID);
- });
-
- it('should return WorkflowVersion layout id for WorkflowVersion object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.WorkflowVersion,
- }),
- ).toBe(DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID);
- });
-
- it('should return WorkflowRun layout id for WorkflowRun object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: CoreObjectNameSingular.WorkflowRun,
- }),
- ).toBe(DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID);
- });
-
- it('should return default record page layout id for unknown object', () => {
- expect(
- getDefaultRecordPageLayoutId({
- targetObjectNameSingular: 'customObject',
- }),
- ).toBe(DEFAULT_RECORD_PAGE_LAYOUT_ID);
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getPageLayoutTabListInitialActiveTabId.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getPageLayoutTabListInitialActiveTabId.test.ts
index 619f0197c92..547f9919f27 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getPageLayoutTabListInitialActiveTabId.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getPageLayoutTabListInitialActiveTabId.test.ts
@@ -3,6 +3,8 @@ import { getPageLayoutTabListInitialActiveTabId } from '@/page-layout/utils/getP
describe('getPageLayoutTabListInitialActiveTabId', () => {
const createMockTab = (id: string): PageLayoutTab => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id,
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getRecordPageLayoutId.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getRecordPageLayoutId.test.ts
deleted file mode 100644
index fbefaa07dd9..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getRecordPageLayoutId.test.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { getRecordPageLayoutId } from '@/page-layout/utils/getRecordPageLayoutId';
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-
-const createMockRecord = (
- overrides: Partial<ObjectRecord> = {},
-): ObjectRecord => ({
- id: 'record-1',
- __typename: 'ObjectRecord',
- ...overrides,
-});
-
-describe('getRecordPageLayoutId', () => {
- it('should return null when record is null', () => {
- const result = getRecordPageLayoutId({
- record: null,
- targetObjectNameSingular: CoreObjectNameSingular.Company,
- });
-
- expect(result).toBeNull();
- });
-
- it('should return null when record is undefined', () => {
- const result = getRecordPageLayoutId({
- record: undefined,
- targetObjectNameSingular: CoreObjectNameSingular.Company,
- });
-
- expect(result).toBeNull();
- });
-
- it('should return record.pageLayoutId when it is defined', () => {
- const record = createMockRecord({ pageLayoutId: 'custom-layout-123' });
-
- const result = getRecordPageLayoutId({
- record,
- targetObjectNameSingular: CoreObjectNameSingular.Company,
- });
-
- expect(result).toBe('custom-layout-123');
- });
-
- it('should return Company default layout for Company object', () => {
- const record = createMockRecord();
-
- const result = getRecordPageLayoutId({
- record,
- targetObjectNameSingular: CoreObjectNameSingular.Company,
- });
-
- expect(result).toBe(DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return Person default layout for Person object', () => {
- const record = createMockRecord();
-
- const result = getRecordPageLayoutId({
- record,
- targetObjectNameSingular: CoreObjectNameSingular.Person,
- });
-
- expect(result).toBe(DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID);
- });
-
- it('should return generic default layout for unknown object type', () => {
- const record = createMockRecord();
-
- const result = getRecordPageLayoutId({
- record,
- targetObjectNameSingular: 'customObject',
- });
-
- expect(result).toBe(DEFAULT_RECORD_PAGE_LAYOUT_ID);
- });
-});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsByDisplayMode.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsByDisplayMode.test.ts
index 8dd7a2b9b97..fa8caf0bb88 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsByDisplayMode.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsByDisplayMode.test.ts
@@ -8,6 +8,8 @@ import {
describe('getTabsByDisplayMode', () => {
const createMockTab = (id: string): PageLayoutTab => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id,
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
index 5ced3398596..2e93732d49b 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsRenderableForTargetObject.test.ts
@@ -12,6 +12,8 @@ describe('getTabsRenderableForTargetObject', () => {
id: string,
type: WidgetType,
): PageLayoutTab['widgets'][0] => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id,
applicationId: '',
@@ -42,6 +44,8 @@ describe('getTabsRenderableForTargetObject', () => {
id: string,
widgets: PageLayoutTab['widgets'],
): PageLayoutTab => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
applicationId: '',
id,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsWithVisibleWidgets.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsWithVisibleWidgets.test.ts
index d66cb65a546..678f2559ac2 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsWithVisibleWidgets.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/getTabsWithVisibleWidgets.test.ts
@@ -10,6 +10,8 @@ describe('getTabsWithVisibleWidgets', () => {
id: string,
conditionalDisplay?: any,
): PageLayoutTab['widgets'][0] => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
id,
applicationId: '',
@@ -40,6 +42,8 @@ describe('getTabsWithVisibleWidgets', () => {
id: string,
widgets: PageLayoutTab['widgets'],
): PageLayoutTab => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
applicationId: '',
id,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/prepareGridLayoutItemsWithPlaceholders.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/prepareGridLayoutItemsWithPlaceholders.test.ts
index 8f69b45a74a..1360bc2d3ca 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/prepareGridLayoutItemsWithPlaceholders.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/prepareGridLayoutItemsWithPlaceholders.test.ts
@@ -9,6 +9,8 @@ import {
describe('prepareGridLayoutItemsWithPlaceholders', () => {
const createMockWidget = (id: string): PageLayoutWidget => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id,
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeWidgetFromTab.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeWidgetFromTab.test.ts
index eaf93c04ddb..8a3cc0d1a3b 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeWidgetFromTab.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/removeWidgetFromTab.test.ts
@@ -10,6 +10,8 @@ import {
describe('removeWidgetFromTab', () => {
const mockTabs: PageLayoutTab[] = [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-1',
applicationId: '',
isActive: true,
@@ -18,6 +20,8 @@ describe('removeWidgetFromTab', () => {
pageLayoutId: 'layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget' as const,
id: 'widget-1',
applicationId: '',
@@ -38,6 +42,8 @@ describe('removeWidgetFromTab', () => {
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget' as const,
id: 'widget-2',
applicationId: '',
@@ -65,6 +71,8 @@ describe('removeWidgetFromTab', () => {
deletedAt: null,
},
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
id: 'tab-2',
applicationId: '',
isActive: true,
@@ -73,6 +81,8 @@ describe('removeWidgetFromTab', () => {
pageLayoutId: 'layout-1',
widgets: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget' as const,
id: 'widget-3',
applicationId: '',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/sanitizeChartFiltersInPageLayoutDraft.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/sanitizeChartFiltersInPageLayoutDraft.test.ts
index 62929121c41..6a3066f3d91 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/sanitizeChartFiltersInPageLayoutDraft.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/sanitizeChartFiltersInPageLayoutDraft.test.ts
@@ -43,6 +43,8 @@ const buildChartFilters = (recordFilters: RecordFilter[]): ChartFilters => ({
const buildDraft = (widgets: PageLayoutWidget[]): DraftPageLayout => {
const tab: PageLayoutTab = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
id: 'tab-1',
applicationId: 'test-application-id',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts
index 73e464d4a1e..ba01aac135b 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts
@@ -27,6 +27,8 @@ export const createDefaultFieldWidget = ({
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title,
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts
index 731997f89f9..40af0218439 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts
@@ -22,6 +22,8 @@ export const createDefaultFieldsWidget = ({
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title: 'Fields',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts
index 7193347e988..d9ce94e58c7 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts
@@ -17,6 +17,8 @@ export const createDefaultFrontComponentWidget = (
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title,
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts
index fc5e4c94e07..364d3866634 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts
@@ -71,6 +71,8 @@ export const createDefaultGraphWidget = ({
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title,
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts
index e26c544af49..68c42a5b04c 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts
@@ -18,6 +18,8 @@ export const createDefaultIframeWidget = (
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title,
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts
index 14c9747420e..1ce65107a6c 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts
@@ -23,6 +23,8 @@ export const createDefaultRecordTableWidget = ({
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title,
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts b/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts
index 60a1d8d635a..598ab319105 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts
@@ -18,6 +18,8 @@ export const createDefaultStandaloneRichTextWidget = (
__typename: 'PageLayoutWidget',
id,
applicationId: '',
+ universalIdentifier: id,
+ isSystemSideEffect: false,
pageLayoutTabId,
title: 'Untitled Rich Text',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/getDefaultRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/utils/getDefaultRecordPageLayoutId.ts
deleted file mode 100644
index 34bd50e2697..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/getDefaultRecordPageLayoutId.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultMessageThreadRecordPageLayoutId';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
-
-const OBJECT_NAME_TO_DEFAULT_LAYOUT_ID: Record<string, string> = {
- [CoreObjectNameSingular.Company]: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Person]: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Opportunity]:
- DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Note]: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Task]: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Workflow]: DEFAULT_WORKFLOW_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.WorkflowVersion]:
- DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.WorkflowRun]: DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.MessageThread]:
- DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID,
-};
-
-export const getDefaultRecordPageLayoutId = ({
- targetObjectNameSingular,
-}: {
- targetObjectNameSingular: string;
-}): string => {
- return (
- OBJECT_NAME_TO_DEFAULT_LAYOUT_ID[targetObjectNameSingular] ??
- DEFAULT_RECORD_PAGE_LAYOUT_ID
- );
-};
diff --git a/packages/twenty-front/src/modules/page-layout/utils/getRecordPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/utils/getRecordPageLayoutId.ts
deleted file mode 100644
index 03f78da83ae..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/getRecordPageLayoutId.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
-import { isDefined } from 'twenty-shared/utils';
-
-const OBJECT_NAME_TO_DEFAULT_LAYOUT_ID: Record<string, string> = {
- [CoreObjectNameSingular.Company]: DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Person]: DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Opportunity]:
- DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Note]: DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Task]: DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.Workflow]: DEFAULT_WORKFLOW_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.WorkflowVersion]:
- DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- [CoreObjectNameSingular.WorkflowRun]: DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
-};
-
-export const getRecordPageLayoutId = ({
- record,
- targetObjectNameSingular,
-}: {
- record: ObjectRecord | null | undefined;
- targetObjectNameSingular: string;
-}): string | null => {
- if (!isDefined(record)) {
- return null;
- }
-
- if (isDefined(record.pageLayoutId)) {
- return record.pageLayoutId;
- }
-
- const defaultLayoutId =
- OBJECT_NAME_TO_DEFAULT_LAYOUT_ID[targetObjectNameSingular] ??
- DEFAULT_RECORD_PAGE_LAYOUT_ID;
-
- return defaultLayoutId;
-};
diff --git a/packages/twenty-front/src/modules/page-layout/utils/isDefaultPageLayoutId.ts b/packages/twenty-front/src/modules/page-layout/utils/isDefaultPageLayoutId.ts
deleted file mode 100644
index 1ada161ca16..00000000000
--- a/packages/twenty-front/src/modules/page-layout/utils/isDefaultPageLayoutId.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultCompanyRecordPageLayoutId';
-import { DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultMessageThreadRecordPageLayoutId';
-import { DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultNoteRecordPageLayoutId';
-import { DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultOpportunityRecordPageLayoutId';
-import { DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPersonRecordPageLayoutId';
-import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
-import { DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultTaskRecordPageLayoutId';
-import { DEFAULT_WORKFLOW_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowPageLayoutId';
-import { DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowRunPageLayoutId';
-import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
-
-const DEFAULT_PAGE_LAYOUT_IDS = new Set<string>([
- DEFAULT_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_COMPANY_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_PERSON_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_OPPORTUNITY_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_NOTE_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_TASK_RECORD_PAGE_LAYOUT_ID,
- DEFAULT_WORKFLOW_PAGE_LAYOUT_ID,
- DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
- DEFAULT_WORKFLOW_RUN_PAGE_LAYOUT_ID,
- DEFAULT_MESSAGE_THREAD_RECORD_PAGE_LAYOUT_ID,
-]);
-
-export const isDefaultPageLayoutId = (pageLayoutId: string): boolean =>
- DEFAULT_PAGE_LAYOUT_IDS.has(pageLayoutId);
diff --git a/packages/twenty-front/src/modules/page-layout/utils/setRecordPageActiveTabId.ts b/packages/twenty-front/src/modules/page-layout/utils/setRecordPageActiveTabId.ts
index e9de1adfa4a..1dfbc4beb09 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/setRecordPageActiveTabId.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/setRecordPageActiveTabId.ts
@@ -4,7 +4,6 @@ import { isDefined } from 'twenty-shared/utils';
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
import { recordPageLayoutByObjectMetadataIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
import { getTabListInstanceIdFromPageLayoutAndRecord } from '@/page-layout/utils/getTabListInstanceIdFromPageLayoutAndRecord';
import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
import { PageLayoutType } from '~/generated-metadata/graphql';
@@ -42,11 +41,11 @@ export const setRecordPageActiveTabId = ({
}),
);
- const pageLayoutId = isDefined(recordPageLayout)
- ? recordPageLayout.id
- : getDefaultRecordPageLayoutId({
- targetObjectNameSingular: objectNameSingular,
- });
+ if (!isDefined(recordPageLayout)) {
+ return;
+ }
+
+ const pageLayoutId = recordPageLayout.id;
const tabListInstanceId = getTabListInstanceIdFromPageLayoutAndRecord({
pageLayoutId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/DashboardWidgetPlaceholder.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/DashboardWidgetPlaceholder.stories.tsx
index a088edf8e95..8f8acbad526 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/DashboardWidgetPlaceholder.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/DashboardWidgetPlaceholder.stories.tsx
@@ -19,9 +19,11 @@ import {
import { getTestEnrichedObjectMetadataItemsMock } from '~/testing/utils/getTestEnrichedObjectMetadataItemsMock';
const mockPageLayout: PageLayout = {
+ applicationId: 'application-id-mock',
id: 'page-layout-1',
name: 'Test Layout',
type: PageLayoutType.DASHBOARD,
+ isSystemSideEffect: false,
objectMetadataId: null,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [],
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/WidgetRenderer.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/WidgetRenderer.stories.tsx
index f2ed473866c..0d52b1ba2b6 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/WidgetRenderer.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/__stories__/WidgetRenderer.stories.tsx
@@ -135,13 +135,17 @@ const createPageLayoutWithWidget = (
widget: PageLayoutWidget,
pageLayoutType: PageLayoutType = PageLayoutType.DASHBOARD,
): PageLayout => ({
+ applicationId: 'application-id-mock',
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
name: 'Mock Page Layout',
type: pageLayoutType,
+ isSystemSideEffect: false,
objectMetadataId: companyObjectMetadataItem.id,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
@@ -252,6 +256,8 @@ type Story = StoryObj<typeof WidgetRenderer>;
export const WithNumberChart: Story = {
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -341,6 +347,8 @@ export const WithNumberChart: Story = {
export const WithBarChart: Story = {
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -441,6 +449,8 @@ export const SmallWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -537,6 +547,8 @@ export const MediumWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -637,6 +649,8 @@ export const LargeWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -737,6 +751,8 @@ export const WideWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -833,6 +849,8 @@ export const TallWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -934,6 +952,8 @@ export const WithManyToOneRelationFieldWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1055,6 +1075,8 @@ export const WithOneToManyRelationFieldWidget: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1168,6 +1190,8 @@ export const OneToManyRelationFieldWidgetWithSeeAllButton: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1307,6 +1331,8 @@ export const OnMobile: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1407,6 +1433,8 @@ export const InSidePanel: Story = {
},
render: () => {
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1569,6 +1597,8 @@ export const Catalog: CatalogStory<Story, typeof WidgetRenderer> = {
const presentation = variant === 'solo' ? 'solo' : 'stack';
const widget: PageLayoutWidget = {
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
@@ -1670,14 +1700,18 @@ export const Catalog: CatalogStory<Story, typeof WidgetRenderer> = {
const pageLayoutData: PageLayout = {
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
+ applicationId: 'application-id-mock',
name: 'Mock Page Layout',
type: pageLayoutType,
+ isSystemSideEffect: false,
objectMetadataId: companyObjectMetadataItem.id,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs:
variant === 'side-column'
? [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
@@ -1694,6 +1728,8 @@ export const Catalog: CatalogStory<Story, typeof WidgetRenderer> = {
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
+ universalIdentifier: 'universal-identifier-mock',
+ isSystemSideEffect: false,
id: 'other-tab',
title: 'Other Tab',
position: 1,
@@ -1709,6 +1745,8 @@ export const Catalog: CatalogStory<Story, typeof WidgetRenderer> = {
__typename: 'PageLayoutTab',
isActive: true,
applicationId: '',
+ universalIdentifier: 'universal-identifier-mock',
+ isSystemSideEffect: false,
id: TAB_ID_OVERVIEW,
title: 'Overview',
position: 0,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/__stories__/FieldWidget.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/__stories__/FieldWidget.stories.tsx
index 240195fce34..1b4f459ee5d 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/__stories__/FieldWidget.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/__stories__/FieldWidget.stories.tsx
@@ -283,13 +283,17 @@ const createPageLayoutWithWidget = (
widget: PageLayoutWidget,
objectMetadataId: string,
): PageLayout => ({
+ applicationId: 'application-id-mock',
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
name: 'Mock Page Layout',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab' as const,
isActive: true,
applicationId: '',
@@ -323,6 +327,8 @@ const buildFieldWidget = ({
fieldMetadataId,
fieldDisplayMode,
}: BuildFieldWidgetArgs): PageLayoutWidget => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/__stories__/FieldsWidget.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/__stories__/FieldsWidget.stories.tsx
index 6bba945d5a2..801f5f30ad4 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/__stories__/FieldsWidget.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/__stories__/FieldsWidget.stories.tsx
@@ -134,13 +134,17 @@ const createPageLayoutWithWidget = (
widget: PageLayoutWidget,
objectMetadataId: string,
): PageLayout => ({
+ applicationId: 'application-id-mock',
id: PAGE_LAYOUT_TEST_INSTANCE_ID,
name: 'Mock Page Layout',
type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
objectMetadataId,
universalIdentifier: '20202020-0000-0000-0000-000000000001',
tabs: [
{
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutTab' as const,
isActive: true,
applicationId: '',
@@ -160,6 +164,8 @@ const createPageLayoutWithWidget = (
});
const createFieldsWidget = (viewId: string | null): PageLayoutWidget => ({
+ isSystemSideEffect: false,
+ universalIdentifier: 'universal-identifier-mock',
__typename: 'PageLayoutWidget',
applicationId: '',
isActive: true,
diff --git a/packages/twenty-front/src/modules/side-panel/hooks/__tests__/useOpenRecordInSidePanel.test.tsx b/packages/twenty-front/src/modules/side-panel/hooks/__tests__/useOpenRecordInSidePanel.test.tsx
index ad02975faaf..9812887e03d 100644
--- a/packages/twenty-front/src/modules/side-panel/hooks/__tests__/useOpenRecordInSidePanel.test.tsx
+++ b/packages/twenty-front/src/modules/side-panel/hooks/__tests__/useOpenRecordInSidePanel.test.tsx
@@ -8,7 +8,7 @@ import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/s
import { ContextStoreViewType } from '@/context-store/types/ContextStoreViewType';
import { getLabelIdentifierFieldMetadataItem } from '@/object-metadata/utils/getLabelIdentifierFieldMetadataItem';
import { newRecordTitleCellToOpenState } from '@/object-record/record-title-cell/states/newRecordTitleCellToOpenState';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
+import { metadataStoreState } from '@/metadata-store/states/metadataStoreState';
import { getTabListInstanceIdFromPageLayoutAndRecord } from '@/page-layout/utils/getTabListInstanceIdFromPageLayoutAndRecord';
import { SIDE_PANEL_COMPONENT_INSTANCE_ID } from '@/side-panel/constants/SidePanelComponentInstanceId';
import { useOpenRecordInSidePanel } from '@/side-panel/hooks/useOpenRecordInSidePanel';
@@ -66,6 +66,19 @@ const personMockObjectMetadataItem =
(item) => item.nameSingular === 'person',
)!;
+const personRecordPageLayout = {
+ id: 'person-record-page-layout-id',
+ name: 'Person record page',
+ type: PageLayoutType.RECORD_PAGE,
+ objectMetadataId: personMockObjectMetadataItem.id,
+ universalIdentifier: 'person-record-page-layout-universal-identifier',
+ isSystemSideEffect: true,
+ defaultTabToFocusOnMobileAndSidePanelId: null,
+ createdAt: '2024-01-01T00:00:00Z',
+ updatedAt: '2024-01-01T00:00:00Z',
+ deletedAt: null,
+};
+
const wrapper = getJestMetadataAndApolloMocksAndCommandMenuWrapper({
apolloMocks: [],
componentInstanceId: SIDE_PANEL_COMPONENT_INSTANCE_ID,
@@ -135,6 +148,11 @@ describe('useOpenRecordInSidePanel', () => {
jest.clearAllMocks();
mockIsMobile = false;
jotaiStore.set(newRecordTitleCellToOpenState.atom, null);
+ jotaiStore.set(metadataStoreState.atomFamily('pageLayouts'), {
+ current: [personRecordPageLayout],
+ draft: [],
+ status: 'up-to-date',
+ });
});
it('should set the correct states and navigate to the record page', () => {
@@ -243,9 +261,7 @@ describe('useOpenRecordInSidePanel', () => {
});
const tabListInstanceId = getTabListInstanceIdFromPageLayoutAndRecord({
- pageLayoutId: getDefaultRecordPageLayoutId({
- targetObjectNameSingular: objectNameSingular,
- }),
+ pageLayoutId: personRecordPageLayout.id,
layoutType: PageLayoutType.RECORD_PAGE,
targetRecordIdentifier: {
id: recordId,
@@ -335,9 +351,7 @@ describe('useOpenRecordInSidePanel', () => {
});
const tabListInstanceId = getTabListInstanceIdFromPageLayoutAndRecord({
- pageLayoutId: getDefaultRecordPageLayoutId({
- targetObjectNameSingular: objectNameSingular,
- }),
+ pageLayoutId: personRecordPageLayout.id,
layoutType: PageLayoutType.RECORD_PAGE,
targetRecordIdentifier: {
id: recordId,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
index 3933ec2f8ed..cce2c5ae1cc 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutRecordPageWidgetTypeSelect.tsx
@@ -279,6 +279,8 @@ export const SidePanelPageLayoutRecordPageWidgetTypeSelect = () => {
__typename: 'PageLayoutWidget',
id: widgetId,
applicationId: '',
+ universalIdentifier: widgetId,
+ isSystemSideEffect: false,
isActive: true,
pageLayoutTabId: tabId,
title: frontComponent.name,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore.ts b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore.ts
index 29cbf402c5a..891351afce1 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore.ts
@@ -4,7 +4,6 @@ import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMeta
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
import { currentPageLayoutIdState } from '@/page-layout/states/currentPageLayoutIdState';
import { recordPageLayoutByObjectMetadataIdFamilySelector } from '@/page-layout/states/selectors/recordPageLayoutByObjectMetadataIdFamilySelector';
-import { getDefaultRecordPageLayoutId } from '@/page-layout/utils/getDefaultRecordPageLayoutId';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
@@ -55,9 +54,7 @@ export const usePageLayoutIdFromContextStore = () => {
? (recordStore?.pageLayoutId ?? currentPageLayoutId)
: isDefined(recordPageLayout)
? recordPageLayout.id
- : getDefaultRecordPageLayoutId({
- targetObjectNameSingular: objectMetadataItem.nameSingular,
- });
+ : null;
return {
pageLayoutId,
diff --git a/packages/twenty-front/src/testing/mock-data/widget-configurations.ts b/packages/twenty-front/src/testing/mock-data/widget-configurations.ts
index 0c280295743..00280116a91 100644
--- a/packages/twenty-front/src/testing/mock-data/widget-configurations.ts
+++ b/packages/twenty-front/src/testing/mock-data/widget-configurations.ts
@@ -114,6 +114,8 @@ export const createTestWidget = (
__typename: 'PageLayoutWidget',
id: 'widget-1',
applicationId: 'test-application-id',
+ universalIdentifier: 'universal-identifier-mock',
+ isSystemSideEffect: false,
pageLayoutTabId: 'tab-1',
title: 'Test Widget',
type: WidgetType.GRAPH,
diff --git a/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap b/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
index 3f033431325..dfdc9872618 100644
--- a/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
+++ b/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
@@ -22,6 +22,7 @@ exports[`stub-twenty-sdk-define plugin > matches the recorded export partition 1
"STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS",
"STANDARD_PAGE_LAYOUT",
"STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS",
+ "SYSTEM_VIEW_KEYS",
"SystemPermissionFlag",
"ViewCalendarLayout",
"ViewFilterGroupLogicalOperator",
diff --git a/packages/twenty-sdk/src/sdk/define/index.ts b/packages/twenty-sdk/src/sdk/define/index.ts
index 35f573e6f27..668d3b2f395 100644
--- a/packages/twenty-sdk/src/sdk/define/index.ts
+++ b/packages/twenty-sdk/src/sdk/define/index.ts
@@ -168,6 +168,8 @@ export { defineViewField } from '@/sdk/define/view-fields/define-view-field';
export {
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
+ SYSTEM_VIEW_KEYS,
+ type SystemViewKey,
} from 'twenty-shared/application';
export type { ViewConfig } from '@/sdk/define/views/view-config';
export { ViewKey } from '@/sdk/define/views/view-key';
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts
index 1b3a717aa44..ba8092aebe4 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts
@@ -1,3 +1,4 @@
+import { SYSTEM_VIEW_KEYS } from 'twenty-shared/application';
import { Command } from 'nest-commander';
import { type FeatureFlagKey, ViewType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -5,20 +6,20 @@ 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 { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
import { ApplicationService } from 'src/engine/core-modules/application/application.service';
import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.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 { computeFlatDefaultRecordPageLayoutToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util';
-import { computeFlatRecordPageFieldsViewToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util';
-import { computeFlatViewFieldsToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util';
+import { type UniversalFlatPageLayoutTab } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-tab.type';
+import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
+import { type UniversalFlatPageLayout } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout.type';
+import { computeSystemRecordPageLayoutToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util';
+import { computeSystemViewToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util';
+import { computeSystemViewFieldsToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
import { 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 { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
@@ -239,8 +240,8 @@ export class BackfillRecordPageLayoutsCommand extends ProvisionedWorkspaceComman
workspaceId: string;
twentyStandardFlatApplication: FlatApplication;
}): Promise<void> {
- const { allFlatEntityMaps: standardMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
@@ -501,16 +502,18 @@ export class BackfillRecordPageLayoutsCommand extends ProvisionedWorkspaceComman
`Creating page layouts for ${customObjectsWithoutPageLayout.length} custom object(s) in workspace ${workspaceId}`,
);
- const allPageLayouts: FlatPageLayout[] = [];
- const allTabs: FlatPageLayoutTab[] = [];
- const allWidgets: FlatPageLayoutWidget[] = [];
+ const allPageLayouts: UniversalFlatPageLayout[] = [];
+ const allTabs: UniversalFlatPageLayoutTab[] = [];
+ const allWidgets: UniversalFlatPageLayoutWidget[] = [];
const allViews: (UniversalFlatView & { id: string })[] = [];
const allViewFields: UniversalFlatViewField[] = [];
for (const customObject of customObjectsWithoutPageLayout) {
- const fieldsView = computeFlatRecordPageFieldsViewToCreate({
+ const fieldsView = computeSystemViewToCreate({
objectMetadata: customObject,
- flatApplication: twentyStandardFlatApplication,
+ applicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
});
const objectFieldMetadatas = Object.values(
@@ -519,7 +522,7 @@ export class BackfillRecordPageLayoutsCommand extends ProvisionedWorkspaceComman
.filter(isDefined)
.filter((field) => field.objectMetadataId === customObject.id);
- const viewFields = computeFlatViewFieldsToCreate({
+ const viewFields = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: objectFieldMetadatas,
viewUniversalIdentifier: fieldsView.universalIdentifier,
applicationUniversalIdentifier:
@@ -530,11 +533,12 @@ export class BackfillRecordPageLayoutsCommand extends ProvisionedWorkspaceComman
});
const { pageLayouts, pageLayoutTabs, pageLayoutWidgets } =
- computeFlatDefaultRecordPageLayoutToCreate({
+ computeSystemRecordPageLayoutToCreate({
objectMetadata: customObject,
- flatApplication: twentyStandardFlatApplication,
- recordPageFieldsView: fieldsView,
- workspaceId,
+ applicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ recordPageFieldsViewUniversalIdentifier:
+ fieldsView.universalIdentifier,
});
allPageLayouts.push(...pageLayouts);
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000055000-sync-call-recording-standard-objects.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000055000-sync-call-recording-standard-objects.command.ts
index ab3a1ccb90c..d5e38a9b69e 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000055000-sync-call-recording-standard-objects.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000055000-sync-call-recording-standard-objects.command.ts
@@ -21,6 +21,8 @@ import {
getExistingOrStandardFlatEntityOrThrow,
getStandardFlatEntitiesToCreateOrThrow,
} from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
+import { toPre231RecordPageUniversalIdentifier } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.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 FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
@@ -33,13 +35,14 @@ import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-f
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 { 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 getUniversalIdentifiers = (
entitiesByName: Record<string, { universalIdentifier: string }>,
): string[] =>
- Object.values(entitiesByName).map((entity) => entity.universalIdentifier);
+ Object.values(entitiesByName).map((entity) =>
+ toPre231RecordPageUniversalIdentifier(entity.universalIdentifier),
+ );
const CALL_RECORDING_OBJECT_METADATA_UNIVERSAL_IDENTIFIERS = [
STANDARD_OBJECTS.callRecording.universalIdentifier,
@@ -56,8 +59,10 @@ const CALL_RECORDING_INDEX_UNIVERSAL_IDENTIFIERS = getUniversalIdentifiers(
const CALL_RECORDING_VIEW_UNIVERSAL_IDENTIFIERS = [
STANDARD_OBJECTS.callRecording.views.allCallRecordings.universalIdentifier,
- STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields
- .universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields
+ .universalIdentifier,
+ ),
];
const CALL_RECORDING_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS =
@@ -77,22 +82,32 @@ const CALL_RECORDING_VIEW_FIELD_UNIVERSAL_IDENTIFIERS = [
];
const CALL_RECORDING_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage
- .universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage
+ .universalIdentifier,
+ ),
];
const CALL_RECORDING_PAGE_LAYOUT_TAB_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs.home
- .universalIdentifier,
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs
- .timeline.universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs.home
+ .universalIdentifier,
+ ),
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs
+ .timeline.universalIdentifier,
+ ),
];
const CALL_RECORDING_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs.home
- .widgets.fields.universalIdentifier,
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs
- .timeline.widgets.timeline.universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs.home
+ .widgets.fields.universalIdentifier,
+ ),
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage.tabs
+ .timeline.widgets.timeline.universalIdentifier,
+ ),
];
// Preserves the shipped 2.10 upgrade path after recordingPreference moved out of
@@ -251,8 +266,8 @@ export class SyncCallRecordingStandardObjectsCommand extends ProvisionedWorkspac
const now = new Date().toISOString();
- const { allFlatEntityMaps: standardAllFlatEntityMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardAllFlatEntityMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now,
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/__tests__/remap-record-page-universal-identifiers-to-pre-2-31.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/__tests__/remap-record-page-universal-identifiers-to-pre-2-31.util.spec.ts
new file mode 100644
index 00000000000..5e594abea8c
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/__tests__/remap-record-page-universal-identifiers-to-pre-2-31.util.spec.ts
@@ -0,0 +1,49 @@
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+import { ViewKey, ViewType } from 'twenty-shared/types';
+
+import { remapRecordPageUniversalIdentifiersToPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.util';
+
+describe('remapRecordPageUniversalIdentifiersToPre231', () => {
+ it('should remap derived record-page universal identifiers to their pre-2.31 literals', () => {
+ const remapped = remapRecordPageUniversalIdentifiersToPre231({
+ universalIdentifier:
+ STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields
+ .universalIdentifier,
+ nested: {
+ viewUniversalIdentifier:
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
+ .universalIdentifier,
+ },
+ });
+
+ expect(remapped).toEqual({
+ universalIdentifier: '99fa8b47-3b11-4f9b-8fbc-e67a9e1da682',
+ nested: {
+ viewUniversalIdentifier: 'c73668d1-022d-4eaf-b825-4e2548180db6',
+ },
+ });
+ });
+
+ it('should downgrade the FIELDS_WIDGET view key to the pre-2.31 null shape without touching the view type', () => {
+ const remapped = remapRecordPageUniversalIdentifiersToPre231({
+ key: null,
+ type: ViewType.FIELDS_WIDGET,
+ name: 'Call Recording Record Page Fields',
+ });
+
+ expect(remapped).toEqual({
+ key: null,
+ type: ViewType.FIELDS_WIDGET,
+ name: 'Call Recording Record Page Fields',
+ });
+ });
+
+ it('should leave INDEX view keys and unrelated identifiers untouched', () => {
+ const input = {
+ key: ViewKey.INDEX,
+ universalIdentifier: '11111111-1111-4111-8111-111111111111',
+ };
+
+ expect(remapRecordPageUniversalIdentifiersToPre231(input)).toEqual(input);
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util.ts
new file mode 100644
index 00000000000..d6b5b01f033
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util.ts
@@ -0,0 +1,19 @@
+import { remapRecordPageUniversalIdentifiersToPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.util';
+import { type TwentyStandardAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type';
+import {
+ type ComputeTwentyStandardApplicationAllFlatEntityMapsArgs,
+ computeTwentyStandardApplicationAllFlatEntityMaps,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
+
+// Standard definitions for upgrade commands that predate the 2-31 record-page
+// reconcile: they run on workspaces whose rows still hold the pre-derivation
+// universal identifiers, so the derived identifiers the shared constants now
+// resolve to are remapped back to the pre-2.31 literals.
+export const computeTwentyStandardApplicationAllFlatEntityMapsPre231 = (
+ args: ComputeTwentyStandardApplicationAllFlatEntityMapsArgs,
+): TwentyStandardAllFlatEntityMaps => {
+ const { allFlatEntityMaps } =
+ computeTwentyStandardApplicationAllFlatEntityMaps(args);
+
+ return remapRecordPageUniversalIdentifiersToPre231(allFlatEntityMaps);
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.util.ts
new file mode 100644
index 00000000000..2e39b90ade7
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.util.ts
@@ -0,0 +1,167 @@
+import {
+ STANDARD_OBJECTS,
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
+} from 'twenty-shared/metadata';
+
+// The 2-31 record-page reconcile re-owns every standard record-page view,
+// view field, view field group, page layout, tab and widget onto derived
+// universal identifiers, and the shared constants now resolve to that derived
+// scheme. Upgrade commands registered BEFORE 2-31 run on workspaces whose rows
+// still hold the pre-derivation literals, so any standard record-page entity
+// they read from the standard definitions must be remapped back to the
+// pre-2.31 literals before being compared with or committed to the workspace.
+const CALENDAR_EVENT_RECORD_PAGE_VIEW =
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields;
+const CALL_RECORDING_RECORD_PAGE_VIEW =
+ STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields;
+const MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW =
+ STANDARD_OBJECTS.messageCampaign.views.messageCampaignRecordPageFields;
+const CALENDAR_EVENT_RECORD_PAGE_LAYOUT =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage;
+const CALL_RECORDING_RECORD_PAGE_LAYOUT =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.callRecordingRecordPage;
+const MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage;
+
+export const PRE_2_31_RECORD_PAGE_UNIVERSAL_IDENTIFIER_BY_DERIVED: Record<
+ string,
+ string
+> = {
+ // calendarEvent record-page view stack
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.universalIdentifier]:
+ 'c73668d1-022d-4eaf-b825-4e2548180db6',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFieldGroups.general.universalIdentifier]:
+ 'aeadeb9e-3673-4c0c-8845-f59cb1e6ca42',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFieldGroups.system.universalIdentifier]:
+ 'eb1aadeb-7feb-44d1-9f9a-e9929e8690fc',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.title.universalIdentifier]:
+ 'd17fc76f-2c3a-4c84-8249-27227bf71638',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.startsAt.universalIdentifier]:
+ '7bbd3744-d870-4704-882c-071732ed23d9',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.endsAt.universalIdentifier]:
+ 'ed7ca7e9-c8b3-4516-be4c-6491a27af847',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.isFullDay.universalIdentifier]:
+ '5d8f89b7-ec9e-41d6-9efe-96f9c32e6c20',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.isCanceled.universalIdentifier]:
+ 'a01f490d-cf67-4458-801e-13d81e74b45a',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.conferenceLink
+ .universalIdentifier]: '5ad748ae-e1bb-47bb-ac34-d82663c31b6e',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.location.universalIdentifier]:
+ '66c73e74-56e6-40c3-b776-0081ee757b8a',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.description.universalIdentifier]:
+ 'a09449be-b23f-48d4-b0dc-0bd36813220a',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.externalCreatedAt
+ .universalIdentifier]: '689c3eba-bedf-4a52-b9f1-3e34ce718251',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.externalUpdatedAt
+ .universalIdentifier]: '7823fa45-8cba-47ba-8dfb-5841bef44fc6',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.iCalUid.universalIdentifier]:
+ '8be763dd-6217-47fb-a7d2-ac223af881d2',
+ [CALENDAR_EVENT_RECORD_PAGE_VIEW.viewFields.conferenceSolution
+ .universalIdentifier]: '795905b6-c6f8-42cf-b8ea-3e5b6d32145f',
+ // calendarEvent record-page layout stack
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.universalIdentifier]:
+ 'b9b10e40-9ce2-4704-8ac6-c6e92e2563c1',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.home.universalIdentifier]:
+ 'c80a0407-25f5-438b-8c32-1ce9cde95657',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.home.widgets.fields
+ .universalIdentifier]: 'fea5c1c2-0c1d-4d2e-a14c-a10108b0db0f',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.home.widgets.participants
+ .universalIdentifier]: '6faea537-02fa-4993-957c-f2e1654986bd',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.home.widgets.callRecordings
+ .universalIdentifier]: 'f473b435-e2d4-4928-8d90-1db0094389f7',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.timeline.universalIdentifier]:
+ '9cb35d6d-932d-49bc-b303-593116ca5343',
+ [CALENDAR_EVENT_RECORD_PAGE_LAYOUT.tabs.timeline.widgets.timeline
+ .universalIdentifier]: '8273e2c4-cc17-4d3e-ba08-5bac612b5d44',
+ // callRecording record-page view stack
+ [CALL_RECORDING_RECORD_PAGE_VIEW.universalIdentifier]:
+ '99fa8b47-3b11-4f9b-8fbc-e67a9e1da682',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFieldGroups.general.universalIdentifier]:
+ '068426eb-dd20-49b0-ae9c-68727f3be2fb',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.title.universalIdentifier]:
+ '6308d574-8579-4cf2-a020-c208df97cf3e',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.status.universalIdentifier]:
+ '93483569-fcd2-46cf-b576-9f0318ad2b3b',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.recordingRequestStatus
+ .universalIdentifier]: '364a90b1-e9aa-4606-996b-46e579ebeb28',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.startedAt.universalIdentifier]:
+ '3fd00fbb-c153-45e3-b6e6-43d18d34052a',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.endedAt.universalIdentifier]:
+ 'ba8c8d41-c112-4173-b927-5b5c5a5c047b',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.video.universalIdentifier]:
+ 'acc54ade-cd26-4be2-9391-a42715ad1523',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.audio.universalIdentifier]:
+ '9445a547-1d1e-4da3-916b-2c2269c951c9',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.transcript.universalIdentifier]:
+ '782c97f6-e6b1-472b-8992-bbb60d25791b',
+ [CALL_RECORDING_RECORD_PAGE_VIEW.viewFields.summary.universalIdentifier]:
+ 'a0ace064-cc72-4631-ade3-07cdded86b0e',
+ // callRecording record-page layout stack
+ [CALL_RECORDING_RECORD_PAGE_LAYOUT.universalIdentifier]:
+ 'fa475fb3-3fe4-4ab8-8320-495eba5b2e58',
+ [CALL_RECORDING_RECORD_PAGE_LAYOUT.tabs.home.universalIdentifier]:
+ 'f61be659-f6f1-4f1f-b3f9-113370740f1b',
+ [CALL_RECORDING_RECORD_PAGE_LAYOUT.tabs.home.widgets.fields
+ .universalIdentifier]: 'e490d2dd-5b69-4518-b867-9dde815f9cb6',
+ [CALL_RECORDING_RECORD_PAGE_LAYOUT.tabs.timeline.universalIdentifier]:
+ '9fb360fa-bc10-430c-8425-25d4e9da4386',
+ [CALL_RECORDING_RECORD_PAGE_LAYOUT.tabs.timeline.widgets.timeline
+ .universalIdentifier]: '9347305a-73de-4651-a116-c67b2706beda',
+ // messageCampaign record-page view stack
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.universalIdentifier]:
+ '20202020-a009-4a09-8a09-fa9de11ca901',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFieldGroups.stats.universalIdentifier]:
+ '20202020-a009-4a09-8a09-fa9de11ca902',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.status.universalIdentifier]:
+ '20202020-af09-4a09-8a09-fa9de11ca903',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.sentAt.universalIdentifier]:
+ '20202020-af09-4a09-8a09-fa9de11ca904',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.sentCount.universalIdentifier]:
+ '20202020-af09-4a09-8a09-fa9de11ca905',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.failedCount
+ .universalIdentifier]: '20202020-af09-4a09-8a09-fa9de11ca906',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.bouncedCount
+ .universalIdentifier]: '20202020-af09-4a09-8a09-fa9de11ca907',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.complainedCount
+ .universalIdentifier]: '20202020-af09-4a09-8a09-fa9de11ca908',
+ // messageCampaign record-page layout stack
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.universalIdentifier]:
+ '8704b091-94bd-4f8f-82b1-e2f3eab92217',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.universalIdentifier]:
+ 'f16785cd-a5b7-4ec1-8f20-ff8b80fb94b9',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.fields
+ .universalIdentifier]: '886296e0-a5b6-4054-b450-ad624180c2ef',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.details
+ .universalIdentifier]: 'ce2f82cc-9340-45a2-90a0-c34207e8e3b0',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.recipients
+ .universalIdentifier]: 'b667f20a-1d38-453e-b888-3ecab00a1044',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.list
+ .universalIdentifier]: 'b04fb8a5-f471-49a7-b82c-8434ea8276c5',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.composer.universalIdentifier]:
+ '5f21c19d-6c3e-4b8a-9d47-1e8f02a63b71',
+ [MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.composer.widgets.messageCampaign
+ .universalIdentifier]: '9c74d8e2-0b5f-4a19-8630-57d2ba14ce92',
+};
+
+export const toPre231RecordPageUniversalIdentifier = (
+ universalIdentifier: string,
+): string =>
+ PRE_2_31_RECORD_PAGE_UNIVERSAL_IDENTIFIER_BY_DERIVED[universalIdentifier] ??
+ universalIdentifier;
+
+export const remapRecordPageUniversalIdentifiersToPre231 = <T>(
+ flatEntity: T,
+): T => {
+ let serialized = JSON.stringify(flatEntity);
+
+ for (const [
+ derivedUniversalIdentifier,
+ pre231UniversalIdentifier,
+ ] of Object.entries(PRE_2_31_RECORD_PAGE_UNIVERSAL_IDENTIFIER_BY_DERIVED)) {
+ serialized = serialized
+ .split(derivedUniversalIdentifier)
+ .join(pre231UniversalIdentifier);
+ }
+
+ return JSON.parse(serialized) as T;
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-14/2-14-workspace-command-1799000065000-sync-call-recording-request-status.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-14/2-14-workspace-command-1799000065000-sync-call-recording-request-status.command.ts
index 1fef008be2a..fa028b7447e 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-14/2-14-workspace-command-1799000065000-sync-call-recording-request-status.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-14/2-14-workspace-command-1799000065000-sync-call-recording-request-status.command.ts
@@ -6,14 +6,15 @@ 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 { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { toPre231RecordPageUniversalIdentifier } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.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 FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
import { 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 { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
const CALL_RECORDING_OBJECT_UNIVERSAL_IDENTIFIER =
@@ -24,8 +25,10 @@ const CALL_RECORDING_REQUEST_STATUS_FIELD_UNIVERSAL_IDENTIFIER =
const CALL_RECORDING_REQUEST_STATUS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS = [
STANDARD_OBJECTS.callRecording.views.allCallRecordings.viewFields
.recordingRequestStatus.universalIdentifier,
- STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields.viewFields
- .recordingRequestStatus.universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_OBJECTS.callRecording.views.callRecordingRecordPageFields
+ .viewFields.recordingRequestStatus.universalIdentifier,
+ ),
];
const CALL_RECORDING_REQUEST_STATUS_FIELD_NAME = 'recordingRequestStatus';
@@ -97,8 +100,8 @@ export class SyncCallRecordingRequestStatusCommand extends ProvisionedWorkspaceC
return;
}
- const { allFlatEntityMaps: standardAllFlatEntityMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardAllFlatEntityMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
index 0398ef5b3d9..a23a47371a0 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
@@ -9,7 +9,9 @@ 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 { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { toPre231RecordPageUniversalIdentifier } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.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';
@@ -19,17 +21,20 @@ import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-f
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 { 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 getUniversalIdentifiers = (
entitiesByName: Record<string, { universalIdentifier: string }>,
): string[] =>
- Object.values(entitiesByName).map((entity) => entity.universalIdentifier);
+ Object.values(entitiesByName).map((entity) =>
+ toPre231RecordPageUniversalIdentifier(entity.universalIdentifier),
+ );
const CALENDAR_EVENT_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIERS = [
- STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
- .universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
+ .universalIdentifier,
+ ),
];
const CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS =
@@ -45,29 +50,43 @@ const CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_UNIVERSAL_IDENTIFIERS =
);
const CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
- .universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage
+ .universalIdentifier,
+ ),
];
const CALENDAR_EVENT_PAGE_LAYOUT_TAB_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
- .universalIdentifier,
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
- .timeline.universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .universalIdentifier,
+ ),
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .timeline.universalIdentifier,
+ ),
];
const CALENDAR_EVENT_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIERS = [
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
- .widgets.fields.universalIdentifier,
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
- .widgets.participants.universalIdentifier,
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
- .timeline.widgets.timeline.universalIdentifier,
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .widgets.fields.universalIdentifier,
+ ),
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .widgets.participants.universalIdentifier,
+ ),
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
+ .timeline.widgets.timeline.universalIdentifier,
+ ),
];
const CALENDAR_EVENT_CALL_RECORDINGS_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
- .widgets.callRecordings.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs.home
+ .widgets.callRecordings.universalIdentifier,
+ );
const CALENDAR_EVENT_CALL_RECORDINGS_FIELD_UNIVERSAL_IDENTIFIER =
STANDARD_OBJECTS.calendarEvent.fields.callRecordings.universalIdentifier;
@@ -145,8 +164,8 @@ export class SyncCalendarEventRecordPageCommand extends ProvisionedWorkspaceComm
]
: CALENDAR_EVENT_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIERS;
- const { allFlatEntityMaps: standardAllFlatEntityMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardAllFlatEntityMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
@@ -155,11 +174,13 @@ export class SyncCalendarEventRecordPageCommand extends ProvisionedWorkspaceComm
const viewsToCreate = getStandardFlatEntitiesToCreateOrThrow<FlatView>({
standardFlatEntityMaps: standardAllFlatEntityMaps.flatViewMaps,
existingFlatEntityMaps: flatViewMaps,
- universalIdentifiers: CALENDAR_EVENT_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIERS,
+ universalIdentifiers:
+ CALENDAR_EVENT_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIERS,
});
const viewFieldGroupsToCreate =
getStandardFlatEntitiesToCreateOrThrow<FlatViewFieldGroup>({
- standardFlatEntityMaps: standardAllFlatEntityMaps.flatViewFieldGroupMaps,
+ standardFlatEntityMaps:
+ standardAllFlatEntityMaps.flatViewFieldGroupMaps,
existingFlatEntityMaps: flatViewFieldGroupMaps,
universalIdentifiers:
CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229940000-add-message-campaign-composer-tab.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229940000-add-message-campaign-composer-tab.command.ts
index 5fe2a42a87d..287687df315 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229940000-add-message-campaign-composer-tab.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229940000-add-message-campaign-composer-tab.command.ts
@@ -9,7 +9,9 @@ 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 { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { toPre231RecordPageUniversalIdentifier } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.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';
@@ -18,60 +20,84 @@ import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-f
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 { 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_CAMPAIGN_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER =
- STANDARD_OBJECTS.messageCampaign.views.messageCampaignRecordPageFields
- .universalIdentifier;
+// This command predates the 2-31 record-page reconcile: workspace rows still
+// hold the pre-derivation universal identifiers.
+const MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW =
+ STANDARD_OBJECTS.messageCampaign.views.messageCampaignRecordPageFields;
+const MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT =
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage;
-const MESSAGE_CAMPAIGN_RECORD_PAGE_FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS =
- Object.values(
- STANDARD_OBJECTS.messageCampaign.views.messageCampaignRecordPageFields
- .viewFields,
- ).map((viewField) => viewField.universalIdentifier);
+const MESSAGE_CAMPAIGN_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER =
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.universalIdentifier,
+ );
+
+const MESSAGE_CAMPAIGN_RECORD_PAGE_FIELDS_VIEW_FIELD_UNIVERSAL_IDENTIFIERS = [
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.status.universalIdentifier,
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.sentAt.universalIdentifier,
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.sentCount.universalIdentifier,
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.failedCount.universalIdentifier,
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.bouncedCount.universalIdentifier,
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFields.complainedCount
+ .universalIdentifier,
+].map(toPre231RecordPageUniversalIdentifier);
const MESSAGE_CAMPAIGN_RECORD_PAGE_FIELDS_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS =
- Object.values(
- STANDARD_OBJECTS.messageCampaign.views.messageCampaignRecordPageFields
- .viewFieldGroups,
- ).map((viewFieldGroup) => viewFieldGroup.universalIdentifier);
+ [
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_VIEW.viewFieldGroups.stats
+ .universalIdentifier,
+ ),
+ ];
const MESSAGE_CAMPAIGN_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
- .universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.universalIdentifier,
+ );
-const HOME_TAB_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .universalIdentifier;
+const HOME_TAB_UNIVERSAL_IDENTIFIER = toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.universalIdentifier,
+);
-const COMPOSER_TAB_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs
- .composer.universalIdentifier;
+const COMPOSER_TAB_UNIVERSAL_IDENTIFIER = toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.composer.universalIdentifier,
+);
const COMPOSER_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs
- .composer.widgets.messageCampaign.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.composer.widgets.messageCampaign
+ .universalIdentifier,
+ );
const HOME_FIELDS_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .widgets.fields.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.fields
+ .universalIdentifier,
+ );
const HOME_DETAILS_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .widgets.details.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.details
+ .universalIdentifier,
+ );
const HOME_LIST_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .widgets.list.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.list
+ .universalIdentifier,
+ );
const HOME_RECIPIENTS_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .widgets.recipients.universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ MESSAGE_CAMPAIGN_RECORD_PAGE_LAYOUT.tabs.home.widgets.recipients
+ .universalIdentifier,
+ );
+// Deleted from the standard definitions, so it has no constant to derive from.
const HOME_OBSOLETE_MESSAGES_WIDGET_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs.home
- .widgets.messages.universalIdentifier;
+ 'a33b43f4-72a1-476d-9372-30e82f450377';
@RegisteredWorkspaceCommand('2.25.0', 1785229940000)
@Command({
@@ -129,8 +155,8 @@ export class AddMessageCampaignComposerTabCommand extends ProvisionedWorkspaceCo
return;
}
- const { allFlatEntityMaps: standardAllFlatEntityMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardAllFlatEntityMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229960000-configure-message-campaign-command-menu.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229960000-configure-message-campaign-command-menu.command.ts
index 99e52c387d2..55772b01c2f 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229960000-configure-message-campaign-command-menu.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229960000-configure-message-campaign-command-menu.command.ts
@@ -6,12 +6,13 @@ 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 { computeTwentyStandardApplicationAllFlatEntityMapsPre231 } from 'src/database/commands/upgrade-version-command/2-10/utils/compute-twenty-standard-application-all-flat-entity-maps-pre-2-31.util';
+import { toPre231RecordPageUniversalIdentifier } from 'src/database/commands/upgrade-version-command/2-10/utils/remap-record-page-universal-identifiers-to-pre-2-31.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 FlatCommandMenuItem } from 'src/engine/metadata-modules/flat-command-menu-item/types/flat-command-menu-item.type';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
import { STANDARD_COMMAND_MENU_ITEMS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant';
-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 SEND_COMMAND_MENU_ITEM_UNIVERSAL_IDENTIFIERS = [
@@ -20,8 +21,10 @@ const SEND_COMMAND_MENU_ITEM_UNIVERSAL_IDENTIFIERS = [
];
const MESSAGE_CAMPAIGN_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
- STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
- .universalIdentifier;
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .universalIdentifier,
+ );
const REALIGNED_COMMAND_MENU_ITEM_UNIVERSAL_IDENTIFIERS = [
STANDARD_COMMAND_MENU_ITEMS.navigateToNextRecord.universalIdentifier,
@@ -78,8 +81,8 @@ export class ConfigureMessageCampaignCommandMenuCommand extends ProvisionedWorks
return;
}
- const { allFlatEntityMaps: standardAllFlatEntityMaps } =
- computeTwentyStandardApplicationAllFlatEntityMaps({
+ const standardAllFlatEntityMaps =
+ computeTwentyStandardApplicationAllFlatEntityMapsPre231({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.ts
index 96bf5ca4694..307324abcb1 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.ts
@@ -2,6 +2,7 @@ import { InjectRepository } from '@nestjs/typeorm';
import { Command } from 'nest-commander';
import {
+ SYSTEM_VIEW_KEYS,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
} from 'twenty-shared/application';
@@ -205,7 +206,7 @@ export class ReconcileIndexViewUniversalIdentifierCommand extends ProvisionedWor
objectMetadataApplicationUniversalIdentifier:
flatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
if (flatView.universalIdentifier === derivedViewUniversalIdentifier) {
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.ts
index 3cd402d9f20..e55e7363c9c 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.ts
@@ -2,6 +2,7 @@ import { InjectRepository } from '@nestjs/typeorm';
import { Command } from 'nest-commander';
import {
+ SYSTEM_VIEW_KEYS,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
} from 'twenty-shared/application';
@@ -17,7 +18,7 @@ import { ApplicationService } from 'src/engine/core-modules/application/applicat
import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';
import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
-import { computeFlatIndexViewToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-index-view-to-create.util';
+import { computeSystemViewToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util';
import { isFlatFieldMetadataDisplayableInDefaultView } from 'src/engine/metadata-modules/object-metadata/utils/is-flat-field-metadata-displayable-in-default-view.util';
import { orderFlatFieldMetadatasForSystemIndexView } from 'src/engine/metadata-modules/object-metadata/utils/order-flat-field-metadatas-for-system-index-view.util';
import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
@@ -223,7 +224,7 @@ export class DemoteAndBackfillApplicationIndexViewCommand extends ProvisionedWor
objectMetadataApplicationUniversalIdentifier:
flatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
if (
@@ -231,14 +232,15 @@ export class DemoteAndBackfillApplicationIndexViewCommand extends ProvisionedWor
flatObjectMetadata.universalIdentifier,
)
) {
- // computeFlatIndexViewToCreate derives the same universal identifier.
+ // computeSystemViewToCreate derives the same universal identifier.
getApplicationBucket(
flatObjectMetadata.applicationUniversalIdentifier,
).viewsToCreate.push(
- computeFlatIndexViewToCreate({
+ computeSystemViewToCreate({
objectMetadata: flatObjectMetadata,
applicationUniversalIdentifier:
flatObjectMetadata.applicationUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
}),
);
}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.spec.ts
index d4383d934e4..8de6923654e 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.spec.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255689000-reconcile-index-view-universal-identifier.command.spec.ts
@@ -1,4 +1,5 @@
import {
+ SYSTEM_VIEW_KEYS,
getSystemViewUniversalIdentifier,
getSystemViewFieldUniversalIdentifier,
} from 'twenty-shared/application';
@@ -29,7 +30,7 @@ const DERIVED_STANDARD_VIEW_UNIVERSAL_IDENTIFIER =
getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
const DERIVED_STANDARD_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
getSystemViewFieldUniversalIdentifier({
@@ -261,7 +262,7 @@ describe('ReconcileIndexViewUniversalIdentifierCommand', () => {
getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
mockWorkspaceCache({
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.spec.ts
index 713cabe3924..3959f5c8659 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.spec.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-26/__tests__/2-26-workspace-command-1785255690000-demote-and-backfill-application-index-view.command.spec.ts
@@ -1,4 +1,5 @@
import {
+ SYSTEM_VIEW_KEYS,
getSystemViewUniversalIdentifier,
getSystemViewFieldUniversalIdentifier,
} from 'twenty-shared/application';
@@ -25,7 +26,7 @@ const FIELD_UNIVERSAL_IDENTIFIER = '20202020-0000-4000-8000-0000000000cc';
const DERIVED_VIEW_UNIVERSAL_IDENTIFIER = getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier: EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
// An external application object with one displayable field.
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-instance-command-fast-1786437480000-add-is-system-side-effect-to-view-field-group.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-instance-command-fast-1786437480000-add-is-system-side-effect-to-view-field-group.ts
new file mode 100644
index 00000000000..4f7a9a4445b
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-instance-command-fast-1786437480000-add-is-system-side-effect-to-view-field-group.ts
@@ -0,0 +1,22 @@
+import { type QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+// View field groups are created by the user-facing CRUD API, by manifest apps and
+// by the engine, so the column defaults to false; the 2-31 record-page reconcile
+// command flags the engine/standard-derived rows afterwards.
+@RegisteredInstanceCommand('2.31.0', 1786437480000)
+export class AddIsSystemSideEffectToViewFieldGroupFastInstanceCommand implements FastInstanceCommand {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ 'ALTER TABLE "core"."viewFieldGroup" ADD COLUMN IF NOT EXISTS "isSystemSideEffect" boolean NOT NULL DEFAULT false',
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ 'ALTER TABLE "core"."viewFieldGroup" DROP COLUMN IF EXISTS "isSystemSideEffect"',
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts
index 1822c2666f9..4c9c4036c5f 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module.ts
@@ -1,18 +1,31 @@
import { Module } from '@nestjs/common';
+import { TypeOrmModule } from '@nestjs/typeorm';
import { WorkspaceIteratorModule } from 'src/database/commands/command-runners/workspace-iterator.module';
-import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command';
+import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command';
+import { ReconcileStandardRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command';
+import { ReconcileWorkspaceCustomRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command';
+import { BackfillRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437482000-backfill-record-page.command';
import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache.module';
+import { WorkspaceMigrationRunnerModule } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/workspace-migration-runner.module';
import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspace-migration/workspace-migration.module';
@Module({
imports: [
+ TypeOrmModule.forFeature([ViewEntity]),
ApplicationModule,
WorkspaceCacheModule,
- WorkspaceMigrationModule,
WorkspaceIteratorModule,
+ WorkspaceMigrationModule,
+ WorkspaceMigrationRunnerModule,
+ ],
+ providers: [
+ AddCalendarEventCallRecordingTabCommand,
+ ReconcileStandardRecordPageCommand,
+ ReconcileWorkspaceCustomRecordPageCommand,
+ BackfillRecordPageCommand,
],
- providers: [AddCalendarEventCallRecordingTabCommand],
})
export class V2_31_UpgradeVersionCommandModule {}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.ts
new file mode 100644
index 00000000000..0093142b676
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.ts
@@ -0,0 +1,395 @@
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { Command } from 'nest-commander';
+import { getSystemRecordPageLayoutUniversalIdentifier } from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+import { Repository } from 'typeorm';
+
+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 { PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER } from 'src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant';
+import { applyRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/apply-record-page-reown-updates.util';
+import { collectRecordPageStackFlatEntities } from 'src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-flat-entities.util';
+import { computeRecordPageStackReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util';
+import { countRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util';
+import { createEmptyRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util';
+import { type RecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+import { computeRecordPageReconcileFlatEntityMapsKeys } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-reconcile-flat-entity-maps-keys.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 AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service';
+
+@RegisteredWorkspaceCommand('2.31.0', 1786437481000)
+@Command({
+ name: 'upgrade:2-31:reconcile-standard-record-page',
+ description:
+ 'Normalize the twenty-standard-owned record-page rows. Only the standard sync and the 1-23 backfill ever authored rows under twenty-standard, so per object there is at most one RECORD_PAGE layout by construction and no winner selection is ever needed. Two passes. (1) For every standard object, the curated layout is located by its pre-2.31 pinned literal (or by the derived identifier on a rerun) and its whole stack (tabs, widgets, the FIELDS widget view plus the reserved FIELDS_WIDGET key backfill, its view fields keyed on the displayed field application, standard-authored groups) is re-owned onto the name-free derived scheme and flagged isSystemSideEffect. App-authored tabs attached to the standard layout (e.g. fireflies, call-recorder) are left untouched. (2) The 1-23 backfill authored the record-page stacks of workspace-custom objects under twenty-standard: those stacks are de-owned, i.e. their applicationId moves to the workspace-custom application without touching identifiers, so that the workspace-custom reconcile command running next treats one homogeneous population per custom object. Standard-owned layouts matching neither pass (unknown row on a standard object, layout on an app object) are logged and left untouched. universalIdentifier is unique per workspace, so any derived identifier already held by another row is skipped with a warning instead of aborting the transaction. Objects missing the stack entirely get it from the backfill-record-page command.',
+})
+export class ReconcileStandardRecordPageCommand extends ProvisionedWorkspaceCommandRunner {
+ constructor(
+ protected readonly workspaceIteratorService: WorkspaceIteratorService,
+ private readonly workspaceCacheService: WorkspaceCacheService,
+ private readonly workspaceMigrationRunnerService: WorkspaceMigrationRunnerService,
+ private readonly applicationService: ApplicationService,
+ // eslint-disable-next-line twenty/prefer-workspace-scoped-repository
+ @InjectRepository(ViewEntity)
+ private readonly viewRepository: Repository<ViewEntity>,
+ ) {
+ super(workspaceIteratorService);
+ }
+
+ override async runOnWorkspace({
+ workspaceId,
+ options,
+ }: RunOnWorkspaceArgs): Promise<void> {
+ const isDryRun = options.dryRun ?? false;
+
+ const {
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ } = await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatViewMaps',
+ 'flatViewFieldMaps',
+ 'flatViewFieldGroupMaps',
+ 'flatObjectMetadataMaps',
+ 'flatFieldMetadataMaps',
+ 'flatPageLayoutMaps',
+ 'flatPageLayoutTabMaps',
+ 'flatPageLayoutWidgetMaps',
+ ]);
+
+ const { twentyStandardFlatApplication, workspaceCustomFlatApplication } =
+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
+ { workspaceId },
+ );
+
+ const reownUpdates = this.computeCuratedStackReownUpdates({
+ workspaceId,
+ twentyStandardApplicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ this.appendDeOwnUpdates({
+ workspaceId,
+ reownUpdates,
+ twentyStandardApplicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ workspaceCustomApplicationId: workspaceCustomFlatApplication.id,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ const totalUpdateCount = countRecordPageReownUpdates(reownUpdates);
+
+ if (totalUpdateCount === 0) {
+ this.logger.log(
+ `No standard record-page stack to reconcile for workspace ${workspaceId}`,
+ );
+
+ return;
+ }
+
+ this.logger.log(
+ `${isDryRun ? '[DRY RUN] ' : ''}Reconciling standard record-page stacks for workspace ${workspaceId} (${totalUpdateCount} row(s))`,
+ );
+
+ if (isDryRun) {
+ return;
+ }
+
+ await applyRecordPageReownUpdates({
+ manager: this.viewRepository.manager,
+ workspaceId,
+ reownUpdates,
+ });
+
+ await this.workspaceMigrationRunnerService.invalidateCache({
+ allFlatEntityMapsKeys: computeRecordPageReconcileFlatEntityMapsKeys(),
+ workspaceId,
+ });
+
+ this.logger.log(
+ `Reconciled standard record-page stacks for workspace ${workspaceId} (${totalUpdateCount} row(s))`,
+ );
+ }
+
+ // Pass 1: for every standard object, locate the curated layout by its
+ // pre-2.31 pinned literal (or the derived identifier on a rerun) and re-own
+ // its whole stack onto the derived scheme.
+ private computeCuratedStackReownUpdates({
+ workspaceId,
+ twentyStandardApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ }: {
+ workspaceId: string;
+ twentyStandardApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationUniversalIdentifier: string;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatObjectMetadataMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+ >): RecordPageReownUpdates {
+ const reownUpdates = createEmptyRecordPageReownUpdates();
+ const engineOwnedApplicationUniversalIdentifiers = new Set([
+ twentyStandardApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ ]);
+
+ for (const flatObjectMetadata of Object.values(
+ flatObjectMetadataMaps.byUniversalIdentifier,
+ )) {
+ if (
+ !isDefined(flatObjectMetadata) ||
+ flatObjectMetadata.applicationUniversalIdentifier !==
+ twentyStandardApplicationUniversalIdentifier
+ ) {
+ continue;
+ }
+
+ const pre228LayoutUniversalIdentifier =
+ PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER[
+ flatObjectMetadata.universalIdentifier
+ ];
+ const derivedPageLayoutUniversalIdentifier =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ twentyStandardApplicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ });
+
+ const flatPageLayout = isDefined(pre228LayoutUniversalIdentifier)
+ ? (flatPageLayoutMaps.byUniversalIdentifier[
+ pre228LayoutUniversalIdentifier
+ ] ??
+ flatPageLayoutMaps.byUniversalIdentifier[
+ derivedPageLayoutUniversalIdentifier
+ ])
+ : flatPageLayoutMaps.byUniversalIdentifier[
+ derivedPageLayoutUniversalIdentifier
+ ];
+
+ if (!isDefined(flatPageLayout) || isDefined(flatPageLayout.deletedAt)) {
+ continue;
+ }
+
+ if (
+ flatPageLayout.applicationUniversalIdentifier !==
+ twentyStandardApplicationUniversalIdentifier ||
+ flatPageLayout.type !== PageLayoutType.RECORD_PAGE ||
+ flatPageLayout.objectMetadataUniversalIdentifier !==
+ flatObjectMetadata.universalIdentifier
+ ) {
+ this.logger.warn(
+ `Layout ${flatPageLayout.id} does not match the expected curated record-page stack of standard object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ const stackReownUpdates = computeRecordPageStackReownUpdates({
+ workspaceId,
+ logger: this.logger,
+ flatObjectMetadata,
+ flatPageLayout,
+ derivedPageLayoutUniversalIdentifier,
+ engineOwnedApplicationUniversalIdentifiers,
+ twentyStandardApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ this.mergeReownUpdates(reownUpdates, stackReownUpdates);
+ }
+
+ return reownUpdates;
+ }
+
+ // Pass 2: the 1-23 backfill authored the record-page stacks of
+ // workspace-custom objects under twenty-standard; move their applicationId
+ // to workspace-custom (identifiers untouched, the workspace-custom
+ // reconcile command re-owns them next).
+ private appendDeOwnUpdates({
+ workspaceId,
+ reownUpdates,
+ twentyStandardApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ workspaceCustomApplicationId,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ }: {
+ workspaceId: string;
+ reownUpdates: RecordPageReownUpdates;
+ twentyStandardApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationId: string;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatObjectMetadataMaps'
+ | 'flatPageLayoutMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+ >): void {
+ for (const flatPageLayout of Object.values(
+ flatPageLayoutMaps.byUniversalIdentifier,
+ )) {
+ if (
+ !isDefined(flatPageLayout) ||
+ flatPageLayout.type !== PageLayoutType.RECORD_PAGE ||
+ isDefined(flatPageLayout.deletedAt) ||
+ flatPageLayout.applicationUniversalIdentifier !==
+ twentyStandardApplicationUniversalIdentifier ||
+ !isDefined(flatPageLayout.objectMetadataUniversalIdentifier)
+ ) {
+ continue;
+ }
+
+ const flatObjectMetadata =
+ flatObjectMetadataMaps.byUniversalIdentifier[
+ flatPageLayout.objectMetadataUniversalIdentifier
+ ];
+
+ if (!isDefined(flatObjectMetadata)) {
+ this.logger.warn(
+ `Missing object for standard-owned record-page layout ${flatPageLayout.id} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ if (
+ flatObjectMetadata.applicationUniversalIdentifier ===
+ twentyStandardApplicationUniversalIdentifier
+ ) {
+ const expectedLayoutUniversalIdentifiers = [
+ PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER[
+ flatObjectMetadata.universalIdentifier
+ ],
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ twentyStandardApplicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ }),
+ ].filter(isDefined);
+
+ if (
+ !expectedLayoutUniversalIdentifiers.includes(
+ flatPageLayout.universalIdentifier,
+ )
+ ) {
+ this.logger.warn(
+ `Standard-owned record-page layout ${flatPageLayout.id} on standard object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId} matches neither the pre-2.31 literal nor the derived identifier, skipping`,
+ );
+ }
+ continue;
+ }
+
+ // Layouts of app objects were never authored under twenty-standard;
+ // anything found there is an anomaly, not a 1-23 backfill row.
+ if (
+ flatObjectMetadata.applicationUniversalIdentifier !==
+ workspaceCustomApplicationUniversalIdentifier
+ ) {
+ this.logger.warn(
+ `Standard-owned record-page layout ${flatPageLayout.id} is attached to app object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ const stack = collectRecordPageStackFlatEntities({
+ flatPageLayout,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ const stackBuckets = [
+ [stack.pageLayouts, reownUpdates.pageLayoutUpdates],
+ [stack.pageLayoutTabs, reownUpdates.pageLayoutTabUpdates],
+ [stack.pageLayoutWidgets, reownUpdates.pageLayoutWidgetUpdates],
+ [stack.views, reownUpdates.viewUpdates],
+ [stack.viewFields, reownUpdates.viewFieldUpdates],
+ [stack.viewFieldGroups, reownUpdates.viewFieldGroupUpdates],
+ ] as const;
+
+ for (const [flatEntities, updates] of stackBuckets) {
+ for (const flatEntity of flatEntities) {
+ if (
+ flatEntity.applicationUniversalIdentifier !==
+ twentyStandardApplicationUniversalIdentifier
+ ) {
+ continue;
+ }
+
+ updates.push({
+ id: flatEntity.id,
+ update: { applicationId: workspaceCustomApplicationId },
+ });
+ }
+ }
+ }
+ }
+
+ private mergeReownUpdates(
+ target: RecordPageReownUpdates,
+ source: RecordPageReownUpdates,
+ ): void {
+ for (const key of Object.keys(source) as (keyof RecordPageReownUpdates)[]) {
+ target[key].push(...source[key]);
+ }
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.ts
new file mode 100644
index 00000000000..07f3b6bec53
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.ts
@@ -0,0 +1,311 @@
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { Command } from 'nest-commander';
+import { getSystemRecordPageLayoutUniversalIdentifier } from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+import { Repository } from 'typeorm';
+
+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 { applyRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/apply-record-page-reown-updates.util';
+import { computeRecordPageStackReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util';
+import { countRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util';
+import { createEmptyRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util';
+import { type RecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+import { computeRecordPageReconcileFlatEntityMapsKeys } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-reconcile-flat-entity-maps-keys.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 AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service';
+
+type FlatPageLayoutCandidate = NonNullable<
+ AllFlatEntityMaps['flatPageLayoutMaps']['byUniversalIdentifier'][string]
+>;
+
+@RegisteredWorkspaceCommand('2.31.0', 1786437481500)
+@Command({
+ name: 'upgrade:2-31:reconcile-workspace-custom-record-page',
+ description:
+ 'Re-own the system record-page stack of every workspace-custom object onto the engine convention. Runs after reconcile-standard-record-page de-owned the 1-23-era stacks onto workspace-custom, so per custom object the workspace-custom RECORD_PAGE layouts are one homogeneous population: the system stack (1-23 backfill or the incremental createOneObject path, whose pre-2-15 rows are stuck at isSystemSideEffect false because the 2-15 column landed with default false and no backfill) plus, theoretically, API-created custom layouts. The system stack per object is resolved by a decision table, never by scoring: a single candidate is the system stack; among several, a single isSystemSideEffect candidate wins (the engine wrote that flag); anything still ambiguous is logged and skipped, the backfill command provisions the derived stack next and the untouched layouts keep working as caller customs. The winner stack (tabs, widgets, the FIELDS widget view plus the reserved FIELDS_WIDGET key backfill, its view fields keyed on the displayed field application) is re-owned onto the name-free derived scheme and flagged isSystemSideEffect. App-authored rows are left untouched, and derived identifiers already held by another row are skipped with a warning instead of aborting the transaction.',
+})
+export class ReconcileWorkspaceCustomRecordPageCommand extends ProvisionedWorkspaceCommandRunner {
+ constructor(
+ protected readonly workspaceIteratorService: WorkspaceIteratorService,
+ private readonly workspaceCacheService: WorkspaceCacheService,
+ private readonly workspaceMigrationRunnerService: WorkspaceMigrationRunnerService,
+ private readonly applicationService: ApplicationService,
+ // eslint-disable-next-line twenty/prefer-workspace-scoped-repository
+ @InjectRepository(ViewEntity)
+ private readonly viewRepository: Repository<ViewEntity>,
+ ) {
+ super(workspaceIteratorService);
+ }
+
+ override async runOnWorkspace({
+ workspaceId,
+ options,
+ }: RunOnWorkspaceArgs): Promise<void> {
+ const isDryRun = options.dryRun ?? false;
+
+ const {
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ } = await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatViewMaps',
+ 'flatViewFieldMaps',
+ 'flatViewFieldGroupMaps',
+ 'flatObjectMetadataMaps',
+ 'flatFieldMetadataMaps',
+ 'flatPageLayoutMaps',
+ 'flatPageLayoutTabMaps',
+ 'flatPageLayoutWidgetMaps',
+ ]);
+
+ const { twentyStandardFlatApplication, workspaceCustomFlatApplication } =
+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
+ { workspaceId },
+ );
+
+ const reownUpdates = this.computeReownUpdates({
+ workspaceId,
+ twentyStandardApplicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier:
+ workspaceCustomFlatApplication.universalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ const totalUpdateCount = countRecordPageReownUpdates(reownUpdates);
+
+ if (totalUpdateCount === 0) {
+ this.logger.log(
+ `No workspace-custom record-page stack to reconcile for workspace ${workspaceId}`,
+ );
+
+ return;
+ }
+
+ this.logger.log(
+ `${isDryRun ? '[DRY RUN] ' : ''}Reconciling workspace-custom record-page stacks for workspace ${workspaceId} (${totalUpdateCount} row(s))`,
+ );
+
+ if (isDryRun) {
+ return;
+ }
+
+ await applyRecordPageReownUpdates({
+ manager: this.viewRepository.manager,
+ workspaceId,
+ reownUpdates,
+ });
+
+ await this.workspaceMigrationRunnerService.invalidateCache({
+ allFlatEntityMapsKeys: computeRecordPageReconcileFlatEntityMapsKeys(),
+ workspaceId,
+ });
+
+ this.logger.log(
+ `Reconciled workspace-custom record-page stacks for workspace ${workspaceId} (${totalUpdateCount} row(s))`,
+ );
+ }
+
+ private computeReownUpdates({
+ workspaceId,
+ twentyStandardApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ }: {
+ workspaceId: string;
+ twentyStandardApplicationUniversalIdentifier: string;
+ workspaceCustomApplicationUniversalIdentifier: string;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatObjectMetadataMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+ >): RecordPageReownUpdates {
+ const reownUpdates = createEmptyRecordPageReownUpdates();
+ const engineOwnedApplicationUniversalIdentifiers = new Set([
+ twentyStandardApplicationUniversalIdentifier,
+ workspaceCustomApplicationUniversalIdentifier,
+ ]);
+
+ const candidatesByObjectUniversalIdentifier = new Map<
+ string,
+ FlatPageLayoutCandidate[]
+ >();
+
+ for (const flatPageLayout of Object.values(
+ flatPageLayoutMaps.byUniversalIdentifier,
+ )) {
+ if (
+ !isDefined(flatPageLayout) ||
+ flatPageLayout.type !== PageLayoutType.RECORD_PAGE ||
+ isDefined(flatPageLayout.deletedAt) ||
+ flatPageLayout.applicationUniversalIdentifier !==
+ workspaceCustomApplicationUniversalIdentifier ||
+ !isDefined(flatPageLayout.objectMetadataUniversalIdentifier)
+ ) {
+ continue;
+ }
+
+ const candidates =
+ candidatesByObjectUniversalIdentifier.get(
+ flatPageLayout.objectMetadataUniversalIdentifier,
+ ) ?? [];
+
+ candidates.push(flatPageLayout);
+ candidatesByObjectUniversalIdentifier.set(
+ flatPageLayout.objectMetadataUniversalIdentifier,
+ candidates,
+ );
+ }
+
+ for (const [
+ objectMetadataUniversalIdentifier,
+ candidates,
+ ] of candidatesByObjectUniversalIdentifier) {
+ const flatObjectMetadata =
+ flatObjectMetadataMaps.byUniversalIdentifier[
+ objectMetadataUniversalIdentifier
+ ];
+
+ if (!isDefined(flatObjectMetadata)) {
+ this.logger.warn(
+ `Missing object for record-page layout(s) ${candidates
+ .map((flatPageLayout) => flatPageLayout.id)
+ .join(', ')} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ // Workspace-custom layouts on standard or app objects are caller
+ // customs by definition (the system stack of those objects is owned by
+ // their own application) and are never re-owned.
+ if (
+ flatObjectMetadata.applicationUniversalIdentifier !==
+ workspaceCustomApplicationUniversalIdentifier
+ ) {
+ continue;
+ }
+
+ const systemStackFlatPageLayout = this.resolveSystemStackFlatPageLayout({
+ workspaceId,
+ flatObjectMetadata,
+ candidates,
+ });
+
+ if (!isDefined(systemStackFlatPageLayout)) {
+ continue;
+ }
+
+ const stackReownUpdates = computeRecordPageStackReownUpdates({
+ workspaceId,
+ logger: this.logger,
+ flatObjectMetadata,
+ flatPageLayout: systemStackFlatPageLayout,
+ derivedPageLayoutUniversalIdentifier:
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ }),
+ engineOwnedApplicationUniversalIdentifiers,
+ twentyStandardApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ for (const key of Object.keys(
+ stackReownUpdates,
+ ) as (keyof RecordPageReownUpdates)[]) {
+ reownUpdates[key].push(...stackReownUpdates[key]);
+ }
+ }
+
+ return reownUpdates;
+ }
+
+ // The decision table: a single candidate is the system stack; among
+ // several, a single isSystemSideEffect candidate wins (the engine wrote
+ // that flag); anything still ambiguous is skipped, never scored.
+ private resolveSystemStackFlatPageLayout({
+ workspaceId,
+ flatObjectMetadata,
+ candidates,
+ }: {
+ workspaceId: string;
+ flatObjectMetadata: NonNullable<
+ AllFlatEntityMaps['flatObjectMetadataMaps']['byUniversalIdentifier'][string]
+ >;
+ candidates: FlatPageLayoutCandidate[];
+ }): FlatPageLayoutCandidate | undefined {
+ if (candidates.length === 1) {
+ return candidates[0];
+ }
+
+ const flaggedCandidates = candidates.filter(
+ (flatPageLayout) => flatPageLayout.isSystemSideEffect,
+ );
+
+ if (flaggedCandidates.length === 1) {
+ const systemStackFlatPageLayout = flaggedCandidates[0];
+
+ for (const flatPageLayout of candidates) {
+ if (flatPageLayout.id === systemStackFlatPageLayout.id) {
+ continue;
+ }
+
+ this.logger.warn(
+ `Record-page layout ${flatPageLayout.id} on object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId} stays a caller custom, the system-flagged layout ${systemStackFlatPageLayout.id} is the system stack`,
+ );
+ }
+
+ return systemStackFlatPageLayout;
+ }
+
+ this.logger.warn(
+ `Ambiguous record-page layouts ${candidates
+ .map((flatPageLayout) => flatPageLayout.id)
+ .join(
+ ', ',
+ )} on object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId}, skipping object`,
+ );
+
+ return undefined;
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437482000-backfill-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437482000-backfill-record-page.command.ts
new file mode 100644
index 00000000000..13f8c949675
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437482000-backfill-record-page.command.ts
@@ -0,0 +1,720 @@
+import { Command } from 'nest-commander';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemRecordPageLayoutUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+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 { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
+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 { computeSystemRecordPageLayoutToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util';
+import { computeSystemViewToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util';
+import { computeSystemViewFieldsToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util';
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { 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 { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
+import { type UniversalFlatPageLayoutTab } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-tab.type';
+import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
+import { type UniversalFlatPageLayout } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout.type';
+import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
+import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
+
+type BackfillOperations = {
+ viewsToCreate: (UniversalFlatView | FlatView)[];
+ viewFieldsToCreate: (UniversalFlatViewField | FlatViewField)[];
+ viewFieldGroupsToCreate: FlatViewFieldGroup[];
+ pageLayoutsToCreate: (UniversalFlatPageLayout | FlatPageLayout)[];
+ pageLayoutTabsToCreate: (UniversalFlatPageLayoutTab | FlatPageLayoutTab)[];
+ pageLayoutWidgetsToCreate: (
+ | UniversalFlatPageLayoutWidget
+ | FlatPageLayoutWidget
+ )[];
+};
+
+type BackfillOperationsByApplication = Map<string, BackfillOperations>;
+
+type StandardRecordPageFlatEntityMaps = Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatPageLayoutMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+>;
+
+@RegisteredWorkspaceCommand('2.31.0', 1786437482000)
+@Command({
+ name: 'upgrade:2-31:backfill-record-page',
+ description:
+ 'Every object carries a system record-page stack; caller-defined custom record-page layouts coexist with it (the frontend displays a custom layout over the system one when defined). Running after the reconcile-standard-record-page and reconcile-workspace-custom-record-page commands normalized identifiers and ownership, this command backfills the system record-page stack for every object missing it, converging upgraded installs with fresh installs and replacing the frontend hardcoded default-layout fallback with a database guarantee. Twenty-standard objects get their curated stack from the standard definitions (which hold the derived identifiers post-reconcile, so lookups are direct); standard objects the definitions give no record page to stay without one, exactly like fresh installs. Workspace-custom and application objects get the engine default stack (the one objectRecordPageOnCreate always emits through the workspace migration pipeline): the FIELDS_WIDGET view (derived identifier, reserved key), its view fields for every displayable field except the label identifier, and the default layout with its 5 tabs and widgets. The backfill is idempotent and retry-safe: view, view-field, view-field-group and layout creation are gated independently on their derived identifiers, so a retry after a partial failure still backfills the missing view fields and groups of an already-committed view. View fields land in the migration bucket of the application owning their displayed field, matching the engine emission for app-contributed fields on foreign objects. On objects whose view already exists it only tops up missing view-field rows, and it never touches the tabs and widgets of an existing layout, so deliberate customizations survive.',
+})
+export class BackfillRecordPageCommand extends ProvisionedWorkspaceCommandRunner {
+ constructor(
+ protected readonly workspaceIteratorService: WorkspaceIteratorService,
+ private readonly workspaceCacheService: WorkspaceCacheService,
+ private readonly applicationService: ApplicationService,
+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,
+ ) {
+ super(workspaceIteratorService);
+ }
+
+ override async runOnWorkspace({
+ workspaceId,
+ options,
+ }: RunOnWorkspaceArgs): Promise<void> {
+ const isDryRun = options.dryRun ?? false;
+
+ const {
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ } = await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatViewMaps',
+ 'flatViewFieldMaps',
+ 'flatViewFieldGroupMaps',
+ 'flatObjectMetadataMaps',
+ 'flatFieldMetadataMaps',
+ 'flatPageLayoutMaps',
+ ]);
+
+ const { twentyStandardFlatApplication } =
+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
+ { workspaceId },
+ );
+
+ const { allFlatEntityMaps: standardFlatEntityMaps } =
+ computeTwentyStandardApplicationAllFlatEntityMaps({
+ now: new Date().toISOString(),
+ workspaceId,
+ twentyStandardApplicationId: twentyStandardFlatApplication.id,
+ });
+
+ const backfillOperationsByApplication =
+ this.computeBackfillOperationsByApplication({
+ twentyStandardApplicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ standardFlatEntityMaps,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ });
+
+ const totalCreateCount = [
+ ...backfillOperationsByApplication.values(),
+ ].reduce(
+ (count, operations) =>
+ count +
+ operations.viewsToCreate.length +
+ operations.viewFieldsToCreate.length +
+ operations.viewFieldGroupsToCreate.length +
+ operations.pageLayoutsToCreate.length +
+ operations.pageLayoutTabsToCreate.length +
+ operations.pageLayoutWidgetsToCreate.length,
+ 0,
+ );
+
+ if (totalCreateCount === 0) {
+ this.logger.log(
+ `No record page to backfill for workspace ${workspaceId}`,
+ );
+
+ return;
+ }
+
+ this.logger.log(
+ `${isDryRun ? '[DRY RUN] ' : ''}Backfilling ${totalCreateCount} record-page entit(ies) for workspace ${workspaceId}`,
+ );
+
+ if (isDryRun) {
+ return;
+ }
+
+ await this.runBackfillMigrations({
+ workspaceId,
+ backfillOperationsByApplication,
+ });
+
+ this.logger.log(
+ `Backfilled ${totalCreateCount} record-page entit(ies) for workspace ${workspaceId}`,
+ );
+ }
+
+ private computeBackfillOperationsByApplication({
+ twentyStandardApplicationUniversalIdentifier,
+ standardFlatEntityMaps,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatObjectMetadataMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ }: {
+ twentyStandardApplicationUniversalIdentifier: string;
+ standardFlatEntityMaps: StandardRecordPageFlatEntityMaps;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatObjectMetadataMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ >): BackfillOperationsByApplication {
+ const backfillOperationsByApplication: BackfillOperationsByApplication =
+ new Map();
+
+ const getApplicationBucket = (applicationUniversalIdentifier: string) => {
+ const existingBucket = backfillOperationsByApplication.get(
+ applicationUniversalIdentifier,
+ );
+
+ if (isDefined(existingBucket)) {
+ return existingBucket;
+ }
+
+ const newBucket: BackfillOperations = {
+ viewsToCreate: [],
+ viewFieldsToCreate: [],
+ viewFieldGroupsToCreate: [],
+ pageLayoutsToCreate: [],
+ pageLayoutTabsToCreate: [],
+ pageLayoutWidgetsToCreate: [],
+ };
+
+ backfillOperationsByApplication.set(
+ applicationUniversalIdentifier,
+ newBucket,
+ );
+
+ return newBucket;
+ };
+
+ for (const flatObjectMetadata of Object.values(
+ flatObjectMetadataMaps.byUniversalIdentifier,
+ )) {
+ if (!isDefined(flatObjectMetadata) || flatObjectMetadata.isRemote) {
+ continue;
+ }
+
+ const isStandardObject =
+ flatObjectMetadata.applicationUniversalIdentifier ===
+ twentyStandardApplicationUniversalIdentifier;
+
+ if (isStandardObject) {
+ this.collectStandardObjectRecordPageOperations({
+ flatObjectMetadata,
+ getApplicationBucket,
+ standardFlatEntityMaps,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ });
+ } else {
+ this.collectDefaultRecordPageOperations({
+ flatObjectMetadata,
+ getApplicationBucket,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ });
+ }
+ }
+
+ return backfillOperationsByApplication;
+ }
+
+ // The previously-defaulted population: standard objects whose record page
+ // the deleted frontend fallback used to synthesize client-side. The curated
+ // stack comes from the standard definitions, which hold the derived
+ // identifiers post-reconcile, so lookups are direct. Standard objects the
+ // definitions give no record page to stay without one, like fresh installs.
+ private collectStandardObjectRecordPageOperations({
+ flatObjectMetadata,
+ getApplicationBucket,
+ standardFlatEntityMaps,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ }: {
+ flatObjectMetadata: FlatObjectMetadata;
+ getApplicationBucket: (
+ applicationUniversalIdentifier: string,
+ ) => BackfillOperations;
+ standardFlatEntityMaps: StandardRecordPageFlatEntityMaps;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ >): void {
+ const applicationUniversalIdentifier =
+ flatObjectMetadata.applicationUniversalIdentifier;
+ const applicationBucket = getApplicationBucket(
+ applicationUniversalIdentifier,
+ );
+
+ const derivedViewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ const standardFlatView =
+ standardFlatEntityMaps.flatViewMaps.byUniversalIdentifier[
+ derivedViewUniversalIdentifier
+ ];
+ const viewAlreadyExists = isDefined(
+ flatViewMaps.byUniversalIdentifier[derivedViewUniversalIdentifier],
+ );
+ const curatedViewFieldUniversalIdentifiers = new Set<string>();
+
+ if (!viewAlreadyExists && isDefined(standardFlatView)) {
+ applicationBucket.viewsToCreate.push(standardFlatView);
+
+ const curatedFlatViewFields = Object.values(
+ standardFlatEntityMaps.flatViewFieldMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .filter(
+ (flatViewField) =>
+ flatViewField.viewUniversalIdentifier ===
+ derivedViewUniversalIdentifier &&
+ isDefined(
+ flatFieldMetadataMaps.byUniversalIdentifier[
+ flatViewField.fieldMetadataUniversalIdentifier
+ ],
+ ),
+ );
+
+ applicationBucket.viewFieldsToCreate.push(...curatedFlatViewFields);
+ curatedFlatViewFields.forEach((flatViewField) =>
+ curatedViewFieldUniversalIdentifiers.add(
+ flatViewField.universalIdentifier,
+ ),
+ );
+ }
+
+ if (viewAlreadyExists || isDefined(standardFlatView)) {
+ // Groups are topped up independently of the view creation gate so a
+ // retry after a partial failure still backfills them on an
+ // already-committed view.
+ applicationBucket.viewFieldGroupsToCreate.push(
+ ...Object.values(
+ standardFlatEntityMaps.flatViewFieldGroupMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .filter(
+ (flatViewFieldGroup) =>
+ flatViewFieldGroup.viewUniversalIdentifier ===
+ derivedViewUniversalIdentifier &&
+ !isDefined(
+ flatViewFieldGroupMaps.byUniversalIdentifier[
+ flatViewFieldGroup.universalIdentifier
+ ],
+ ),
+ ),
+ );
+
+ this.collectMissingFlatViewFieldsToCreate({
+ flatObjectMetadata,
+ derivedViewUniversalIdentifier,
+ getApplicationBucket,
+ flatViewFieldMaps,
+ flatFieldMetadataMaps,
+ skippedViewFieldUniversalIdentifiers:
+ curatedViewFieldUniversalIdentifiers,
+ });
+ }
+
+ const derivedPageLayoutUniversalIdentifier =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ });
+
+ if (
+ isDefined(
+ flatPageLayoutMaps.byUniversalIdentifier[
+ derivedPageLayoutUniversalIdentifier
+ ],
+ )
+ ) {
+ return;
+ }
+
+ const standardFlatPageLayout =
+ standardFlatEntityMaps.flatPageLayoutMaps.byUniversalIdentifier[
+ derivedPageLayoutUniversalIdentifier
+ ];
+
+ if (!isDefined(standardFlatPageLayout)) {
+ return;
+ }
+
+ applicationBucket.pageLayoutsToCreate.push(standardFlatPageLayout);
+
+ const standardFlatPageLayoutTabs = Object.values(
+ standardFlatEntityMaps.flatPageLayoutTabMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .filter(
+ (flatPageLayoutTab) =>
+ flatPageLayoutTab.pageLayoutUniversalIdentifier ===
+ derivedPageLayoutUniversalIdentifier,
+ );
+
+ applicationBucket.pageLayoutTabsToCreate.push(
+ ...standardFlatPageLayoutTabs,
+ );
+
+ const standardTabUniversalIdentifiers = new Set(
+ standardFlatPageLayoutTabs.map((tab) => tab.universalIdentifier),
+ );
+
+ applicationBucket.pageLayoutWidgetsToCreate.push(
+ ...Object.values(
+ standardFlatEntityMaps.flatPageLayoutWidgetMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .filter((flatPageLayoutWidget) => {
+ if (
+ !standardTabUniversalIdentifiers.has(
+ flatPageLayoutWidget.pageLayoutTabUniversalIdentifier,
+ )
+ ) {
+ return false;
+ }
+
+ if (
+ flatPageLayoutWidget.universalConfiguration.configurationType ===
+ WidgetConfigurationType.FIELD
+ ) {
+ return isDefined(
+ flatFieldMetadataMaps.byUniversalIdentifier[
+ flatPageLayoutWidget.universalConfiguration.fieldMetadataId
+ ],
+ );
+ }
+
+ return true;
+ }),
+ );
+ }
+
+ // The application and workspace-custom population: the engine default stack
+ // objectRecordPageOnCreate always emits at object creation, backfilled here
+ // for objects that predate the engine handler.
+ private collectDefaultRecordPageOperations({
+ flatObjectMetadata,
+ getApplicationBucket,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ }: {
+ flatObjectMetadata: FlatObjectMetadata;
+ getApplicationBucket: (
+ applicationUniversalIdentifier: string,
+ ) => BackfillOperations;
+ } & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ >): void {
+ const applicationUniversalIdentifier =
+ flatObjectMetadata.applicationUniversalIdentifier;
+ const applicationBucket = getApplicationBucket(
+ applicationUniversalIdentifier,
+ );
+
+ const derivedViewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ if (
+ !isDefined(
+ flatViewMaps.byUniversalIdentifier[derivedViewUniversalIdentifier],
+ )
+ ) {
+ applicationBucket.viewsToCreate.push(
+ computeSystemViewToCreate({
+ objectMetadata: flatObjectMetadata,
+ applicationUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ }),
+ );
+ }
+
+ this.collectMissingFlatViewFieldsToCreate({
+ flatObjectMetadata,
+ derivedViewUniversalIdentifier,
+ getApplicationBucket,
+ flatViewFieldMaps,
+ flatFieldMetadataMaps,
+ });
+
+ const derivedPageLayoutUniversalIdentifier =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ });
+
+ if (
+ isDefined(
+ flatPageLayoutMaps.byUniversalIdentifier[
+ derivedPageLayoutUniversalIdentifier
+ ],
+ )
+ ) {
+ return;
+ }
+
+ const { pageLayouts, pageLayoutTabs, pageLayoutWidgets } =
+ computeSystemRecordPageLayoutToCreate({
+ objectMetadata: flatObjectMetadata,
+ applicationUniversalIdentifier,
+ recordPageFieldsViewUniversalIdentifier: derivedViewUniversalIdentifier,
+ });
+
+ applicationBucket.pageLayoutsToCreate.push(...pageLayouts);
+ applicationBucket.pageLayoutTabsToCreate.push(...pageLayoutTabs);
+ applicationBucket.pageLayoutWidgetsToCreate.push(...pageLayoutWidgets);
+ }
+
+ // Missing view-field rows for the object's record-page view, so every
+ // displayable field except the label identifier has one, the invariant the
+ // engine maintains on field creation. Each row lands in the bucket of the
+ // application owning its displayed field, per the engine convention: a field
+ // contributed by another application yields a view field owned by that
+ // application, on a view owned by the object's application.
+ private collectMissingFlatViewFieldsToCreate({
+ flatObjectMetadata,
+ derivedViewUniversalIdentifier,
+ getApplicationBucket,
+ flatViewFieldMaps,
+ flatFieldMetadataMaps,
+ skippedViewFieldUniversalIdentifiers,
+ }: {
+ flatObjectMetadata: FlatObjectMetadata;
+ derivedViewUniversalIdentifier: string;
+ getApplicationBucket: (
+ applicationUniversalIdentifier: string,
+ ) => BackfillOperations;
+ skippedViewFieldUniversalIdentifiers?: Set<string>;
+ } & Pick<
+ AllFlatEntityMaps,
+ 'flatViewFieldMaps' | 'flatFieldMetadataMaps'
+ >): void {
+ const objectFlatFieldMetadatas =
+ flatObjectMetadata.fieldUniversalIdentifiers
+ .map(
+ (fieldUniversalIdentifier) =>
+ flatFieldMetadataMaps.byUniversalIdentifier[
+ fieldUniversalIdentifier
+ ],
+ )
+ .filter(isDefined);
+
+ const fieldApplicationUniversalIdentifierByFieldUniversalIdentifier =
+ new Map(
+ objectFlatFieldMetadatas.map((flatFieldMetadata) => [
+ flatFieldMetadata.universalIdentifier,
+ flatFieldMetadata.applicationUniversalIdentifier,
+ ]),
+ );
+
+ const missingFlatViewFields: UniversalFlatViewField[] =
+ computeSystemViewFieldsToCreate({
+ objectFlatFieldMetadatas,
+ viewUniversalIdentifier: derivedViewUniversalIdentifier,
+ applicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier:
+ flatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier,
+ excludeLabelIdentifier: true,
+ }).filter(
+ (flatViewFieldToCreate) =>
+ !isDefined(
+ flatViewFieldMaps.byUniversalIdentifier[
+ flatViewFieldToCreate.universalIdentifier
+ ],
+ ) &&
+ !skippedViewFieldUniversalIdentifiers?.has(
+ flatViewFieldToCreate.universalIdentifier,
+ ),
+ );
+
+ for (const missingFlatViewField of missingFlatViewFields) {
+ const fieldApplicationUniversalIdentifier =
+ fieldApplicationUniversalIdentifierByFieldUniversalIdentifier.get(
+ missingFlatViewField.fieldMetadataUniversalIdentifier,
+ ) ?? flatObjectMetadata.applicationUniversalIdentifier;
+
+ getApplicationBucket(
+ fieldApplicationUniversalIdentifier,
+ ).viewFieldsToCreate.push({
+ ...missingFlatViewField,
+ applicationUniversalIdentifier: fieldApplicationUniversalIdentifier,
+ });
+ }
+ }
+
+ private async runBackfillMigrations({
+ workspaceId,
+ backfillOperationsByApplication,
+ }: {
+ workspaceId: string;
+ backfillOperationsByApplication: BackfillOperationsByApplication;
+ }): Promise<void> {
+ // Views commit before view fields and layouts across applications: a view
+ // field belongs to the application owning its displayed field, which can
+ // differ from the application owning the object.
+ for (const [
+ applicationUniversalIdentifier,
+ { viewsToCreate },
+ ] of backfillOperationsByApplication.entries()) {
+ if (viewsToCreate.length === 0) {
+ continue;
+ }
+
+ await this.runBackfillMigration({
+ workspaceId,
+ applicationUniversalIdentifier,
+ allFlatEntityOperationByMetadataName: {
+ view: {
+ flatEntityToCreate: viewsToCreate,
+ flatEntityToDelete: [],
+ flatEntityToUpdate: [],
+ },
+ },
+ });
+ }
+
+ for (const [
+ applicationUniversalIdentifier,
+ {
+ viewFieldsToCreate,
+ viewFieldGroupsToCreate,
+ pageLayoutsToCreate,
+ pageLayoutTabsToCreate,
+ pageLayoutWidgetsToCreate,
+ },
+ ] of backfillOperationsByApplication.entries()) {
+ const operationCount =
+ viewFieldsToCreate.length +
+ viewFieldGroupsToCreate.length +
+ pageLayoutsToCreate.length +
+ pageLayoutTabsToCreate.length +
+ pageLayoutWidgetsToCreate.length;
+
+ if (operationCount === 0) {
+ continue;
+ }
+
+ await this.runBackfillMigration({
+ workspaceId,
+ applicationUniversalIdentifier,
+ allFlatEntityOperationByMetadataName: {
+ 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: [],
+ },
+ },
+ });
+ }
+ }
+
+ private async runBackfillMigration({
+ workspaceId,
+ applicationUniversalIdentifier,
+ allFlatEntityOperationByMetadataName,
+ }: {
+ workspaceId: string;
+ applicationUniversalIdentifier: string;
+ allFlatEntityOperationByMetadataName: Record<
+ string,
+ {
+ flatEntityToCreate: unknown[];
+ flatEntityToDelete: never[];
+ flatEntityToUpdate: never[];
+ }
+ >;
+ }): Promise<void> {
+ const result =
+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
+ {
+ isSystemBuild: true,
+ workspaceId,
+ applicationUniversalIdentifier,
+ allFlatEntityOperationByMetadataName:
+ allFlatEntityOperationByMetadataName as never,
+ },
+ );
+
+ if (result.status === 'fail') {
+ this.logger.error(
+ `Failed to backfill record page(s) for application ${applicationUniversalIdentifier} in workspace ${workspaceId}:\n${JSON.stringify(result, null, 2)}`,
+ );
+
+ throw new Error(
+ `Failed to backfill record page(s) for workspace ${workspaceId}`,
+ );
+ }
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.ts
similarity index 95%
rename from packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts
rename to packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.ts
index fa4ace15b9d..cf5630d7b6d 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.ts
@@ -28,7 +28,7 @@ const TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER =
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.calendarEventRecordPage.tabs
.callRecording.widgets.transcript.universalIdentifier;
-@RegisteredWorkspaceCommand('2.31.0', 1786353778242)
+@RegisteredWorkspaceCommand('2.31.0', 1786437483000)
@Command({
name: 'upgrade:2-31:add-calendar-event-call-recording-tab',
description:
@@ -55,12 +55,15 @@ export class AddCalendarEventCallRecordingTabCommand extends ProvisionedWorkspac
{ workspaceId },
);
- const { flatPageLayoutMaps, flatPageLayoutTabMaps, flatPageLayoutWidgetMaps } =
- await this.workspaceCacheService.getOrRecompute(workspaceId, [
- 'flatPageLayoutMaps',
- 'flatPageLayoutTabMaps',
- 'flatPageLayoutWidgetMaps',
- ]);
+ const {
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ } = await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatPageLayoutMaps',
+ 'flatPageLayoutTabMaps',
+ 'flatPageLayoutWidgetMaps',
+ ]);
const existingPageLayout =
flatPageLayoutMaps.byUniversalIdentifier[
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.spec.ts
new file mode 100644
index 00000000000..4d9e3f6e6c8
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command.spec.ts
@@ -0,0 +1,364 @@
+import { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+
+import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { ReconcileStandardRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481000-reconcile-standard-record-page.command';
+import { PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER } from 'src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant';
+import {
+ buildByUniversalIdentifierMap,
+ type FlatEntityFixture,
+ buildDerivedRecordPageStackUniversalIdentifiers,
+ buildUnderivedRecordPageStack,
+ CUSTOM_APPLICATION_ID,
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ FIELD_UNIVERSAL_IDENTIFIER,
+ STANDARD_APPLICATION_ID,
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ WORKSPACE_ID,
+} from 'src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup';
+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { PageLayoutTabEntity } from 'src/engine/metadata-modules/page-layout-tab/entities/page-layout-tab.entity';
+import { PageLayoutWidgetEntity } from 'src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity';
+import { PageLayoutEntity } from 'src/engine/metadata-modules/page-layout/entities/page-layout.entity';
+import { ViewFieldGroupEntity } from 'src/engine/metadata-modules/view-field-group/entities/view-field-group.entity';
+import { ViewFieldEntity } from 'src/engine/metadata-modules/view-field/entities/view-field.entity';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { type WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service';
+
+const COMPANY_OBJECT_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company;
+const COMPANY_PRE_2_31_LAYOUT_UNIVERSAL_IDENTIFIER =
+ PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER[
+ COMPANY_OBJECT_UNIVERSAL_IDENTIFIER
+ ];
+const CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000bb';
+
+const DERIVED = buildDerivedRecordPageStackUniversalIdentifiers({
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: COMPANY_OBJECT_UNIVERSAL_IDENTIFIER,
+});
+
+// The curated company stack, still on its pre-2.31 pinned literal.
+const CURATED_STACK = (() => {
+ const stack = buildUnderivedRecordPageStack({
+ idPrefix: 'company',
+ objectUniversalIdentifier: COMPANY_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ withGroup: true,
+ });
+
+ return {
+ ...stack,
+ pageLayout: {
+ ...stack.pageLayout,
+ universalIdentifier: COMPANY_PRE_2_31_LAYOUT_UNIVERSAL_IDENTIFIER,
+ },
+ };
+})();
+
+// A 1-23-era stack: custom object, whole stack authored under twenty-standard.
+const ONE_23_ERA_STACK = buildUnderivedRecordPageStack({
+ idPrefix: 'legacy-custom',
+ objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: false,
+});
+
+const COMPANY_OBJECT_METADATA = {
+ universalIdentifier: COMPANY_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const CUSTOM_OBJECT_METADATA = {
+ universalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const FIELD_METADATA = {
+ universalIdentifier: FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+describe('ReconcileStandardRecordPageCommand', () => {
+ let command: ReconcileStandardRecordPageCommand;
+ let getOrRecomputeMock: jest.Mock;
+ let invalidateCacheMock: jest.Mock;
+ let updateMocksByEntity: Map<unknown, jest.Mock>;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+
+ getOrRecomputeMock = jest.fn();
+ invalidateCacheMock = jest.fn().mockResolvedValue(undefined);
+ updateMocksByEntity = new Map(
+ [
+ PageLayoutEntity,
+ PageLayoutTabEntity,
+ PageLayoutWidgetEntity,
+ ViewEntity,
+ ViewFieldEntity,
+ ViewFieldGroupEntity,
+ ].map((entity) => [entity, jest.fn().mockResolvedValue(undefined)]),
+ );
+
+ const entityManagerMock = {
+ getRepository: (entity: unknown) => {
+ const updateMock = updateMocksByEntity.get(entity);
+
+ if (updateMock === undefined) {
+ throw new Error('Unexpected repository');
+ }
+
+ return { update: updateMock };
+ },
+ };
+
+ const viewRepositoryMock = {
+ manager: {
+ transaction: jest.fn(
+ async (callback: (entityManager: unknown) => Promise<void>) =>
+ callback(entityManagerMock),
+ ),
+ },
+ };
+
+ command = new ReconcileStandardRecordPageCommand(
+ {} as WorkspaceIteratorService,
+ {
+ getOrRecompute: getOrRecomputeMock,
+ } as unknown as WorkspaceCacheService,
+ {
+ invalidateCache: invalidateCacheMock,
+ } as unknown as WorkspaceMigrationRunnerService,
+ {
+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest
+ .fn()
+ .mockResolvedValue({
+ twentyStandardFlatApplication: {
+ id: STANDARD_APPLICATION_ID,
+ universalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ workspaceCustomFlatApplication: {
+ id: CUSTOM_APPLICATION_ID,
+ universalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ }),
+ } as unknown as ApplicationService,
+ viewRepositoryMock as never,
+ );
+ });
+
+ const mockWorkspaceCache = ({
+ objects = [COMPANY_OBJECT_METADATA],
+ views = [CURATED_STACK.view],
+ viewFields = [CURATED_STACK.viewField],
+ viewFieldGroups = CURATED_STACK.viewFieldGroup
+ ? [CURATED_STACK.viewFieldGroup]
+ : [],
+ pageLayouts = [CURATED_STACK.pageLayout],
+ pageLayoutTabs = [CURATED_STACK.homeTab],
+ pageLayoutWidgets = [CURATED_STACK.fieldsWidget],
+ }: {
+ objects?: FlatEntityFixture[];
+ views?: FlatEntityFixture[];
+ viewFields?: FlatEntityFixture[];
+ viewFieldGroups?: FlatEntityFixture[];
+ pageLayouts?: FlatEntityFixture[];
+ pageLayoutTabs?: FlatEntityFixture[];
+ pageLayoutWidgets?: FlatEntityFixture[];
+ } = {}) => {
+ getOrRecomputeMock.mockResolvedValue({
+ flatViewMaps: buildByUniversalIdentifierMap(views),
+ flatViewFieldMaps: buildByUniversalIdentifierMap(viewFields),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap(viewFieldGroups),
+ flatObjectMetadataMaps: buildByUniversalIdentifierMap(objects),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap([FIELD_METADATA]),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap(pageLayouts),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap(pageLayoutTabs),
+ flatPageLayoutWidgetMaps:
+ buildByUniversalIdentifierMap(pageLayoutWidgets),
+ });
+ };
+
+ const runOnWorkspace = (dryRun = false) =>
+ command.runOnWorkspace({
+ workspaceId: WORKSPACE_ID,
+ options: { dryRun },
+ index: 0,
+ total: 1,
+ });
+
+ it('re-owns the curated stack located by its pre-2.31 literal', async () => {
+ mockWorkspaceCache();
+
+ await runOnWorkspace();
+
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledWith(
+ { id: CURATED_STACK.pageLayout.id, workspaceId: WORKSPACE_ID },
+ { universalIdentifier: DERIVED.pageLayout },
+ );
+ expect(updateMocksByEntity.get(PageLayoutTabEntity)).toHaveBeenCalledWith(
+ { id: CURATED_STACK.homeTab.id, workspaceId: WORKSPACE_ID },
+ { universalIdentifier: DERIVED.homeTab },
+ );
+ expect(
+ updateMocksByEntity.get(PageLayoutWidgetEntity),
+ ).toHaveBeenCalledWith(
+ { id: CURATED_STACK.fieldsWidget.id, workspaceId: WORKSPACE_ID },
+ { universalIdentifier: DERIVED.fieldsWidget },
+ );
+ expect(updateMocksByEntity.get(ViewEntity)).toHaveBeenCalledWith(
+ { id: CURATED_STACK.view.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.view,
+ },
+ );
+ expect(updateMocksByEntity.get(ViewFieldEntity)).toHaveBeenCalledWith(
+ { id: CURATED_STACK.viewField.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.viewField,
+ isSystemSideEffect: true,
+ },
+ );
+ expect(updateMocksByEntity.get(ViewFieldGroupEntity)).toHaveBeenCalledWith(
+ { id: CURATED_STACK.viewFieldGroup?.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.generalGroup,
+ isSystemSideEffect: true,
+ },
+ );
+ expect(invalidateCacheMock).toHaveBeenCalled();
+ });
+
+ it('is idempotent: a fully derived stack yields no update', async () => {
+ mockWorkspaceCache({
+ views: [
+ {
+ ...CURATED_STACK.view,
+ universalIdentifier: DERIVED.view,
+ viewFieldUniversalIdentifiers: [DERIVED.viewField],
+ viewFieldGroupUniversalIdentifiers: [DERIVED.generalGroup],
+ },
+ ],
+ viewFields: [
+ {
+ ...CURATED_STACK.viewField,
+ universalIdentifier: DERIVED.viewField,
+ isSystemSideEffect: true,
+ },
+ ],
+ viewFieldGroups: [
+ {
+ ...CURATED_STACK.viewFieldGroup,
+ universalIdentifier: DERIVED.generalGroup,
+ isSystemSideEffect: true,
+ },
+ ],
+ pageLayouts: [
+ {
+ ...CURATED_STACK.pageLayout,
+ universalIdentifier: DERIVED.pageLayout,
+ tabUniversalIdentifiers: [DERIVED.homeTab],
+ },
+ ],
+ pageLayoutTabs: [
+ {
+ ...CURATED_STACK.homeTab,
+ universalIdentifier: DERIVED.homeTab,
+ widgetUniversalIdentifiers: [DERIVED.fieldsWidget],
+ },
+ ],
+ pageLayoutWidgets: [
+ {
+ ...CURATED_STACK.fieldsWidget,
+ universalIdentifier: DERIVED.fieldsWidget,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ expect(invalidateCacheMock).not.toHaveBeenCalled();
+ });
+
+ it('de-owns a 1-23-era custom-object stack to workspace-custom without touching identifiers', async () => {
+ mockWorkspaceCache({
+ objects: [CUSTOM_OBJECT_METADATA],
+ views: [ONE_23_ERA_STACK.view],
+ viewFields: [ONE_23_ERA_STACK.viewField],
+ viewFieldGroups: [],
+ pageLayouts: [ONE_23_ERA_STACK.pageLayout],
+ pageLayoutTabs: [ONE_23_ERA_STACK.homeTab],
+ pageLayoutWidgets: [ONE_23_ERA_STACK.fieldsWidget],
+ });
+
+ await runOnWorkspace();
+
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledWith(
+ { id: ONE_23_ERA_STACK.pageLayout.id, workspaceId: WORKSPACE_ID },
+ { applicationId: CUSTOM_APPLICATION_ID },
+ );
+ expect(updateMocksByEntity.get(PageLayoutTabEntity)).toHaveBeenCalledWith(
+ { id: ONE_23_ERA_STACK.homeTab.id, workspaceId: WORKSPACE_ID },
+ { applicationId: CUSTOM_APPLICATION_ID },
+ );
+ expect(
+ updateMocksByEntity.get(PageLayoutWidgetEntity),
+ ).toHaveBeenCalledWith(
+ { id: ONE_23_ERA_STACK.fieldsWidget.id, workspaceId: WORKSPACE_ID },
+ { applicationId: CUSTOM_APPLICATION_ID },
+ );
+ expect(updateMocksByEntity.get(ViewEntity)).toHaveBeenCalledWith(
+ { id: ONE_23_ERA_STACK.view.id, workspaceId: WORKSPACE_ID },
+ { applicationId: CUSTOM_APPLICATION_ID },
+ );
+ expect(updateMocksByEntity.get(ViewFieldEntity)).toHaveBeenCalledWith(
+ { id: ONE_23_ERA_STACK.viewField.id, workspaceId: WORKSPACE_ID },
+ { applicationId: CUSTOM_APPLICATION_ID },
+ );
+ // Identifiers stay untouched: the workspace-custom reconcile re-owns them.
+ expect(updateMocksByEntity.get(PageLayoutEntity)).not.toHaveBeenCalledWith(
+ expect.anything(),
+ expect.objectContaining({ universalIdentifier: expect.anything() }),
+ );
+ });
+
+ it('leaves workspace-custom-owned layouts alone', async () => {
+ const customOwnedStack = buildUnderivedRecordPageStack({
+ idPrefix: 'custom-owned',
+ objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ });
+
+ mockWorkspaceCache({
+ objects: [CUSTOM_OBJECT_METADATA],
+ views: [customOwnedStack.view],
+ viewFields: [customOwnedStack.viewField],
+ viewFieldGroups: [],
+ pageLayouts: [customOwnedStack.pageLayout],
+ pageLayoutTabs: [customOwnedStack.homeTab],
+ pageLayoutWidgets: [customOwnedStack.fieldsWidget],
+ });
+
+ await runOnWorkspace();
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ });
+
+ it('skips every write in dry-run mode', async () => {
+ mockWorkspaceCache();
+
+ await runOnWorkspace(true);
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ expect(invalidateCacheMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.spec.ts
new file mode 100644
index 00000000000..86a65ff0514
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command.spec.ts
@@ -0,0 +1,327 @@
+import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { ReconcileWorkspaceCustomRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437481500-reconcile-workspace-custom-record-page.command';
+import {
+ buildByUniversalIdentifierMap,
+ type FlatEntityFixture,
+ buildDerivedRecordPageStackUniversalIdentifiers,
+ buildUnderivedRecordPageStack,
+ CUSTOM_APPLICATION_ID,
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ FIELD_UNIVERSAL_IDENTIFIER,
+ STANDARD_APPLICATION_ID,
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ WORKSPACE_ID,
+} from 'src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup';
+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { PageLayoutTabEntity } from 'src/engine/metadata-modules/page-layout-tab/entities/page-layout-tab.entity';
+import { PageLayoutWidgetEntity } from 'src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity';
+import { PageLayoutEntity } from 'src/engine/metadata-modules/page-layout/entities/page-layout.entity';
+import { ViewFieldGroupEntity } from 'src/engine/metadata-modules/view-field-group/entities/view-field-group.entity';
+import { ViewFieldEntity } from 'src/engine/metadata-modules/view-field/entities/view-field.entity';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { type WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/services/workspace-migration-runner.service';
+
+const CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000bb';
+const STANDARD_OBJECT_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000bc';
+
+const DERIVED = buildDerivedRecordPageStackUniversalIdentifiers({
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+});
+
+// The system stack of a custom object: workspace-custom-owned, either from
+// the incremental createOneObject path or de-owned from 1-23 by the standard
+// reconcile.
+const SYSTEM_STACK = buildUnderivedRecordPageStack({
+ idPrefix: 'system',
+ objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: true,
+});
+
+const CUSTOM_OBJECT_METADATA = {
+ universalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const STANDARD_OBJECT_METADATA = {
+ universalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const FIELD_METADATA = {
+ universalIdentifier: FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+describe('ReconcileWorkspaceCustomRecordPageCommand', () => {
+ let command: ReconcileWorkspaceCustomRecordPageCommand;
+ let getOrRecomputeMock: jest.Mock;
+ let invalidateCacheMock: jest.Mock;
+ let updateMocksByEntity: Map<unknown, jest.Mock>;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+
+ getOrRecomputeMock = jest.fn();
+ invalidateCacheMock = jest.fn().mockResolvedValue(undefined);
+ updateMocksByEntity = new Map(
+ [
+ PageLayoutEntity,
+ PageLayoutTabEntity,
+ PageLayoutWidgetEntity,
+ ViewEntity,
+ ViewFieldEntity,
+ ViewFieldGroupEntity,
+ ].map((entity) => [entity, jest.fn().mockResolvedValue(undefined)]),
+ );
+
+ const entityManagerMock = {
+ getRepository: (entity: unknown) => {
+ const updateMock = updateMocksByEntity.get(entity);
+
+ if (updateMock === undefined) {
+ throw new Error('Unexpected repository');
+ }
+
+ return { update: updateMock };
+ },
+ };
+
+ const viewRepositoryMock = {
+ manager: {
+ transaction: jest.fn(
+ async (callback: (entityManager: unknown) => Promise<void>) =>
+ callback(entityManagerMock),
+ ),
+ },
+ };
+
+ command = new ReconcileWorkspaceCustomRecordPageCommand(
+ {} as WorkspaceIteratorService,
+ {
+ getOrRecompute: getOrRecomputeMock,
+ } as unknown as WorkspaceCacheService,
+ {
+ invalidateCache: invalidateCacheMock,
+ } as unknown as WorkspaceMigrationRunnerService,
+ {
+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest
+ .fn()
+ .mockResolvedValue({
+ twentyStandardFlatApplication: {
+ id: STANDARD_APPLICATION_ID,
+ universalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ workspaceCustomFlatApplication: {
+ id: CUSTOM_APPLICATION_ID,
+ universalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ }),
+ } as unknown as ApplicationService,
+ viewRepositoryMock as never,
+ );
+ });
+
+ const mockWorkspaceCache = ({
+ objects = [CUSTOM_OBJECT_METADATA],
+ views = [SYSTEM_STACK.view],
+ viewFields = [SYSTEM_STACK.viewField],
+ pageLayouts = [SYSTEM_STACK.pageLayout],
+ pageLayoutTabs = [SYSTEM_STACK.homeTab],
+ pageLayoutWidgets = [SYSTEM_STACK.fieldsWidget],
+ }: {
+ objects?: FlatEntityFixture[];
+ views?: FlatEntityFixture[];
+ viewFields?: FlatEntityFixture[];
+ pageLayouts?: FlatEntityFixture[];
+ pageLayoutTabs?: FlatEntityFixture[];
+ pageLayoutWidgets?: FlatEntityFixture[];
+ } = {}) => {
+ getOrRecomputeMock.mockResolvedValue({
+ flatViewMaps: buildByUniversalIdentifierMap(views),
+ flatViewFieldMaps: buildByUniversalIdentifierMap(viewFields),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap([]),
+ flatObjectMetadataMaps: buildByUniversalIdentifierMap(objects),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap([FIELD_METADATA]),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap(pageLayouts),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap(pageLayoutTabs),
+ flatPageLayoutWidgetMaps:
+ buildByUniversalIdentifierMap(pageLayoutWidgets),
+ });
+ };
+
+ const runOnWorkspace = (dryRun = false) =>
+ command.runOnWorkspace({
+ workspaceId: WORKSPACE_ID,
+ options: { dryRun },
+ index: 0,
+ total: 1,
+ });
+
+ it('re-owns the single workspace-custom stack of a custom object', async () => {
+ mockWorkspaceCache();
+
+ await runOnWorkspace();
+
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledWith(
+ { id: SYSTEM_STACK.pageLayout.id, workspaceId: WORKSPACE_ID },
+ { universalIdentifier: DERIVED.pageLayout },
+ );
+ expect(updateMocksByEntity.get(ViewEntity)).toHaveBeenCalledWith(
+ { id: SYSTEM_STACK.view.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.view,
+ },
+ );
+ expect(updateMocksByEntity.get(ViewFieldEntity)).toHaveBeenCalledWith(
+ { id: SYSTEM_STACK.viewField.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.viewField,
+ isSystemSideEffect: true,
+ },
+ );
+ expect(invalidateCacheMock).toHaveBeenCalled();
+ });
+
+ it('re-owns an unflagged single stack (pre-2-15 incremental rows)', async () => {
+ const unflaggedStack = buildUnderivedRecordPageStack({
+ idPrefix: 'unflagged',
+ objectUniversalIdentifier: CUSTOM_OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: false,
+ });
+
+ mockWorkspaceCache({
+ views: [unflaggedStack.view],
+ viewFields: [unflaggedStack.viewField],
+ pageLayouts: [unflaggedStack.pageLayout],
+ pageLayoutTabs: [unflaggedStack.homeTab],
+ pageLayoutWidgets: [unflaggedStack.fieldsWidget],
+ });
+
+ await runOnWorkspace();
+
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledWith(
+ { id: unflaggedStack.pageLayout.id, workspaceId: WORKSPACE_ID },
+ {
+ universalIdentifier: DERIVED.pageLayout,
+ isSystemSideEffect: true,
+ },
+ );
+ });
+
+ it('picks the single flagged candidate among several and leaves the custom one untouched', async () => {
+ const callerCustomLayout = {
+ ...SYSTEM_STACK.pageLayout,
+ id: 'caller-custom-layout-db-id',
+ universalIdentifier: 'caller-custom-layout-universal-identifier',
+ isSystemSideEffect: false,
+ tabUniversalIdentifiers: [],
+ };
+
+ mockWorkspaceCache({
+ // The caller custom comes first: the flag must decide, not order.
+ pageLayouts: [callerCustomLayout, SYSTEM_STACK.pageLayout],
+ });
+
+ await runOnWorkspace();
+
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledTimes(1);
+ expect(updateMocksByEntity.get(PageLayoutEntity)).toHaveBeenCalledWith(
+ { id: SYSTEM_STACK.pageLayout.id, workspaceId: WORKSPACE_ID },
+ { universalIdentifier: DERIVED.pageLayout },
+ );
+ });
+
+ it('skips the object when several candidates are ambiguous', async () => {
+ const firstUnflaggedLayout = {
+ ...SYSTEM_STACK.pageLayout,
+ isSystemSideEffect: false,
+ };
+ const secondUnflaggedLayout = {
+ ...SYSTEM_STACK.pageLayout,
+ id: 'second-layout-db-id',
+ universalIdentifier: 'second-layout-universal-identifier',
+ isSystemSideEffect: false,
+ tabUniversalIdentifiers: [],
+ };
+
+ mockWorkspaceCache({
+ pageLayouts: [firstUnflaggedLayout, secondUnflaggedLayout],
+ });
+
+ await runOnWorkspace();
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ });
+
+ it('leaves workspace-custom layouts of standard objects untouched', async () => {
+ const customLayoutOnStandardObject = {
+ ...SYSTEM_STACK.pageLayout,
+ objectMetadataUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIER,
+ };
+
+ mockWorkspaceCache({
+ objects: [STANDARD_OBJECT_METADATA],
+ pageLayouts: [customLayoutOnStandardObject],
+ });
+
+ await runOnWorkspace();
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ });
+
+ it('is idempotent: a fully derived stack yields no update', async () => {
+ mockWorkspaceCache({
+ views: [
+ {
+ ...SYSTEM_STACK.view,
+ universalIdentifier: DERIVED.view,
+ viewFieldUniversalIdentifiers: [DERIVED.viewField],
+ },
+ ],
+ viewFields: [
+ {
+ ...SYSTEM_STACK.viewField,
+ universalIdentifier: DERIVED.viewField,
+ isSystemSideEffect: true,
+ },
+ ],
+ pageLayouts: [
+ {
+ ...SYSTEM_STACK.pageLayout,
+ universalIdentifier: DERIVED.pageLayout,
+ tabUniversalIdentifiers: [DERIVED.homeTab],
+ },
+ ],
+ pageLayoutTabs: [
+ {
+ ...SYSTEM_STACK.homeTab,
+ universalIdentifier: DERIVED.homeTab,
+ widgetUniversalIdentifiers: [DERIVED.fieldsWidget],
+ },
+ ],
+ pageLayoutWidgets: [
+ {
+ ...SYSTEM_STACK.fieldsWidget,
+ universalIdentifier: DERIVED.fieldsWidget,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ for (const updateMock of updateMocksByEntity.values()) {
+ expect(updateMock).not.toHaveBeenCalled();
+ }
+ expect(invalidateCacheMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437482000-backfill-record-page.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437482000-backfill-record-page.command.spec.ts
new file mode 100644
index 00000000000..9131d38878f
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437482000-backfill-record-page.command.spec.ts
@@ -0,0 +1,617 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemRecordPageLayoutUniversalIdentifier,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { FieldMetadataType, ViewType } from 'twenty-shared/types';
+
+import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { BackfillRecordPageCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437482000-backfill-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 { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+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',
+ () => ({
+ computeTwentyStandardApplicationAllFlatEntityMaps: jest.fn(),
+ }),
+);
+
+const computeStandardMapsMock =
+ computeTwentyStandardApplicationAllFlatEntityMaps as jest.Mock;
+
+const WORKSPACE_ID = '20202020-0000-4000-8000-000000000001';
+const STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000ad';
+const CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000aa';
+const EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000ae';
+const OBJECT_UNIVERSAL_IDENTIFIER = '20202020-0000-4000-8000-0000000000bb';
+const LABEL_FIELD_UNIVERSAL_IDENTIFIER = '20202020-0000-4000-8000-0000000000cc';
+const OTHER_FIELD_UNIVERSAL_IDENTIFIER = '20202020-0000-4000-8000-0000000000cd';
+
+const DERIVED_VIEW_UNIVERSAL_IDENTIFIER = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+});
+
+const STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+const STANDARD_DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ });
+
+// An external application object with a label identifier and one other field.
+const OBJECT_METADATA = {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
+ labelIdentifierFieldMetadataUniversalIdentifier:
+ LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ fieldUniversalIdentifiers: [
+ LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ ],
+ labelSingular: 'Listing',
+ isRemote: false,
+};
+
+const LABEL_FIELD_METADATA = {
+ universalIdentifier: LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'name',
+ type: FieldMetadataType.TEXT,
+};
+
+const OTHER_FIELD_METADATA = {
+ universalIdentifier: OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
+ name: 'price',
+ type: FieldMetadataType.NUMBER,
+};
+
+const buildByUniversalIdentifierMap = <
+ T extends { universalIdentifier: string },
+>(
+ flatEntities: T[],
+) => ({
+ byUniversalIdentifier: Object.fromEntries(
+ flatEntities.map((flatEntity) => [
+ flatEntity.universalIdentifier,
+ flatEntity,
+ ]),
+ ),
+});
+
+const isDefinedOperations = (
+ args: {
+ allFlatEntityOperationByMetadataName: Record<
+ string,
+ { flatEntityToCreate: unknown[] } | undefined
+ >;
+ },
+ metadataName: string,
+) =>
+ (args.allFlatEntityOperationByMetadataName[metadataName]?.flatEntityToCreate
+ .length ?? 0) > 0;
+
+const buildStandardMaps = ({
+ views = [] as { universalIdentifier: string }[],
+ viewFields = [] as { universalIdentifier: string }[],
+ viewFieldGroups = [] as { universalIdentifier: string }[],
+ pageLayouts = [] as { universalIdentifier: string }[],
+ pageLayoutTabs = [] as { universalIdentifier: string }[],
+ pageLayoutWidgets = [] as { universalIdentifier: string }[],
+} = {}) => ({
+ allFlatEntityMaps: {
+ flatViewMaps: buildByUniversalIdentifierMap(views),
+ flatViewFieldMaps: buildByUniversalIdentifierMap(viewFields),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap(viewFieldGroups),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap(pageLayouts),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap(pageLayoutTabs),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap(pageLayoutWidgets),
+ },
+});
+
+describe('BackfillRecordPageCommand', () => {
+ let command: BackfillRecordPageCommand;
+ let getOrRecomputeMock: jest.Mock;
+ let validateBuildAndRunLegacyWorkspaceMigrationMock: jest.Mock;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+
+ computeStandardMapsMock.mockReturnValue(buildStandardMaps());
+
+ getOrRecomputeMock = jest.fn();
+ validateBuildAndRunLegacyWorkspaceMigrationMock = jest
+ .fn()
+ .mockResolvedValue({ status: 'success' });
+
+ command = new BackfillRecordPageCommand(
+ {} as WorkspaceIteratorService,
+ {
+ getOrRecompute: getOrRecomputeMock,
+ } as unknown as WorkspaceCacheService,
+ {
+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest
+ .fn()
+ .mockResolvedValue({
+ twentyStandardFlatApplication: {
+ id: '20202020-0000-4000-8000-00000000ad1d',
+ universalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ workspaceCustomFlatApplication: {
+ universalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ }),
+ } as unknown as ApplicationService,
+ {
+ validateBuildAndRunLegacyWorkspaceMigration:
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ } as unknown as WorkspaceMigrationValidateBuildAndRunService,
+ );
+ });
+
+ const mockWorkspaceCache = ({
+ objectMetadatas = [OBJECT_METADATA],
+ views = [] as {
+ universalIdentifier: string;
+ type: ViewType;
+ deletedAt?: string | null;
+ objectMetadataUniversalIdentifier: string;
+ }[],
+ viewFields = [] as { universalIdentifier: string }[],
+ viewFieldGroups = [] as { universalIdentifier: string }[],
+ pageLayouts = [] as {
+ universalIdentifier: string;
+ type: PageLayoutType;
+ deletedAt?: string | null;
+ objectMetadataUniversalIdentifier: string | null;
+ }[],
+ fieldMetadatas = [LABEL_FIELD_METADATA, OTHER_FIELD_METADATA],
+ } = {}) => {
+ getOrRecomputeMock.mockResolvedValue({
+ flatViewMaps: buildByUniversalIdentifierMap(
+ views.map((view) => ({ deletedAt: null, ...view })),
+ ),
+ flatViewFieldMaps: buildByUniversalIdentifierMap(viewFields),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap(viewFieldGroups),
+ flatObjectMetadataMaps: buildByUniversalIdentifierMap(objectMetadatas),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap(fieldMetadatas),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap(
+ pageLayouts.map((pageLayout) => ({ deletedAt: null, ...pageLayout })),
+ ),
+ });
+ };
+
+ const runOnWorkspace = (dryRun = false) =>
+ command.runOnWorkspace({
+ workspaceId: WORKSPACE_ID,
+ options: { dryRun },
+ index: 0,
+ total: 1,
+ });
+
+ it('backfills the full record-page stack for an application object without one', async () => {
+ mockWorkspaceCache();
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).toHaveBeenCalledTimes(2);
+
+ const [viewRun, restRun] =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls.map(
+ ([args]) => args,
+ );
+
+ expect(viewRun.applicationUniversalIdentifier).toBe(
+ EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER,
+ );
+ const [createdView] =
+ viewRun.allFlatEntityOperationByMetadataName.view.flatEntityToCreate;
+
+ expect(createdView).toMatchObject({
+ universalIdentifier: DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ key: null,
+ type: ViewType.FIELDS_WIDGET,
+ isSystemSideEffect: true,
+ });
+
+ const {
+ viewField: viewFieldOperations,
+ pageLayout: pageLayoutOperations,
+ pageLayoutTab: pageLayoutTabOperations,
+ pageLayoutWidget: pageLayoutWidgetOperations,
+ } = restRun.allFlatEntityOperationByMetadataName;
+
+ // The label identifier is excluded from the record page.
+ expect(viewFieldOperations.flatEntityToCreate).toHaveLength(1);
+ expect(viewFieldOperations.flatEntityToCreate[0]).toMatchObject({
+ fieldMetadataUniversalIdentifier: OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier: DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: true,
+ });
+ expect(pageLayoutOperations.flatEntityToCreate).toHaveLength(1);
+ expect(pageLayoutTabOperations.flatEntityToCreate).toHaveLength(5);
+ expect(pageLayoutWidgetOperations.flatEntityToCreate).toHaveLength(5);
+ });
+
+ // Caller-defined custom record pages coexist with the system stack: the
+ // backfill still provisions the system one.
+ it('still backfills the system stack when the object carries a caller-authored record-page stack', async () => {
+ mockWorkspaceCache({
+ views: [
+ {
+ universalIdentifier: 'app-authored-view-uid',
+ type: ViewType.FIELDS_WIDGET,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ pageLayouts: [
+ {
+ universalIdentifier: 'app-authored-layout-uid',
+ type: PageLayoutType.RECORD_PAGE,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).toHaveBeenCalledTimes(2);
+
+ const [viewRun] =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls.map(
+ ([args]) => args,
+ );
+ const [createdView] =
+ viewRun.allFlatEntityOperationByMetadataName.view.flatEntityToCreate;
+
+ expect(createdView.universalIdentifier).toBe(
+ DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+ });
+
+ it('backfills the engine default stack for a workspace-custom object without one', async () => {
+ mockWorkspaceCache({
+ objectMetadatas: [
+ {
+ ...OBJECT_METADATA,
+ applicationUniversalIdentifier:
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ fieldMetadatas: [
+ {
+ ...LABEL_FIELD_METADATA,
+ applicationUniversalIdentifier:
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ {
+ ...OTHER_FIELD_METADATA,
+ applicationUniversalIdentifier:
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).toHaveBeenCalledTimes(2);
+
+ const [viewRun] =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls.map(
+ ([args]) => args,
+ );
+
+ expect(viewRun.applicationUniversalIdentifier).toBe(
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ );
+ });
+
+ it('backfills the curated standard stack for a standard object without one', async () => {
+ const curatedViewFieldUniversalIdentifier =
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ });
+
+ computeStandardMapsMock.mockReturnValue(
+ buildStandardMaps({
+ views: [
+ {
+ universalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ viewFields: [
+ {
+ universalIdentifier: curatedViewFieldUniversalIdentifier,
+ viewUniversalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ } as never,
+ ],
+ viewFieldGroups: [
+ {
+ universalIdentifier: 'standard-group-uid',
+ viewUniversalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ } as never,
+ ],
+ pageLayouts: [
+ {
+ universalIdentifier:
+ STANDARD_DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ pageLayoutTabs: [
+ {
+ universalIdentifier: 'standard-tab-uid',
+ pageLayoutUniversalIdentifier:
+ STANDARD_DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ } as never,
+ ],
+ pageLayoutWidgets: [
+ {
+ universalIdentifier: 'standard-widget-uid',
+ pageLayoutTabUniversalIdentifier: 'standard-tab-uid',
+ universalConfiguration: {
+ configurationType: WidgetConfigurationType.FIELDS,
+ },
+ } as never,
+ {
+ universalIdentifier: 'standard-orphan-field-widget-uid',
+ pageLayoutTabUniversalIdentifier: 'standard-tab-uid',
+ universalConfiguration: {
+ configurationType: WidgetConfigurationType.FIELD,
+ fieldMetadataId: 'missing-field-uid',
+ },
+ } as never,
+ ],
+ }),
+ );
+
+ mockWorkspaceCache({
+ objectMetadatas: [
+ {
+ ...OBJECT_METADATA,
+ applicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ fieldMetadatas: [
+ {
+ ...LABEL_FIELD_METADATA,
+ applicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ {
+ ...OTHER_FIELD_METADATA,
+ applicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).toHaveBeenCalledTimes(2);
+
+ const [viewRun, restRun] =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls.map(
+ ([args]) => args,
+ );
+
+ expect(viewRun.applicationUniversalIdentifier).toBe(
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ );
+ expect(
+ viewRun.allFlatEntityOperationByMetadataName.view.flatEntityToCreate[0]
+ .universalIdentifier,
+ ).toBe(STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER);
+
+ const {
+ viewField: viewFieldOperations,
+ viewFieldGroup: viewFieldGroupOperations,
+ pageLayout: pageLayoutOperations,
+ pageLayoutTab: pageLayoutTabOperations,
+ pageLayoutWidget: pageLayoutWidgetOperations,
+ } = restRun.allFlatEntityOperationByMetadataName;
+
+ // The curated view field covers the only displayable non-label field, so
+ // the generated top-up adds nothing on top of it.
+ expect(viewFieldOperations.flatEntityToCreate).toHaveLength(1);
+ expect(viewFieldOperations.flatEntityToCreate[0].universalIdentifier).toBe(
+ curatedViewFieldUniversalIdentifier,
+ );
+ expect(viewFieldGroupOperations.flatEntityToCreate).toHaveLength(1);
+ expect(pageLayoutOperations.flatEntityToCreate).toHaveLength(1);
+ expect(pageLayoutTabOperations.flatEntityToCreate).toHaveLength(1);
+ // The FIELD widget pointing at a field absent from the workspace is
+ // dropped, like the standard sync does.
+ expect(pageLayoutWidgetOperations.flatEntityToCreate).toHaveLength(1);
+ expect(
+ pageLayoutWidgetOperations.flatEntityToCreate[0].universalIdentifier,
+ ).toBe('standard-widget-uid');
+ });
+
+ it('buckets the view field of an app-contributed field under the contributing application', async () => {
+ mockWorkspaceCache({
+ fieldMetadatas: [
+ LABEL_FIELD_METADATA,
+ {
+ ...OTHER_FIELD_METADATA,
+ applicationUniversalIdentifier:
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ const contributedViewFieldRun =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls
+ .map(([args]) => args)
+ .find(
+ (args) =>
+ args.applicationUniversalIdentifier ===
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER &&
+ isDefinedOperations(args, 'viewField'),
+ );
+
+ expect(contributedViewFieldRun).toBeDefined();
+
+ const [contributedViewField] =
+ contributedViewFieldRun.allFlatEntityOperationByMetadataName.viewField
+ .flatEntityToCreate;
+
+ expect(contributedViewField).toMatchObject({
+ fieldMetadataUniversalIdentifier: OTHER_FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ });
+ });
+
+ it('tops up missing curated view field groups on an already-committed standard view (retry safety)', async () => {
+ computeStandardMapsMock.mockReturnValue(
+ buildStandardMaps({
+ views: [
+ {
+ universalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ viewFieldGroups: [
+ {
+ universalIdentifier: 'standard-group-uid',
+ viewUniversalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ } as never,
+ ],
+ pageLayouts: [
+ {
+ universalIdentifier:
+ STANDARD_DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ mockWorkspaceCache({
+ objectMetadatas: [
+ {
+ ...OBJECT_METADATA,
+ applicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ fieldMetadatas: [],
+ views: [
+ {
+ universalIdentifier: STANDARD_DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ type: ViewType.FIELDS_WIDGET,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ const groupRun = validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls
+ .map(([args]) => args)
+ .find((args) => isDefinedOperations(args, 'viewFieldGroup'));
+
+ expect(groupRun).toBeDefined();
+ expect(groupRun.allFlatEntityOperationByMetadataName.view).toBeUndefined();
+ expect(
+ groupRun.allFlatEntityOperationByMetadataName.viewFieldGroup
+ .flatEntityToCreate,
+ ).toEqual([
+ expect.objectContaining({ universalIdentifier: 'standard-group-uid' }),
+ ]);
+ });
+
+ it('leaves a standard object without curated record page untouched, like fresh installs', async () => {
+ mockWorkspaceCache({
+ objectMetadatas: [
+ {
+ ...OBJECT_METADATA,
+ applicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).not.toHaveBeenCalled();
+ });
+
+ it('still backfills the missing view fields and layout of an already-committed view (retry safety)', async () => {
+ // A view under the DERIVED identifier is a partial artifact of a previous
+ // (partially failed) run, not a caller-authored stack.
+ mockWorkspaceCache({
+ views: [
+ {
+ universalIdentifier: DERIVED_VIEW_UNIVERSAL_IDENTIFIER,
+ type: ViewType.FIELDS_WIDGET,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).toHaveBeenCalledTimes(1);
+
+ const [restRun] =
+ validateBuildAndRunLegacyWorkspaceMigrationMock.mock.calls.map(
+ ([args]) => args,
+ );
+
+ expect(restRun.allFlatEntityOperationByMetadataName.view).toBeUndefined();
+ expect(
+ restRun.allFlatEntityOperationByMetadataName.viewField.flatEntityToCreate,
+ ).toHaveLength(1);
+ expect(
+ restRun.allFlatEntityOperationByMetadataName.pageLayout
+ .flatEntityToCreate,
+ ).toHaveLength(1);
+ });
+
+ it('performs no write in dry-run mode', async () => {
+ mockWorkspaceCache();
+
+ await runOnWorkspace(true);
+
+ expect(
+ validateBuildAndRunLegacyWorkspaceMigrationMock,
+ ).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.spec.ts
similarity index 98%
rename from packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts
rename to packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.spec.ts
index 14b3f66dbcf..f8a8a525ad5 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command.spec.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.spec.ts
@@ -1,7 +1,7 @@
import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
-import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786353778242-add-calendar-event-call-recording-tab.command';
+import { AddCalendarEventCallRecordingTabCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.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 { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
@@ -39,7 +39,9 @@ const TRANSCRIPT_WIDGET_UNIVERSAL_IDENTIFIER =
const buildByUniversalIdentifierMap = <
T extends { universalIdentifier: string },
->(flatEntities: T[]) => ({
+>(
+ flatEntities: T[],
+) => ({
byUniversalIdentifier: Object.fromEntries(
flatEntities.map((flatEntity) => [
flatEntity.universalIdentifier,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup.ts
new file mode 100644
index 00000000000..c691ed74bf0
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup.ts
@@ -0,0 +1,189 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemPageLayoutTabUniversalIdentifier,
+ getSystemPageLayoutWidgetUniversalIdentifier,
+ getSystemRecordPageLayoutUniversalIdentifier,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+ getSystemViewFieldGroupUniversalIdentifier,
+} from 'twenty-shared/application';
+import { ViewKey } from 'twenty-shared/types';
+
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+
+export const WORKSPACE_ID = '20202020-0000-4000-8000-000000000001';
+export const STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000ad';
+export const STANDARD_APPLICATION_ID = 'standard-application-db-id';
+export const CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000aa';
+export const CUSTOM_APPLICATION_ID = 'custom-application-db-id';
+export const EXTERNAL_APPLICATION_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000ae';
+export const FIELD_UNIVERSAL_IDENTIFIER =
+ '20202020-0000-4000-8000-0000000000cc';
+
+export const buildDerivedRecordPageStackUniversalIdentifiers = ({
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier,
+ fieldApplicationUniversalIdentifier = applicationUniversalIdentifier,
+ fieldUniversalIdentifier = FIELD_UNIVERSAL_IDENTIFIER,
+}: {
+ applicationUniversalIdentifier: string;
+ objectUniversalIdentifier: string;
+ fieldApplicationUniversalIdentifier?: string;
+ fieldUniversalIdentifier?: string;
+}) => {
+ const pageLayout = getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier,
+ });
+ const homeTab = getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ pageLayoutUniversalIdentifier: pageLayout,
+ title: 'Home',
+ });
+ const fieldsWidget = getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ pageLayoutTabUniversalIdentifier: homeTab,
+ title: 'Fields',
+ });
+ const view = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+ const viewField = getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ fieldApplicationUniversalIdentifier,
+ viewUniversalIdentifier: view,
+ fieldMetadataUniversalIdentifier: fieldUniversalIdentifier,
+ });
+ const generalGroup = getSystemViewFieldGroupUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ viewUniversalIdentifier: view,
+ name: 'General',
+ });
+
+ return { pageLayout, homeTab, fieldsWidget, view, viewField, generalGroup };
+};
+
+// An underived pre-2.31 stack: v4 identifiers everywhere, no key.
+export const buildUnderivedRecordPageStack = ({
+ idPrefix,
+ objectUniversalIdentifier,
+ applicationUniversalIdentifier,
+ isSystemSideEffect = true,
+ withGroup = false,
+}: {
+ idPrefix: string;
+ objectUniversalIdentifier: string;
+ applicationUniversalIdentifier: string;
+ isSystemSideEffect?: boolean;
+ withGroup?: boolean;
+}) => {
+ const view = {
+ id: `${idPrefix}-view-db-id`,
+ universalIdentifier: `${idPrefix}-view-universal-identifier`,
+ key: null as ViewKey | null,
+ isSystemSideEffect,
+ deletedAt: null as string | null,
+ objectMetadataUniversalIdentifier: objectUniversalIdentifier,
+ applicationUniversalIdentifier,
+ viewFieldUniversalIdentifiers: [
+ `${idPrefix}-view-field-universal-identifier`,
+ ],
+ viewFieldGroupUniversalIdentifiers: withGroup
+ ? [`${idPrefix}-group-universal-identifier`]
+ : [],
+ };
+
+ const viewField = {
+ id: `${idPrefix}-view-field-db-id`,
+ universalIdentifier: `${idPrefix}-view-field-universal-identifier`,
+ fieldMetadataUniversalIdentifier: FIELD_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: false,
+ deletedAt: null as string | null,
+ applicationUniversalIdentifier,
+ };
+
+ const viewFieldGroup = {
+ id: `${idPrefix}-group-db-id`,
+ universalIdentifier: `${idPrefix}-group-universal-identifier`,
+ name: 'General',
+ isSystemSideEffect: false,
+ deletedAt: null as string | null,
+ applicationUniversalIdentifier,
+ };
+
+ const fieldsWidget = {
+ id: `${idPrefix}-widget-db-id`,
+ universalIdentifier: `${idPrefix}-widget-universal-identifier`,
+ title: 'Fields',
+ isSystemSideEffect,
+ deletedAt: null as string | null,
+ applicationUniversalIdentifier,
+ configuration: {
+ configurationType: WidgetConfigurationType.FIELDS,
+ viewId: view.id,
+ newFieldDefaultVisibility: true,
+ },
+ };
+
+ const homeTab = {
+ id: `${idPrefix}-tab-db-id`,
+ universalIdentifier: `${idPrefix}-tab-universal-identifier`,
+ title: 'Home',
+ isSystemSideEffect,
+ deletedAt: null as string | null,
+ applicationUniversalIdentifier,
+ widgetUniversalIdentifiers: [fieldsWidget.universalIdentifier],
+ };
+
+ const pageLayout = {
+ id: `${idPrefix}-page-layout-db-id`,
+ universalIdentifier: `${idPrefix}-page-layout-universal-identifier`,
+ type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect,
+ deletedAt: null as string | null,
+ objectMetadataUniversalIdentifier: objectUniversalIdentifier,
+ applicationUniversalIdentifier,
+ tabUniversalIdentifiers: [homeTab.universalIdentifier],
+ };
+
+ return {
+ pageLayout,
+ homeTab,
+ fieldsWidget,
+ view,
+ viewField,
+ viewFieldGroup: withGroup ? viewFieldGroup : undefined,
+ };
+};
+
+export type FlatEntityFixture = {
+ universalIdentifier: string;
+ id?: string;
+} & Record<string, unknown>;
+
+export const buildByUniversalIdentifierMap = <T extends FlatEntityFixture>(
+ flatEntities: T[],
+) => ({
+ byUniversalIdentifier: Object.fromEntries(
+ flatEntities.map((flatEntity) => [
+ flatEntity.universalIdentifier,
+ flatEntity,
+ ]),
+ ),
+ universalIdentifierById: Object.fromEntries(
+ flatEntities
+ .filter((flatEntity) => flatEntity.id !== undefined)
+ .map((flatEntity) => [flatEntity.id, flatEntity.universalIdentifier]),
+ ),
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/add-is-system-side-effect-to-view-field-group-upgrade-command-name.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/add-is-system-side-effect-to-view-field-group-upgrade-command-name.constant.ts
new file mode 100644
index 00000000000..4d6a681f850
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/add-is-system-side-effect-to-view-field-group-upgrade-command-name.constant.ts
@@ -0,0 +1,2 @@
+export const ADD_IS_SYSTEM_SIDE_EFFECT_TO_VIEW_FIELD_GROUP_UPGRADE_COMMAND_NAME =
+ '2.31.0_AddIsSystemSideEffectToViewFieldGroupFastInstanceCommand_1786437480000';
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.ts
new file mode 100644
index 00000000000..3e25cc07a56
--- /dev/null
+++ 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
@@ -0,0 +1,56 @@
+import {
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
+} from 'twenty-shared/metadata';
+
+import { PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER } from 'src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant';
+
+// 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[] = [];
+
+describe('PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER', () => {
+ // A missing entry would make the standard reconcile silently skip that
+ // curated stack, and the backfill would then create a duplicate one.
+ it('covers every pre-2.31 standard record-page layout', () => {
+ const recordPageObjectNames = Object.keys(
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
+ )
+ .filter((key) => key.endsWith('RecordPage'))
+ .filter((key) => !POST_2_28_RECORD_PAGE_KEYS.includes(key))
+ .map((key) => key.slice(0, -'RecordPage'.length));
+
+ expect(recordPageObjectNames.length).toBeGreaterThan(0);
+
+ for (const objectName of recordPageObjectNames) {
+ const objectUniversalIdentifier =
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS[
+ objectName as keyof typeof STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS
+ ];
+
+ expect(objectUniversalIdentifier).toBeDefined();
+ expect(
+ PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER[
+ objectUniversalIdentifier
+ ],
+ ).toBeDefined();
+ }
+ });
+
+ it('holds no derived identifier: every literal predates the derivation', () => {
+ const derivedLayoutUniversalIdentifiers = new Set(
+ Object.values(STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS).map(
+ (pageLayout) => pageLayout.universalIdentifier,
+ ),
+ );
+
+ for (const pre228LayoutUniversalIdentifier of Object.values(
+ PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER,
+ )) {
+ expect(
+ derivedLayoutUniversalIdentifiers.has(pre228LayoutUniversalIdentifier),
+ ).toBe(false);
+ }
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.ts
new file mode 100644
index 00000000000..602e4ae829e
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/constants/pre-2-31-standard-record-page-layout-universal-identifier-by-object-universal-identifier.constant.ts
@@ -0,0 +1,53 @@
+import { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
+
+// The pre-2.31 pinned universal identifiers of the 20 curated standard
+// record-page layouts, keyed by their object. The 2-31 record-page re-own
+// derives layout identifiers from the object, so these literals were removed
+// from the shared constants; the standard reconcile command still needs them
+// to locate the curated layout row of each standard object in workspaces that
+// predate the derivation. Frozen: never mutate these values.
+export const PRE_2_31_STANDARD_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER_BY_OBJECT_UNIVERSAL_IDENTIFIER: Record<
+ string,
+ string
+> = {
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company]:
+ '20202020-a101-4001-8001-c0aba11c0001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.person]:
+ '20202020-a102-4002-8002-ae0a1ea11002',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity]:
+ '20202020-a103-4003-8003-0aa0b1ca1003',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.note]:
+ '20202020-a104-4004-8004-a0be5a11a004',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.task]:
+ '20202020-a105-4005-8005-ba5ca11a1005',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflow]:
+ '20202020-a106-4006-8006-a0bcf10aa006',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowVersion]:
+ '20202020-a107-4007-8007-a0bcf10ab007',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowRun]:
+ '20202020-a108-4008-8008-a0bcf10ac008',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.blocklist]:
+ '20202020-a109-4009-8009-b10c115b0001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarChannelEventAssociation]:
+ '20202020-a10b-400b-800b-ca1c4e0b0001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEvent]:
+ 'b9b10e40-9ce2-4704-8ac6-c6e92e2563c1',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEventParticipant]:
+ '20202020-a10c-400c-800c-ca1e0a0c0001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.callRecording]:
+ 'fa475fb3-3fe4-4ab8-8320-495eba5b2e58',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociation]:
+ '20202020-a111-4011-8011-a5c4a5110001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociationMessageFolder]:
+ '20202020-a112-4012-8012-a5c4a6120001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageParticipant]:
+ '20202020-a114-4014-8014-a5ea10140001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowAutomatedTrigger]:
+ '20202020-a115-4015-8015-a0bcf1150001',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageThread]:
+ '20202020-95bb-40eb-a699-70e7ea02a79e',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageList]:
+ 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f60',
+ [STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageCampaign]:
+ '8704b091-94bd-4f8f-82b1-e2f3eab92217',
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type.ts
new file mode 100644
index 00000000000..ab6e44a2791
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type.ts
@@ -0,0 +1,17 @@
+export type RecordPageReownUpdate = {
+ id: string;
+ update: {
+ universalIdentifier?: string;
+ isSystemSideEffect?: boolean;
+ applicationId?: string;
+ };
+};
+
+export type RecordPageReownUpdates = {
+ pageLayoutUpdates: RecordPageReownUpdate[];
+ pageLayoutTabUpdates: RecordPageReownUpdate[];
+ pageLayoutWidgetUpdates: RecordPageReownUpdate[];
+ viewUpdates: RecordPageReownUpdate[];
+ viewFieldUpdates: RecordPageReownUpdate[];
+ viewFieldGroupUpdates: RecordPageReownUpdate[];
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts
index 15e0aa4e980..fedd4f11c91 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-call-recording-tab-position.util.spec.ts
@@ -73,7 +73,10 @@ describe('computeCallRecordingTabPosition', () => {
expect(
computeCallRecordingTabPosition({
existingPageLayoutTabs: [
- buildPageLayoutTab({ universalIdentifier: 'custom-tab', position: 50 }),
+ buildPageLayoutTab({
+ universalIdentifier: 'custom-tab',
+ position: 50,
+ }),
],
}),
).toBe(60);
@@ -86,7 +89,10 @@ describe('computeCallRecordingTabPosition', () => {
position: 10,
isActive: false,
}),
- buildPageLayoutTab({ universalIdentifier: 'custom-tab', position: 20 }),
+ buildPageLayoutTab({
+ universalIdentifier: 'custom-tab',
+ position: 20,
+ }),
],
}),
).toBe(30);
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-record-page-stack-reown-updates.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-record-page-stack-reown-updates.util.spec.ts
new file mode 100644
index 00000000000..e106de757b3
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/__tests__/compute-record-page-stack-reown-updates.util.spec.ts
@@ -0,0 +1,346 @@
+import { getSystemRecordPageLayoutUniversalIdentifier } from 'twenty-shared/application';
+
+import {
+ buildByUniversalIdentifierMap,
+ buildUnderivedRecordPageStack,
+ CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ FIELD_UNIVERSAL_IDENTIFIER,
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ WORKSPACE_ID,
+} from 'src/database/commands/upgrade-version-command/2-31/__tests__/record-page-reconcile-test-setup';
+import { computeRecordPageStackReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util';
+import { countRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util';
+
+const OBJECT_UNIVERSAL_IDENTIFIER = '20202020-0000-4000-8000-0000000000bb';
+
+const OBJECT_METADATA = {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const FIELD_METADATA = {
+ universalIdentifier: FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+const DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ });
+
+describe('computeRecordPageStackReownUpdates', () => {
+ let warnMock: jest.Mock;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+ warnMock = jest.fn();
+ });
+
+ const buildStack = () =>
+ buildUnderivedRecordPageStack({
+ idPrefix: 'stack',
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ withGroup: true,
+ });
+
+ const runCompute = ({
+ stack,
+ extraTabs = [] as Record<string, unknown>[],
+ extraWidgets = [] as Record<string, unknown>[],
+ extraViews = [] as Record<string, unknown>[],
+ fieldMetadatas = [FIELD_METADATA],
+ pageLayoutOverride = {} as Record<string, unknown>,
+ }: {
+ stack: ReturnType<typeof buildStack>;
+ extraTabs?: Record<string, unknown>[];
+ extraWidgets?: Record<string, unknown>[];
+ extraViews?: Record<string, unknown>[];
+ fieldMetadatas?: Record<string, unknown>[];
+ pageLayoutOverride?: Record<string, unknown>;
+ }) => {
+ const flatPageLayout = {
+ ...stack.pageLayout,
+ ...pageLayoutOverride,
+ };
+
+ return computeRecordPageStackReownUpdates({
+ workspaceId: WORKSPACE_ID,
+ logger: { warn: warnMock },
+ flatObjectMetadata: OBJECT_METADATA,
+ flatPageLayout,
+ derivedPageLayoutUniversalIdentifier:
+ DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ engineOwnedApplicationUniversalIdentifiers: new Set([
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ ]),
+ twentyStandardApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ flatViewMaps: buildByUniversalIdentifierMap([
+ stack.view,
+ ...extraViews,
+ ] as never),
+ flatViewFieldMaps: buildByUniversalIdentifierMap([
+ stack.viewField,
+ ] as never),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap(
+ stack.viewFieldGroup ? ([stack.viewFieldGroup] as never) : [],
+ ),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap(
+ fieldMetadatas as never,
+ ),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap([
+ flatPageLayout,
+ ] as never),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap([
+ stack.homeTab,
+ ...extraTabs,
+ ] as never),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap([
+ stack.fieldsWidget,
+ ...extraWidgets,
+ ] as never),
+ } as never);
+ };
+
+ it('re-owns the full underived stack without warnings', () => {
+ const stack = buildStack();
+
+ const reownUpdates = runCompute({ stack });
+
+ expect(warnMock).not.toHaveBeenCalled();
+ expect(reownUpdates.pageLayoutUpdates).toHaveLength(1);
+ expect(reownUpdates.pageLayoutTabUpdates).toHaveLength(1);
+ expect(reownUpdates.pageLayoutWidgetUpdates).toHaveLength(1);
+ expect(reownUpdates.viewUpdates).toHaveLength(1);
+ expect(reownUpdates.viewFieldUpdates).toHaveLength(1);
+ expect(reownUpdates.viewFieldGroupUpdates).toHaveLength(1);
+ });
+
+ it('skips the second tab claiming the same title with a warning', () => {
+ const stack = buildStack();
+ const duplicateTab = {
+ ...stack.homeTab,
+ id: 'duplicate-tab-db-id',
+ universalIdentifier: 'duplicate-tab-universal-identifier',
+ widgetUniversalIdentifiers: [],
+ };
+
+ stack.pageLayout.tabUniversalIdentifiers.push(
+ duplicateTab.universalIdentifier,
+ );
+
+ const reownUpdates = runCompute({ stack, extraTabs: [duplicateTab] });
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining('Duplicate tab title "Home"'),
+ );
+ expect(reownUpdates.pageLayoutTabUpdates).toHaveLength(1);
+ expect(reownUpdates.pageLayoutTabUpdates[0].id).toBe(stack.homeTab.id);
+ });
+
+ it('skips the second widget claiming the same title on a tab with a warning', () => {
+ const stack = buildStack();
+ const duplicateWidget = {
+ ...stack.fieldsWidget,
+ id: 'duplicate-widget-db-id',
+ universalIdentifier: 'duplicate-widget-universal-identifier',
+ };
+
+ stack.homeTab.widgetUniversalIdentifiers.push(
+ duplicateWidget.universalIdentifier,
+ );
+
+ const reownUpdates = runCompute({ stack, extraWidgets: [duplicateWidget] });
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining('Duplicate widget title "Fields"'),
+ );
+ expect(reownUpdates.pageLayoutWidgetUpdates).toHaveLength(1);
+ expect(reownUpdates.pageLayoutWidgetUpdates[0].id).toBe(
+ stack.fieldsWidget.id,
+ );
+ });
+
+ it('warns on a dangling FIELDS widget view and skips the view branch', () => {
+ const stack = buildStack();
+
+ stack.fieldsWidget.configuration.viewId = 'unknown-view-db-id';
+
+ const reownUpdates = runCompute({ stack });
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining('Dangling FIELDS widget view unknown-view-db-id'),
+ );
+ expect(reownUpdates.viewUpdates).toHaveLength(0);
+ expect(reownUpdates.viewFieldUpdates).toHaveLength(0);
+ // The widget itself is still re-owned.
+ expect(reownUpdates.pageLayoutWidgetUpdates).toHaveLength(1);
+ });
+
+ it('warns and skips a view field whose displayed field is missing', () => {
+ const stack = buildStack();
+
+ const reownUpdates = runCompute({ stack, fieldMetadatas: [] });
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining(
+ `Missing field for record-page view field ${stack.viewField.id}`,
+ ),
+ );
+ expect(reownUpdates.viewFieldUpdates).toHaveLength(0);
+ expect(reownUpdates.viewUpdates).toHaveLength(1);
+ });
+
+ it('warns and skips a row whose derived identifier is already held by another row', () => {
+ const stack = buildStack();
+ const identifierHolderView = {
+ ...stack.view,
+ id: 'holder-view-db-id',
+ universalIdentifier: 'holder-view-universal-identifier',
+ viewFieldUniversalIdentifiers: [],
+ viewFieldGroupUniversalIdentifiers: [],
+ };
+
+ // Another row already holds the layout's derived identifier.
+ const reownUpdates = runCompute({
+ stack,
+ extraViews: [identifierHolderView],
+ pageLayoutOverride: {},
+ });
+
+ // Sanity: the standard path stays warning-free; now collide on the layout.
+ expect(warnMock).not.toHaveBeenCalled();
+ expect(countRecordPageReownUpdates(reownUpdates)).toBeGreaterThan(0);
+
+ const collidingLayoutHolder = {
+ id: 'holder-layout-db-id',
+ universalIdentifier: DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ };
+ const collidingStack = buildStack();
+
+ const collidingReownUpdates = computeRecordPageStackReownUpdates({
+ workspaceId: WORKSPACE_ID,
+ logger: { warn: warnMock },
+ flatObjectMetadata: OBJECT_METADATA,
+ flatPageLayout: collidingStack.pageLayout,
+ derivedPageLayoutUniversalIdentifier:
+ DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ engineOwnedApplicationUniversalIdentifiers: new Set([
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ ]),
+ twentyStandardApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ flatViewMaps: buildByUniversalIdentifierMap([
+ collidingStack.view,
+ ] as never),
+ flatViewFieldMaps: buildByUniversalIdentifierMap([
+ collidingStack.viewField,
+ ] as never),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap(
+ collidingStack.viewFieldGroup
+ ? ([collidingStack.viewFieldGroup] as never)
+ : [],
+ ),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap([
+ FIELD_METADATA,
+ ] as never),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap([
+ collidingStack.pageLayout,
+ collidingLayoutHolder,
+ ] as never),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap([
+ collidingStack.homeTab,
+ ] as never),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap([
+ collidingStack.fieldsWidget,
+ ] as never),
+ } as never);
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining(
+ `Derived universal identifier ${DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER} is already held by another row`,
+ ),
+ );
+ expect(collidingReownUpdates.pageLayoutUpdates).toHaveLength(0);
+ });
+
+ it('skips the second standard group claiming the same name with a warning', () => {
+ const stack = buildStack();
+ const duplicateGroup = {
+ ...stack.viewFieldGroup,
+ id: 'duplicate-group-db-id',
+ universalIdentifier: 'duplicate-group-universal-identifier',
+ };
+
+ stack.view.viewFieldGroupUniversalIdentifiers.push(
+ duplicateGroup.universalIdentifier,
+ );
+
+ const reownUpdates = computeRecordPageStackReownUpdates({
+ workspaceId: WORKSPACE_ID,
+ logger: { warn: warnMock },
+ flatObjectMetadata: OBJECT_METADATA,
+ flatPageLayout: stack.pageLayout,
+ derivedPageLayoutUniversalIdentifier:
+ DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ engineOwnedApplicationUniversalIdentifiers: new Set([
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ ]),
+ twentyStandardApplicationUniversalIdentifier:
+ STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ flatViewMaps: buildByUniversalIdentifierMap([stack.view] as never),
+ flatViewFieldMaps: buildByUniversalIdentifierMap([
+ stack.viewField,
+ ] as never),
+ flatViewFieldGroupMaps: buildByUniversalIdentifierMap([
+ stack.viewFieldGroup,
+ duplicateGroup,
+ ] as never),
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap([
+ FIELD_METADATA,
+ ] as never),
+ flatPageLayoutMaps: buildByUniversalIdentifierMap([
+ stack.pageLayout,
+ ] as never),
+ flatPageLayoutTabMaps: buildByUniversalIdentifierMap([
+ stack.homeTab,
+ ] as never),
+ flatPageLayoutWidgetMaps: buildByUniversalIdentifierMap([
+ stack.fieldsWidget,
+ ] as never),
+ } as never);
+
+ expect(warnMock).toHaveBeenCalledWith(
+ expect.stringContaining('Duplicate view field group name "General"'),
+ );
+ expect(reownUpdates.viewFieldGroupUpdates).toHaveLength(1);
+ expect(reownUpdates.viewFieldGroupUpdates[0].id).toBe(
+ stack.viewFieldGroup?.id,
+ );
+ });
+
+ it('leaves app-authored tabs attached to the engine layout untouched', () => {
+ const stack = buildStack();
+ const appAuthoredTab = {
+ ...stack.homeTab,
+ id: 'app-tab-db-id',
+ universalIdentifier: 'app-tab-universal-identifier',
+ title: 'Call Recording',
+ applicationUniversalIdentifier: CUSTOM_APPLICATION_UNIVERSAL_IDENTIFIER,
+ widgetUniversalIdentifiers: [],
+ };
+
+ stack.pageLayout.tabUniversalIdentifiers.push(
+ appAuthoredTab.universalIdentifier,
+ );
+
+ const reownUpdates = runCompute({ stack, extraTabs: [appAuthoredTab] });
+
+ expect(warnMock).not.toHaveBeenCalled();
+ expect(reownUpdates.pageLayoutTabUpdates).toHaveLength(1);
+ expect(reownUpdates.pageLayoutTabUpdates[0].id).toBe(stack.homeTab.id);
+ });
+});
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/apply-record-page-reown-updates.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/apply-record-page-reown-updates.util.ts
new file mode 100644
index 00000000000..8d93e6a19b6
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/apply-record-page-reown-updates.util.ts
@@ -0,0 +1,38 @@
+import { type EntityManager } from 'typeorm';
+
+import { type RecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+import { PageLayoutTabEntity } from 'src/engine/metadata-modules/page-layout-tab/entities/page-layout-tab.entity';
+import { PageLayoutWidgetEntity } from 'src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity';
+import { PageLayoutEntity } from 'src/engine/metadata-modules/page-layout/entities/page-layout.entity';
+import { ViewFieldGroupEntity } from 'src/engine/metadata-modules/view-field-group/entities/view-field-group.entity';
+import { ViewFieldEntity } from 'src/engine/metadata-modules/view-field/entities/view-field.entity';
+import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
+
+export const applyRecordPageReownUpdates = async ({
+ manager,
+ workspaceId,
+ reownUpdates,
+}: {
+ manager: EntityManager;
+ workspaceId: string;
+ reownUpdates: RecordPageReownUpdates;
+}): Promise<void> => {
+ await manager.transaction(async (entityManager) => {
+ const updatesByEntity = [
+ [PageLayoutEntity, reownUpdates.pageLayoutUpdates],
+ [PageLayoutTabEntity, reownUpdates.pageLayoutTabUpdates],
+ [PageLayoutWidgetEntity, reownUpdates.pageLayoutWidgetUpdates],
+ [ViewEntity, reownUpdates.viewUpdates],
+ [ViewFieldEntity, reownUpdates.viewFieldUpdates],
+ [ViewFieldGroupEntity, reownUpdates.viewFieldGroupUpdates],
+ ] as const;
+
+ for (const [entity, updates] of updatesByEntity) {
+ const repository = entityManager.getRepository(entity);
+
+ for (const { id, update } of updates) {
+ await repository.update({ id, workspaceId }, update);
+ }
+ }
+ });
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-flat-entities.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-flat-entities.util.ts
new file mode 100644
index 00000000000..e596e098e30
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-flat-entities.util.ts
@@ -0,0 +1,81 @@
+import { isDefined } from 'twenty-shared/utils';
+
+import { collectRecordPageStackTree } from 'src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-tree.util';
+import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+
+type ApplicationOwnedFlatEntity = {
+ id: string;
+ applicationUniversalIdentifier: string;
+};
+
+export type RecordPageStackFlatEntities = {
+ pageLayouts: ApplicationOwnedFlatEntity[];
+ pageLayoutTabs: ApplicationOwnedFlatEntity[];
+ pageLayoutWidgets: ApplicationOwnedFlatEntity[];
+ views: ApplicationOwnedFlatEntity[];
+ viewFields: ApplicationOwnedFlatEntity[];
+ viewFieldGroups: ApplicationOwnedFlatEntity[];
+};
+
+// Collect one record-page stack (layout, tabs, widgets, the FIELDS widget
+// views, their view fields and groups) as raw rows, soft-deleted excluded.
+// Used by the standard reconcile command to de-own the 1-23-era stacks of
+// workspace-custom objects, which were authored under twenty-standard.
+export const collectRecordPageStackFlatEntities = ({
+ flatPageLayout,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+}: {
+ flatPageLayout: NonNullable<
+ AllFlatEntityMaps['flatPageLayoutMaps']['byUniversalIdentifier'][string]
+ >;
+} & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+>): RecordPageStackFlatEntities => {
+ const stackTree = collectRecordPageStackTree({
+ flatPageLayout,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ const stack: RecordPageStackFlatEntities = {
+ pageLayouts: [flatPageLayout],
+ pageLayoutTabs: [],
+ pageLayoutWidgets: [],
+ views: [],
+ viewFields: [],
+ viewFieldGroups: [],
+ };
+
+ for (const { flatPageLayoutTab, widgets } of stackTree.tabs) {
+ stack.pageLayoutTabs.push(flatPageLayoutTab);
+
+ for (const { flatPageLayoutWidget, fieldsView } of widgets) {
+ stack.pageLayoutWidgets.push(flatPageLayoutWidget);
+
+ if (
+ !isDefined(fieldsView) ||
+ stack.views.some((view) => view.id === fieldsView.flatView.id)
+ ) {
+ continue;
+ }
+
+ stack.views.push(fieldsView.flatView);
+ stack.viewFields.push(...fieldsView.flatViewFields);
+ stack.viewFieldGroups.push(...fieldsView.flatViewFieldGroups);
+ }
+ }
+
+ return stack;
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-tree.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-tree.util.ts
new file mode 100644
index 00000000000..b56b801c36e
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-tree.util.ts
@@ -0,0 +1,167 @@
+import { isDefined } from 'twenty-shared/utils';
+
+import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+
+type FlatPageLayoutFromMaps = NonNullable<
+ AllFlatEntityMaps['flatPageLayoutMaps']['byUniversalIdentifier'][string]
+>;
+type FlatPageLayoutTabFromMaps = NonNullable<
+ AllFlatEntityMaps['flatPageLayoutTabMaps']['byUniversalIdentifier'][string]
+>;
+type FlatPageLayoutWidgetFromMaps = NonNullable<
+ AllFlatEntityMaps['flatPageLayoutWidgetMaps']['byUniversalIdentifier'][string]
+>;
+type FlatViewFromMaps = NonNullable<
+ AllFlatEntityMaps['flatViewMaps']['byUniversalIdentifier'][string]
+>;
+type FlatViewFieldFromMaps = NonNullable<
+ AllFlatEntityMaps['flatViewFieldMaps']['byUniversalIdentifier'][string]
+>;
+type FlatViewFieldGroupFromMaps = NonNullable<
+ AllFlatEntityMaps['flatViewFieldGroupMaps']['byUniversalIdentifier'][string]
+>;
+
+export type RecordPageStackFieldsViewNode = {
+ flatView: FlatViewFromMaps;
+ flatViewFields: FlatViewFieldFromMaps[];
+ flatViewFieldGroups: FlatViewFieldGroupFromMaps[];
+};
+
+export type RecordPageStackWidgetNode = {
+ flatPageLayoutWidget: FlatPageLayoutWidgetFromMaps;
+ // Set on FIELDS widgets whose configured view resolves; a FIELDS widget with
+ // a dangling or absent view keeps fieldsWidgetViewId for the caller to
+ // report. The same view can appear under several FIELDS widgets of one
+ // stack: consumers dedup by view id.
+ fieldsWidgetViewId?: string | null;
+ fieldsView?: RecordPageStackFieldsViewNode;
+};
+
+export type RecordPageStackTabNode = {
+ flatPageLayoutTab: FlatPageLayoutTabFromMaps;
+ widgets: RecordPageStackWidgetNode[];
+};
+
+export type RecordPageStackTree = {
+ flatPageLayout: FlatPageLayoutFromMaps;
+ tabs: RecordPageStackTabNode[];
+};
+
+// Single traversal of one record-page stack: layout, active tabs, active
+// widgets, and each FIELDS widget's resolved view with its active view fields
+// and groups. Soft-deleted rows are excluded at every level. Consumers apply
+// their own ownership filtering and dedup on top.
+export const collectRecordPageStackTree = ({
+ flatPageLayout,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+}: {
+ flatPageLayout: FlatPageLayoutFromMaps;
+} & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+>): RecordPageStackTree => {
+ const tabs: RecordPageStackTabNode[] = [];
+ // Several FIELDS widgets of one stack can reference the same view: the
+ // materialized node is cached so its fields and groups are walked once.
+ const fieldsViewNodeByViewId = new Map<
+ string,
+ RecordPageStackFieldsViewNode
+ >();
+
+ for (const tabUniversalIdentifier of flatPageLayout.tabUniversalIdentifiers) {
+ const flatPageLayoutTab =
+ flatPageLayoutTabMaps.byUniversalIdentifier[tabUniversalIdentifier];
+
+ if (
+ !isDefined(flatPageLayoutTab) ||
+ isDefined(flatPageLayoutTab.deletedAt)
+ ) {
+ continue;
+ }
+
+ const widgets: RecordPageStackWidgetNode[] = [];
+
+ for (const widgetUniversalIdentifier of flatPageLayoutTab.widgetUniversalIdentifiers) {
+ const flatPageLayoutWidget =
+ flatPageLayoutWidgetMaps.byUniversalIdentifier[
+ widgetUniversalIdentifier
+ ];
+
+ if (
+ !isDefined(flatPageLayoutWidget) ||
+ isDefined(flatPageLayoutWidget.deletedAt)
+ ) {
+ continue;
+ }
+
+ if (
+ flatPageLayoutWidget.configuration?.configurationType !==
+ WidgetConfigurationType.FIELDS
+ ) {
+ widgets.push({ flatPageLayoutWidget });
+ continue;
+ }
+
+ const fieldsWidgetViewId = flatPageLayoutWidget.configuration.viewId;
+ const viewUniversalIdentifier = isDefined(fieldsWidgetViewId)
+ ? flatViewMaps.universalIdentifierById[fieldsWidgetViewId]
+ : undefined;
+ const flatView = isDefined(viewUniversalIdentifier)
+ ? flatViewMaps.byUniversalIdentifier[viewUniversalIdentifier]
+ : undefined;
+
+ if (!isDefined(flatView) || isDefined(flatView.deletedAt)) {
+ widgets.push({ flatPageLayoutWidget, fieldsWidgetViewId });
+ continue;
+ }
+
+ let fieldsView = fieldsViewNodeByViewId.get(flatView.id);
+
+ if (!isDefined(fieldsView)) {
+ fieldsView = {
+ flatView,
+ flatViewFields: flatView.viewFieldUniversalIdentifiers
+ .map(
+ (viewFieldUniversalIdentifier) =>
+ flatViewFieldMaps.byUniversalIdentifier[
+ viewFieldUniversalIdentifier
+ ],
+ )
+ .filter(isDefined)
+ .filter((flatViewField) => !isDefined(flatViewField.deletedAt)),
+ flatViewFieldGroups: flatView.viewFieldGroupUniversalIdentifiers
+ .map(
+ (viewFieldGroupUniversalIdentifier) =>
+ flatViewFieldGroupMaps.byUniversalIdentifier[
+ viewFieldGroupUniversalIdentifier
+ ],
+ )
+ .filter(isDefined)
+ .filter(
+ (flatViewFieldGroup) => !isDefined(flatViewFieldGroup.deletedAt),
+ ),
+ };
+ fieldsViewNodeByViewId.set(flatView.id, fieldsView);
+ }
+
+ widgets.push({
+ flatPageLayoutWidget,
+ fieldsWidgetViewId,
+ fieldsView,
+ });
+ }
+
+ tabs.push({ flatPageLayoutTab, widgets });
+ }
+
+ return { flatPageLayout, tabs };
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-reconcile-flat-entity-maps-keys.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-reconcile-flat-entity-maps-keys.util.ts
new file mode 100644
index 00000000000..e178336d9f7
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-reconcile-flat-entity-maps-keys.util.ts
@@ -0,0 +1,28 @@
+import { getMetadataFlatEntityMapsKey } from 'src/engine/metadata-modules/flat-entity/utils/get-metadata-flat-entity-maps-key.util';
+import { getMetadataRelatedMetadataNames } from 'src/engine/metadata-modules/flat-entity/utils/get-metadata-related-metadata-names.util';
+
+// Full flat-maps closure of the re-owned record-page stack: widget universal
+// configurations resolve view primary keys at cache-build time, so the widget
+// maps must be rebuilt together with the view/view-field/group/layout maps.
+export const computeRecordPageReconcileFlatEntityMapsKeys = () => {
+ const reconciledMetadataRelatedNames = [
+ 'view',
+ ...getMetadataRelatedMetadataNames('view'),
+ 'viewField',
+ ...getMetadataRelatedMetadataNames('viewField'),
+ 'viewFieldGroup',
+ ...getMetadataRelatedMetadataNames('viewFieldGroup'),
+ 'pageLayout',
+ ...getMetadataRelatedMetadataNames('pageLayout'),
+ 'pageLayoutTab',
+ ...getMetadataRelatedMetadataNames('pageLayoutTab'),
+ 'pageLayoutWidget',
+ ...getMetadataRelatedMetadataNames('pageLayoutWidget'),
+ ] as const;
+
+ return [
+ ...new Set(
+ reconciledMetadataRelatedNames.map(getMetadataFlatEntityMapsKey),
+ ),
+ ];
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util.ts
new file mode 100644
index 00000000000..daddc4a6e95
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/compute-record-page-stack-reown-updates.util.ts
@@ -0,0 +1,416 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemPageLayoutTabUniversalIdentifier,
+ getSystemPageLayoutWidgetUniversalIdentifier,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+ getSystemViewFieldGroupUniversalIdentifier,
+} from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+
+import {
+ type RecordPageReownUpdate,
+ type RecordPageReownUpdates,
+} from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+import {
+ collectRecordPageStackTree,
+ type RecordPageStackFieldsViewNode,
+} from 'src/database/commands/upgrade-version-command/2-31/utils/collect-record-page-stack-tree.util';
+import { createEmptyRecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util';
+import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+
+type ReownLogger = { warn: (message: string) => void };
+
+type RecordPageStackMaps = Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatFieldMetadataMaps'
+ | 'flatPageLayoutMaps'
+ | 'flatPageLayoutTabMaps'
+ | 'flatPageLayoutWidgetMaps'
+>;
+
+type ComputeRecordPageStackReownUpdatesArgs = {
+ workspaceId: string;
+ logger: ReownLogger;
+ flatObjectMetadata: NonNullable<
+ AllFlatEntityMaps['flatObjectMetadataMaps']['byUniversalIdentifier'][string]
+ >;
+ flatPageLayout: NonNullable<
+ AllFlatEntityMaps['flatPageLayoutMaps']['byUniversalIdentifier'][string]
+ >;
+ derivedPageLayoutUniversalIdentifier: string;
+ engineOwnedApplicationUniversalIdentifiers: Set<string>;
+ twentyStandardApplicationUniversalIdentifier: string;
+} & RecordPageStackMaps;
+
+// Re-own one system record-page stack (layout, tabs, widgets, the FIELDS
+// widget view, its view fields and standard-authored groups) onto the derived
+// identifier scheme, flagging everything isSystemSideEffect. Rows owned by
+// other applications (e.g. app-authored tabs attached to the engine layout)
+// are left untouched. universalIdentifier is unique per workspace including
+// soft-deleted rows, so any derived identifier already held by another row is
+// skipped with a warning instead of aborting the transaction.
+export const computeRecordPageStackReownUpdates = ({
+ workspaceId,
+ logger,
+ flatObjectMetadata,
+ flatPageLayout,
+ derivedPageLayoutUniversalIdentifier,
+ engineOwnedApplicationUniversalIdentifiers,
+ twentyStandardApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ flatPageLayoutMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+}: ComputeRecordPageStackReownUpdatesArgs): RecordPageReownUpdates => {
+ const reownUpdates = createEmptyRecordPageReownUpdates();
+
+ const stackTree = collectRecordPageStackTree({
+ flatPageLayout,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutTabMaps,
+ flatPageLayoutWidgetMaps,
+ });
+
+ pushReownUpdate({
+ workspaceId,
+ logger,
+ updates: reownUpdates.pageLayoutUpdates,
+ flatEntity: flatPageLayout,
+ derivedUniversalIdentifier: derivedPageLayoutUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier: flatPageLayoutMaps.byUniversalIdentifier,
+ });
+
+ const seenDerivedTabUniversalIdentifiers = new Set<string>();
+ const processedViewIds = new Set<string>();
+
+ for (const { flatPageLayoutTab, widgets } of stackTree.tabs) {
+ if (
+ // App-authored tabs attached to the engine layout stay app-owned.
+ !engineOwnedApplicationUniversalIdentifiers.has(
+ flatPageLayoutTab.applicationUniversalIdentifier,
+ )
+ ) {
+ continue;
+ }
+
+ const derivedTabUniversalIdentifier =
+ getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ pageLayoutUniversalIdentifier: derivedPageLayoutUniversalIdentifier,
+ title: flatPageLayoutTab.title,
+ });
+
+ if (seenDerivedTabUniversalIdentifiers.has(derivedTabUniversalIdentifier)) {
+ logger.warn(
+ `Duplicate tab title "${flatPageLayoutTab.title}" on record-page layout ${flatPageLayout.id} in workspace ${workspaceId}, skipping tab ${flatPageLayoutTab.id}`,
+ );
+ continue;
+ }
+ seenDerivedTabUniversalIdentifiers.add(derivedTabUniversalIdentifier);
+
+ pushReownUpdate({
+ workspaceId,
+ logger,
+ updates: reownUpdates.pageLayoutTabUpdates,
+ flatEntity: flatPageLayoutTab,
+ derivedUniversalIdentifier: derivedTabUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier:
+ flatPageLayoutTabMaps.byUniversalIdentifier,
+ });
+
+ const seenDerivedWidgetUniversalIdentifiers = new Set<string>();
+
+ for (const {
+ flatPageLayoutWidget,
+ fieldsWidgetViewId,
+ fieldsView,
+ } of widgets) {
+ if (
+ !engineOwnedApplicationUniversalIdentifiers.has(
+ flatPageLayoutWidget.applicationUniversalIdentifier,
+ )
+ ) {
+ continue;
+ }
+
+ const derivedWidgetUniversalIdentifier =
+ getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ pageLayoutTabUniversalIdentifier: derivedTabUniversalIdentifier,
+ title: flatPageLayoutWidget.title,
+ });
+
+ if (
+ seenDerivedWidgetUniversalIdentifiers.has(
+ derivedWidgetUniversalIdentifier,
+ )
+ ) {
+ logger.warn(
+ `Duplicate widget title "${flatPageLayoutWidget.title}" on tab ${flatPageLayoutTab.id} in workspace ${workspaceId}, skipping widget ${flatPageLayoutWidget.id}`,
+ );
+ continue;
+ }
+ seenDerivedWidgetUniversalIdentifiers.add(
+ derivedWidgetUniversalIdentifier,
+ );
+
+ pushReownUpdate({
+ workspaceId,
+ logger,
+ updates: reownUpdates.pageLayoutWidgetUpdates,
+ flatEntity: flatPageLayoutWidget,
+ derivedUniversalIdentifier: derivedWidgetUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier:
+ flatPageLayoutWidgetMaps.byUniversalIdentifier,
+ });
+
+ if (isDefined(fieldsWidgetViewId) && !isDefined(fieldsView)) {
+ logger.warn(
+ `Dangling FIELDS widget view ${fieldsWidgetViewId} for object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ if (
+ !isDefined(fieldsView) ||
+ processedViewIds.has(fieldsView.flatView.id)
+ ) {
+ continue;
+ }
+ processedViewIds.add(fieldsView.flatView.id);
+
+ computeRecordPageViewReownUpdates({
+ workspaceId,
+ logger,
+ reownUpdates,
+ flatObjectMetadata,
+ fieldsView,
+ twentyStandardApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+ });
+ }
+ }
+
+ return reownUpdates;
+};
+
+const computeRecordPageViewReownUpdates = ({
+ workspaceId,
+ logger,
+ reownUpdates,
+ flatObjectMetadata,
+ fieldsView,
+ twentyStandardApplicationUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatFieldMetadataMaps,
+}: {
+ workspaceId: string;
+ logger: ReownLogger;
+ reownUpdates: RecordPageReownUpdates;
+ flatObjectMetadata: ComputeRecordPageStackReownUpdatesArgs['flatObjectMetadata'];
+ fieldsView: RecordPageStackFieldsViewNode;
+ twentyStandardApplicationUniversalIdentifier: string;
+} & Pick<
+ RecordPageStackMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatFieldMetadataMaps'
+>): void => {
+ const { flatView, flatViewFields, flatViewFieldGroups } = fieldsView;
+
+ const derivedViewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ objectUniversalIdentifier: flatObjectMetadata.universalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ // The view identifier derives from the object alone, so a second view
+ // reached through another FIELDS widget of the same stack cannot take it.
+ const derivedViewIdentifierHolder =
+ flatViewMaps.byUniversalIdentifier[derivedViewUniversalIdentifier];
+
+ if (
+ isDefined(derivedViewIdentifierHolder) &&
+ derivedViewIdentifierHolder.id !== flatView.id
+ ) {
+ logger.warn(
+ `Duplicate FIELDS widget view for object ${flatObjectMetadata.universalIdentifier} in workspace ${workspaceId}, skipping view ${flatView.id}`,
+ );
+
+ return;
+ }
+
+ const viewUpdate: RecordPageReownUpdate['update'] = {};
+
+ if (flatView.universalIdentifier !== derivedViewUniversalIdentifier) {
+ viewUpdate.universalIdentifier = derivedViewUniversalIdentifier;
+ }
+ if (!flatView.isSystemSideEffect) {
+ viewUpdate.isSystemSideEffect = true;
+ }
+
+ if (Object.keys(viewUpdate).length > 0) {
+ reownUpdates.viewUpdates.push({ id: flatView.id, update: viewUpdate });
+ }
+
+ const seenDerivedViewFieldUniversalIdentifiers = new Set<string>();
+
+ for (const flatViewField of flatViewFields) {
+ const flatFieldMetadata =
+ flatFieldMetadataMaps.byUniversalIdentifier[
+ flatViewField.fieldMetadataUniversalIdentifier
+ ];
+
+ if (!isDefined(flatFieldMetadata)) {
+ logger.warn(
+ `Missing field for record-page view field ${flatViewField.id} in workspace ${workspaceId}, skipping`,
+ );
+ continue;
+ }
+
+ const derivedViewFieldUniversalIdentifier =
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ flatFieldMetadata.applicationUniversalIdentifier,
+ viewUniversalIdentifier: derivedViewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier:
+ flatViewField.fieldMetadataUniversalIdentifier,
+ });
+
+ if (
+ seenDerivedViewFieldUniversalIdentifiers.has(
+ derivedViewFieldUniversalIdentifier,
+ )
+ ) {
+ logger.warn(
+ `Duplicate view field for field ${flatViewField.fieldMetadataUniversalIdentifier} on record-page view ${flatView.id} in workspace ${workspaceId}, skipping view field ${flatViewField.id}`,
+ );
+ continue;
+ }
+ seenDerivedViewFieldUniversalIdentifiers.add(
+ derivedViewFieldUniversalIdentifier,
+ );
+
+ pushReownUpdate({
+ workspaceId,
+ logger,
+ updates: reownUpdates.viewFieldUpdates,
+ flatEntity: flatViewField,
+ derivedUniversalIdentifier: derivedViewFieldUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier:
+ flatViewFieldMaps.byUniversalIdentifier,
+ });
+ }
+
+ const seenDerivedViewFieldGroupUniversalIdentifiers = new Set<string>();
+
+ for (const flatViewFieldGroup of flatViewFieldGroups) {
+ if (
+ // User-created groups (CRUD API) keep isSystemSideEffect false and
+ // their own identifier; only standard-authored groups are re-owned.
+ flatViewFieldGroup.applicationUniversalIdentifier !==
+ twentyStandardApplicationUniversalIdentifier
+ ) {
+ continue;
+ }
+
+ const derivedViewFieldGroupUniversalIdentifier =
+ getSystemViewFieldGroupUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ flatObjectMetadata.applicationUniversalIdentifier,
+ viewUniversalIdentifier: derivedViewUniversalIdentifier,
+ name: flatViewFieldGroup.name,
+ });
+
+ if (
+ seenDerivedViewFieldGroupUniversalIdentifiers.has(
+ derivedViewFieldGroupUniversalIdentifier,
+ )
+ ) {
+ logger.warn(
+ `Duplicate view field group name "${flatViewFieldGroup.name}" on record-page view ${flatView.id} in workspace ${workspaceId}, skipping group ${flatViewFieldGroup.id}`,
+ );
+ continue;
+ }
+ seenDerivedViewFieldGroupUniversalIdentifiers.add(
+ derivedViewFieldGroupUniversalIdentifier,
+ );
+
+ pushReownUpdate({
+ workspaceId,
+ logger,
+ updates: reownUpdates.viewFieldGroupUpdates,
+ flatEntity: flatViewFieldGroup,
+ derivedUniversalIdentifier: derivedViewFieldGroupUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier:
+ flatViewFieldGroupMaps.byUniversalIdentifier,
+ });
+ }
+};
+
+const pushReownUpdate = ({
+ workspaceId,
+ logger,
+ updates,
+ flatEntity,
+ derivedUniversalIdentifier,
+ flatEntitiesByUniversalIdentifier,
+}: {
+ workspaceId: string;
+ logger: ReownLogger;
+ updates: RecordPageReownUpdate[];
+ flatEntity: {
+ id: string;
+ universalIdentifier: string;
+ isSystemSideEffect: boolean;
+ };
+ derivedUniversalIdentifier: string;
+ flatEntitiesByUniversalIdentifier: Record<string, { id: string } | undefined>;
+}): void => {
+ const update: RecordPageReownUpdate['update'] = {};
+
+ if (flatEntity.universalIdentifier !== derivedUniversalIdentifier) {
+ const derivedIdentifierHolder =
+ flatEntitiesByUniversalIdentifier[derivedUniversalIdentifier];
+
+ if (
+ isDefined(derivedIdentifierHolder) &&
+ derivedIdentifierHolder.id !== flatEntity.id
+ ) {
+ logger.warn(
+ `Derived universal identifier ${derivedUniversalIdentifier} is already held by another row in workspace ${workspaceId}, skipping ${flatEntity.id}`,
+ );
+
+ return;
+ }
+
+ update.universalIdentifier = derivedUniversalIdentifier;
+ }
+ if (!flatEntity.isSystemSideEffect) {
+ update.isSystemSideEffect = true;
+ }
+
+ if (Object.keys(update).length === 0) {
+ return;
+ }
+
+ updates.push({ id: flatEntity.id, update });
+};
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util.ts
new file mode 100644
index 00000000000..e8bc113c643
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/count-record-page-reown-updates.util.ts
@@ -0,0 +1,9 @@
+import { type RecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+
+export const countRecordPageReownUpdates = (
+ reownUpdates: RecordPageReownUpdates,
+): number =>
+ Object.values(reownUpdates).reduce(
+ (count, updates) => count + updates.length,
+ 0,
+ );
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util.ts
new file mode 100644
index 00000000000..f79bfb7cfc9
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/utils/create-empty-record-page-reown-updates.util.ts
@@ -0,0 +1,11 @@
+import { type RecordPageReownUpdates } from 'src/database/commands/upgrade-version-command/2-31/types/record-page-reown-updates.type';
+
+export const createEmptyRecordPageReownUpdates =
+ (): RecordPageReownUpdates => ({
+ pageLayoutUpdates: [],
+ pageLayoutTabUpdates: [],
+ pageLayoutWidgetUpdates: [],
+ viewUpdates: [],
+ viewFieldUpdates: [],
+ viewFieldGroupUpdates: [],
+ });
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
index d9d59f073c6..b602840dbce 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
@@ -51,8 +51,16 @@ import { AddCacheTokensToAgentChatThreadFastInstanceCommand } from 'src/database
import { AddLogoToApplicationFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-2/2-2-instance-command-fast-1777539664664-add-logo-to-application';
import { AllowServerScopedFileFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-20/2-20-instance-command-fast-1783499671541-allow-server-scoped-file';
import { AddCalendarEndFieldMetadataIdToViewFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-22/2-22-instance-command-fast-1783956795000-add-calendar-end-field-metadata-id-to-view';
-import { AddSdkClientCoreChecksumToApplicationFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-23/2-23-instance-command-fast-1784625638000-add-sdk-client-core-checksum-to-application';
import { AddAutoUpgradeToApplicationFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-23/2-23-instance-command-fast-1784297307235-add-auto-upgrade-to-application';
+import { AddSdkClientCoreChecksumToApplicationFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-23/2-23-instance-command-fast-1784625638000-add-sdk-client-core-checksum-to-application';
+import { AddChannelWebhookSubscriptionExternalIdIndexesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-25/2-25-instance-command-fast-1785173910915-add-channel-webhook-subscription-external-id-indexes';
+import { AddConnectedAccountHandleProviderIndexFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-26/2-26-instance-command-fast-1785420705255-add-connected-account-handle-provider-index';
+import { AddOpenRecordInToObjectMetadataFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785504900000-add-open-record-in-to-object-metadata';
+import { CreateUserSessionCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785518325511-create-user-session-core-table';
+import { CreateApplicationAuthorizationCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785681272278-create-application-authorization-core-table';
+import { AddOnDisconnectLogicFunctionToConnectionProviderFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785810340935-add-on-disconnect-logic-function-to-connection-provider';
+import { AddCallRecordingWidgetTypesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-29/2-29-instance-command-fast-1786009374684-add-call-recording-widget-types';
+import { AddIsSystemSideEffectToViewFieldGroupFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-31/2-31-instance-command-fast-1786437480000-add-is-system-side-effect-to-view-field-group';
import { AddSubFieldNameToViewSortEarlyFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-fast-1747234200000-add-sub-field-name-to-view-sort';
import { AddRelationTargetFieldMetadataIdToViewFilterEarlyFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-fast-1747234300000-add-relation-target-field-metadata-id-to-view-filter';
import { AddUpgradeMigrationWorkspaceIdIndexFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-fast-1777308014234-add-upgrade-migration-workspace-id-index';
@@ -63,6 +71,8 @@ import { TransformApplicationVariableToSyncableEntityFastInstanceCommand } from
import { AddToolAndWorkflowActionTriggerSettingsFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-fast-1797000001000-add-tool-and-workflow-action-trigger-settings';
import { BackfillApplicationVariableUniversalIdentifierSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-slow-1777966965588-backfill-application-variable-universal-identifier';
import { MigrateToolTriggerSettingsSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-3/2-3-instance-command-slow-1797000002000-migrate-tool-trigger-settings';
+import { AddListViewTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-30/2-30-instance-command-fast-1785929606728-add-list-view-type';
+import { AddListWidgetViewTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-30/2-30-instance-command-fast-1786227282471-add-list-widget-view-type';
import { AddRelationTargetFieldMetadataIdToViewFilterEarly2_4FastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-4/2-4-instance-command-fast-1747234400000-add-relation-target-field-metadata-id-to-view-filter';
import { AddMetadataToBillingPriceFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-4/2-4-instance-command-fast-1777100000000-add-metadata-to-billing-price';
import { AddEmailGroupChannelTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-4/2-4-instance-command-fast-1778256809018-add-email-group-channel-type';
@@ -118,26 +128,17 @@ import { AddKanbanAndCalendarWidgetViewTypesFastInstanceCommand } from './2-23/2
import { WidenViewCalendarIntegrityConstraintFastInstanceCommand } from './2-23/2-23-instance-command-fast-1784620626406-widen-view-calendar-integrity-constraint';
import { AddApplicationIdToKeyValuePairFastInstanceCommand } from './2-23/2-23-instance-command-fast-1784659343818-add-application-id-to-key-value-pair';
import { AddLogoFileIdToApplicationRegistration2_23FastInstanceCommand } from './2-23/2-23-instance-command-fast-1784823473532-add-logo-file-id-to-application-registration';
-import { AddMessageChannelDisplayNameFastInstanceCommand } from './2-25/2-25-instance-command-fast-1784904030252-add-message-channel-display-name';
-import { AddMessageCampaignWidgetTypeFastInstanceCommand } from './2-25/2-25-instance-command-fast-1785229950000-add-message-campaign-widget-type';
import { BackfillCreatedWorkspaceActivationStatusSlowInstanceCommand } from './2-23/2-23-instance-command-slow-1784286705000-backfill-created-workspace-activation-status';
import { UnlistUnclaimedNpmApplicationRegistrationsSlowInstanceCommand } from './2-23/2-23-instance-command-slow-1784322591746-unlist-unclaimed-npm-application-registrations';
import { AddStatusesToBillingSubscriptionIndexSlowInstanceCommand } from './2-23/2-23-instance-command-slow-1784650048045-add-statuses-to-billing-subscription-index';
import { AddOnConnectLogicFunctionToConnectionProviderFastInstanceCommand } from './2-24/2-24-instance-command-fast-1784712843602-add-on-connect-logic-function-to-connection-provider';
import { RepairKeyValuePairApplicationIdFastInstanceCommand } from './2-24/2-24-instance-command-fast-1784897347051-repair-key-value-pair-application-id';
import { AddAgentForeignKeyToRoleTargetFastInstanceCommand } from './2-25/2-25-instance-command-fast-1784820332810-add-agent-foreign-key-to-role-target';
-import { AddAppTokenSsoExchangeIndexFastInstanceCommand } from './2-25/2-25-instance-command-fast-1785143586000-add-app-token-sso-exchange-index';
import { AddPageLayoutCascadeDeleteIndexesFastInstanceCommand } from './2-25/2-25-instance-command-fast-1784904030251-add-page-layout-cascade-delete-indexes';
-import { AddChannelWebhookSubscriptionExternalIdIndexesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-25/2-25-instance-command-fast-1785173910915-add-channel-webhook-subscription-external-id-indexes';
+import { AddMessageChannelDisplayNameFastInstanceCommand } from './2-25/2-25-instance-command-fast-1784904030252-add-message-channel-display-name';
+import { AddAppTokenSsoExchangeIndexFastInstanceCommand } from './2-25/2-25-instance-command-fast-1785143586000-add-app-token-sso-exchange-index';
+import { AddMessageCampaignWidgetTypeFastInstanceCommand } from './2-25/2-25-instance-command-fast-1785229950000-add-message-campaign-widget-type';
import { AddIsHiddenToAgentMessageFastInstanceCommand } from './2-25/2-25-instance-command-fast-1785230296000-add-is-hidden-to-agent-message';
-import { AddOnDisconnectLogicFunctionToConnectionProviderFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785810340935-add-on-disconnect-logic-function-to-connection-provider';
-import { AddConnectedAccountHandleProviderIndexFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-26/2-26-instance-command-fast-1785420705255-add-connected-account-handle-provider-index';
-import { AddOpenRecordInToObjectMetadataFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785504900000-add-open-record-in-to-object-metadata';
-import { CreateUserSessionCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785518325511-create-user-session-core-table';
-import { CreateApplicationAuthorizationCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785681272278-create-application-authorization-core-table';
-import { AddListViewTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-30/2-30-instance-command-fast-1785929606728-add-list-view-type';
-import { AddListWidgetViewTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-30/2-30-instance-command-fast-1786227282471-add-list-widget-view-type';
-import { AddCallRecordingWidgetTypesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-29/2-29-instance-command-fast-1786009374684-add-call-recording-widget-types';
export const INSTANCE_COMMANDS = [
AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand,
@@ -278,4 +279,5 @@ export const INSTANCE_COMMANDS = [
AddListViewTypeFastInstanceCommand,
AddCallRecordingWidgetTypesFastInstanceCommand,
AddListWidgetViewTypeFastInstanceCommand,
+ AddIsSystemSideEffectToViewFieldGroupFastInstanceCommand,
];
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
index 0b7f979f214..5af0102519c 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/workspace-command-provider.module.ts
@@ -5,13 +5,6 @@ import { V1_22_UpgradeVersionCommandModule } from 'src/database/commands/upgrade
import { V1_23_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/1-23/1-23-upgrade-version-command.module';
import { V2_0_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-0/2-0-upgrade-version-command.module';
import { V2_1_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-1/2-1-upgrade-version-command.module';
-import { V2_2_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-2/2-2-upgrade-version-command.module';
-import { V2_3_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-3/2-3-upgrade-version-command.module';
-import { V2_4_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-4/2-4-upgrade-version-command.module';
-import { V2_5_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-5/2-5-upgrade-version-command.module';
-import { V2_7_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-7/2-7-upgrade-version-command.module';
-import { V2_8_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-8/2-8-upgrade-version-command.module';
-import { V2_9_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-9/2-9-upgrade-version-command.module';
import { V2_10_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-10/2-10-upgrade-version-command.module';
import { V2_13_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-13/2-13-upgrade-version-command.module';
import { V2_14_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-14/2-14-upgrade-version-command.module';
@@ -20,6 +13,7 @@ import { V2_16_UpgradeVersionCommandModule } from 'src/database/commands/upgrade
import { V2_17_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-17/2-17-upgrade-version-command.module';
import { V2_18_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-18/2-18-upgrade-version-command.module';
import { V2_19_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-19/2-19-upgrade-version-command.module';
+import { V2_2_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-2/2-2-upgrade-version-command.module';
import { V2_20_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-20/2-20-upgrade-version-command.module';
import { V2_21_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-21/2-21-upgrade-version-command.module';
import { V2_22_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-22/2-22-upgrade-version-command.module';
@@ -28,7 +22,13 @@ import { V2_25_UpgradeVersionCommandModule } from 'src/database/commands/upgrade
import { V2_26_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-26/2-26-upgrade-version-command.module';
import { V2_27_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-27/2-27-upgrade-version-command.module';
import { V2_28_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-28/2-28-upgrade-version-command.module';
+import { V2_3_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-3/2-3-upgrade-version-command.module';
import { V2_31_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-31/2-31-upgrade-version-command.module';
+import { V2_4_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-4/2-4-upgrade-version-command.module';
+import { V2_5_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-5/2-5-upgrade-version-command.module';
+import { V2_7_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-7/2-7-upgrade-version-command.module';
+import { V2_8_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-8/2-8-upgrade-version-command.module';
+import { V2_9_UpgradeVersionCommandModule } from 'src/database/commands/upgrade-version-command/2-9/2-9-upgrade-version-command.module';
@Module({
imports: [
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-field-group-manifest-to-universal-flat-view-field-group.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-field-group-manifest-to-universal-flat-view-field-group.util.ts
index 68e5b9f4957..57e7f820b51 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-field-group-manifest-to-universal-flat-view-field-group.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-view-field-group-manifest-to-universal-flat-view-field-group.util.ts
@@ -21,6 +21,7 @@ export const fromViewFieldGroupManifestToUniversalFlatViewFieldGroup = ({
position: viewFieldGroupManifest.position,
isVisible: viewFieldGroupManifest.isVisible ?? true,
isActive: true,
+ isSystemSideEffect: false,
overrides: null,
viewFieldUniversalIdentifiers: [],
createdAt: now,
diff --git a/packages/twenty-server/src/engine/metadata-modules/field-metadata/services/field-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/field-metadata/services/field-metadata.service.ts
index dd2318f54e7..fe55f8a0e6f 100644
--- a/packages/twenty-server/src/engine/metadata-modules/field-metadata/services/field-metadata.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/field-metadata/services/field-metadata.service.ts
@@ -23,13 +23,11 @@ import { fromCreateFieldInputToFlatFieldMetadatasToCreate } from 'src/engine/met
import { fromDeleteFieldInputToFlatFieldMetadatasToDelete } from 'src/engine/metadata-modules/flat-field-metadata/utils/from-delete-field-input-to-flat-field-metadatas-to-delete.util';
import { fromUpdateFieldInputToFlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/utils/from-update-field-input-to-flat-field-metadata.util';
import { throwOnFieldInputTranspilationsError } from 'src/engine/metadata-modules/flat-field-metadata/utils/throw-on-field-input-transpilations-error.util';
-import { computeFlatViewFieldsFromFieldsWidgets } from 'src/engine/metadata-modules/flat-view-field/utils/compute-flat-view-fields-from-fields-widgets.util';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
import { EMPTY_ORCHESTRATOR_FAILURE_REPORT } from 'src/engine/workspace-manager/workspace-migration/constant/empty-orchestrator-failure-report.constant';
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';
-import { UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
@Injectable()
export class FieldMetadataService {
@@ -390,17 +388,9 @@ export class FieldMetadataService {
const {
flatObjectMetadataMaps: existingFlatObjectMetadataMaps,
flatFieldMetadataMaps: existingFlatFieldMetadataMaps,
- flatPageLayoutWidgetMaps: existingFlatPageLayoutWidgetMaps,
- flatViewFieldMaps: existingFlatViewFieldMaps,
- flatViewMaps: existingFlatViewMaps,
- flatViewFieldGroupMaps: existingFlatViewFieldGroupMaps,
} = await this.workspaceCacheService.getOrRecompute(workspaceId, [
'flatObjectMetadataMaps',
'flatFieldMetadataMaps',
- 'flatPageLayoutWidgetMaps',
- 'flatViewFieldMaps',
- 'flatViewMaps',
- 'flatViewFieldGroupMaps',
]);
const allTranspiledTranspilationInputs: Awaited<
@@ -437,22 +427,6 @@ export class FieldMetadataService {
{ flatFieldMetadatas: [], indexMetadatas: [] },
);
- const flatViewFieldsToCreate: UniversalFlatViewField[] =
- computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: flatFieldMetadatasToCreate.map((flatFieldMetadata) => ({
- objectMetadataUniversalIdentifier:
- flatFieldMetadata.objectMetadataUniversalIdentifier,
- fieldMetadataUniversalIdentifier:
- flatFieldMetadata.universalIdentifier,
- })),
- flatPageLayoutWidgetMaps: existingFlatPageLayoutWidgetMaps,
- flatViewFieldMaps: existingFlatViewFieldMaps,
- flatViewMaps: existingFlatViewMaps,
- flatViewFieldGroupMaps: existingFlatViewFieldGroupMaps,
- applicationUniversalIdentifier:
- resolvedOwnerFlatApplication.universalIdentifier,
- });
-
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunWorkspaceMigration(
{
@@ -467,11 +441,6 @@ export class FieldMetadataService {
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
- viewField: {
- flatEntityToCreate: flatViewFieldsToCreate,
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
},
workspaceId,
isSystemBuild,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
index 17508683dd3..b8ea18b3830 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
@@ -450,6 +450,11 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {
},
},
viewFieldGroup: {
+ isSystemSideEffect: {
+ toCompare: false,
+ toStringify: false,
+ universalProperty: undefined,
+ },
name: {
toStringify: false,
universalProperty: undefined,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-metadata-side-effect-companion-metadata-names.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-metadata-side-effect-companion-metadata-names.constant.ts
index 1915daa5109..bc4ef025543 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-metadata-side-effect-companion-metadata-names.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-metadata-side-effect-companion-metadata-names.constant.ts
@@ -1,13 +1,24 @@
import { type AllMetadataName } from 'twenty-shared/metadata';
export const ALL_METADATA_SIDE_EFFECT_COMPANION_METADATA_NAMES = {
- fieldMetadata: ['index', 'searchFieldMetadata', 'view', 'viewField'],
+ fieldMetadata: [
+ 'index',
+ 'searchFieldMetadata',
+ 'view',
+ 'viewField',
+ 'viewFieldGroup',
+ 'pageLayoutWidget',
+ ],
objectMetadata: [
'fieldMetadata',
'index',
'searchFieldMetadata',
'view',
'viewField',
+ 'viewFieldGroup',
+ 'pageLayout',
+ 'pageLayoutTab',
+ 'pageLayoutWidget',
],
} as const satisfies Partial<
Record<AllMetadataName, readonly AllMetadataName[]>
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/handle-flat-object-metadata-update-side-effect.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/handle-flat-object-metadata-update-side-effect.util.ts
index a1d754fc3db..2e3c08b8252 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/handle-flat-object-metadata-update-side-effect.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/handle-flat-object-metadata-update-side-effect.util.ts
@@ -34,6 +34,12 @@ type HandleFlatObjectMetadataUpdateSideEffectArgs = FromTo<
| 'flatSearchFieldMetadataMaps'
>;
+// Transitional: the label identifier view-field recompute below duplicates the
+// engine's objectIndexViewLabelIdentifierOnUpdate on the engine INDEX view and
+// mutates caller-owned view rows directly on every other view. Once the
+// override mechanism ships, this per-view maintenance is expected to be
+// re-expressed as overrides instead of direct row mutations; the exact shape
+// is not settled yet.
export const handleFlatObjectMetadataUpdateSideEffect = ({
flatIndexMaps,
flatFieldMetadataMaps,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/recompute-view-field-identifier-after-flat-object-identifier-update.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/recompute-view-field-identifier-after-flat-object-identifier-update.util.ts
index c20ba8a9f3f..2a8d504145a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/recompute-view-field-identifier-after-flat-object-identifier-update.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/recompute-view-field-identifier-after-flat-object-identifier-update.util.ts
@@ -1,3 +1,4 @@
+import { ViewType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
@@ -27,10 +28,13 @@ export const recomputeViewFieldIdentifierAfterFlatObjectIdentifierUpdate = ({
flatFieldMetadataMaps,
updatedLabelIdentifierFieldMetadataId,
}: RecomputeViewFieldIdentifierAfterFlatObjectIdentifierUpdateArgs): FlatViewFieldToCreateAndUpdate => {
+ // FIELDS_WIDGET record-page views are excluded: the engine owns their label
+ // identifier lifecycle (objectRecordPageLabelIdentifierOnUpdate) and the
+ // record page never displays the label identifier.
const flatViews = findManyFlatEntityByIdInFlatEntityMapsOrThrow({
flatEntityMaps: flatViewMaps,
flatEntityIds: existingFlatObjectMetadata.viewIds,
- });
+ }).filter((flatView) => flatView.type !== ViewType.FIELDS_WIDGET);
const updatedLabelIdentifierFieldMetadata =
findFlatEntityByIdInFlatEntityMapsOrThrow({
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-view-field-group/utils/from-create-view-field-group-input-to-flat-view-field-group-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-view-field-group/utils/from-create-view-field-group-input-to-flat-view-field-group-to-create.util.ts
index fcb54698c11..92e3c8283f6 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-view-field-group/utils/from-create-view-field-group-input-to-flat-view-field-group-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-view-field-group/utils/from-create-view-field-group-input-to-flat-view-field-group-to-create.util.ts
@@ -47,6 +47,7 @@ export const fromCreateViewFieldGroupInputToFlatViewFieldGroupToCreate = ({
position: createViewFieldGroupInput.position ?? 0,
isVisible: createViewFieldGroupInput.isVisible ?? true,
isActive: true,
+ isSystemSideEffect: false,
overrides: null,
viewFieldUniversalIdentifiers: [],
applicationUniversalIdentifier: flatApplication.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/__tests__/compute-flat-view-fields-from-fields-widgets.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/__tests__/compute-flat-view-fields-from-fields-widgets.util.spec.ts
deleted file mode 100644
index 5485f5c0c8a..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/__tests__/compute-flat-view-fields-from-fields-widgets.util.spec.ts
+++ /dev/null
@@ -1,890 +0,0 @@
-import { ViewKey } from 'twenty-shared/types';
-
-import { type FlatPageLayoutWidgetMaps } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget-maps.type';
-import { type FlatViewFieldGroupMaps } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group-maps.type';
-import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
-import { type FlatViewFieldMaps } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field-maps.type';
-import { computeFlatViewFieldsFromFieldsWidgets } from 'src/engine/metadata-modules/flat-view-field/utils/compute-flat-view-fields-from-fields-widgets.util';
-import { type FlatViewMaps } from 'src/engine/metadata-modules/flat-view/types/flat-view-maps.type';
-import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
-
-const APPLICATION_UNIVERSAL_IDENTIFIER = 'app-uid-1';
-const VIEW_ID = 'view-db-id-1';
-const VIEW_UNIVERSAL_IDENTIFIER = 'view-uid-1';
-const VIEW_FIELD_GROUP_ID = 'vfg-db-id-1';
-const VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIER = 'vfg-uid-1';
-const OBJECT_METADATA_UNIVERSAL_IDENTIFIER = 'obj-uid-1';
-
-const buildEmptyFlatEntityMaps = () => ({
- byUniversalIdentifier: {},
- universalIdentifierById: {},
- universalIdentifiersByApplicationId: {},
-});
-
-const buildFlatViewMaps = (
- entries: {
- id: string;
- universalIdentifier: string;
- key?: ViewKey | null;
- isActive?: boolean;
- isSystemSideEffect?: boolean;
- objectMetadataUniversalIdentifier?: string | null;
- deletedAt?: string | null;
- }[] = [],
-): FlatViewMaps =>
- ({
- byUniversalIdentifier: Object.fromEntries(
- entries.map((entry) => [
- entry.universalIdentifier,
- {
- universalIdentifier: entry.universalIdentifier,
- id: entry.id,
- key: entry.key ?? null,
- isActive: entry.isActive ?? true,
- isSystemSideEffect: entry.isSystemSideEffect ?? false,
- objectMetadataUniversalIdentifier:
- entry.objectMetadataUniversalIdentifier ?? null,
- deletedAt: entry.deletedAt ?? null,
- },
- ]),
- ),
- universalIdentifierById: Object.fromEntries(
- entries.map((entry) => [entry.id, entry.universalIdentifier]),
- ),
- universalIdentifiersByApplicationId: {},
- }) as unknown as FlatViewMaps;
-
-const buildFlatViewFieldGroupMaps = (
- entries: {
- id: string;
- universalIdentifier: string;
- viewId?: string;
- position?: number;
- }[] = [],
-): FlatViewFieldGroupMaps =>
- ({
- byUniversalIdentifier: Object.fromEntries(
- entries.map((entry) => [
- entry.universalIdentifier,
- {
- universalIdentifier: entry.universalIdentifier,
- id: entry.id,
- viewId: entry.viewId ?? VIEW_ID,
- position: entry.position ?? 0,
- isActive: true,
- deletedAt: null,
- },
- ]),
- ),
- universalIdentifierById: Object.fromEntries(
- entries.map((entry) => [entry.id, entry.universalIdentifier]),
- ),
- universalIdentifiersByApplicationId: {},
- }) as unknown as FlatViewFieldGroupMaps;
-
-const buildFlatViewFieldMaps = (
- entries: {
- universalIdentifier: string;
- viewId: string;
- viewFieldGroupId: string | null;
- position: number;
- isActive: boolean;
- }[] = [],
-): FlatViewFieldMaps =>
- ({
- byUniversalIdentifier: Object.fromEntries(
- entries.map((entry) => [entry.universalIdentifier, entry]),
- ),
- universalIdentifierById: {},
- universalIdentifiersByApplicationId: {},
- }) as unknown as FlatViewFieldMaps;
-
-const buildFieldsWidget = ({
- widgetUniversalIdentifier = 'widget-uid-1',
- objectMetadataUniversalIdentifier = OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- viewId = VIEW_ID,
- isVisible = true,
- isActive = true,
-}: {
- widgetUniversalIdentifier?: string;
- objectMetadataUniversalIdentifier?: string;
- viewId?: string | null;
- isVisible?: boolean;
- isActive?: boolean;
-} = {}) => ({
- universalIdentifier: widgetUniversalIdentifier,
- objectMetadataUniversalIdentifier,
- type: WidgetType.FIELDS,
- isActive,
- configuration: {
- configurationType: WidgetConfigurationType.FIELDS,
- viewId,
- newFieldDefaultVisibility: isVisible,
- },
- universalConfiguration: null,
- overrides: null,
-});
-
-const buildFlatPageLayoutWidgetMaps = (
- widgets: ReturnType<typeof buildFieldsWidget>[],
-): FlatPageLayoutWidgetMaps =>
- ({
- byUniversalIdentifier: Object.fromEntries(
- widgets.map((widget) => [widget.universalIdentifier, widget]),
- ),
- universalIdentifierById: {},
- universalIdentifiersByApplicationId: {},
- }) as unknown as FlatPageLayoutWidgetMaps;
-
-describe('computeFlatViewFieldsFromFieldsWidgets', () => {
- describe('when no matching widgets exist', () => {
- it('should return empty array when widget maps are empty', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps:
- buildEmptyFlatEntityMaps() as unknown as FlatPageLayoutWidgetMaps,
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps(),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should return empty array when fieldsToCreate is empty', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should skip widgets for a different object', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier: 'other-obj-uid',
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should skip inactive widgets', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ isActive: false }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should skip widgets without viewId', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ viewId: null }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps(),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should skip widgets whose viewId cannot be resolved', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ viewId: 'non-existent-view-id' }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps(),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
- });
-
- describe('when creating view fields for a single field', () => {
- it('should create a view field with correct properties', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ isVisible: true }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0]).toMatchObject({
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- viewUniversalIdentifier: VIEW_UNIVERSAL_IDENTIFIER,
- viewFieldGroupUniversalIdentifier: null,
- isVisible: true,
- size: DEFAULT_VIEW_FIELD_SIZE,
- position: 0,
- aggregateOperation: null,
- deletedAt: null,
- });
- expect(result[0].universalIdentifier).toBeDefined();
- expect(result[0].createdAt).toBeDefined();
- expect(result[0].updatedAt).toBeDefined();
- });
-
- it('should respect isVisible: false from configuration', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ isVisible: false }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0].isVisible).toBe(false);
- });
- });
-
- describe('position computation', () => {
- it('should start at position 0 when no existing view fields', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(0);
- });
-
- it('should append after the last existing view field position', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'existing-vf-1',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 3,
- isActive: true,
- },
- {
- universalIdentifier: 'existing-vf-2',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 7,
- isActive: true,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(8);
- });
-
- it('should assign sequential positions for multiple fields in the same batch', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-2',
- },
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-3',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'existing-vf-1',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 2,
- isActive: true,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(3);
- expect(result[0].position).toBe(3);
- expect(result[1].position).toBe(4);
- expect(result[2].position).toBe(5);
- });
-
- it('should ignore inactive view fields when computing position', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'existing-vf-1',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 5,
- isActive: true,
- },
- {
- universalIdentifier: 'inactive-vf',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 99,
- isActive: false,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(6);
- });
-
- it('should ignore view fields from a different view', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'other-view-vf',
- viewId: 'other-view-db-id',
- viewFieldGroupId: null,
- position: 50,
- isActive: true,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(0);
- });
- });
-
- describe('view field group handling', () => {
- it('should resolve to the last view field group when groups exist', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps([
- {
- id: VIEW_FIELD_GROUP_ID,
- universalIdentifier: VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIER,
- },
- ]),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0].viewFieldGroupUniversalIdentifier).toBe(
- VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIER,
- );
- });
-
- it('should set viewFieldGroupUniversalIdentifier to null when no groups exist', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].viewFieldGroupUniversalIdentifier).toBeNull();
- });
-
- it('should compute position only from view fields in the last group', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'vf-in-group',
- viewId: VIEW_ID,
- viewFieldGroupId: VIEW_FIELD_GROUP_ID,
- position: 2,
- isActive: true,
- },
- {
- universalIdentifier: 'vf-no-group',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 99,
- isActive: true,
- },
- {
- universalIdentifier: 'vf-other-group',
- viewId: VIEW_ID,
- viewFieldGroupId: 'other-group-id',
- position: 50,
- isActive: true,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps([
- {
- id: VIEW_FIELD_GROUP_ID,
- universalIdentifier: VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIER,
- },
- ]),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(3);
- });
-
- it('should compute position only from ungrouped view fields when no groups exist', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps([
- {
- universalIdentifier: 'vf-no-group',
- viewId: VIEW_ID,
- viewFieldGroupId: null,
- position: 1,
- isActive: true,
- },
- {
- universalIdentifier: 'vf-in-group',
- viewId: VIEW_ID,
- viewFieldGroupId: VIEW_FIELD_GROUP_ID,
- position: 99,
- isActive: true,
- },
- ]),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result[0].position).toBe(2);
- });
- });
-
- describe('multiple widgets for the same object', () => {
- it('should create view fields for each matching widget', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({
- widgetUniversalIdentifier: 'widget-uid-1',
- viewId: 'view-db-id-A',
- }),
- buildFieldsWidget({
- widgetUniversalIdentifier: 'widget-uid-2',
- viewId: 'view-db-id-B',
- }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: 'view-db-id-A', universalIdentifier: 'view-uid-A' },
- { id: 'view-db-id-B', universalIdentifier: 'view-uid-B' },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(2);
- expect(result[0].viewUniversalIdentifier).toBe('view-uid-A');
- expect(result[1].viewUniversalIdentifier).toBe('view-uid-B');
- });
- });
-
- describe('multiple objects', () => {
- it('should create view fields for fields across different objects', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier: 'obj-uid-1',
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- {
- objectMetadataUniversalIdentifier: 'obj-uid-2',
- fieldMetadataUniversalIdentifier: 'field-uid-2',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({
- widgetUniversalIdentifier: 'widget-uid-1',
- objectMetadataUniversalIdentifier: 'obj-uid-1',
- viewId: 'view-db-id-A',
- }),
- buildFieldsWidget({
- widgetUniversalIdentifier: 'widget-uid-2',
- objectMetadataUniversalIdentifier: 'obj-uid-2',
- viewId: 'view-db-id-B',
- }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: 'view-db-id-A', universalIdentifier: 'view-uid-A' },
- { id: 'view-db-id-B', universalIdentifier: 'view-uid-B' },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(2);
-
- const viewFieldForObj1 = result.find(
- (viewField) =>
- viewField.fieldMetadataUniversalIdentifier === 'field-uid-1',
- );
- const viewFieldForObj2 = result.find(
- (viewField) =>
- viewField.fieldMetadataUniversalIdentifier === 'field-uid-2',
- );
-
- expect(viewFieldForObj1?.viewUniversalIdentifier).toBe('view-uid-A');
- expect(viewFieldForObj2?.viewUniversalIdentifier).toBe('view-uid-B');
- });
- });
-
- describe('isSystemSideEffect inheritance from parent view', () => {
- it('should flag the created view field when the parent view is a system side effect', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- {
- id: VIEW_ID,
- universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER,
- isSystemSideEffect: true,
- },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0].isSystemSideEffect).toBe(true);
- });
-
- it('should not flag the created view field when the parent view is not a system side effect', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- {
- id: VIEW_ID,
- universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER,
- isSystemSideEffect: false,
- },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0].isSystemSideEffect).toBe(false);
- });
- });
-
- describe('INDEX view non-propagation', () => {
- it('should not target the object INDEX view without a fields widget', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps:
- buildEmptyFlatEntityMaps() as unknown as FlatPageLayoutWidgetMaps,
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- {
- id: 'index-view-db-id',
- universalIdentifier: 'index-view-uid',
- key: ViewKey.INDEX,
- isSystemSideEffect: true,
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toEqual([]);
- });
-
- it('should still honor a fields widget explicitly targeting the INDEX view', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget({ viewId: 'index-view-db-id', isVisible: true }),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- {
- id: 'index-view-db-id',
- universalIdentifier: 'index-view-uid',
- key: ViewKey.INDEX,
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- expect(result).toHaveLength(1);
- expect(result[0].isVisible).toBe(true);
- expect(result[0].viewUniversalIdentifier).toBe('index-view-uid');
- });
- });
-
- describe('unique universal identifiers', () => {
- it('should generate unique universalIdentifier for each created view field', () => {
- const result = computeFlatViewFieldsFromFieldsWidgets({
- fieldsToCreate: [
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-1',
- },
- {
- objectMetadataUniversalIdentifier:
- OBJECT_METADATA_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: 'field-uid-2',
- },
- ],
- flatPageLayoutWidgetMaps: buildFlatPageLayoutWidgetMaps([
- buildFieldsWidget(),
- ]),
- flatViewFieldMaps: buildFlatViewFieldMaps(),
- flatViewMaps: buildFlatViewMaps([
- { id: VIEW_ID, universalIdentifier: VIEW_UNIVERSAL_IDENTIFIER },
- ]),
- flatViewFieldGroupMaps: buildFlatViewFieldGroupMaps(),
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- });
-
- const universalIdentifiers = result.map(
- (viewField) => viewField.universalIdentifier,
- );
-
- expect(new Set(universalIdentifiers).size).toBe(
- universalIdentifiers.length,
- );
- });
- });
-});
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/compute-flat-view-fields-from-fields-widgets.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/compute-flat-view-fields-from-fields-widgets.util.ts
deleted file mode 100644
index 8908241c9aa..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/flat-view-field/utils/compute-flat-view-fields-from-fields-widgets.util.ts
+++ /dev/null
@@ -1,243 +0,0 @@
-import { isDefined } from 'twenty-shared/utils';
-import { v4 } from 'uuid';
-
-import { type FlatPageLayoutWidgetMaps } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget-maps.type';
-import { type FlatViewFieldGroupMaps } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group-maps.type';
-import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
-import { type FlatViewFieldMaps } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field-maps.type';
-import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
-import { type FlatViewMaps } from 'src/engine/metadata-modules/flat-view/types/flat-view-maps.type';
-import { type FieldsConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/fields-configuration.dto';
-import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
-import { type AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
-import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
-
-type FieldToCreateInfo = {
- objectMetadataUniversalIdentifier: string;
- fieldMetadataUniversalIdentifier: string;
-};
-
-type FieldViewTarget = {
- viewId: string;
- isVisible: boolean;
-};
-
-const isFieldsWidgetConfiguration = (
- configuration: AllPageLayoutWidgetConfiguration,
-): configuration is FieldsConfigurationDTO => {
- return (
- isDefined(configuration) &&
- configuration.configurationType === WidgetConfigurationType.FIELDS
- );
-};
-
-// TODO remove when implementing https://github.com/twentyhq/core-team-issues/issues/2721
-const getFieldViewTargets = ({
- objectMetadataUniversalIdentifier,
- flatPageLayoutWidgetMaps,
-}: {
- objectMetadataUniversalIdentifier: string;
- flatPageLayoutWidgetMaps: FlatPageLayoutWidgetMaps;
-}): FieldViewTarget[] => {
- const targets: FieldViewTarget[] = [];
- const seenViewIds = new Set<string>();
-
- for (const widget of Object.values(
- flatPageLayoutWidgetMaps.byUniversalIdentifier,
- ).filter(isDefined)) {
- if (
- !widget.isActive ||
- widget.type !== WidgetType.FIELDS ||
- widget.objectMetadataUniversalIdentifier !==
- objectMetadataUniversalIdentifier ||
- !isFieldsWidgetConfiguration(widget.configuration)
- ) {
- continue;
- }
-
- const { viewId, newFieldDefaultVisibility } = widget.configuration;
-
- if (
- !isDefined(viewId) ||
- !isDefined(newFieldDefaultVisibility) ||
- seenViewIds.has(viewId)
- ) {
- continue;
- }
-
- seenViewIds.add(viewId);
- targets.push({ viewId, isVisible: newFieldDefaultVisibility });
- }
-
- return targets;
-};
-
-const findLastViewFieldGroupId = ({
- viewId,
- flatViewFieldGroupMaps,
-}: {
- viewId: string;
- flatViewFieldGroupMaps: FlatViewFieldGroupMaps;
-}): string | null => {
- const groupsForView = Object.values(
- flatViewFieldGroupMaps.byUniversalIdentifier,
- )
- .filter(isDefined)
- .filter((group) => group.isActive && group.viewId === viewId);
-
- if (groupsForView.length === 0) {
- return null;
- }
-
- const lastGroup = groupsForView.reduce((maxGroup, group) =>
- group.position > maxGroup.position ? group : maxGroup,
- );
-
- return lastGroup.id;
-};
-
-const computeNextPosition = ({
- viewId,
- viewFieldGroupId,
- flatViewFieldMaps,
-}: {
- viewId: string;
- viewFieldGroupId: string | null;
- flatViewFieldMaps: FlatViewFieldMaps;
-}): number => {
- const existingViewFields = Object.values(
- flatViewFieldMaps.byUniversalIdentifier,
- )
- .filter(isDefined)
- .filter(
- (viewField: FlatViewField) =>
- viewField.isActive && viewField.viewId === viewId,
- )
- .filter(
- (viewField: FlatViewField) =>
- viewField.viewFieldGroupId === viewFieldGroupId,
- );
-
- if (existingViewFields.length === 0) {
- return 0;
- }
-
- const maxPosition = Math.max(
- ...existingViewFields.map((viewField) => viewField.position),
- );
-
- return maxPosition + 1;
-};
-
-export const computeFlatViewFieldsFromFieldsWidgets = ({
- fieldsToCreate,
- flatPageLayoutWidgetMaps,
- flatViewFieldMaps,
- flatViewMaps,
- flatViewFieldGroupMaps,
- applicationUniversalIdentifier,
-}: {
- fieldsToCreate: FieldToCreateInfo[];
- flatPageLayoutWidgetMaps: FlatPageLayoutWidgetMaps;
- flatViewFieldMaps: FlatViewFieldMaps;
- flatViewMaps: FlatViewMaps;
- flatViewFieldGroupMaps: FlatViewFieldGroupMaps;
- applicationUniversalIdentifier: string;
-}): UniversalFlatViewField[] => {
- const flatViewFieldsToCreate: UniversalFlatViewField[] = [];
- const now = new Date().toISOString();
-
- const objectMetadataUniversalIdentifiers = [
- ...new Set(
- fieldsToCreate.map((field) => field.objectMetadataUniversalIdentifier),
- ),
- ];
-
- const nextPositionByKey = new Map<string, number>();
- const queuedViewFieldKeys = new Set<string>();
-
- for (const objectMetadataUniversalIdentifier of objectMetadataUniversalIdentifiers) {
- const targets = getFieldViewTargets({
- objectMetadataUniversalIdentifier,
- flatPageLayoutWidgetMaps,
- });
-
- const fieldsForObject = fieldsToCreate.filter(
- (field) =>
- field.objectMetadataUniversalIdentifier ===
- objectMetadataUniversalIdentifier,
- );
-
- for (const { viewId, isVisible } of targets) {
- const viewUniversalIdentifier =
- flatViewMaps.universalIdentifierById[viewId] ?? null;
-
- if (!isDefined(viewUniversalIdentifier)) {
- continue;
- }
-
- const isSystemSideEffect =
- flatViewMaps.byUniversalIdentifier[viewUniversalIdentifier]
- ?.isSystemSideEffect ?? false;
-
- const viewFieldGroupId = findLastViewFieldGroupId({
- viewId,
- flatViewFieldGroupMaps,
- });
-
- const viewFieldGroupUniversalIdentifier = isDefined(viewFieldGroupId)
- ? (flatViewFieldGroupMaps.universalIdentifierById[viewFieldGroupId] ??
- null)
- : null;
-
- const positionKey = `${viewId}:${viewFieldGroupId ?? 'null'}`;
-
- if (!nextPositionByKey.has(positionKey)) {
- nextPositionByKey.set(
- positionKey,
- computeNextPosition({
- viewId,
- viewFieldGroupId,
- flatViewFieldMaps,
- }),
- );
- }
-
- for (const field of fieldsForObject) {
- const dedupKey = `${viewId}:${field.fieldMetadataUniversalIdentifier}`;
-
- if (queuedViewFieldKeys.has(dedupKey)) {
- continue;
- }
-
- queuedViewFieldKeys.add(dedupKey);
-
- const position = nextPositionByKey.get(positionKey)!;
-
- nextPositionByKey.set(positionKey, position + 1);
-
- flatViewFieldsToCreate.push({
- universalIdentifier: v4(),
- applicationUniversalIdentifier,
- fieldMetadataUniversalIdentifier:
- field.fieldMetadataUniversalIdentifier,
- viewUniversalIdentifier,
- viewFieldGroupUniversalIdentifier,
- isVisible,
- size: DEFAULT_VIEW_FIELD_SIZE,
- position,
- aggregateOperation: null,
- isActive: true,
- isSystemSideEffect,
- universalOverrides: null,
- createdAt: now,
- updatedAt: now,
- deletedAt: null,
- });
- }
- }
- }
-
- return flatViewFieldsToCreate;
-};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-index-view-field-on-create-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-index-view-field-on-create-side-effect-handler.service.spec.ts
index 7c6860779aa..646e518bace 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-index-view-field-on-create-side-effect-handler.service.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-index-view-field-on-create-side-effect-handler.service.spec.ts
@@ -1,215 +1,18 @@
-import {
- getFieldUniversalIdentifier,
- getSystemViewFieldUniversalIdentifier,
- getSystemViewUniversalIdentifier,
-} from 'twenty-shared/application';
-import { FieldMetadataType, ViewKey } from 'twenty-shared/types';
+import { FieldMetadataType } from 'twenty-shared/types';
-import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
import { FieldIndexViewFieldOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service';
-import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
-
-const APPLICATION_UNIVERSAL_IDENTIFIER = 'a1a2a3a4-a5a6-4000-8000-000000000001';
-const OBJECT_UNIVERSAL_IDENTIFIER = 'b1b2b3b4-b5b6-4000-8000-000000000001';
-
-const computeFieldUniversalIdentifier = (name: string) =>
- getFieldUniversalIdentifier({
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- name,
- });
-
-const NAME_FIELD_UNIVERSAL_IDENTIFIER = computeFieldUniversalIdentifier('name');
-const PRIORITY_FIELD_UNIVERSAL_IDENTIFIER =
- computeFieldUniversalIdentifier('priority');
-
-const DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER =
- getSystemViewUniversalIdentifier({
- objectMetadataApplicationUniversalIdentifier:
- APPLICATION_UNIVERSAL_IDENTIFIER,
- objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
- });
-
-const computeViewFieldUniversalIdentifier = ({
- viewUniversalIdentifier,
- fieldMetadataUniversalIdentifier,
-}: {
- viewUniversalIdentifier: string;
- fieldMetadataUniversalIdentifier: string;
-}) =>
- getSystemViewFieldUniversalIdentifier({
- fieldMetadataApplicationUniversalIdentifier:
- APPLICATION_UNIVERSAL_IDENTIFIER,
- viewUniversalIdentifier,
- fieldMetadataUniversalIdentifier,
- });
-
-type PendingFieldMetadata = {
- universalIdentifier: string;
- objectMetadataUniversalIdentifier: string;
- applicationUniversalIdentifier: string;
- name: string;
- type: FieldMetadataType;
- isSystemSideEffect: boolean;
-};
-
-const buildPendingFieldMetadata = (
- name: string,
- type: FieldMetadataType = FieldMetadataType.TEXT,
- isSystemSideEffect = false,
-): PendingFieldMetadata => ({
- universalIdentifier: computeFieldUniversalIdentifier(name),
- objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- name,
- type,
- isSystemSideEffect,
-});
-
-const NAME_FIELD = buildPendingFieldMetadata('name');
-const PRIORITY_FIELD = buildPendingFieldMetadata(
- 'priority',
- FieldMetadataType.NUMBER,
-);
-
-const OBJECT_METADATA = {
- universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
- nameSingular: 'ticket',
- labelIdentifierFieldMetadataUniversalIdentifier:
- NAME_FIELD_UNIVERSAL_IDENTIFIER,
-};
-
-type WorkspaceView = {
- id: string;
- universalIdentifier: string;
- key: ViewKey | null;
- isActive?: boolean;
- deletedAt?: string | null;
- isSystemSideEffect?: boolean;
- objectMetadataUniversalIdentifier?: string;
-};
-
-type WorkspaceViewField = {
- universalIdentifier: string;
- viewId: string;
- viewUniversalIdentifier?: string;
- fieldMetadataUniversalIdentifier?: string;
- position: number;
- isActive: boolean;
- deletedAt?: string | null;
-};
-
-const buildArgs = ({
- triggerFieldMetadata,
- pendingFieldMetadatas = [],
- objectMetadataCreatedInBatch = false,
- pendingViews = [],
- pendingViewFields = [],
- objectMetadataInWorkspace = false,
- viewsInWorkspace = [],
- viewFieldsInWorkspace = [],
-}: {
- triggerFieldMetadata: PendingFieldMetadata;
- pendingFieldMetadatas?: PendingFieldMetadata[];
- objectMetadataCreatedInBatch?: boolean;
- pendingViews?: { universalIdentifier: string; isSystemSideEffect: boolean }[];
- pendingViewFields?: {
- universalIdentifier: string;
- viewUniversalIdentifier: string;
- fieldMetadataUniversalIdentifier: string;
- }[];
- objectMetadataInWorkspace?: boolean;
- viewsInWorkspace?: WorkspaceView[];
- viewFieldsInWorkspace?: WorkspaceViewField[];
-}): BuildSideEffectsArgs<'fieldMetadata'> =>
- ({
- flatEntity: triggerFieldMetadata,
- allFlatEntityOperationRecordByMetadataName: {
- fieldMetadata: {
- flatEntityToCreate: Object.fromEntries(
- pendingFieldMetadatas.map((pendingFieldMetadata) => [
- pendingFieldMetadata.universalIdentifier,
- pendingFieldMetadata,
- ]),
- ),
- flatEntityToUpdate: {},
- flatEntityToDelete: {},
- },
- objectMetadata: {
- flatEntityToCreate: objectMetadataCreatedInBatch
- ? { [OBJECT_UNIVERSAL_IDENTIFIER]: OBJECT_METADATA }
- : {},
- flatEntityToUpdate: {},
- flatEntityToDelete: {},
- },
- view: {
- flatEntityToCreate: Object.fromEntries(
- pendingViews.map((pendingView) => [
- pendingView.universalIdentifier,
- pendingView,
- ]),
- ),
- flatEntityToUpdate: {},
- flatEntityToDelete: {},
- },
- viewField: {
- flatEntityToCreate: Object.fromEntries(
- pendingViewFields.map((pendingViewField) => [
- pendingViewField.universalIdentifier,
- pendingViewField,
- ]),
- ),
- flatEntityToUpdate: {},
- flatEntityToDelete: {},
- },
- } as unknown as AllFlatEntityOperationRecordByMetadataName,
- relatedFlatEntityMaps: {
- flatObjectMetadataMaps: {
- byUniversalIdentifier: objectMetadataInWorkspace
- ? { [OBJECT_UNIVERSAL_IDENTIFIER]: OBJECT_METADATA }
- : {},
- },
- flatViewMaps: {
- byUniversalIdentifier: Object.fromEntries(
- viewsInWorkspace.map((view) => [
- view.universalIdentifier,
- {
- isActive: true,
- deletedAt: null,
- isSystemSideEffect: false,
- objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- ...view,
- // Mirrors fromViewEntityToFlatView: the view aggregates the
- // view fields pointing at it.
- viewFieldUniversalIdentifiers: viewFieldsInWorkspace
- .filter((viewField) => viewField.viewId === view.id)
- .map((viewField) => viewField.universalIdentifier),
- },
- ]),
- ),
- },
- flatViewFieldMaps: {
- byUniversalIdentifier: Object.fromEntries(
- viewFieldsInWorkspace.map((viewField) => [
- viewField.universalIdentifier,
- viewField,
- ]),
- ),
- },
- },
- context: {},
- }) as unknown as BuildSideEffectsArgs<'fieldMetadata'>;
-
-// Synced INDEX view: the 2-26 reconcile command re-owns every INDEX view to the
-// derived identifier, so the handler resolves it by that identifier alone.
-const SYNCED_INDEX_VIEW: WorkspaceView = {
- id: 'view-db-id-1',
- universalIdentifier: DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
- key: ViewKey.INDEX,
- isSystemSideEffect: true,
-};
+import {
+ buildArgs,
+ buildPendingFieldMetadata,
+ computeViewFieldUniversalIdentifier,
+ DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
+ filterByView,
+ NAME_FIELD,
+ NAME_FIELD_UNIVERSAL_IDENTIFIER,
+ PRIORITY_FIELD,
+ PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ SYNCED_INDEX_VIEW,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-view-field-on-create-side-effect-test-setup';
describe('FieldIndexViewFieldOnCreateSideEffectHandlerService', () => {
const handler =
@@ -270,7 +73,13 @@ describe('FieldIndexViewFieldOnCreateSideEffectHandlerService', () => {
);
expect(viewFields).toHaveLength(1);
- expect(viewFields[0].position).toBe(1);
+
+ const [indexViewField] = filterByView(
+ viewFields,
+ DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(indexViewField.position).toBe(1);
});
it('should still emit when the pending INDEX view is a system side effect (object handler emission)', () => {
@@ -675,16 +484,18 @@ describe('FieldIndexViewFieldOnCreateSideEffectHandlerService', () => {
throw new Error('expected success');
}
- expect(
- Object.values(result.operations.viewField?.flatEntityToCreate ?? {})[0]
- .position,
- ).toBe(1);
+ const [indexViewField] = filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(indexViewField.position).toBe(1);
});
- // A second writer claiming the same (view, field) pair is not deduped here:
+ // A second writer claiming the same INDEX (view, field) pair is not deduped:
// it is a genuine conflict left to surface downstream (engine collision, then
- // the flat view field validator on the pair).
- it('should still emit when a pending view field already covers the same (view, field) pair', () => {
+ // the flat view field validator on the pair). Record-page pairs ARE deduped.
+ it('should still emit when a pending view field already covers the same INDEX (view, field) pair', () => {
const result = handler.buildSideEffects(
buildArgs({
triggerFieldMetadata: PRIORITY_FIELD,
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-record-page-view-field-on-create-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-record-page-view-field-on-create-side-effect-handler.service.spec.ts
new file mode 100644
index 00000000000..3c221679d12
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-record-page-view-field-on-create-side-effect-handler.service.spec.ts
@@ -0,0 +1,319 @@
+import { ViewType } from 'twenty-shared/types';
+
+import { FieldRecordPageViewFieldOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-record-page-view-field-on-create-side-effect-handler.service';
+import {
+ buildArgs,
+ computeViewFieldUniversalIdentifier,
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ filterByView,
+ NAME_FIELD,
+ OBJECT_UNIVERSAL_IDENTIFIER,
+ PRIORITY_FIELD,
+ PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ SYNCED_FIELDS_WIDGET,
+ SYNCED_INDEX_VIEW,
+ SYNCED_RECORD_PAGE_VIEW,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-view-field-on-create-side-effect-test-setup';
+
+describe('FieldRecordPageViewFieldOnCreateSideEffectHandlerService', () => {
+ const handler =
+ new (FieldRecordPageViewFieldOnCreateSideEffectHandlerService as unknown as new () => FieldRecordPageViewFieldOnCreateSideEffectHandlerService)();
+
+ it('should fail when the parent object cannot be resolved', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: NAME_FIELD,
+ pendingFieldMetadatas: [NAME_FIELD],
+ }),
+ );
+
+ expect(result.status).toBe('fail');
+ });
+
+ describe('record-page view field emission', () => {
+ it('should emit a record-page view field with the derived identifier on same-batch creation', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [NAME_FIELD, PRIORITY_FIELD],
+ objectMetadataCreatedInBatch: true,
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const [recordPageViewField] = filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(recordPageViewField).toMatchObject({
+ universalIdentifier: computeViewFieldUniversalIdentifier({
+ viewUniversalIdentifier:
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ }),
+ // The label identifier is excluded, so priority is first.
+ position: 0,
+ isVisible: true,
+ isSystemSideEffect: true,
+ viewFieldGroupUniversalIdentifier: null,
+ });
+ });
+
+ // The engine always produces its system side effects: a caller-pending
+ // view field for the same pair is a conflict the pair-uniqueness validator
+ // surfaces to the caller, not something the engine yields to.
+ it('should still emit when a pending view field already covers the same record-page (view, field) pair', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [NAME_FIELD, PRIORITY_FIELD],
+ objectMetadataCreatedInBatch: true,
+ pendingViewFields: [
+ {
+ universalIdentifier: 'caller-authored-record-page-vf-uid',
+ viewUniversalIdentifier:
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const recordPageViewFields = filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(recordPageViewFields).toHaveLength(1);
+ expect(recordPageViewFields[0].universalIdentifier).toBe(
+ computeViewFieldUniversalIdentifier({
+ viewUniversalIdentifier:
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ }),
+ );
+ });
+
+ it('should not emit a record-page view field for the label identifier', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: NAME_FIELD,
+ pendingFieldMetadatas: [NAME_FIELD, PRIORITY_FIELD],
+ objectMetadataCreatedInBatch: true,
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+
+ // Caller-defined custom record pages coexist with the system stack: the
+ // engine still emits its record-page view field.
+ it('should still emit a record-page view field when the batch carries a caller-authored record-page stack', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [NAME_FIELD, PRIORITY_FIELD],
+ objectMetadataCreatedInBatch: true,
+ pendingViews: [
+ {
+ universalIdentifier: 'app-authored-record-page-view-uid',
+ isSystemSideEffect: false,
+ type: ViewType.FIELDS_WIDGET,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(
+ filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ ),
+ ).toHaveLength(1);
+ });
+
+ it('should follow the FIELDS widget visibility and append after existing view fields on an existing object', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [PRIORITY_FIELD],
+ objectMetadataInWorkspace: true,
+ viewsInWorkspace: [SYNCED_INDEX_VIEW, SYNCED_RECORD_PAGE_VIEW],
+ viewFieldsInWorkspace: [
+ {
+ universalIdentifier: 'existing-record-page-vf',
+ viewId: SYNCED_RECORD_PAGE_VIEW.id,
+ position: 3,
+ isActive: true,
+ },
+ ],
+ fieldsWidgetsInWorkspace: [
+ {
+ ...SYNCED_FIELDS_WIDGET,
+ universalConfiguration: {
+ ...SYNCED_FIELDS_WIDGET.universalConfiguration,
+ newFieldDefaultVisibility: false,
+ },
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const [recordPageViewField] = filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(recordPageViewField).toMatchObject({
+ isVisible: false,
+ position: 4,
+ isSystemSideEffect: true,
+ viewFieldGroupUniversalIdentifier: null,
+ });
+ });
+
+ it('should append into the last active view field group', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [PRIORITY_FIELD],
+ objectMetadataInWorkspace: true,
+ viewsInWorkspace: [
+ SYNCED_INDEX_VIEW,
+ {
+ ...SYNCED_RECORD_PAGE_VIEW,
+ viewFieldGroupUniversalIdentifiers: [
+ 'group-uid-1',
+ 'group-uid-2',
+ ],
+ },
+ ],
+ viewFieldsInWorkspace: [
+ {
+ universalIdentifier: 'grouped-vf',
+ viewId: SYNCED_RECORD_PAGE_VIEW.id,
+ viewFieldGroupUniversalIdentifier: 'group-uid-2',
+ position: 7,
+ isActive: true,
+ },
+ {
+ universalIdentifier: 'ungrouped-vf',
+ viewId: SYNCED_RECORD_PAGE_VIEW.id,
+ position: 11,
+ isActive: true,
+ },
+ ],
+ viewFieldGroupsInWorkspace: [
+ { universalIdentifier: 'group-uid-1', position: 0 },
+ { universalIdentifier: 'group-uid-2', position: 1 },
+ ],
+ fieldsWidgetsInWorkspace: [SYNCED_FIELDS_WIDGET],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const [recordPageViewField] = filterByView(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+
+ expect(recordPageViewField).toMatchObject({
+ viewFieldGroupUniversalIdentifier: 'group-uid-2',
+ position: 8,
+ });
+ });
+
+ it('should not emit when no active FIELDS widget references the engine record-page view', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [PRIORITY_FIELD],
+ objectMetadataInWorkspace: true,
+ viewsInWorkspace: [SYNCED_INDEX_VIEW, SYNCED_RECORD_PAGE_VIEW],
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+
+ it('should not emit when the widget does not declare newFieldDefaultVisibility', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [PRIORITY_FIELD],
+ objectMetadataInWorkspace: true,
+ viewsInWorkspace: [SYNCED_INDEX_VIEW, SYNCED_RECORD_PAGE_VIEW],
+ fieldsWidgetsInWorkspace: [
+ {
+ ...SYNCED_FIELDS_WIDGET,
+ universalConfiguration: {
+ configurationType: 'FIELDS',
+ viewUniversalIdentifier:
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ newFieldDefaultVisibility: null,
+ },
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+
+ it('should not emit when the (view, field) pair is already synced whatever its identifier', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ triggerFieldMetadata: PRIORITY_FIELD,
+ pendingFieldMetadatas: [PRIORITY_FIELD],
+ objectMetadataInWorkspace: true,
+ viewsInWorkspace: [SYNCED_INDEX_VIEW, SYNCED_RECORD_PAGE_VIEW],
+ viewFieldsInWorkspace: [
+ {
+ // Underived incremental-path row for the same pair.
+ universalIdentifier: 'legacy-v4-view-field-uid',
+ viewId: SYNCED_RECORD_PAGE_VIEW.id,
+ fieldMetadataUniversalIdentifier:
+ PRIORITY_FIELD_UNIVERSAL_IDENTIFIER,
+ position: 0,
+ isActive: true,
+ },
+ ],
+ fieldsWidgetsInWorkspace: [SYNCED_FIELDS_WIDGET],
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-view-field-on-create-side-effect-test-setup.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-view-field-on-create-side-effect-test-setup.ts
new file mode 100644
index 00000000000..5e918ed64a3
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/__tests__/field-view-field-on-create-side-effect-test-setup.ts
@@ -0,0 +1,296 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getFieldUniversalIdentifier,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { FieldMetadataType, ViewKey, ViewType } from 'twenty-shared/types';
+
+import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
+import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+
+export const APPLICATION_UNIVERSAL_IDENTIFIER =
+ 'a1a2a3a4-a5a6-4000-8000-000000000001';
+export const OBJECT_UNIVERSAL_IDENTIFIER =
+ 'b1b2b3b4-b5b6-4000-8000-000000000001';
+
+export const computeFieldUniversalIdentifier = (name: string) =>
+ getFieldUniversalIdentifier({
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ name,
+ });
+
+export const NAME_FIELD_UNIVERSAL_IDENTIFIER =
+ computeFieldUniversalIdentifier('name');
+export const PRIORITY_FIELD_UNIVERSAL_IDENTIFIER =
+ computeFieldUniversalIdentifier('priority');
+
+export const DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
+ });
+
+export const DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+export const computeViewFieldUniversalIdentifier = ({
+ viewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier,
+}: {
+ viewUniversalIdentifier: string;
+ fieldMetadataUniversalIdentifier: string;
+}) =>
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier,
+ });
+
+export type PendingFieldMetadata = {
+ universalIdentifier: string;
+ objectMetadataUniversalIdentifier: string;
+ applicationUniversalIdentifier: string;
+ name: string;
+ type: FieldMetadataType;
+ isSystemSideEffect: boolean;
+};
+
+export const buildPendingFieldMetadata = (
+ name: string,
+ type: FieldMetadataType = FieldMetadataType.TEXT,
+ isSystemSideEffect = false,
+): PendingFieldMetadata => ({
+ universalIdentifier: computeFieldUniversalIdentifier(name),
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ name,
+ type,
+ isSystemSideEffect,
+});
+
+export const NAME_FIELD = buildPendingFieldMetadata('name');
+export const PRIORITY_FIELD = buildPendingFieldMetadata(
+ 'priority',
+ FieldMetadataType.NUMBER,
+);
+
+export const OBJECT_METADATA = {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ nameSingular: 'ticket',
+ labelIdentifierFieldMetadataUniversalIdentifier:
+ NAME_FIELD_UNIVERSAL_IDENTIFIER,
+};
+
+export type WorkspaceView = {
+ id: string;
+ universalIdentifier: string;
+ key: ViewKey | null;
+ type?: ViewType;
+ isActive?: boolean;
+ deletedAt?: string | null;
+ isSystemSideEffect?: boolean;
+ objectMetadataUniversalIdentifier?: string;
+ viewFieldGroupUniversalIdentifiers?: string[];
+};
+
+export type WorkspaceViewField = {
+ universalIdentifier: string;
+ viewId: string;
+ viewUniversalIdentifier?: string;
+ fieldMetadataUniversalIdentifier?: string;
+ viewFieldGroupUniversalIdentifier?: string | null;
+ position: number;
+ isActive: boolean;
+ deletedAt?: string | null;
+};
+
+export type WorkspaceFieldsWidget = {
+ universalIdentifier: string;
+ isActive?: boolean;
+ deletedAt?: string | null;
+ universalConfiguration: {
+ configurationType: string;
+ viewUniversalIdentifier?: string | null;
+ newFieldDefaultVisibility?: boolean | null;
+ };
+};
+
+export type WorkspaceViewFieldGroup = {
+ universalIdentifier: string;
+ position: number;
+ isActive?: boolean;
+ deletedAt?: string | null;
+};
+
+export const buildArgs = ({
+ triggerFieldMetadata,
+ pendingFieldMetadatas = [],
+ objectMetadataCreatedInBatch = false,
+ pendingViews = [],
+ pendingViewFields = [],
+ objectMetadataInWorkspace = false,
+ viewsInWorkspace = [],
+ viewFieldsInWorkspace = [],
+ fieldsWidgetsInWorkspace = [],
+ viewFieldGroupsInWorkspace = [],
+}: {
+ triggerFieldMetadata: PendingFieldMetadata;
+ pendingFieldMetadatas?: PendingFieldMetadata[];
+ objectMetadataCreatedInBatch?: boolean;
+ pendingViews?: {
+ universalIdentifier: string;
+ isSystemSideEffect: boolean;
+ type?: ViewType;
+ objectMetadataUniversalIdentifier?: string;
+ }[];
+ pendingViewFields?: {
+ universalIdentifier: string;
+ viewUniversalIdentifier: string;
+ fieldMetadataUniversalIdentifier: string;
+ }[];
+ objectMetadataInWorkspace?: boolean;
+ viewsInWorkspace?: WorkspaceView[];
+ viewFieldsInWorkspace?: WorkspaceViewField[];
+ fieldsWidgetsInWorkspace?: WorkspaceFieldsWidget[];
+ viewFieldGroupsInWorkspace?: WorkspaceViewFieldGroup[];
+}): BuildSideEffectsArgs<'fieldMetadata'> =>
+ ({
+ flatEntity: triggerFieldMetadata,
+ allFlatEntityOperationRecordByMetadataName: {
+ fieldMetadata: {
+ flatEntityToCreate: Object.fromEntries(
+ pendingFieldMetadatas.map((pendingFieldMetadata) => [
+ pendingFieldMetadata.universalIdentifier,
+ pendingFieldMetadata,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ objectMetadata: {
+ flatEntityToCreate: objectMetadataCreatedInBatch
+ ? { [OBJECT_UNIVERSAL_IDENTIFIER]: OBJECT_METADATA }
+ : {},
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ view: {
+ flatEntityToCreate: Object.fromEntries(
+ pendingViews.map((pendingView) => [
+ pendingView.universalIdentifier,
+ pendingView,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ viewField: {
+ flatEntityToCreate: Object.fromEntries(
+ pendingViewFields.map((pendingViewField) => [
+ pendingViewField.universalIdentifier,
+ pendingViewField,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ } as unknown as AllFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps: {
+ flatObjectMetadataMaps: {
+ byUniversalIdentifier: objectMetadataInWorkspace
+ ? { [OBJECT_UNIVERSAL_IDENTIFIER]: OBJECT_METADATA }
+ : {},
+ },
+ flatViewMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ viewsInWorkspace.map((view) => [
+ view.universalIdentifier,
+ {
+ isActive: true,
+ deletedAt: null,
+ isSystemSideEffect: false,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewFieldGroupUniversalIdentifiers: [],
+ ...view,
+ // Mirrors fromViewEntityToFlatView: the view aggregates the
+ // view fields pointing at it.
+ viewFieldUniversalIdentifiers: viewFieldsInWorkspace
+ .filter((viewField) => viewField.viewId === view.id)
+ .map((viewField) => viewField.universalIdentifier),
+ },
+ ]),
+ ),
+ },
+ flatViewFieldMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ viewFieldsInWorkspace.map((viewField) => [
+ viewField.universalIdentifier,
+ { viewFieldGroupUniversalIdentifier: null, ...viewField },
+ ]),
+ ),
+ },
+ flatViewFieldGroupMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ viewFieldGroupsInWorkspace.map((viewFieldGroup) => [
+ viewFieldGroup.universalIdentifier,
+ { isActive: true, deletedAt: null, ...viewFieldGroup },
+ ]),
+ ),
+ },
+ flatPageLayoutWidgetMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ fieldsWidgetsInWorkspace.map((fieldsWidget) => [
+ fieldsWidget.universalIdentifier,
+ { isActive: true, deletedAt: null, ...fieldsWidget },
+ ]),
+ ),
+ },
+ },
+ context: {},
+ }) as unknown as BuildSideEffectsArgs<'fieldMetadata'>;
+
+// Synced INDEX view: the 2-26 reconcile command re-owns every INDEX view to the
+// derived identifier, so the handler resolves it by that identifier alone.
+export const SYNCED_INDEX_VIEW: WorkspaceView = {
+ id: 'view-db-id-1',
+ universalIdentifier: DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
+ key: ViewKey.INDEX,
+ isSystemSideEffect: true,
+};
+
+export const SYNCED_RECORD_PAGE_VIEW: WorkspaceView = {
+ id: 'view-db-id-2',
+ universalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ key: null,
+ type: ViewType.FIELDS_WIDGET,
+ isSystemSideEffect: true,
+};
+
+export const SYNCED_FIELDS_WIDGET: WorkspaceFieldsWidget = {
+ universalIdentifier: 'widget-uid-1',
+ universalConfiguration: {
+ configurationType: 'FIELDS',
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ newFieldDefaultVisibility: true,
+ },
+};
+
+export const filterByView = <T extends { viewUniversalIdentifier: string }>(
+ viewFields: T[],
+ viewUniversalIdentifier: string,
+): T[] =>
+ viewFields.filter(
+ (viewField) =>
+ viewField.viewUniversalIdentifier === viewUniversalIdentifier,
+ );
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service.ts
index 68feee76617..0ab0951d854 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service.ts
@@ -1,17 +1,20 @@
import { Injectable } from '@nestjs/common';
import {
+ SYSTEM_VIEW_KEYS,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
} from 'twenty-shared/application';
-import { ViewKey } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
import { buildFieldSideEffectParentNotFoundFailure } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/utils/build-field-side-effect-parent-not-found-failure.util';
import { resolveParentFlatObjectMetadataAfterStateForFieldSideEffect } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/utils/resolve-parent-flat-object-metadata-after-state-for-field-side-effect.util';
import { computeCallerFlatFieldMetadatasForObject } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-caller-flat-field-metadatas-for-object.util';
-import { computeDefaultIndexViewFieldPositionByFieldUniversalIdentifier } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-index-view-field-position-by-field-universal-identifier.util';
+import {
+ computeSameBatchViewFieldPositionByFieldUniversalIdentifier,
+ type ParentFlatObjectMetadataForViewFields,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-same-batch-view-field-position-by-field-universal-identifier.util';
import {
type BuildSideEffectsArgs,
MetadataSideEffectHandler,
@@ -27,7 +30,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
metadataName: 'fieldMetadata',
name: 'fieldIndexViewFieldOnCreate',
description:
- 'When a field is created, provision its visible view field on the parent object INDEX view. Owns the view fields of every caller-provided field, relations included; engine-emitted fields get theirs from the handler that emits them.',
+ 'When a caller-provided field is created, provision its visible engine-owned view field on the parent object INDEX table view (every caller-provided field, relations included; engine-emitted fields get their view fields from the handler that emits them). On same-batch object+field creation the position derives statelessly from the caller-then-system contract shared with objectIndexViewOnCreate, so the layout is contiguous without ordering dependency. On an existing object the view field appends after the existing active positions, except the label identifier, which is placed strictly lowest as the flat view field validator requires. Noop when the object INDEX view does not exist under its derived identifier (unreconciled workspace). A second writer claiming the same (view, field) pair is not deferred to: it is a genuine conflict left to surface downstream (engine collision, then the flat view field validator on the pair). The record-page counterpart is fieldRecordPageViewFieldOnCreate.',
},
) {
buildSideEffects({
@@ -57,7 +60,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
objectMetadataApplicationUniversalIdentifier:
parentFlatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: objectMetadataUniversalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
const parentObjectCreatedInSameBatch = isDefined(
@@ -65,14 +68,14 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
?.flatEntityToCreate[objectMetadataUniversalIdentifier],
);
- const flatViewFieldToCreate = parentObjectCreatedInSameBatch
- ? this.buildViewFieldForObjectCreatedInSameBatch({
+ const flatIndexViewFieldToCreate = parentObjectCreatedInSameBatch
+ ? this.buildIndexViewFieldForObjectCreatedInSameBatch({
sourceFlatFieldMetadata,
parentFlatObjectMetadata,
indexViewUniversalIdentifier,
allFlatEntityOperationRecordByMetadataName,
})
- : this.buildViewFieldForExistingObject({
+ : this.buildIndexViewFieldForExistingObject({
sourceFlatFieldMetadata,
parentFlatObjectMetadata,
indexViewUniversalIdentifier,
@@ -80,7 +83,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
relatedFlatEntityMaps,
});
- if (!isDefined(flatViewFieldToCreate)) {
+ if (!isDefined(flatIndexViewFieldToCreate)) {
return { status: 'noop' };
}
@@ -89,45 +92,31 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
operations: {
viewField: {
flatEntityToCreate: {
- [flatViewFieldToCreate.universalIdentifier]: flatViewFieldToCreate,
+ [flatIndexViewFieldToCreate.universalIdentifier]:
+ flatIndexViewFieldToCreate,
},
},
},
};
}
- private buildViewFieldForObjectCreatedInSameBatch({
+ private buildIndexViewFieldForObjectCreatedInSameBatch({
sourceFlatFieldMetadata,
parentFlatObjectMetadata,
indexViewUniversalIdentifier,
allFlatEntityOperationRecordByMetadataName,
}: {
sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
- parentFlatObjectMetadata: {
- applicationUniversalIdentifier: string;
- labelIdentifierFieldMetadataUniversalIdentifier: string | null;
- };
+ parentFlatObjectMetadata: ParentFlatObjectMetadataForViewFields;
indexViewUniversalIdentifier: string;
allFlatEntityOperationRecordByMetadataName: BuildSideEffectsArgs<'fieldMetadata'>['allFlatEntityOperationRecordByMetadataName'];
}): UniversalFlatViewField {
- const { labelIdentifierFieldMetadataUniversalIdentifier } =
- parentFlatObjectMetadata;
-
- const callerFlatFieldMetadatas = computeCallerFlatFieldMetadatasForObject({
- objectMetadataUniversalIdentifier:
- sourceFlatFieldMetadata.objectMetadataUniversalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier,
- allFlatEntityOperationRecordByMetadataName,
- });
-
const positionByFieldUniversalIdentifier =
- computeDefaultIndexViewFieldPositionByFieldUniversalIdentifier({
- applicationUniversalIdentifier:
- parentFlatObjectMetadata.applicationUniversalIdentifier,
- objectMetadataUniversalIdentifier:
- sourceFlatFieldMetadata.objectMetadataUniversalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier,
- callerFlatFieldMetadatas,
+ computeSameBatchViewFieldPositionByFieldUniversalIdentifier({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy: 'displayedFirst',
});
const position =
@@ -142,7 +131,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
});
}
- private buildViewFieldForExistingObject({
+ private buildIndexViewFieldForExistingObject({
sourceFlatFieldMetadata,
parentFlatObjectMetadata,
indexViewUniversalIdentifier,
@@ -150,10 +139,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
relatedFlatEntityMaps,
}: {
sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
- parentFlatObjectMetadata: {
- applicationUniversalIdentifier: string;
- labelIdentifierFieldMetadataUniversalIdentifier: string | null;
- };
+ parentFlatObjectMetadata: ParentFlatObjectMetadataForViewFields;
indexViewUniversalIdentifier: string;
allFlatEntityOperationRecordByMetadataName: BuildSideEffectsArgs<'fieldMetadata'>['allFlatEntityOperationRecordByMetadataName'];
relatedFlatEntityMaps: BuildSideEffectsArgs<'fieldMetadata'>['relatedFlatEntityMaps'];
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-record-page-view-field-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-record-page-view-field-on-create-side-effect-handler.service.ts
new file mode 100644
index 00000000000..20c0035e276
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-record-page-view-field-on-create-side-effect-handler.service.ts
@@ -0,0 +1,217 @@
+import { Injectable } from '@nestjs/common';
+
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+
+import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
+import { buildFieldSideEffectParentNotFoundFailure } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/utils/build-field-side-effect-parent-not-found-failure.util';
+import { resolveParentFlatObjectMetadataAfterStateForFieldSideEffect } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/utils/resolve-parent-flat-object-metadata-after-state-for-field-side-effect.util';
+import { computeRecordPageViewFieldForExistingObject } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-record-page-view-field-for-existing-object.util';
+import {
+ computeSameBatchViewFieldPositionByFieldUniversalIdentifier,
+ type ParentFlatObjectMetadataForViewFields,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-same-batch-view-field-position-by-field-universal-identifier.util';
+import {
+ type BuildSideEffectsArgs,
+ MetadataSideEffectHandler,
+} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
+import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
+import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
+
+@Injectable()
+export class FieldRecordPageViewFieldOnCreateSideEffectHandlerService extends MetadataSideEffectHandler(
+ {
+ operation: 'create',
+ metadataName: 'fieldMetadata',
+ name: 'fieldRecordPageViewFieldOnCreate',
+ description:
+ 'When a caller-provided field is created, provision its engine-owned view field on the engine-owned FIELDS_WIDGET record-page view, resolved strictly by its derived universal identifier. On an existing object the emission is widget-driven: visibility follows the FIELDS widget newFieldDefaultVisibility and the view field appends into the last active view field group, degrading to no group (the common case: custom objects are created with zero groups). On same-batch object+field creation no widget map exists yet, so the default widget configuration is derived statelessly from the constant (visible, no group, deterministic caller-then-system position shared with objectRecordPageOnCreate). Noop when the object has no engine record-page view, when no active FIELDS widget references it, when the widget does not declare newFieldDefaultVisibility, when the field is the object label identifier (the record page displays it in the title), or when the (view, field) pair is already synced, whatever its identifier. A caller-pending view field for the same pair is not deferred to: the engine always produces its system side effects, and the pair-uniqueness validator surfaces the conflict to the caller, exactly like INDEX. The INDEX counterpart is fieldIndexViewFieldOnCreate.',
+ },
+) {
+ buildSideEffects({
+ flatEntity: flatFieldMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps,
+ }: BuildSideEffectsArgs<'fieldMetadata'>): MetadataSideEffectResult {
+ const sourceFlatFieldMetadata =
+ flatFieldMetadata as UniversalFlatFieldMetadata;
+ const { objectMetadataUniversalIdentifier } = sourceFlatFieldMetadata;
+
+ const parentFlatObjectMetadata =
+ resolveParentFlatObjectMetadataAfterStateForFieldSideEffect({
+ objectMetadataUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps,
+ });
+
+ if (!isDefined(parentFlatObjectMetadata)) {
+ return buildFieldSideEffectParentNotFoundFailure({
+ flatFieldMetadata: sourceFlatFieldMetadata,
+ operation: 'create',
+ });
+ }
+
+ const recordPageViewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ parentFlatObjectMetadata.applicationUniversalIdentifier,
+ objectUniversalIdentifier: objectMetadataUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ const parentObjectCreatedInSameBatch = isDefined(
+ allFlatEntityOperationRecordByMetadataName.objectMetadata
+ ?.flatEntityToCreate[objectMetadataUniversalIdentifier],
+ );
+
+ const flatRecordPageViewFieldToCreate = parentObjectCreatedInSameBatch
+ ? this.buildRecordPageViewFieldForObjectCreatedInSameBatch({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ recordPageViewUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ })
+ : this.buildRecordPageViewFieldForExistingObject({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ recordPageViewUniversalIdentifier,
+ relatedFlatEntityMaps,
+ });
+
+ if (!isDefined(flatRecordPageViewFieldToCreate)) {
+ return { status: 'noop' };
+ }
+
+ return {
+ status: 'success',
+ operations: {
+ viewField: {
+ flatEntityToCreate: {
+ [flatRecordPageViewFieldToCreate.universalIdentifier]:
+ flatRecordPageViewFieldToCreate,
+ },
+ },
+ },
+ };
+ }
+
+ private buildRecordPageViewFieldForObjectCreatedInSameBatch({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ recordPageViewUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ }: {
+ sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
+ parentFlatObjectMetadata: ParentFlatObjectMetadataForViewFields;
+ recordPageViewUniversalIdentifier: string;
+ allFlatEntityOperationRecordByMetadataName: BuildSideEffectsArgs<'fieldMetadata'>['allFlatEntityOperationRecordByMetadataName'];
+ }): UniversalFlatViewField | undefined {
+ const { labelIdentifierFieldMetadataUniversalIdentifier } =
+ parentFlatObjectMetadata;
+
+ if (
+ sourceFlatFieldMetadata.universalIdentifier ===
+ labelIdentifierFieldMetadataUniversalIdentifier
+ ) {
+ return undefined;
+ }
+
+ const positionByFieldUniversalIdentifier =
+ computeSameBatchViewFieldPositionByFieldUniversalIdentifier({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy: 'excluded',
+ });
+
+ const createdAt = new Date().toISOString();
+ const { applicationUniversalIdentifier } = sourceFlatFieldMetadata;
+
+ return {
+ universalIdentifier: getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ viewUniversalIdentifier: recordPageViewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier:
+ sourceFlatFieldMetadata.universalIdentifier,
+ }),
+ applicationUniversalIdentifier,
+ fieldMetadataUniversalIdentifier:
+ sourceFlatFieldMetadata.universalIdentifier,
+ viewUniversalIdentifier: recordPageViewUniversalIdentifier,
+ viewFieldGroupUniversalIdentifier: null,
+ isVisible: true,
+ size: DEFAULT_VIEW_FIELD_SIZE,
+ position:
+ positionByFieldUniversalIdentifier.get(
+ sourceFlatFieldMetadata.universalIdentifier,
+ ) ?? 0,
+ aggregateOperation: null,
+ isActive: true,
+ isSystemSideEffect: true,
+ universalOverrides: null,
+ createdAt,
+ updatedAt: createdAt,
+ deletedAt: null,
+ };
+ }
+
+ private buildRecordPageViewFieldForExistingObject({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ recordPageViewUniversalIdentifier,
+ relatedFlatEntityMaps,
+ }: {
+ sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
+ parentFlatObjectMetadata: ParentFlatObjectMetadataForViewFields;
+ recordPageViewUniversalIdentifier: string;
+ relatedFlatEntityMaps: BuildSideEffectsArgs<'fieldMetadata'>['relatedFlatEntityMaps'];
+ }): UniversalFlatViewField | undefined {
+ if (
+ sourceFlatFieldMetadata.universalIdentifier ===
+ parentFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier
+ ) {
+ return undefined;
+ }
+
+ const existingRecordPageFlatView =
+ relatedFlatEntityMaps.flatViewMaps.byUniversalIdentifier[
+ recordPageViewUniversalIdentifier
+ ];
+
+ const pairAlreadySynced =
+ isDefined(existingRecordPageFlatView) &&
+ existingRecordPageFlatView.viewFieldUniversalIdentifiers.some(
+ (viewFieldUniversalIdentifier) => {
+ const existingFlatViewField =
+ relatedFlatEntityMaps.flatViewFieldMaps.byUniversalIdentifier[
+ viewFieldUniversalIdentifier
+ ];
+
+ return (
+ isDefined(existingFlatViewField) &&
+ existingFlatViewField.fieldMetadataUniversalIdentifier ===
+ sourceFlatFieldMetadata.universalIdentifier &&
+ !isDefined(existingFlatViewField.deletedAt)
+ );
+ },
+ );
+
+ if (pairAlreadySynced) {
+ return undefined;
+ }
+
+ return computeRecordPageViewFieldForExistingObject({
+ sourceFlatFieldMetadata,
+ recordPageViewUniversalIdentifier,
+ flatViewMaps: relatedFlatEntityMaps.flatViewMaps,
+ flatViewFieldMaps: relatedFlatEntityMaps.flatViewFieldMaps,
+ flatViewFieldGroupMaps: relatedFlatEntityMaps.flatViewFieldGroupMaps,
+ flatPageLayoutWidgetMaps: relatedFlatEntityMaps.flatPageLayoutWidgetMaps,
+ });
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-system-view-fields-on-delete-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-system-view-fields-on-delete-side-effect-handler.service.ts
index fa37330cfe9..eb5ce64eb38 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-system-view-fields-on-delete-side-effect-handler.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-system-view-fields-on-delete-side-effect-handler.service.ts
@@ -14,7 +14,7 @@ export class FieldSystemViewFieldsOnDeleteSideEffectHandlerService extends Metad
metadataName: 'fieldMetadata',
name: 'fieldSystemViewFieldsOnDelete',
description:
- 'When a field is deleted, cascade-delete every engine-owned view field displaying it, wherever it lives: the INDEX view fields emitted by fieldIndexViewFieldOnCreate, and the record-page ones. Counterpart of fieldIndexViewFieldOnCreate: the engine authored those view fields, so it owns their deletion. Manifest deletion inference excludes isSystemSideEffect entities, so without this cascade they would only ever disappear through the viewField -> fieldMetadata foreign key, behind the engine back. Caller-authored view fields are NOT touched: they are deleted through normal deletion inference / the field delete transpiler.',
+ 'When a field is deleted, cascade-delete every engine-owned view field displaying it, wherever it lives: the INDEX view fields emitted by fieldIndexViewFieldOnCreate, and the record-page ones emitted by fieldRecordPageViewFieldOnCreate. Counterpart of both: the engine authored those view fields, so it owns their deletion. Manifest deletion inference excludes isSystemSideEffect entities, so without this cascade they would only ever disappear through the viewField -> fieldMetadata foreign key, behind the engine back. Caller-authored view fields are NOT touched: they are deleted through normal deletion inference / the field delete transpiler.',
},
) {
buildSideEffects({
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/metadata-side-effect-handlers.module.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/metadata-side-effect-handlers.module.ts
index 40e1eec1fb7..daf825bb85d 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/metadata-side-effect-handlers.module.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/metadata-side-effect-handlers.module.ts
@@ -1,15 +1,19 @@
import { Module } from '@nestjs/common';
-import { FieldIndexViewFieldOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service';
import { FieldSearchFieldMetadataOnDeleteSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-search-field-metadata-on-delete-side-effect-handler.service';
+import { FieldIndexViewFieldOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-index-view-field-on-create-side-effect-handler.service';
+import { FieldRecordPageViewFieldOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-record-page-view-field-on-create-side-effect-handler.service';
import { FieldSystemViewFieldsOnDeleteSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-system-view-fields-on-delete-side-effect-handler.service';
import { FieldUniqueBackingIndexOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-unique-backing-index-on-create-side-effect-handler.service';
import { FieldUniqueBackingIndexOnDeleteSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-unique-backing-index-on-delete-side-effect-handler.service';
import { FieldUniqueBackingIndexOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/field-metadata/services/field-unique-backing-index-on-update-side-effect-handler.service';
-import { ObjectSearchVectorOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-search-vector-on-create-side-effect-handler.service';
import { ObjectIndexViewLabelIdentifierOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service';
+import { ObjectIndexViewOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-on-create-side-effect-handler.service';
+import { ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-label-identifier-on-update-side-effect-handler.service';
+import { ObjectRecordPageOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-on-create-side-effect-handler.service';
+import { ObjectSearchVectorOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-search-vector-on-create-side-effect-handler.service';
import { ObjectSearchVectorOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-search-vector-on-update-side-effect-handler.service';
-import { ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-and-index-view-on-create-side-effect-handler.service';
+import { ObjectSystemFieldsOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-on-create-side-effect-handler.service';
import { ObjectSystemRelationsOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-relations-on-create-side-effect-handler.service';
import { ObjectSystemRelationsOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-relations-on-update-side-effect-handler.service';
import { ObjectSystemSideEffectsOnDeleteSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-side-effects-on-delete-side-effect-handler.service';
@@ -21,13 +25,17 @@ import { ObjectSystemSideEffectsOnDeleteSideEffectHandlerService } from 'src/eng
FieldUniqueBackingIndexOnDeleteSideEffectHandlerService,
FieldSearchFieldMetadataOnDeleteSideEffectHandlerService,
FieldIndexViewFieldOnCreateSideEffectHandlerService,
+ FieldRecordPageViewFieldOnCreateSideEffectHandlerService,
FieldSystemViewFieldsOnDeleteSideEffectHandlerService,
- ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService,
+ ObjectSystemFieldsOnCreateSideEffectHandlerService,
+ ObjectIndexViewOnCreateSideEffectHandlerService,
+ ObjectRecordPageOnCreateSideEffectHandlerService,
ObjectSystemRelationsOnCreateSideEffectHandlerService,
ObjectSystemRelationsOnUpdateSideEffectHandlerService,
ObjectSearchVectorOnCreateSideEffectHandlerService,
ObjectSearchVectorOnUpdateSideEffectHandlerService,
ObjectIndexViewLabelIdentifierOnUpdateSideEffectHandlerService,
+ ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService,
ObjectSystemSideEffectsOnDeleteSideEffectHandlerService,
],
})
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-label-identifier-on-update-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-label-identifier-on-update-side-effect-handler.service.spec.ts
index cd3e60f93c1..075690cd424 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-label-identifier-on-update-side-effect-handler.service.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-label-identifier-on-update-side-effect-handler.service.spec.ts
@@ -1,5 +1,7 @@
-import { getSystemViewUniversalIdentifier } from 'twenty-shared/application';
-import { ViewKey } from 'twenty-shared/types';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
import { ObjectIndexViewLabelIdentifierOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service';
import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
@@ -13,7 +15,7 @@ const INDEX_VIEW_UNIVERSAL_IDENTIFIER = getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
const NAME_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-and-index-view-on-create-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-on-create-side-effect-handler.service.spec.ts
similarity index 84%
rename from packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-and-index-view-on-create-side-effect-handler.service.spec.ts
rename to packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-on-create-side-effect-handler.service.spec.ts
index 31316e111ab..66a8897476b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-and-index-view-on-create-side-effect-handler.service.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-index-view-on-create-side-effect-handler.service.spec.ts
@@ -1,12 +1,13 @@
import {
+ SYSTEM_VIEW_KEYS,
getFieldUniversalIdentifier,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
} from 'twenty-shared/application';
-import { FieldMetadataType, ViewKey } from 'twenty-shared/types';
+import { FieldMetadataType } from 'twenty-shared/types';
import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
-import { ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-and-index-view-on-create-side-effect-handler.service';
+import { ObjectIndexViewOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-on-create-side-effect-handler.service';
import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
const APPLICATION_UNIVERSAL_IDENTIFIER = 'a1a2a3a4-a5a6-4000-8000-000000000001';
@@ -22,19 +23,6 @@ const computeFieldUniversalIdentifier = (name: string) =>
});
const NAME_FIELD_UNIVERSAL_IDENTIFIER = computeFieldUniversalIdentifier('name');
-const SEARCH_VECTOR_FIELD_UNIVERSAL_IDENTIFIER =
- computeFieldUniversalIdentifier('searchVector');
-
-const ALL_SYSTEM_FIELD_NAMES = [
- 'id',
- 'createdAt',
- 'updatedAt',
- 'deletedAt',
- 'createdBy',
- 'updatedBy',
- 'position',
-] as const;
-
// The subset of system fields the INDEX view displays: id/deletedAt/position are
// filtered out by the view-field builder.
const DISPLAYABLE_SYSTEM_FIELD_NAMES = [
@@ -49,7 +37,7 @@ const DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER =
objectMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
type PendingFieldMetadata = {
@@ -110,39 +98,9 @@ const buildArgs = ({
context: {},
}) as unknown as BuildSideEffectsArgs<'objectMetadata'>;
-describe('ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService', () => {
+describe('ObjectIndexViewOnCreateSideEffectHandlerService', () => {
const handler =
- new (ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService as unknown as new () => ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService)();
-
- it('should synthesize exactly the 7 reserved system fields, never the caller name nor searchVector', () => {
- const result = handler.buildSideEffects(
- buildArgs({ pendingFieldMetadatas: [NAME_FIELD] }),
- );
-
- expect(result.status).toBe('success');
-
- if (result.status !== 'success') {
- throw new Error('expected success');
- }
-
- const createdUniversalIdentifiers = Object.keys(
- result.operations.fieldMetadata?.flatEntityToCreate ?? {},
- );
-
- expect(createdUniversalIdentifiers).toHaveLength(7);
- expect(createdUniversalIdentifiers).not.toContain(
- NAME_FIELD_UNIVERSAL_IDENTIFIER,
- );
- expect(createdUniversalIdentifiers).not.toContain(
- SEARCH_VECTOR_FIELD_UNIVERSAL_IDENTIFIER,
- );
-
- for (const name of ALL_SYSTEM_FIELD_NAMES) {
- expect(createdUniversalIdentifiers).toContain(
- computeFieldUniversalIdentifier(name),
- );
- }
- });
+ new (ObjectIndexViewOnCreateSideEffectHandlerService as unknown as new () => ObjectIndexViewOnCreateSideEffectHandlerService)();
it('should provision the INDEX view and the system-field view fields only, positioned after the displayable caller fields', () => {
const result = handler.buildSideEffects(
@@ -244,9 +202,6 @@ describe('ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService', () =>
throw new Error('expected success');
}
- expect(
- Object.keys(result.operations.fieldMetadata?.flatEntityToCreate ?? {}),
- ).toHaveLength(7);
expect(
Object.keys(result.operations.view?.flatEntityToCreate ?? {}),
).toEqual([DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER]);
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-label-identifier-on-update-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-label-identifier-on-update-side-effect-handler.service.spec.ts
new file mode 100644
index 00000000000..a9183b7b8d1
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-label-identifier-on-update-side-effect-handler.service.spec.ts
@@ -0,0 +1,388 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+
+import { ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-label-identifier-on-update-side-effect-handler.service';
+import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+
+const APPLICATION_UNIVERSAL_IDENTIFIER = 'a1a2a3a4-a5a6-4000-8000-000000000001';
+const OBJECT_UNIVERSAL_IDENTIFIER = 'b1b2b3b4-b5b6-4000-8000-000000000001';
+const PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER =
+ 'c1c2c3c4-c5c6-4000-8000-000000000001';
+const NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER =
+ 'c1c2c3c4-c5c6-4000-8000-000000000002';
+
+const DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+const NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ });
+
+const FIELDS_WIDGET = {
+ universalIdentifier: 'widget-uid-1',
+ isActive: true,
+ deletedAt: null,
+ universalConfiguration: {
+ configurationType: 'FIELDS',
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ newFieldDefaultVisibility: true,
+ },
+};
+
+const buildArgs = ({
+ previousLabelIdentifier = PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ newLabelIdentifier = NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ recordPageView = {
+ id: 'view-db-id-1',
+ universalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: true,
+ deletedAt: null,
+ },
+ recordPageViewFields = [] as {
+ universalIdentifier: string;
+ fieldMetadataUniversalIdentifier: string;
+ isSystemSideEffect?: boolean;
+ position?: number;
+ deletedAt?: string | null;
+ viewFieldGroupUniversalIdentifier?: string | null;
+ isActive?: boolean;
+ }[],
+ fieldsWidgets = [FIELDS_WIDGET],
+ fieldMetadatasDeletedInBatch = [] as string[],
+ viewFieldsPendingInBatch = [] as {
+ universalIdentifier: string;
+ viewUniversalIdentifier: string;
+ fieldMetadataUniversalIdentifier: string;
+ }[],
+} = {}): BuildSideEffectsArgs<'objectMetadata'> =>
+ ({
+ flatEntity: {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ labelIdentifierFieldMetadataUniversalIdentifier: newLabelIdentifier,
+ },
+ allFlatEntityOperationRecordByMetadataName: {
+ fieldMetadata: {
+ flatEntityToCreate: {},
+ flatEntityToUpdate: {},
+ flatEntityToDelete: Object.fromEntries(
+ fieldMetadatasDeletedInBatch.map((fieldUniversalIdentifier) => [
+ fieldUniversalIdentifier,
+ { universalIdentifier: fieldUniversalIdentifier },
+ ]),
+ ),
+ },
+ ...(viewFieldsPendingInBatch.length > 0 && {
+ viewField: {
+ flatEntityToCreate: Object.fromEntries(
+ viewFieldsPendingInBatch.map((pendingViewField) => [
+ pendingViewField.universalIdentifier,
+ pendingViewField,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ }),
+ },
+ relatedFlatEntityMaps: {
+ flatObjectMetadataMaps: {
+ byUniversalIdentifier: {
+ [OBJECT_UNIVERSAL_IDENTIFIER]: {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ labelIdentifierFieldMetadataUniversalIdentifier:
+ previousLabelIdentifier,
+ },
+ },
+ },
+ flatFieldMetadataMaps: {
+ byUniversalIdentifier: {
+ [PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER]: {
+ universalIdentifier: PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ [NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER]: {
+ universalIdentifier: NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ },
+ },
+ flatViewMaps: {
+ byUniversalIdentifier: {
+ [recordPageView.universalIdentifier]: {
+ ...recordPageView,
+ viewFieldUniversalIdentifiers: recordPageViewFields.map(
+ (viewField) => viewField.universalIdentifier,
+ ),
+ viewFieldGroupUniversalIdentifiers: [],
+ },
+ },
+ },
+ flatViewFieldMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ recordPageViewFields.map((viewField) => [
+ viewField.universalIdentifier,
+ {
+ isSystemSideEffect: true,
+ position: 0,
+ deletedAt: null,
+ isActive: true,
+ viewFieldGroupUniversalIdentifier: null,
+ ...viewField,
+ },
+ ]),
+ ),
+ },
+ flatViewFieldGroupMaps: { byUniversalIdentifier: {} },
+ flatPageLayoutWidgetMaps: {
+ byUniversalIdentifier: Object.fromEntries(
+ fieldsWidgets.map((fieldsWidget) => [
+ fieldsWidget.universalIdentifier,
+ fieldsWidget,
+ ]),
+ ),
+ },
+ },
+ context: {},
+ }) as unknown as BuildSideEffectsArgs<'objectMetadata'>;
+
+describe('ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService', () => {
+ const handler =
+ new (ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService as unknown as new () => ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService)();
+
+ it('should delete the new label identifier engine view field and restore the previous one', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ position: 3,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const deletedViewFields = Object.values(
+ result.operations.viewField?.flatEntityToDelete ?? {},
+ );
+
+ expect(deletedViewFields).toHaveLength(1);
+ expect(deletedViewFields[0].universalIdentifier).toBe(
+ NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ );
+
+ const createdViewFields = Object.values(
+ result.operations.viewField?.flatEntityToCreate ?? {},
+ );
+
+ expect(createdViewFields).toHaveLength(1);
+ expect(createdViewFields[0]).toMatchObject({
+ universalIdentifier: getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ }),
+ fieldMetadataUniversalIdentifier:
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: true,
+ // Appended after the (deleted) view field at position 3.
+ position: 4,
+ });
+ });
+
+ it('should noop when the label identifier is unchanged', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ previousLabelIdentifier: NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ newLabelIdentifier: NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+
+ it('should noop when the object has no engine-owned record-page view', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageView: {
+ id: 'view-db-id-1',
+ universalIdentifier: 'not-the-derived-identifier',
+ isSystemSideEffect: true,
+ deletedAt: null,
+ },
+ }),
+ );
+
+ expect(result.status).toBe('noop');
+ });
+
+ it('should not delete a caller-owned view field displaying the new label identifier', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: 'caller-owned-view-field-uid',
+ fieldMetadataUniversalIdentifier:
+ NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ isSystemSideEffect: false,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(
+ Object.values(result.operations.viewField?.flatEntityToDelete ?? {}),
+ ).toHaveLength(0);
+ });
+
+ it('should not restore the previous label identifier when it is already displayed', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: 'previous-label-view-field-uid',
+ fieldMetadataUniversalIdentifier:
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ // Nothing to delete and nothing to restore: the handler emits no
+ // operations at all.
+ expect(result.status).toBe('noop');
+ });
+
+ it('should not restore a previous label identifier deleted in the same batch', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ fieldMetadatasDeletedInBatch: [
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ ).toHaveLength(0);
+ // The exclusion half still applies.
+ expect(
+ Object.values(result.operations.viewField?.flatEntityToDelete ?? {}),
+ ).toHaveLength(1);
+ });
+
+ // The engine always produces its system side effects: a caller-pending view
+ // field for the same pair is a conflict the pair-uniqueness validator
+ // surfaces to the caller, not something the engine yields to.
+ it('should restore the previous label identifier even when the batch declares a view field for the same pair', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ viewFieldsPendingInBatch: [
+ {
+ universalIdentifier: 'caller-authored-view-field-uid',
+ viewUniversalIdentifier:
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const restoredFlatViewFields = Object.values(
+ result.operations.viewField?.flatEntityToCreate ?? {},
+ );
+
+ expect(restoredFlatViewFields).toHaveLength(1);
+ expect(restoredFlatViewFields[0].fieldMetadataUniversalIdentifier).toBe(
+ PREVIOUS_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ );
+ expect(restoredFlatViewFields[0].isSystemSideEffect).toBe(true);
+ });
+
+ it('should not restore the previous label identifier when no active FIELDS widget references the view', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ recordPageViewFields: [
+ {
+ universalIdentifier: NEW_LABEL_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier:
+ NEW_LABEL_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ fieldsWidgets: [],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(
+ Object.values(result.operations.viewField?.flatEntityToCreate ?? {}),
+ ).toHaveLength(0);
+ // The exclusion half still applies.
+ expect(
+ Object.values(result.operations.viewField?.flatEntityToDelete ?? {}),
+ ).toHaveLength(1);
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-on-create-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-on-create-side-effect-handler.service.spec.ts
new file mode 100644
index 00000000000..186dce29193
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-record-page-on-create-side-effect-handler.service.spec.ts
@@ -0,0 +1,225 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemPageLayoutTabUniversalIdentifier,
+ getSystemPageLayoutWidgetUniversalIdentifier,
+ getSystemRecordPageLayoutUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { ViewType } from 'twenty-shared/types';
+
+import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
+import { ObjectRecordPageOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-on-create-side-effect-handler.service';
+import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+
+const APPLICATION_UNIVERSAL_IDENTIFIER = 'a1a2a3a4-a5a6-4000-8000-000000000001';
+const OBJECT_UNIVERSAL_IDENTIFIER = 'b1b2b3b4-b5b6-4000-8000-000000000001';
+
+const OBJECT_METADATA = {
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ labelSingular: 'Ticket',
+ labelIdentifierFieldMetadataUniversalIdentifier: null,
+};
+
+const DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+const DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ });
+
+const buildArgs = ({
+ pendingViews = [],
+ pendingPageLayouts = [],
+}: {
+ pendingViews?: {
+ universalIdentifier: string;
+ isSystemSideEffect: boolean;
+ type: ViewType;
+ objectMetadataUniversalIdentifier: string;
+ }[];
+ pendingPageLayouts?: {
+ universalIdentifier: string;
+ isSystemSideEffect: boolean;
+ type: PageLayoutType;
+ objectMetadataUniversalIdentifier: string;
+ }[];
+} = {}): BuildSideEffectsArgs<'objectMetadata'> =>
+ ({
+ flatEntity: OBJECT_METADATA,
+ allFlatEntityOperationRecordByMetadataName: {
+ objectMetadata: {
+ flatEntityToCreate: { [OBJECT_UNIVERSAL_IDENTIFIER]: OBJECT_METADATA },
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ fieldMetadata: {
+ flatEntityToCreate: {},
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ view: {
+ flatEntityToCreate: Object.fromEntries(
+ pendingViews.map((pendingView) => [
+ pendingView.universalIdentifier,
+ pendingView,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ pageLayout: {
+ flatEntityToCreate: Object.fromEntries(
+ pendingPageLayouts.map((pendingPageLayout) => [
+ pendingPageLayout.universalIdentifier,
+ pendingPageLayout,
+ ]),
+ ),
+ flatEntityToUpdate: {},
+ flatEntityToDelete: {},
+ },
+ } as unknown as AllFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps: {},
+ context: {},
+ }) as unknown as BuildSideEffectsArgs<'objectMetadata'>;
+
+describe('ObjectRecordPageOnCreateSideEffectHandlerService', () => {
+ const handler =
+ new (ObjectRecordPageOnCreateSideEffectHandlerService as unknown as new () => ObjectRecordPageOnCreateSideEffectHandlerService)();
+
+ it('should emit the full record-page stack with derived identifiers', () => {
+ const result = handler.buildSideEffects(buildArgs());
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const views = Object.values(
+ result.operations.view?.flatEntityToCreate ?? {},
+ );
+
+ expect(views).toHaveLength(1);
+ expect(views[0]).toMatchObject({
+ universalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ key: null,
+ type: ViewType.FIELDS_WIDGET,
+ isSystemSideEffect: true,
+ name: 'Ticket Record Page Fields',
+ });
+
+ const pageLayouts = Object.values(
+ result.operations.pageLayout?.flatEntityToCreate ?? {},
+ );
+
+ expect(pageLayouts).toHaveLength(1);
+ expect(pageLayouts[0]).toMatchObject({
+ universalIdentifier: DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ type: PageLayoutType.RECORD_PAGE,
+ isSystemSideEffect: true,
+ });
+
+ const pageLayoutTabs = Object.values(
+ result.operations.pageLayoutTab?.flatEntityToCreate ?? {},
+ );
+
+ expect(pageLayoutTabs).toHaveLength(5);
+ expect(pageLayoutTabs.map((tab) => tab.title)).toEqual([
+ 'Home',
+ 'Timeline',
+ 'Tasks',
+ 'Notes',
+ 'Files',
+ ]);
+ for (const pageLayoutTab of pageLayoutTabs) {
+ expect(pageLayoutTab.universalIdentifier).toBe(
+ getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ pageLayoutUniversalIdentifier:
+ DERIVED_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ title: pageLayoutTab.title,
+ }),
+ );
+ expect(pageLayoutTab.isSystemSideEffect).toBe(true);
+ }
+
+ const pageLayoutWidgets = Object.values(
+ result.operations.pageLayoutWidget?.flatEntityToCreate ?? {},
+ );
+
+ expect(pageLayoutWidgets).toHaveLength(5);
+ for (const pageLayoutWidget of pageLayoutWidgets) {
+ expect(pageLayoutWidget.universalIdentifier).toBe(
+ getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ APPLICATION_UNIVERSAL_IDENTIFIER,
+ pageLayoutTabUniversalIdentifier:
+ pageLayoutWidget.pageLayoutTabUniversalIdentifier,
+ title: pageLayoutWidget.title,
+ }),
+ );
+ expect(pageLayoutWidget.isSystemSideEffect).toBe(true);
+ }
+
+ const fieldsWidget = pageLayoutWidgets.find(
+ (pageLayoutWidget) =>
+ pageLayoutWidget.universalConfiguration.configurationType ===
+ WidgetConfigurationType.FIELDS,
+ );
+
+ expect(fieldsWidget?.universalConfiguration).toMatchObject({
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ newFieldDefaultVisibility: true,
+ });
+ });
+
+ // Caller-defined custom record pages coexist with the system stack: the
+ // engine emits its own whatever the batch carries.
+ it('should still emit when the batch carries a caller-authored record-page stack for the object', () => {
+ const result = handler.buildSideEffects(
+ buildArgs({
+ pendingViews: [
+ {
+ universalIdentifier: 'app-authored-view-uid',
+ isSystemSideEffect: false,
+ type: ViewType.FIELDS_WIDGET,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ pendingPageLayouts: [
+ {
+ universalIdentifier: 'app-authored-layout-uid',
+ isSystemSideEffect: false,
+ type: PageLayoutType.RECORD_PAGE,
+ objectMetadataUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ },
+ ],
+ }),
+ );
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(
+ Object.values(result.operations.view?.flatEntityToCreate ?? {}),
+ ).toHaveLength(1);
+ expect(
+ Object.values(result.operations.pageLayout?.flatEntityToCreate ?? {}),
+ ).toHaveLength(1);
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-on-create-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-on-create-side-effect-handler.service.spec.ts
new file mode 100644
index 00000000000..0de02862fc3
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-fields-on-create-side-effect-handler.service.spec.ts
@@ -0,0 +1,89 @@
+import { getFieldUniversalIdentifier } from 'twenty-shared/application';
+
+import { ObjectSystemFieldsOnCreateSideEffectHandlerService } from 'src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-on-create-side-effect-handler.service';
+import { type BuildSideEffectsArgs } from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+
+const APPLICATION_UNIVERSAL_IDENTIFIER = 'a1a2a3a4-a5a6-4000-8000-000000000001';
+const OBJECT_UNIVERSAL_IDENTIFIER = 'b1b2b3b4-b5b6-4000-8000-000000000001';
+
+const computeFieldUniversalIdentifier = (name: string) =>
+ getFieldUniversalIdentifier({
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ name,
+ });
+
+const ALL_SYSTEM_FIELD_NAMES = [
+ 'id',
+ 'createdAt',
+ 'updatedAt',
+ 'deletedAt',
+ 'createdBy',
+ 'updatedBy',
+ 'position',
+] as const;
+
+const buildArgs = (): BuildSideEffectsArgs<'objectMetadata'> =>
+ ({
+ flatEntity: {
+ applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
+ universalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
+ nameSingular: 'ticket',
+ labelIdentifierFieldMetadataUniversalIdentifier:
+ computeFieldUniversalIdentifier('name'),
+ },
+ allFlatEntityOperationRecordByMetadataName: {},
+ relatedFlatEntityMaps: {},
+ context: {},
+ }) as unknown as BuildSideEffectsArgs<'objectMetadata'>;
+
+describe('ObjectSystemFieldsOnCreateSideEffectHandlerService', () => {
+ const handler =
+ new (ObjectSystemFieldsOnCreateSideEffectHandlerService as unknown as new () => ObjectSystemFieldsOnCreateSideEffectHandlerService)();
+
+ it('should synthesize exactly the 7 reserved system fields, never the caller name nor searchVector', () => {
+ const result = handler.buildSideEffects(buildArgs());
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ const createdUniversalIdentifiers = Object.keys(
+ result.operations.fieldMetadata?.flatEntityToCreate ?? {},
+ );
+
+ expect(createdUniversalIdentifiers).toHaveLength(7);
+ expect(createdUniversalIdentifiers).not.toContain(
+ computeFieldUniversalIdentifier('name'),
+ );
+ expect(createdUniversalIdentifiers).not.toContain(
+ computeFieldUniversalIdentifier('searchVector'),
+ );
+
+ for (const name of ALL_SYSTEM_FIELD_NAMES) {
+ expect(createdUniversalIdentifiers).toContain(
+ computeFieldUniversalIdentifier(name),
+ );
+ }
+
+ for (const createdFlatFieldMetadata of Object.values(
+ result.operations.fieldMetadata?.flatEntityToCreate ?? {},
+ )) {
+ expect(createdFlatFieldMetadata.isSystemSideEffect).toBe(true);
+ }
+ });
+
+ it('should emit nothing but field metadata', () => {
+ const result = handler.buildSideEffects(buildArgs());
+
+ expect(result.status).toBe('success');
+
+ if (result.status !== 'success') {
+ throw new Error('expected success');
+ }
+
+ expect(Object.keys(result.operations)).toEqual(['fieldMetadata']);
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-side-effects-on-delete-side-effect-handler.service.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-side-effects-on-delete-side-effect-handler.service.spec.ts
index 51f94d296dc..d34ed4d4c2d 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-side-effects-on-delete-side-effect-handler.service.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/__tests__/object-system-side-effects-on-delete-side-effect-handler.service.spec.ts
@@ -37,6 +37,7 @@ type ViewFixture = {
universalIdentifier: string;
isSystemSideEffect: boolean;
viewFieldUniversalIdentifiers?: string[];
+ viewFieldGroupUniversalIdentifiers?: string[];
};
const buildFieldMetadataMaps = (fields: FieldFixture[]) => ({
@@ -82,6 +83,10 @@ const buildArgs = ({
flatSearchFieldMetadataMaps: { byUniversalIdentifier: {} },
flatViewMaps: { byUniversalIdentifier: {} },
flatViewFieldMaps: { byUniversalIdentifier: {} },
+ flatViewFieldGroupMaps: { byUniversalIdentifier: {} },
+ flatPageLayoutMaps: { byUniversalIdentifier: {} },
+ flatPageLayoutTabMaps: { byUniversalIdentifier: {} },
+ flatPageLayoutWidgetMaps: { byUniversalIdentifier: {} },
...relatedFlatEntityMaps,
},
context: {},
@@ -272,7 +277,10 @@ describe('ObjectSystemSideEffectsOnDeleteSideEffectHandlerService', () => {
],
},
] satisfies ViewFixture[]
- ).map((view) => [view.universalIdentifier, view]),
+ ).map((view) => [
+ view.universalIdentifier,
+ { viewFieldGroupUniversalIdentifiers: [], ...view },
+ ]),
),
},
flatViewFieldMaps: {
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service.ts
index e578e50b5c0..87f70cbfb1f 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-label-identifier-on-update-side-effect-handler.service.ts
@@ -1,8 +1,10 @@
import { msg, t } from '@lingui/core/macro';
import { Injectable } from '@nestjs/common';
-import { getSystemViewUniversalIdentifier } from 'twenty-shared/application';
-import { ViewKey } from 'twenty-shared/types';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
import { isDefined } from 'twenty-shared/utils';
import { type MetadataFlatEntity } from 'src/engine/metadata-modules/flat-entity/types/metadata-flat-entity.type';
@@ -69,7 +71,7 @@ export class ObjectIndexViewLabelIdentifierOnUpdateSideEffectHandlerService exte
objectMetadataApplicationUniversalIdentifier:
updatedFlatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: updatedFlatObjectMetadata.universalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
const indexFlatView =
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-on-create-side-effect-handler.service.ts
new file mode 100644
index 00000000000..af358aba018
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-index-view-on-create-side-effect-handler.service.ts
@@ -0,0 +1,63 @@
+import { SYSTEM_VIEW_KEYS } from 'twenty-shared/application';
+import { Injectable } from '@nestjs/common';
+
+import { fromArrayToUniqueKeyRecord } from 'twenty-shared/utils';
+
+import { computeSystemViewFieldsForCreatedObjectView } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-for-created-object-view.util';
+import { computeSystemViewToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util';
+import {
+ type BuildSideEffectsArgs,
+ MetadataSideEffectHandler,
+} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+
+@Injectable()
+export class ObjectIndexViewOnCreateSideEffectHandlerService extends MetadataSideEffectHandler(
+ {
+ operation: 'create',
+ metadataName: 'objectMetadata',
+ name: 'objectIndexViewOnCreate',
+ description:
+ 'When an object is created, provision its default INDEX table view ("All {objectLabelPlural}") with one view field per displayable SYSTEM field only, all isSystemSideEffect so the engine owns their lifecycle. The reserved system fields themselves are created by objectSystemFieldsOnCreate; this handler re-derives them statelessly from the object identity, so there is no ordering dependency between the two. View fields for caller-provided fields are owned by fieldIndexViewFieldOnCreate (the field creation side effect), which positions them before the system view fields; both handlers derive positions from the same caller-input list so the layout is contiguous without any ordering dependency. The view identifier is name-free (object identifier + INDEX view key), so an object rename keeps the same view. The engine is the sole owner of the INDEX view and always emits it: the flat view validator rejects caller-created INDEX views (caller inputs are forced isSystemSideEffect: false) and enforces a single non-deleted INDEX view per object. twenty-standard is not concerned: it synchronizes through the from/to migration path, which never runs the side-effect engine, and authors its own curated INDEX view/fields.',
+ },
+) {
+ buildSideEffects({
+ flatEntity: flatObjectMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ }: BuildSideEffectsArgs<'objectMetadata'>): MetadataSideEffectResult {
+ const sourceFlatObjectMetadata =
+ flatObjectMetadata as UniversalFlatObjectMetadata;
+ const { applicationUniversalIdentifier } = sourceFlatObjectMetadata;
+
+ const flatIndexViewToCreate = computeSystemViewToCreate({
+ objectMetadata: sourceFlatObjectMetadata,
+ applicationUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
+ });
+
+ const flatViewFieldsToCreate = computeSystemViewFieldsForCreatedObjectView({
+ sourceFlatObjectMetadata,
+ viewUniversalIdentifier: flatIndexViewToCreate.universalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy: 'displayedFirst',
+ });
+
+ return {
+ status: 'success',
+ operations: {
+ view: {
+ flatEntityToCreate: {
+ [flatIndexViewToCreate.universalIdentifier]: flatIndexViewToCreate,
+ },
+ },
+ viewField: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: flatViewFieldsToCreate,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ },
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-label-identifier-on-update-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-label-identifier-on-update-side-effect-handler.service.ts
new file mode 100644
index 00000000000..9ae9a2d3af8
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-label-identifier-on-update-side-effect-handler.service.ts
@@ -0,0 +1,212 @@
+import { msg, t } from '@lingui/core/macro';
+import { Injectable } from '@nestjs/common';
+
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+
+import { type MetadataFlatEntity } from 'src/engine/metadata-modules/flat-entity/types/metadata-flat-entity.type';
+import { findManyFlatEntityByUniversalIdentifierInUniversalFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-many-flat-entity-by-universal-identifier-in-universal-flat-entity-maps.util';
+import { MetadataSideEffectExceptionCode } from 'src/engine/metadata-modules/metadata-side-effect/exceptions/metadata-side-effect-exception-code';
+import { computeRecordPageViewFieldForExistingObject } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-record-page-view-field-for-existing-object.util';
+import {
+ type BuildSideEffectsArgs,
+ MetadataSideEffectHandler,
+} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { type MetadataSideEffectOperationsByMetadataName } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-operations-by-metadata-name.type';
+import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
+
+@Injectable()
+export class ObjectRecordPageLabelIdentifierOnUpdateSideEffectHandlerService extends MetadataSideEffectHandler(
+ {
+ operation: 'update',
+ metadataName: 'objectMetadata',
+ name: 'objectRecordPageLabelIdentifierOnUpdate',
+ description:
+ 'When an object label identifier changes onto a pre-existing field, preserve the record-page exclusion invariant, the inverse of objectIndexViewLabelIdentifierOnUpdate: the engine-owned FIELDS_WIDGET record-page view never displays the label identifier (the record page shows it in the title), so the new label identifier engine-owned view field is deleted from the record-page view, and the previous label identifier gets its view field restored through the widget-driven builder (visibility from the FIELDS widget newFieldDefaultVisibility, appended into the last active group). Only engine-owned (isSystemSideEffect) view fields are touched. Relabeling onto a field created in the same operation is handled by fieldRecordPageViewFieldOnCreate instead. The restore is emitted even when the caller batch declares a view field for the same (view, field) pair: the engine always produces its system side effects, and the pair-uniqueness validator surfaces the conflict to the caller. Noop when the label identifier is unchanged, when the object has no engine-owned record-page view, when the new label identifier has no engine-owned record-page view field and the old one is already displayed or not restorable.',
+ },
+) {
+ buildSideEffects({
+ flatEntity,
+ allFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps,
+ }: BuildSideEffectsArgs<'objectMetadata'>): MetadataSideEffectResult {
+ const updatedFlatObjectMetadata = flatEntity as UniversalFlatObjectMetadata;
+
+ const existingFlatObjectMetadata =
+ relatedFlatEntityMaps.flatObjectMetadataMaps.byUniversalIdentifier[
+ updatedFlatObjectMetadata.universalIdentifier
+ ];
+
+ if (!isDefined(existingFlatObjectMetadata)) {
+ return {
+ status: 'fail',
+ type: 'update',
+ metadataName: 'objectMetadata',
+ flatEntityMinimalInformation: {
+ universalIdentifier: updatedFlatObjectMetadata.universalIdentifier,
+ } as Partial<MetadataFlatEntity<'objectMetadata'>>,
+ errors: [
+ {
+ code: MetadataSideEffectExceptionCode.SIDE_EFFECT_PARENT_METADATA_NOT_FOUND,
+ message: t`Could not resolve the existing object to reconcile its record-page label identifier view field`,
+ userFriendlyMessage: msg`The object to update could not be found to reconcile its record page`,
+ },
+ ],
+ };
+ }
+
+ const previousLabelIdentifierFieldMetadataUniversalIdentifier =
+ existingFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier;
+ const newLabelIdentifierFieldMetadataUniversalIdentifier =
+ updatedFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier;
+
+ if (
+ previousLabelIdentifierFieldMetadataUniversalIdentifier ===
+ newLabelIdentifierFieldMetadataUniversalIdentifier ||
+ !isDefined(newLabelIdentifierFieldMetadataUniversalIdentifier)
+ ) {
+ return { status: 'noop' };
+ }
+
+ const recordPageViewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ updatedFlatObjectMetadata.applicationUniversalIdentifier,
+ objectUniversalIdentifier: updatedFlatObjectMetadata.universalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ const recordPageFlatView =
+ relatedFlatEntityMaps.flatViewMaps.byUniversalIdentifier[
+ recordPageViewUniversalIdentifier
+ ];
+
+ if (
+ !isDefined(recordPageFlatView) ||
+ recordPageFlatView.isSystemSideEffect !== true ||
+ isDefined(recordPageFlatView.deletedAt)
+ ) {
+ return { status: 'noop' };
+ }
+
+ const recordPageFlatViewFields =
+ findManyFlatEntityByUniversalIdentifierInUniversalFlatEntityMaps({
+ flatEntityMaps: relatedFlatEntityMaps.flatViewFieldMaps,
+ universalIdentifiers: recordPageFlatView.viewFieldUniversalIdentifiers,
+ }).filter((flatViewField) => !isDefined(flatViewField.deletedAt));
+
+ const newLabelIdentifierFlatViewFieldToDelete =
+ recordPageFlatViewFields.find(
+ (flatViewField) =>
+ flatViewField.fieldMetadataUniversalIdentifier ===
+ newLabelIdentifierFieldMetadataUniversalIdentifier &&
+ flatViewField.isSystemSideEffect === true,
+ );
+
+ const previousLabelIdentifierFlatViewFieldToCreate =
+ this.buildRestoredPreviousLabelIdentifierViewField({
+ previousLabelIdentifierFieldMetadataUniversalIdentifier,
+ recordPageViewUniversalIdentifier,
+ recordPageFlatViewFields,
+ allFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps,
+ });
+
+ const operations: MetadataSideEffectOperationsByMetadataName = {};
+
+ if (
+ isDefined(newLabelIdentifierFlatViewFieldToDelete) ||
+ isDefined(previousLabelIdentifierFlatViewFieldToCreate)
+ ) {
+ operations.viewField = {
+ ...(isDefined(newLabelIdentifierFlatViewFieldToDelete)
+ ? {
+ flatEntityToDelete: {
+ [newLabelIdentifierFlatViewFieldToDelete.universalIdentifier]:
+ newLabelIdentifierFlatViewFieldToDelete,
+ },
+ }
+ : {}),
+ ...(isDefined(previousLabelIdentifierFlatViewFieldToCreate)
+ ? {
+ flatEntityToCreate: {
+ [previousLabelIdentifierFlatViewFieldToCreate.universalIdentifier]:
+ previousLabelIdentifierFlatViewFieldToCreate,
+ },
+ }
+ : {}),
+ };
+ }
+
+ if (Object.keys(operations).length === 0) {
+ return { status: 'noop' };
+ }
+
+ return {
+ status: 'success',
+ operations,
+ };
+ }
+
+ private buildRestoredPreviousLabelIdentifierViewField({
+ previousLabelIdentifierFieldMetadataUniversalIdentifier,
+ recordPageViewUniversalIdentifier,
+ recordPageFlatViewFields,
+ allFlatEntityOperationRecordByMetadataName,
+ relatedFlatEntityMaps,
+ }: {
+ previousLabelIdentifierFieldMetadataUniversalIdentifier: string | null;
+ recordPageViewUniversalIdentifier: string;
+ recordPageFlatViewFields: UniversalFlatViewField[];
+ allFlatEntityOperationRecordByMetadataName: BuildSideEffectsArgs<'objectMetadata'>['allFlatEntityOperationRecordByMetadataName'];
+ relatedFlatEntityMaps: BuildSideEffectsArgs<'objectMetadata'>['relatedFlatEntityMaps'];
+ }): UniversalFlatViewField | undefined {
+ if (!isDefined(previousLabelIdentifierFieldMetadataUniversalIdentifier)) {
+ return undefined;
+ }
+
+ const previousLabelIdentifierDeletedInSameBatch = isDefined(
+ allFlatEntityOperationRecordByMetadataName.fieldMetadata
+ ?.flatEntityToDelete[
+ previousLabelIdentifierFieldMetadataUniversalIdentifier
+ ],
+ );
+
+ if (previousLabelIdentifierDeletedInSameBatch) {
+ return undefined;
+ }
+
+ const previousLabelIdentifierFlatFieldMetadata =
+ relatedFlatEntityMaps.flatFieldMetadataMaps.byUniversalIdentifier[
+ previousLabelIdentifierFieldMetadataUniversalIdentifier
+ ];
+
+ if (!isDefined(previousLabelIdentifierFlatFieldMetadata)) {
+ return undefined;
+ }
+
+ const previousLabelIdentifierAlreadyDisplayed =
+ recordPageFlatViewFields.some(
+ (flatViewField) =>
+ flatViewField.fieldMetadataUniversalIdentifier ===
+ previousLabelIdentifierFieldMetadataUniversalIdentifier,
+ );
+
+ if (previousLabelIdentifierAlreadyDisplayed) {
+ return undefined;
+ }
+
+ return computeRecordPageViewFieldForExistingObject({
+ sourceFlatFieldMetadata: previousLabelIdentifierFlatFieldMetadata,
+ recordPageViewUniversalIdentifier,
+ flatViewMaps: relatedFlatEntityMaps.flatViewMaps,
+ flatViewFieldMaps: relatedFlatEntityMaps.flatViewFieldMaps,
+ flatViewFieldGroupMaps: relatedFlatEntityMaps.flatViewFieldGroupMaps,
+ flatPageLayoutWidgetMaps: relatedFlatEntityMaps.flatPageLayoutWidgetMaps,
+ });
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-on-create-side-effect-handler.service.ts
new file mode 100644
index 00000000000..164833e900c
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-record-page-on-create-side-effect-handler.service.ts
@@ -0,0 +1,91 @@
+import { SYSTEM_VIEW_KEYS } from 'twenty-shared/application';
+import { Injectable } from '@nestjs/common';
+
+import { fromArrayToUniqueKeyRecord } from 'twenty-shared/utils';
+
+import { computeSystemRecordPageLayoutToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util';
+import { computeSystemViewFieldsForCreatedObjectView } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-for-created-object-view.util';
+import { computeSystemViewToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util';
+import {
+ type BuildSideEffectsArgs,
+ MetadataSideEffectHandler,
+} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+
+@Injectable()
+export class ObjectRecordPageOnCreateSideEffectHandlerService extends MetadataSideEffectHandler(
+ {
+ operation: 'create',
+ metadataName: 'objectMetadata',
+ name: 'objectRecordPageOnCreate',
+ description:
+ 'When an object is created, provision its default record-page stack: the FIELDS_WIDGET record-page view ("{labelSingular} Record Page Fields", keyed on SYSTEM_VIEW_KEYS.FIELDS_WIDGET) with one view field per displayable SYSTEM field (the label identifier is excluded: the record page displays it in the title), and the RECORD_PAGE page layout with its 5 tabs (Home/Timeline/Tasks/Notes/Files) and 5 widgets, of which the Home FIELDS widget references the record-page view by universal identifier. All entities are isSystemSideEffect with name-free deterministic universal identifiers, so an object rename keeps every identifier. View fields for caller-provided fields are owned by fieldRecordPageViewFieldOnCreate; both handlers derive positions from the same caller-input list so the layout is contiguous without ordering dependency. The engine always emits the system record-page stack, exactly like INDEX. Caller-defined custom RECORD_PAGE layouts (e.g. manifest apps authoring a record page for their own objects) are legitimate and coexist with it: the frontend displays a custom record page over the system one when defined, and identifier squatting on engine emissions is caught by the side-effect collision detector. twenty-standard is not concerned: it synchronizes through the from/to migration path, which never runs the side-effect engine, and authors its own curated record-page stack on the same derived identifiers.',
+ },
+) {
+ buildSideEffects({
+ flatEntity: flatObjectMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ }: BuildSideEffectsArgs<'objectMetadata'>): MetadataSideEffectResult {
+ const sourceFlatObjectMetadata =
+ flatObjectMetadata as UniversalFlatObjectMetadata;
+ const { applicationUniversalIdentifier } = sourceFlatObjectMetadata;
+
+ const flatRecordPageViewToCreate = computeSystemViewToCreate({
+ objectMetadata: sourceFlatObjectMetadata,
+ applicationUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ const flatViewFieldsToCreate = computeSystemViewFieldsForCreatedObjectView({
+ sourceFlatObjectMetadata,
+ viewUniversalIdentifier: flatRecordPageViewToCreate.universalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy: 'excluded',
+ });
+
+ const { pageLayouts, pageLayoutTabs, pageLayoutWidgets } =
+ computeSystemRecordPageLayoutToCreate({
+ objectMetadata: sourceFlatObjectMetadata,
+ applicationUniversalIdentifier,
+ recordPageFieldsViewUniversalIdentifier:
+ flatRecordPageViewToCreate.universalIdentifier,
+ });
+
+ return {
+ status: 'success',
+ operations: {
+ view: {
+ flatEntityToCreate: {
+ [flatRecordPageViewToCreate.universalIdentifier]:
+ flatRecordPageViewToCreate,
+ },
+ },
+ viewField: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: flatViewFieldsToCreate,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ pageLayout: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: pageLayouts,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ pageLayoutTab: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: pageLayoutTabs,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ pageLayoutWidget: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: pageLayoutWidgets,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ },
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-and-index-view-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-and-index-view-on-create-side-effect-handler.service.ts
deleted file mode 100644
index 89afa6873a4..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-and-index-view-on-create-side-effect-handler.service.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-import { Injectable } from '@nestjs/common';
-
-import { fromArrayToUniqueKeyRecord } from 'twenty-shared/utils';
-
-import { type MetadataUniversalFlatEntity } from 'src/engine/metadata-modules/flat-entity/types/metadata-universal-flat-entity.type';
-import { computeCallerFlatFieldMetadatasForObject } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-caller-flat-field-metadatas-for-object.util';
-import { computeDefaultIndexViewFieldPositionByFieldUniversalIdentifier } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-index-view-field-position-by-field-universal-identifier.util';
-import {
- type BuildSideEffectsArgs,
- MetadataSideEffectHandler,
-} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
-import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
-import { buildReservedSystemFlatFieldMetadatasForCustomObject } from 'src/engine/metadata-modules/object-metadata/utils/build-reserved-system-flat-field-metadatas-for-custom-object.util';
-import { computeFlatIndexViewToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-index-view-to-create.util';
-import { computeFlatViewFieldsToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util';
-import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
-
-@Injectable()
-export class ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService extends MetadataSideEffectHandler(
- {
- operation: 'create',
- metadataName: 'objectMetadata',
- name: 'objectSystemFieldsAndIndexViewOnCreate',
- description:
- 'When an object is created, provision (1) its 7 reserved system fields (id, createdAt, updatedAt, deletedAt, createdBy, updatedBy, position; searchVector is handled by objectSearchVectorOnCreate, and the name field is caller-provided) and (2) its default INDEX table view ("All {objectLabelPlural}") with one view field per displayable SYSTEM field only, all isSystemSideEffect so the engine owns their lifecycle. View fields for caller-provided fields are owned by fieldIndexViewFieldOnCreate (the field creation side effect), which positions them before the system view fields; both handlers derive positions from the same caller-input list so the layout is contiguous without any ordering dependency. The view identifier is name-free (object identifier + INDEX view key), so an object rename keeps the same view. The engine is the sole owner of the INDEX view and always emits it: the flat view validator rejects caller-created INDEX views (caller inputs are forced isSystemSideEffect: false) and enforces a single non-deleted INDEX view per object. twenty-standard is not concerned: it synchronizes through the from/to migration path, which never runs the side-effect engine, and authors its own curated INDEX view/fields.',
- },
-) {
- buildSideEffects({
- flatEntity: flatObjectMetadata,
- allFlatEntityOperationRecordByMetadataName,
- }: BuildSideEffectsArgs<'objectMetadata'>): MetadataSideEffectResult {
- const sourceFlatObjectMetadata =
- flatObjectMetadata as UniversalFlatObjectMetadata;
- const { applicationUniversalIdentifier, universalIdentifier } =
- sourceFlatObjectMetadata;
-
- const systemFlatFieldMetadatas = Object.values(
- buildReservedSystemFlatFieldMetadatasForCustomObject({
- flatObjectMetadata: {
- applicationUniversalIdentifier,
- universalIdentifier,
- },
- }),
- );
-
- const systemFieldMetadataToCreate: Record<
- string,
- MetadataUniversalFlatEntity<'fieldMetadata'>
- > = {};
-
- for (const systemFlatFieldMetadata of systemFlatFieldMetadatas) {
- systemFieldMetadataToCreate[systemFlatFieldMetadata.universalIdentifier] =
- systemFlatFieldMetadata;
- }
-
- const flatIndexViewToCreate = computeFlatIndexViewToCreate({
- objectMetadata: sourceFlatObjectMetadata,
- applicationUniversalIdentifier,
- });
-
- const callerFlatFieldMetadatas = computeCallerFlatFieldMetadatasForObject({
- objectMetadataUniversalIdentifier: universalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier:
- sourceFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier,
- allFlatEntityOperationRecordByMetadataName,
- });
-
- const positionByFieldUniversalIdentifier =
- computeDefaultIndexViewFieldPositionByFieldUniversalIdentifier({
- applicationUniversalIdentifier,
- objectMetadataUniversalIdentifier: universalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier:
- sourceFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier,
- callerFlatFieldMetadatas,
- });
-
- const flatViewFieldsToCreate = computeFlatViewFieldsToCreate({
- objectFlatFieldMetadatas: systemFlatFieldMetadatas,
- viewUniversalIdentifier: flatIndexViewToCreate.universalIdentifier,
- applicationUniversalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier:
- sourceFlatObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier,
- }).map((flatViewFieldToCreate) => ({
- ...flatViewFieldToCreate,
- position:
- positionByFieldUniversalIdentifier.get(
- flatViewFieldToCreate.fieldMetadataUniversalIdentifier,
- ) ?? flatViewFieldToCreate.position,
- }));
-
- return {
- status: 'success',
- operations: {
- fieldMetadata: { flatEntityToCreate: systemFieldMetadataToCreate },
- view: {
- flatEntityToCreate: {
- [flatIndexViewToCreate.universalIdentifier]: flatIndexViewToCreate,
- },
- },
- viewField: {
- flatEntityToCreate: fromArrayToUniqueKeyRecord({
- array: flatViewFieldsToCreate,
- uniqueKey: 'universalIdentifier',
- }),
- },
- },
- };
- }
-}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-on-create-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-on-create-side-effect-handler.service.ts
new file mode 100644
index 00000000000..246e9890d91
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-fields-on-create-side-effect-handler.service.ts
@@ -0,0 +1,52 @@
+import { Injectable } from '@nestjs/common';
+
+import { fromArrayToUniqueKeyRecord } from 'twenty-shared/utils';
+
+import {
+ type BuildSideEffectsArgs,
+ MetadataSideEffectHandler,
+} from 'src/engine/metadata-modules/metadata-side-effect/interfaces/base-metadata-side-effect-handler.service';
+import { type MetadataSideEffectResult } from 'src/engine/metadata-modules/metadata-side-effect/types/metadata-side-effect-result.type';
+import { buildReservedSystemFlatFieldMetadatasForCustomObject } from 'src/engine/metadata-modules/object-metadata/utils/build-reserved-system-flat-field-metadatas-for-custom-object.util';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+
+@Injectable()
+export class ObjectSystemFieldsOnCreateSideEffectHandlerService extends MetadataSideEffectHandler(
+ {
+ operation: 'create',
+ metadataName: 'objectMetadata',
+ name: 'objectSystemFieldsOnCreate',
+ description:
+ 'When an object is created, provision its 7 reserved system fields (id, createdAt, updatedAt, deletedAt, createdBy, updatedBy, position), all isSystemSideEffect so the engine owns their lifecycle; searchVector is handled by objectSearchVectorOnCreate and the name field is caller-provided. Their view fields are owned by the view handlers (objectIndexViewOnCreate, objectRecordPageOnCreate), which re-derive the same reserved fields statelessly from the object identity, so there is no ordering dependency between handlers. twenty-standard is not concerned: it synchronizes through the from/to migration path, which never runs the side-effect engine, and authors its own system fields.',
+ },
+) {
+ buildSideEffects({
+ flatEntity: flatObjectMetadata,
+ }: BuildSideEffectsArgs<'objectMetadata'>): MetadataSideEffectResult {
+ const sourceFlatObjectMetadata =
+ flatObjectMetadata as UniversalFlatObjectMetadata;
+ const { applicationUniversalIdentifier, universalIdentifier } =
+ sourceFlatObjectMetadata;
+
+ const systemFlatFieldMetadatas = Object.values(
+ buildReservedSystemFlatFieldMetadatasForCustomObject({
+ flatObjectMetadata: {
+ applicationUniversalIdentifier,
+ universalIdentifier,
+ },
+ }),
+ );
+
+ return {
+ status: 'success',
+ operations: {
+ fieldMetadata: {
+ flatEntityToCreate: fromArrayToUniqueKeyRecord({
+ array: systemFlatFieldMetadatas,
+ uniqueKey: 'universalIdentifier',
+ }),
+ },
+ },
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-side-effects-on-delete-side-effect-handler.service.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-side-effects-on-delete-side-effect-handler.service.ts
index ad4cb1065d9..e299761a419 100644
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-side-effects-on-delete-side-effect-handler.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/object-metadata/services/object-system-side-effects-on-delete-side-effect-handler.service.ts
@@ -20,7 +20,11 @@ type FlatEntityToDelete<
| 'index'
| 'searchFieldMetadata'
| 'view'
- | 'viewField',
+ | 'viewField'
+ | 'viewFieldGroup'
+ | 'pageLayout'
+ | 'pageLayoutTab'
+ | 'pageLayoutWidget',
> = Record<string, MetadataUniversalFlatEntity<TMetadataName>>;
@Injectable()
@@ -30,7 +34,7 @@ export class ObjectSystemSideEffectsOnDeleteSideEffectHandlerService extends Met
metadataName: 'objectMetadata',
name: 'objectSystemSideEffectsOnDelete',
description:
- 'When an object is deleted, cascade-delete its engine-owned side effects: the reserved system fields, the default relation fields (forward field on the deleted object and reverse morph field on the standard object), every system index (reverse join-column indexes, the GIN searchVector index), its searchFieldMetadata rows, and its engine-owned views (the INDEX table view provisioned by objectSystemFieldsAndIndexViewOnCreate) with their view fields. View fields of the deleted system fields are cascaded too even when they live on another object view, which happens for the reverse relation fields. Every lookup walks a foreign key aggregator down from the deleted object (its fields, indexes, searchFieldMetadatas, views, then their view fields) and indexes into the flat entity maps, so the work is proportional to what the object owns and never to the size of the workspace. The engine is the sole authority for isSystemSideEffect entities on delete: the API object delete transpiler cascades only user-authored fields and indexes, and manifest deletion inference excludes these entities entirely. Caller-provided defaults (e.g. the name field) are NOT engine-owned and are deleted through normal deletion inference / the object delete transpiler.',
+ 'When an object is deleted, cascade-delete its engine-owned side effects: the reserved system fields, the default relation fields (forward field on the deleted object and reverse morph field on the standard object), every system index (reverse join-column indexes, the GIN searchVector index), its searchFieldMetadata rows, its engine-owned views (the INDEX table view and the FIELDS_WIDGET record-page view) with their view fields and view field groups, and its engine-owned record-page layout stack (pageLayout, pageLayoutTab, pageLayoutWidget). View fields of the deleted system fields are cascaded too even when they live on another object view, which happens for the reverse relation fields. Every lookup walks a foreign key aggregator down from the deleted object (its fields, indexes, searchFieldMetadatas, views, then their view fields and groups; page layouts have no aggregator on the object, so they are resolved by their objectMetadata reference) and indexes into the flat entity maps. The engine is the sole authority for isSystemSideEffect entities on delete: the API object delete transpiler cascades only user-authored fields and indexes and emits nothing for the layout stack, and manifest deletion inference excludes these entities entirely, so without these buckets the layout stack would only ever disappear through raw DB foreign key cascade, behind the engine back. Caller-provided defaults (e.g. the name field) are NOT engine-owned and are deleted through normal deletion inference / the object delete transpiler.',
},
) {
buildSideEffects({
@@ -48,6 +52,15 @@ export class ObjectSystemSideEffectsOnDeleteSideEffectHandlerService extends Met
relatedFlatEntityMaps,
});
+ const pageLayoutToDelete = this.computePageLayoutToDelete({
+ flatObjectMetadata,
+ relatedFlatEntityMaps,
+ });
+ const pageLayoutTabToDelete = this.computePageLayoutTabToDelete({
+ relatedFlatEntityMaps,
+ flatPageLayoutsToDelete: Object.values(pageLayoutToDelete),
+ });
+
const flatEntityToDeleteByMetadataName = {
fieldMetadata: fieldMetadataToDelete,
index: this.computeIndexToDelete({
@@ -65,6 +78,16 @@ export class ObjectSystemSideEffectsOnDeleteSideEffectHandlerService extends Met
flatViewsToDelete: Object.values(viewToDelete),
flatFieldMetadatasToDelete,
}),
+ viewFieldGroup: this.computeViewFieldGroupToDelete({
+ relatedFlatEntityMaps,
+ flatViewsToDelete: Object.values(viewToDelete),
+ }),
+ pageLayout: pageLayoutToDelete,
+ pageLayoutTab: pageLayoutTabToDelete,
+ pageLayoutWidget: this.computePageLayoutWidgetToDelete({
+ relatedFlatEntityMaps,
+ flatPageLayoutTabsToDelete: Object.values(pageLayoutTabToDelete),
+ }),
};
const operations = Object.fromEntries(
@@ -287,4 +310,126 @@ export class ObjectSystemSideEffectsOnDeleteSideEffectHandlerService extends Met
flatViewFieldMaps: relatedFlatEntityMaps.flatViewFieldMaps,
});
}
+
+ private computeViewFieldGroupToDelete({
+ relatedFlatEntityMaps,
+ flatViewsToDelete,
+ }: {
+ relatedFlatEntityMaps: RelatedFlatEntityMaps;
+ flatViewsToDelete: MetadataUniversalFlatEntity<'view'>[];
+ }): FlatEntityToDelete<'viewFieldGroup'> {
+ const viewFieldGroupToDelete: FlatEntityToDelete<'viewFieldGroup'> = {};
+
+ for (const flatView of flatViewsToDelete) {
+ for (const viewFieldGroupUniversalIdentifier of flatView.viewFieldGroupUniversalIdentifiers) {
+ const flatViewFieldGroup =
+ relatedFlatEntityMaps.flatViewFieldGroupMaps.byUniversalIdentifier[
+ viewFieldGroupUniversalIdentifier
+ ];
+
+ if (
+ !isDefined(flatViewFieldGroup) ||
+ flatViewFieldGroup.isSystemSideEffect !== true
+ ) {
+ continue;
+ }
+
+ viewFieldGroupToDelete[flatViewFieldGroup.universalIdentifier] =
+ flatViewFieldGroup;
+ }
+ }
+
+ return viewFieldGroupToDelete;
+ }
+
+ // Page layouts have no foreign key aggregator on the object flat entity, so
+ // they are resolved by their objectMetadata reference.
+ private computePageLayoutToDelete({
+ flatObjectMetadata,
+ relatedFlatEntityMaps,
+ }: {
+ flatObjectMetadata: MetadataUniversalFlatEntity<'objectMetadata'>;
+ relatedFlatEntityMaps: RelatedFlatEntityMaps;
+ }): FlatEntityToDelete<'pageLayout'> {
+ const pageLayoutToDelete: FlatEntityToDelete<'pageLayout'> = {};
+
+ for (const flatPageLayout of Object.values(
+ relatedFlatEntityMaps.flatPageLayoutMaps.byUniversalIdentifier,
+ )) {
+ if (
+ !isDefined(flatPageLayout) ||
+ flatPageLayout.objectMetadataUniversalIdentifier !==
+ flatObjectMetadata.universalIdentifier ||
+ flatPageLayout.isSystemSideEffect !== true
+ ) {
+ continue;
+ }
+
+ pageLayoutToDelete[flatPageLayout.universalIdentifier] = flatPageLayout;
+ }
+
+ return pageLayoutToDelete;
+ }
+
+ private computePageLayoutTabToDelete({
+ relatedFlatEntityMaps,
+ flatPageLayoutsToDelete,
+ }: {
+ relatedFlatEntityMaps: RelatedFlatEntityMaps;
+ flatPageLayoutsToDelete: MetadataUniversalFlatEntity<'pageLayout'>[];
+ }): FlatEntityToDelete<'pageLayoutTab'> {
+ const pageLayoutTabToDelete: FlatEntityToDelete<'pageLayoutTab'> = {};
+
+ for (const flatPageLayout of flatPageLayoutsToDelete) {
+ for (const tabUniversalIdentifier of flatPageLayout.tabUniversalIdentifiers) {
+ const flatPageLayoutTab =
+ relatedFlatEntityMaps.flatPageLayoutTabMaps.byUniversalIdentifier[
+ tabUniversalIdentifier
+ ];
+
+ if (
+ !isDefined(flatPageLayoutTab) ||
+ flatPageLayoutTab.isSystemSideEffect !== true
+ ) {
+ continue;
+ }
+
+ pageLayoutTabToDelete[flatPageLayoutTab.universalIdentifier] =
+ flatPageLayoutTab;
+ }
+ }
+
+ return pageLayoutTabToDelete;
+ }
+
+ private computePageLayoutWidgetToDelete({
+ relatedFlatEntityMaps,
+ flatPageLayoutTabsToDelete,
+ }: {
+ relatedFlatEntityMaps: RelatedFlatEntityMaps;
+ flatPageLayoutTabsToDelete: MetadataUniversalFlatEntity<'pageLayoutTab'>[];
+ }): FlatEntityToDelete<'pageLayoutWidget'> {
+ const pageLayoutWidgetToDelete: FlatEntityToDelete<'pageLayoutWidget'> = {};
+
+ for (const flatPageLayoutTab of flatPageLayoutTabsToDelete) {
+ for (const widgetUniversalIdentifier of flatPageLayoutTab.widgetUniversalIdentifiers) {
+ const flatPageLayoutWidget =
+ relatedFlatEntityMaps.flatPageLayoutWidgetMaps.byUniversalIdentifier[
+ widgetUniversalIdentifier
+ ];
+
+ if (
+ !isDefined(flatPageLayoutWidget) ||
+ flatPageLayoutWidget.isSystemSideEffect !== true
+ ) {
+ continue;
+ }
+
+ pageLayoutWidgetToDelete[flatPageLayoutWidget.universalIdentifier] =
+ flatPageLayoutWidget;
+ }
+ }
+
+ return pageLayoutWidgetToDelete;
+ }
}
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-view-fields-to-create.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-fields-to-create.util.spec.ts
similarity index 91%
rename from packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-view-fields-to-create.util.spec.ts
rename to packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-fields-to-create.util.spec.ts
index deb108caea9..f8d1f0a8739 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-view-fields-to-create.util.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-fields-to-create.util.spec.ts
@@ -4,7 +4,7 @@ import { v4 } from 'uuid';
import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
-import { computeFlatViewFieldsToCreate } from '../compute-flat-view-fields-to-create.util';
+import { computeSystemViewFieldsToCreate } from '../compute-system-view-fields-to-create.util';
const makeFieldMetadata = (
overrides: Partial<UniversalFlatFieldMetadata> & {
@@ -17,7 +17,7 @@ const makeFieldMetadata = (
return {
universalIdentifier,
objectMetadataUniversalIdentifier: 'object-uid',
- applicationUniversalIdentifier: 'app-uid',
+ applicationUniversalIdentifier: 'a1a2a3a4-a5a6-4000-8000-000000000001',
name: overrides.name,
label: overrides.label ?? overrides.name,
type: overrides.type,
@@ -44,7 +44,7 @@ const applicationUniversalIdentifier = 'a1a2a3a4-a5a6-4000-8000-000000000001';
const viewUniversalIdentifier = 'view-uid';
-describe('computeFlatViewFieldsToCreate', () => {
+describe('computeSystemViewFieldsToCreate', () => {
it('should exclude TS_VECTOR fields', () => {
const fields = [
makeFieldMetadata({
@@ -57,7 +57,7 @@ describe('computeFlatViewFieldsToCreate', () => {
}),
];
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: fields,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -82,7 +82,7 @@ describe('computeFlatViewFieldsToCreate', () => {
}),
];
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: fields,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -111,7 +111,7 @@ describe('computeFlatViewFieldsToCreate', () => {
}),
];
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: fields,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -136,7 +136,7 @@ describe('computeFlatViewFieldsToCreate', () => {
}),
];
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: fields,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -160,7 +160,7 @@ describe('computeFlatViewFieldsToCreate', () => {
});
const fields = [otherField, labelField];
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: fields,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -189,7 +189,7 @@ describe('computeFlatViewFieldsToCreate', () => {
type: FieldMetadataType.DATE_TIME,
});
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: [labelField, otherField],
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -210,7 +210,7 @@ describe('computeFlatViewFieldsToCreate', () => {
type: FieldMetadataType.TEXT,
});
- const result = computeFlatViewFieldsToCreate({
+ const result = computeSystemViewFieldsToCreate({
objectFlatFieldMetadatas: [field],
viewUniversalIdentifier,
applicationUniversalIdentifier,
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-to-create.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-to-create.util.spec.ts
new file mode 100644
index 00000000000..0d4efa179d4
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/__tests__/compute-system-view-to-create.util.spec.ts
@@ -0,0 +1,85 @@
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from 'twenty-shared/application';
+import { ViewKey, ViewType } from 'twenty-shared/types';
+
+import { computeSystemViewToCreate } from '../compute-system-view-to-create.util';
+
+const applicationUniversalIdentifier = 'a1a2a3a4-a5a6-4000-8000-000000000001';
+const objectUniversalIdentifier = 'b1b2b3b4-b5b6-4000-8000-000000000001';
+const objectMetadata = {
+ universalIdentifier: objectUniversalIdentifier,
+ labelSingular: 'Ticket',
+};
+
+describe('computeSystemViewToCreate', () => {
+ it.each([ViewKey.INDEX, SYSTEM_VIEW_KEYS.FIELDS_WIDGET])(
+ 'should derive the %s view universal identifier from the object',
+ (viewKey) => {
+ const result = computeSystemViewToCreate({
+ applicationUniversalIdentifier,
+ objectMetadata,
+ viewKey,
+ });
+
+ expect(result.universalIdentifier).toBe(
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier,
+ viewKey,
+ }),
+ );
+ },
+ );
+
+ it('should build a system-owned INDEX table view keyed on ViewKey.INDEX', () => {
+ const result = computeSystemViewToCreate({
+ applicationUniversalIdentifier,
+ objectMetadata,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
+ });
+
+ expect(result.key).toBe(ViewKey.INDEX);
+ expect(result.type).toBe(ViewType.TABLE);
+ expect(result.name).toBe('All {objectLabelPlural}');
+ expect(result.isSystemSideEffect).toBe(true);
+ expect(result.objectMetadataUniversalIdentifier).toBe(
+ objectUniversalIdentifier,
+ );
+ expect(result.applicationUniversalIdentifier).toBe(
+ applicationUniversalIdentifier,
+ );
+ });
+
+ it('should build a system-owned record-page view with a null persisted key', () => {
+ const result = computeSystemViewToCreate({
+ applicationUniversalIdentifier,
+ objectMetadata,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ // The record-page view key is derivation-only, never persisted.
+ expect(result.key).toBeNull();
+ expect(result.type).toBe(ViewType.FIELDS_WIDGET);
+ expect(result.name).toBe('Ticket Record Page Fields');
+ expect(result.isSystemSideEffect).toBe(true);
+ });
+
+ it('should be deterministic and independent from the view primary key', () => {
+ const first = computeSystemViewToCreate({
+ applicationUniversalIdentifier,
+ objectMetadata,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
+ });
+ const second = computeSystemViewToCreate({
+ applicationUniversalIdentifier,
+ objectMetadata,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
+ });
+
+ expect(first.universalIdentifier).toBe(second.universalIdentifier);
+ expect(first.id).not.toBe(second.id);
+ });
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-index-view-field-position-by-field-universal-identifier.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-index-view-field-position-by-field-universal-identifier.util.ts
deleted file mode 100644
index 65619c4c7ce..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-index-view-field-position-by-field-universal-identifier.util.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { buildReservedSystemFlatFieldMetadatasForCustomObject } from 'src/engine/metadata-modules/object-metadata/utils/build-reserved-system-flat-field-metadatas-for-custom-object.util';
-import { isFlatFieldMetadataDisplayableInDefaultView } from 'src/engine/metadata-modules/object-metadata/utils/is-flat-field-metadata-displayable-in-default-view.util';
-import { orderFlatFieldMetadatasForSystemIndexView } from 'src/engine/metadata-modules/object-metadata/utils/order-flat-field-metadatas-for-system-index-view.util';
-import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
-
-export const computeDefaultIndexViewFieldPositionByFieldUniversalIdentifier = ({
- applicationUniversalIdentifier,
- objectMetadataUniversalIdentifier,
- labelIdentifierFieldMetadataUniversalIdentifier,
- callerFlatFieldMetadatas,
-}: {
- applicationUniversalIdentifier: string;
- objectMetadataUniversalIdentifier: string;
- labelIdentifierFieldMetadataUniversalIdentifier: string | null;
- callerFlatFieldMetadatas: UniversalFlatFieldMetadata[];
-}): Map<string, number> => {
- const displayableSystemFlatFieldMetadatas = Object.values(
- buildReservedSystemFlatFieldMetadatasForCustomObject({
- flatObjectMetadata: {
- applicationUniversalIdentifier,
- universalIdentifier: objectMetadataUniversalIdentifier,
- },
- }),
- ).filter((flatFieldMetadata) =>
- isFlatFieldMetadataDisplayableInDefaultView({
- flatFieldMetadata,
- labelIdentifierFieldMetadataUniversalIdentifier,
- }),
- );
-
- const orderedFlatFieldMetadatas = orderFlatFieldMetadatasForSystemIndexView({
- labelIdentifierFieldMetadataUniversalIdentifier,
- flatFieldMetadatas: [
- ...callerFlatFieldMetadatas,
- ...displayableSystemFlatFieldMetadatas,
- ],
- });
-
- return new Map(
- orderedFlatFieldMetadatas.map((flatFieldMetadata, position) => [
- flatFieldMetadata.universalIdentifier,
- position,
- ]),
- );
-};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-view-field-position-by-field-universal-identifier.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-view-field-position-by-field-universal-identifier.util.ts
new file mode 100644
index 00000000000..8686e661058
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-view-field-position-by-field-universal-identifier.util.ts
@@ -0,0 +1,49 @@
+import { isFlatFieldMetadataDisplayableInDefaultView } from 'src/engine/metadata-modules/object-metadata/utils/is-flat-field-metadata-displayable-in-default-view.util';
+import { orderFlatFieldMetadatasForSystemIndexView } from 'src/engine/metadata-modules/object-metadata/utils/order-flat-field-metadatas-for-system-index-view.util';
+import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
+
+export type ViewFieldLabelIdentifierPolicy = 'displayedFirst' | 'excluded';
+
+export const computeDefaultViewFieldPositionByFieldUniversalIdentifier = ({
+ systemFlatFieldMetadatas,
+ callerFlatFieldMetadatas,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ labelIdentifierPolicy,
+}: {
+ systemFlatFieldMetadatas: UniversalFlatFieldMetadata[];
+ callerFlatFieldMetadatas: UniversalFlatFieldMetadata[];
+ labelIdentifierFieldMetadataUniversalIdentifier: string | null;
+ labelIdentifierPolicy: ViewFieldLabelIdentifierPolicy;
+}): Map<string, number> => {
+ const displayableSystemFlatFieldMetadatas = systemFlatFieldMetadatas.filter(
+ (flatFieldMetadata) =>
+ isFlatFieldMetadataDisplayableInDefaultView({
+ flatFieldMetadata,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ }),
+ );
+
+ const flatFieldMetadatas = [
+ ...callerFlatFieldMetadatas,
+ ...displayableSystemFlatFieldMetadatas,
+ ];
+
+ const orderedFlatFieldMetadatas =
+ labelIdentifierPolicy === 'displayedFirst'
+ ? orderFlatFieldMetadatasForSystemIndexView({
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ flatFieldMetadatas,
+ })
+ : flatFieldMetadatas.filter(
+ (flatFieldMetadata) =>
+ flatFieldMetadata.universalIdentifier !==
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ );
+
+ return new Map(
+ orderedFlatFieldMetadatas.map((flatFieldMetadata, position) => [
+ flatFieldMetadata.universalIdentifier,
+ position,
+ ]),
+ );
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-record-page-view-field-for-existing-object.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-record-page-view-field-for-existing-object.util.ts
new file mode 100644
index 00000000000..dc5472d1934
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-record-page-view-field-for-existing-object.util.ts
@@ -0,0 +1,138 @@
+import { getSystemViewFieldUniversalIdentifier } from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+
+import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type';
+import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
+import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
+
+export const computeRecordPageViewFieldForExistingObject = ({
+ sourceFlatFieldMetadata,
+ recordPageViewUniversalIdentifier,
+ flatViewMaps,
+ flatViewFieldMaps,
+ flatViewFieldGroupMaps,
+ flatPageLayoutWidgetMaps,
+}: {
+ sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
+ recordPageViewUniversalIdentifier: string;
+} & Pick<
+ AllFlatEntityMaps,
+ | 'flatViewMaps'
+ | 'flatViewFieldMaps'
+ | 'flatViewFieldGroupMaps'
+ | 'flatPageLayoutWidgetMaps'
+>): UniversalFlatViewField | undefined => {
+ const recordPageFlatView =
+ flatViewMaps.byUniversalIdentifier[recordPageViewUniversalIdentifier];
+
+ if (
+ !isDefined(recordPageFlatView) ||
+ recordPageFlatView.isSystemSideEffect !== true ||
+ isDefined(recordPageFlatView.deletedAt)
+ ) {
+ return undefined;
+ }
+
+ const fieldsWidget = Object.values(
+ flatPageLayoutWidgetMaps.byUniversalIdentifier,
+ )
+ .filter(isDefined)
+ .find(
+ (widget) =>
+ widget.isActive &&
+ !isDefined(widget.deletedAt) &&
+ widget.universalConfiguration?.configurationType ===
+ WidgetConfigurationType.FIELDS &&
+ widget.universalConfiguration.viewUniversalIdentifier ===
+ recordPageViewUniversalIdentifier,
+ );
+
+ if (
+ !isDefined(fieldsWidget) ||
+ fieldsWidget.universalConfiguration.configurationType !==
+ WidgetConfigurationType.FIELDS
+ ) {
+ return undefined;
+ }
+
+ const { newFieldDefaultVisibility } = fieldsWidget.universalConfiguration;
+
+ if (!isDefined(newFieldDefaultVisibility)) {
+ return undefined;
+ }
+
+ const activeFlatViewFieldGroups =
+ recordPageFlatView.viewFieldGroupUniversalIdentifiers
+ .map(
+ (viewFieldGroupUniversalIdentifier) =>
+ flatViewFieldGroupMaps.byUniversalIdentifier[
+ viewFieldGroupUniversalIdentifier
+ ],
+ )
+ .filter(isDefined)
+ .filter((group) => group.isActive && !isDefined(group.deletedAt));
+
+ const lastFlatViewFieldGroup =
+ activeFlatViewFieldGroups.length > 0
+ ? activeFlatViewFieldGroups.reduce((maxGroup, group) =>
+ group.position > maxGroup.position ? group : maxGroup,
+ )
+ : undefined;
+
+ const targetSystemViewFieldGroupUniversalIdentifier =
+ lastFlatViewFieldGroup?.universalIdentifier ?? null;
+
+ const existingActivePositions =
+ recordPageFlatView.viewFieldUniversalIdentifiers
+ .map(
+ (viewFieldUniversalIdentifier) =>
+ flatViewFieldMaps.byUniversalIdentifier[viewFieldUniversalIdentifier],
+ )
+ .filter(isDefined)
+ .filter(
+ (flatViewField) =>
+ flatViewField.isActive &&
+ !isDefined(flatViewField.deletedAt) &&
+ flatViewField.viewFieldGroupUniversalIdentifier ===
+ targetSystemViewFieldGroupUniversalIdentifier,
+ )
+ .map((flatViewField) => flatViewField.position);
+
+ const position =
+ existingActivePositions.reduce(
+ (maxPosition, existingPosition) =>
+ Math.max(maxPosition, existingPosition),
+ -1,
+ ) + 1;
+
+ const createdAt = new Date().toISOString();
+ const { applicationUniversalIdentifier } = sourceFlatFieldMetadata;
+
+ return {
+ universalIdentifier: getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ viewUniversalIdentifier: recordPageViewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier:
+ sourceFlatFieldMetadata.universalIdentifier,
+ }),
+ applicationUniversalIdentifier,
+ fieldMetadataUniversalIdentifier:
+ sourceFlatFieldMetadata.universalIdentifier,
+ viewUniversalIdentifier: recordPageViewUniversalIdentifier,
+ viewFieldGroupUniversalIdentifier:
+ targetSystemViewFieldGroupUniversalIdentifier,
+ isVisible: newFieldDefaultVisibility,
+ size: DEFAULT_VIEW_FIELD_SIZE,
+ position,
+ aggregateOperation: null,
+ isActive: true,
+ isSystemSideEffect: true,
+ universalOverrides: null,
+ createdAt,
+ updatedAt: createdAt,
+ deletedAt: null,
+ };
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-same-batch-view-field-position-by-field-universal-identifier.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-same-batch-view-field-position-by-field-universal-identifier.util.ts
new file mode 100644
index 00000000000..b6282b26ee4
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-same-batch-view-field-position-by-field-universal-identifier.util.ts
@@ -0,0 +1,44 @@
+import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
+import {
+ computeDefaultViewFieldPositionByFieldUniversalIdentifier,
+ type ViewFieldLabelIdentifierPolicy,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-view-field-position-by-field-universal-identifier.util';
+import { computeViewFieldPositionInputFlatFieldMetadatas } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-view-field-position-input-flat-field-metadatas.util';
+import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
+
+export type ParentFlatObjectMetadataForViewFields = {
+ applicationUniversalIdentifier: string;
+ labelIdentifierFieldMetadataUniversalIdentifier: string | null;
+};
+
+export const computeSameBatchViewFieldPositionByFieldUniversalIdentifier = ({
+ sourceFlatFieldMetadata,
+ parentFlatObjectMetadata,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy,
+}: {
+ sourceFlatFieldMetadata: UniversalFlatFieldMetadata;
+ parentFlatObjectMetadata: ParentFlatObjectMetadataForViewFields;
+ allFlatEntityOperationRecordByMetadataName: AllFlatEntityOperationRecordByMetadataName;
+ labelIdentifierPolicy: ViewFieldLabelIdentifierPolicy;
+}): Map<string, number> => {
+ const { labelIdentifierFieldMetadataUniversalIdentifier } =
+ parentFlatObjectMetadata;
+
+ const { systemFlatFieldMetadatas, callerFlatFieldMetadatas } =
+ computeViewFieldPositionInputFlatFieldMetadatas({
+ applicationUniversalIdentifier:
+ parentFlatObjectMetadata.applicationUniversalIdentifier,
+ objectMetadataUniversalIdentifier:
+ sourceFlatFieldMetadata.objectMetadataUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ });
+
+ return computeDefaultViewFieldPositionByFieldUniversalIdentifier({
+ systemFlatFieldMetadatas,
+ callerFlatFieldMetadatas,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ labelIdentifierPolicy,
+ });
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util.ts
new file mode 100644
index 00000000000..69cff5ff9b4
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-record-page-layout-to-create.util.ts
@@ -0,0 +1,162 @@
+import {
+ getSystemPageLayoutTabUniversalIdentifier,
+ getSystemPageLayoutWidgetUniversalIdentifier,
+ getSystemRecordPageLayoutUniversalIdentifier,
+} from 'twenty-shared/application';
+
+import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+import {
+ TAB_PROPS,
+ WIDGET_PROPS,
+} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+import { type UniversalFlatPageLayoutTab } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-tab.type';
+import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
+import { type UniversalFlatPageLayout } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout.type';
+
+const DEFAULT_RECORD_PAGE_TAB_DEFINITIONS = [
+ {
+ key: 'home',
+ widgetKey: 'fields',
+ widgetConfigurationType: WidgetConfigurationType.FIELDS,
+ },
+ {
+ key: 'timeline',
+ widgetKey: 'timeline',
+ widgetConfigurationType: WidgetConfigurationType.TIMELINE,
+ },
+ {
+ key: 'tasks',
+ widgetKey: 'tasks',
+ widgetConfigurationType: WidgetConfigurationType.TASKS,
+ },
+ {
+ key: 'notes',
+ widgetKey: 'notes',
+ widgetConfigurationType: WidgetConfigurationType.NOTES,
+ },
+ {
+ key: 'files',
+ widgetKey: 'files',
+ widgetConfigurationType: WidgetConfigurationType.FILES,
+ },
+] as const satisfies readonly {
+ key: keyof typeof TAB_PROPS;
+ widgetKey: keyof typeof WIDGET_PROPS;
+ widgetConfigurationType: WidgetConfigurationType;
+}[];
+
+export const computeSystemRecordPageLayoutToCreate = ({
+ objectMetadata,
+ applicationUniversalIdentifier,
+ recordPageFieldsViewUniversalIdentifier,
+}: {
+ applicationUniversalIdentifier: string;
+ objectMetadata: Pick<
+ UniversalFlatObjectMetadata,
+ 'universalIdentifier' | 'labelSingular'
+ >;
+ recordPageFieldsViewUniversalIdentifier: string;
+}): {
+ pageLayouts: UniversalFlatPageLayout[];
+ pageLayoutTabs: UniversalFlatPageLayoutTab[];
+ pageLayoutWidgets: UniversalFlatPageLayoutWidget[];
+} => {
+ const now = new Date().toISOString();
+ const pageLayoutUniversalIdentifier =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ objectUniversalIdentifier: objectMetadata.universalIdentifier,
+ });
+
+ const pageLayoutTabs: UniversalFlatPageLayoutTab[] = [];
+ const pageLayoutWidgets: UniversalFlatPageLayoutWidget[] = [];
+
+ for (const {
+ key,
+ widgetKey,
+ widgetConfigurationType,
+ } of DEFAULT_RECORD_PAGE_TAB_DEFINITIONS) {
+ const tabProps = TAB_PROPS[key];
+ const widgetProps = WIDGET_PROPS[widgetKey];
+ const tabUniversalIdentifier = getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ pageLayoutUniversalIdentifier,
+ title: tabProps.title,
+ });
+ const widgetUniversalIdentifier =
+ getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ applicationUniversalIdentifier,
+ pageLayoutTabUniversalIdentifier: tabUniversalIdentifier,
+ title: widgetProps.title,
+ });
+
+ pageLayoutTabs.push({
+ universalIdentifier: tabUniversalIdentifier,
+ applicationUniversalIdentifier,
+ title: tabProps.title,
+ position: tabProps.position,
+ pageLayoutUniversalIdentifier,
+ widgetUniversalIdentifiers: [widgetUniversalIdentifier],
+ isActive: true,
+ isSystemSideEffect: true,
+ createdAt: now,
+ updatedAt: now,
+ deletedAt: null,
+ icon: tabProps.icon,
+ layoutMode: tabProps.layoutMode,
+ overrides: null,
+ });
+
+ const universalConfiguration =
+ widgetConfigurationType === WidgetConfigurationType.FIELDS
+ ? {
+ configurationType: WidgetConfigurationType.FIELDS,
+ viewUniversalIdentifier: recordPageFieldsViewUniversalIdentifier,
+ newFieldDefaultVisibility: true,
+ }
+ : { configurationType: widgetConfigurationType };
+
+ pageLayoutWidgets.push({
+ universalIdentifier: widgetUniversalIdentifier,
+ applicationUniversalIdentifier,
+ pageLayoutTabUniversalIdentifier: tabUniversalIdentifier,
+ title: widgetProps.title,
+ type: widgetProps.type,
+ gridPosition: widgetProps.gridPosition,
+ position: widgetProps.position,
+ // @ts-expect-error - configurationType is validated but TS can't match to discriminated union
+ universalConfiguration,
+ objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
+ isActive: true,
+ isSystemSideEffect: true,
+ createdAt: now,
+ updatedAt: now,
+ deletedAt: null,
+ conditionalDisplay: null,
+ universalOverrides: null,
+ });
+ }
+
+ const pageLayout: UniversalFlatPageLayout = {
+ universalIdentifier: pageLayoutUniversalIdentifier,
+ applicationUniversalIdentifier,
+ name: `Default ${objectMetadata.labelSingular} Layout`,
+ type: PageLayoutType.RECORD_PAGE,
+ objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
+ tabUniversalIdentifiers: pageLayoutTabs.map(
+ (tab) => tab.universalIdentifier,
+ ),
+ isSystemSideEffect: true,
+ createdAt: now,
+ updatedAt: now,
+ deletedAt: null,
+ defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier: null,
+ };
+
+ return { pageLayouts: [pageLayout], pageLayoutTabs, pageLayoutWidgets };
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-for-created-object-view.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-for-created-object-view.util.ts
new file mode 100644
index 00000000000..3cae4cee4f4
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-for-created-object-view.util.ts
@@ -0,0 +1,57 @@
+import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
+import {
+ computeDefaultViewFieldPositionByFieldUniversalIdentifier,
+ type ViewFieldLabelIdentifierPolicy,
+} from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-default-view-field-position-by-field-universal-identifier.util';
+import { computeSystemViewFieldsToCreate } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util';
+import { computeViewFieldPositionInputFlatFieldMetadatas } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-view-field-position-input-flat-field-metadatas.util';
+import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
+import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
+
+export const computeSystemViewFieldsForCreatedObjectView = ({
+ sourceFlatObjectMetadata,
+ viewUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ labelIdentifierPolicy,
+}: {
+ sourceFlatObjectMetadata: UniversalFlatObjectMetadata;
+ viewUniversalIdentifier: string;
+ allFlatEntityOperationRecordByMetadataName: AllFlatEntityOperationRecordByMetadataName;
+ labelIdentifierPolicy: ViewFieldLabelIdentifierPolicy;
+}): UniversalFlatViewField[] => {
+ const {
+ applicationUniversalIdentifier,
+ universalIdentifier: objectMetadataUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ } = sourceFlatObjectMetadata;
+
+ const { systemFlatFieldMetadatas, callerFlatFieldMetadatas } =
+ computeViewFieldPositionInputFlatFieldMetadatas({
+ applicationUniversalIdentifier,
+ objectMetadataUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ });
+
+ const positionByFieldUniversalIdentifier =
+ computeDefaultViewFieldPositionByFieldUniversalIdentifier({
+ systemFlatFieldMetadatas,
+ callerFlatFieldMetadatas,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ labelIdentifierPolicy,
+ });
+
+ return computeSystemViewFieldsToCreate({
+ objectFlatFieldMetadatas: systemFlatFieldMetadatas,
+ viewUniversalIdentifier,
+ applicationUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ excludeLabelIdentifier: labelIdentifierPolicy === 'excluded',
+ }).map((flatViewFieldToCreate) => ({
+ ...flatViewFieldToCreate,
+ position:
+ positionByFieldUniversalIdentifier.get(
+ flatViewFieldToCreate.fieldMetadataUniversalIdentifier,
+ ) ?? flatViewFieldToCreate.position,
+ }));
+};
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util.ts
similarity index 87%
rename from packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util.ts
rename to packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util.ts
index 20896389459..671aa3b0308 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-fields-to-create.util.ts
@@ -1,4 +1,4 @@
-import { getViewFieldUniversalIdentifier } from 'twenty-shared/application';
+import { getSystemViewFieldUniversalIdentifier } from 'twenty-shared/application';
import { DEFAULT_VIEW_FIELD_SIZE } from 'src/engine/metadata-modules/flat-view-field/constants/default-view-field-size.constant';
import { isFlatFieldMetadataDisplayableInDefaultView } from 'src/engine/metadata-modules/object-metadata/utils/is-flat-field-metadata-displayable-in-default-view.util';
@@ -6,7 +6,7 @@ import { orderFlatFieldMetadatasForSystemIndexView } from 'src/engine/metadata-m
import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
import { type UniversalFlatViewField } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view-field.type';
-export const computeFlatViewFieldsToCreate = ({
+export const computeSystemViewFieldsToCreate = ({
objectFlatFieldMetadatas,
viewUniversalIdentifier,
applicationUniversalIdentifier,
@@ -42,8 +42,10 @@ export const computeFlatViewFieldsToCreate = ({
createdAt,
updatedAt: createdAt,
deletedAt: null,
- universalIdentifier: getViewFieldUniversalIdentifier({
- applicationUniversalIdentifier,
+ // Keyed on the displayed field's application, per the engine convention.
+ universalIdentifier: getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ field.applicationUniversalIdentifier,
viewUniversalIdentifier,
fieldMetadataUniversalIdentifier: field.universalIdentifier,
}),
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-index-view-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util.ts
similarity index 60%
rename from packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-index-view-to-create.util.ts
rename to packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util.ts
index 1421eeb635e..4cd8cd19dd8 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-index-view-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-system-view-to-create.util.ts
@@ -1,4 +1,8 @@
-import { getSystemViewUniversalIdentifier } from 'twenty-shared/application';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+ type SystemViewKey,
+} from 'twenty-shared/application';
import {
ViewKey,
ViewOpenRecordIn,
@@ -10,22 +14,52 @@ import { v4 } from 'uuid';
import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
-export const computeFlatIndexViewToCreate = ({
+type SystemViewObjectMetadata = Pick<
+ UniversalFlatObjectMetadata,
+ 'universalIdentifier' | 'labelSingular'
+>;
+
+// The INDEX view name is a template resolved at display time; the record-page
+// view name is materialized at creation.
+const SYSTEM_VIEW_PROPERTIES_BY_VIEW_KEY = {
+ [SYSTEM_VIEW_KEYS.INDEX]: {
+ type: ViewType.TABLE,
+ computeName: () => 'All {objectLabelPlural}',
+ },
+ [SYSTEM_VIEW_KEYS.FIELDS_WIDGET]: {
+ type: ViewType.FIELDS_WIDGET,
+ computeName: (objectMetadata: SystemViewObjectMetadata) =>
+ `${objectMetadata.labelSingular} Record Page Fields`,
+ },
+} as const satisfies Record<
+ SystemViewKey,
+ {
+ type: ViewType;
+ computeName: (objectMetadata: SystemViewObjectMetadata) => string;
+ }
+>;
+
+export const computeSystemViewToCreate = ({
objectMetadata,
applicationUniversalIdentifier,
+ viewKey,
}: {
applicationUniversalIdentifier: string;
- objectMetadata: Pick<UniversalFlatObjectMetadata, 'universalIdentifier'>;
+ objectMetadata: SystemViewObjectMetadata;
+ viewKey: SystemViewKey;
}): UniversalFlatView & { id: string } => {
+ const { type, computeName } = SYSTEM_VIEW_PROPERTIES_BY_VIEW_KEY[viewKey];
const createdAt = new Date().toISOString();
return {
id: v4(),
objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
- name: `All {objectLabelPlural}`,
- key: ViewKey.INDEX,
+ name: computeName(objectMetadata),
+ // Only INDEX is a persisted key; FIELDS_WIDGET exists solely in the
+ // universal identifier derivation.
+ key: viewKey === SYSTEM_VIEW_KEYS.INDEX ? ViewKey.INDEX : null,
icon: 'IconList',
- type: ViewType.TABLE,
+ type,
createdAt,
updatedAt: createdAt,
deletedAt: null,
@@ -46,7 +80,7 @@ export const computeFlatIndexViewToCreate = ({
objectMetadataApplicationUniversalIdentifier:
applicationUniversalIdentifier,
objectUniversalIdentifier: objectMetadata.universalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey,
}),
visibility: ViewVisibility.WORKSPACE,
createdByUserWorkspaceId: null,
diff --git a/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-view-field-position-input-flat-field-metadatas.util.ts b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-view-field-position-input-flat-field-metadatas.util.ts
new file mode 100644
index 00000000000..b0849f44aeb
--- /dev/null
+++ b/packages/twenty-server/src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-view-field-position-input-flat-field-metadatas.util.ts
@@ -0,0 +1,36 @@
+import { type AllFlatEntityOperationRecordByMetadataName } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-operation-record-by-metadata-name.type';
+import { computeCallerFlatFieldMetadatasForObject } from 'src/engine/metadata-modules/metadata-side-effect/handlers/utils/compute-caller-flat-field-metadatas-for-object.util';
+import { buildReservedSystemFlatFieldMetadatasForCustomObject } from 'src/engine/metadata-modules/object-metadata/utils/build-reserved-system-flat-field-metadatas-for-custom-object.util';
+import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
+
+// Single assembly of the position-numbering inputs shared by the same-batch
+// field path and the created-object path, so reserved-field and caller-field
+// selection cannot drift between them.
+export const computeViewFieldPositionInputFlatFieldMetadatas = ({
+ applicationUniversalIdentifier,
+ objectMetadataUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+}: {
+ applicationUniversalIdentifier: string;
+ objectMetadataUniversalIdentifier: string;
+ labelIdentifierFieldMetadataUniversalIdentifier: string | null;
+ allFlatEntityOperationRecordByMetadataName: AllFlatEntityOperationRecordByMetadataName;
+}): {
+ systemFlatFieldMetadatas: UniversalFlatFieldMetadata[];
+ callerFlatFieldMetadatas: UniversalFlatFieldMetadata[];
+} => ({
+ systemFlatFieldMetadatas: Object.values(
+ buildReservedSystemFlatFieldMetadatasForCustomObject({
+ flatObjectMetadata: {
+ applicationUniversalIdentifier,
+ universalIdentifier: objectMetadataUniversalIdentifier,
+ },
+ }),
+ ),
+ callerFlatFieldMetadatas: computeCallerFlatFieldMetadatasForObject({
+ objectMetadataUniversalIdentifier,
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ allFlatEntityOperationRecordByMetadataName,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts
index 7d8fcda9500..8209bdd81d0 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts
@@ -23,9 +23,6 @@ import { FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-meta
import { fromCreateObjectInputToFlatObjectMetadataAndFlatFieldMetadatasToCreate } from 'src/engine/metadata-modules/flat-object-metadata/utils/from-create-object-input-to-flat-object-metadata-and-flat-field-metadatas-to-create.util';
import { fromDeleteObjectInputToFlatFieldMetadatasToDelete } from 'src/engine/metadata-modules/flat-object-metadata/utils/from-delete-object-input-to-flat-field-metadatas-to-delete.util';
import { fromUpdateObjectInputToFlatObjectMetadataAndRelatedFlatEntities } from 'src/engine/metadata-modules/flat-object-metadata/utils/from-update-object-input-to-flat-object-metadata-and-related-flat-entities.util';
-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 { NavigationMenuItemType } from 'src/engine/metadata-modules/navigation-menu-item/enums/navigation-menu-item-type.enum';
import { CreateObjectInput } from 'src/engine/metadata-modules/object-metadata/dtos/create-object.input';
import { DeleteOneObjectInput } from 'src/engine/metadata-modules/object-metadata/dtos/delete-object.input';
@@ -35,16 +32,11 @@ import {
ObjectMetadataException,
ObjectMetadataExceptionCode,
} from 'src/engine/metadata-modules/object-metadata/object-metadata.exception';
-import { buildReservedSystemFlatFieldMetadatasForCustomObject } from 'src/engine/metadata-modules/object-metadata/utils/build-reserved-system-flat-field-metadatas-for-custom-object.util';
-import { computeFlatDefaultRecordPageLayoutToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util';
-import { computeFlatRecordPageFieldsViewToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util';
-import { computeFlatViewFieldsToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util';
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';
import { type UniversalFlatFieldMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-field-metadata.type';
import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
-import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
@Injectable()
export class ObjectMetadataService {
@@ -480,27 +472,6 @@ export class ObjectMetadataService {
flatApplication: resolvedOwnerFlatApplication,
});
- // The INDEX table view and its view fields are provisioned by the metadata
- // side-effect engine (objectSystemFieldsAndIndexViewOnCreate). The FIELDS_WIDGET
- // record-page view below still references the caller-provided fields plus
- // the engine-owned reserved system fields, whose deterministic identifiers
- // we re-derive here (searchVector is never shown).
- // TODO: remove once the record-page view fields move to the side-effect engine.
- const defaultFlatFieldMetadatasForViewFields: UniversalFlatFieldMetadata[] =
- [
- ...flatFieldMetadataToCreateOnObject,
- ...Object.values(
- buildReservedSystemFlatFieldMetadatasForCustomObject({
- flatObjectMetadata: {
- applicationUniversalIdentifier:
- resolvedOwnerFlatApplication.universalIdentifier,
- universalIdentifier:
- flatObjectMetadataToCreate.universalIdentifier,
- },
- }),
- ),
- ];
-
const flatNavigationMenuItemToCreate =
await this.computeFlatNavigationMenuItemToCreate({
objectMetadata: flatObjectMetadataToCreate,
@@ -529,32 +500,6 @@ export class ObjectMetadataService {
},
);
- const flatRecordPageFieldsViewToCreate =
- this.computeFlatRecordPageFieldsViewToCreate({
- objectMetadata: flatObjectMetadataToCreate,
- flatApplication: resolvedOwnerFlatApplication,
- });
-
- const flatRecordPageFieldsViewFieldsToCreate =
- computeFlatViewFieldsToCreate({
- applicationUniversalIdentifier:
- resolvedOwnerFlatApplication.universalIdentifier,
- objectFlatFieldMetadatas: defaultFlatFieldMetadatasForViewFields,
- labelIdentifierFieldMetadataUniversalIdentifier:
- flatObjectMetadataToCreate.labelIdentifierFieldMetadataUniversalIdentifier,
- viewUniversalIdentifier:
- flatRecordPageFieldsViewToCreate.universalIdentifier,
- excludeLabelIdentifier: true,
- });
-
- const flatDefaultRecordPageLayoutsToCreate =
- this.computeFlatDefaultRecordPageLayoutToCreate({
- objectMetadata: flatObjectMetadataToCreate,
- flatApplication: resolvedOwnerFlatApplication,
- recordPageFieldsView: flatRecordPageFieldsViewToCreate,
- workspaceId,
- });
-
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunWorkspaceMigration(
{
@@ -574,39 +519,11 @@ export class ObjectMetadataService {
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
- view: {
- flatEntityToCreate: [flatRecordPageFieldsViewToCreate],
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
- viewField: {
- flatEntityToCreate: [...flatRecordPageFieldsViewFieldsToCreate],
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
commandMenuItem: {
flatEntityToCreate: [flatCommandMenuItemToCreate],
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
- pageLayout: {
- flatEntityToCreate:
- flatDefaultRecordPageLayoutsToCreate.pageLayouts,
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
- pageLayoutTab: {
- flatEntityToCreate:
- flatDefaultRecordPageLayoutsToCreate.pageLayoutTabs,
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
- pageLayoutWidget: {
- flatEntityToCreate:
- flatDefaultRecordPageLayoutsToCreate.pageLayoutWidgets,
- flatEntityToDelete: [],
- flatEntityToUpdate: [],
- },
...(isDefined(flatNavigationMenuItemToCreate)
? {
navigationMenuItem: {
@@ -654,42 +571,6 @@ export class ObjectMetadataService {
return createdFlatObjectMetadata;
}
- private computeFlatRecordPageFieldsViewToCreate({
- objectMetadata,
- flatApplication,
- }: {
- flatApplication: FlatApplication;
- objectMetadata: UniversalFlatObjectMetadata & { id: string };
- }): UniversalFlatView & { id: string } {
- return computeFlatRecordPageFieldsViewToCreate({
- objectMetadata,
- flatApplication,
- });
- }
-
- private computeFlatDefaultRecordPageLayoutToCreate({
- objectMetadata,
- flatApplication,
- recordPageFieldsView,
- workspaceId,
- }: {
- flatApplication: FlatApplication;
- objectMetadata: UniversalFlatObjectMetadata & { id: string };
- recordPageFieldsView: UniversalFlatView & { id: string };
- workspaceId: string;
- }): {
- pageLayouts: FlatPageLayout[];
- pageLayoutTabs: FlatPageLayoutTab[];
- pageLayoutWidgets: FlatPageLayoutWidget[];
- } {
- return computeFlatDefaultRecordPageLayoutToCreate({
- objectMetadata,
- flatApplication,
- recordPageFieldsView,
- workspaceId,
- });
- }
-
private async computeFlatNavigationMenuItemToCreate({
objectMetadata,
workspaceId,
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-index-view-to-create.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-index-view-to-create.util.spec.ts
deleted file mode 100644
index 80c3446c0e5..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/__tests__/compute-flat-index-view-to-create.util.spec.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { getSystemViewUniversalIdentifier } from 'twenty-shared/application';
-import { ViewKey, ViewType } from 'twenty-shared/types';
-
-import { computeFlatIndexViewToCreate } from '../compute-flat-index-view-to-create.util';
-
-const applicationUniversalIdentifier = 'a1a2a3a4-a5a6-4000-8000-000000000001';
-const objectUniversalIdentifier = 'b1b2b3b4-b5b6-4000-8000-000000000001';
-
-describe('computeFlatIndexViewToCreate', () => {
- it('should derive the INDEX view universal identifier from the object', () => {
- const result = computeFlatIndexViewToCreate({
- applicationUniversalIdentifier,
- objectMetadata: { universalIdentifier: objectUniversalIdentifier },
- });
-
- expect(result.universalIdentifier).toBe(
- getSystemViewUniversalIdentifier({
- objectMetadataApplicationUniversalIdentifier:
- applicationUniversalIdentifier,
- objectUniversalIdentifier,
- viewKey: ViewKey.INDEX,
- }),
- );
- });
-
- it('should build a system-owned INDEX table view keyed on ViewKey.INDEX', () => {
- const result = computeFlatIndexViewToCreate({
- applicationUniversalIdentifier,
- objectMetadata: { universalIdentifier: objectUniversalIdentifier },
- });
-
- expect(result.key).toBe(ViewKey.INDEX);
- expect(result.type).toBe(ViewType.TABLE);
- expect(result.name).toBe('All {objectLabelPlural}');
- expect(result.isSystemSideEffect).toBe(true);
- expect(result.objectMetadataUniversalIdentifier).toBe(
- objectUniversalIdentifier,
- );
- expect(result.applicationUniversalIdentifier).toBe(
- applicationUniversalIdentifier,
- );
- });
-
- it('should be deterministic and independent from the view primary key', () => {
- const first = computeFlatIndexViewToCreate({
- applicationUniversalIdentifier,
- objectMetadata: { universalIdentifier: objectUniversalIdentifier },
- });
- const second = computeFlatIndexViewToCreate({
- applicationUniversalIdentifier,
- objectMetadata: { universalIdentifier: objectUniversalIdentifier },
- });
-
- expect(first.universalIdentifier).toBe(second.universalIdentifier);
- expect(first.id).not.toBe(second.id);
- });
-});
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util.ts
deleted file mode 100644
index 5dd6b4a758f..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util.ts
+++ /dev/null
@@ -1,155 +0,0 @@
-import { v4 } from 'uuid';
-
-import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
-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 { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
-import {
- TAB_PROPS,
- WIDGET_PROPS,
-} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
-import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
-import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
-
-export const computeFlatDefaultRecordPageLayoutToCreate = ({
- objectMetadata,
- flatApplication,
- recordPageFieldsView,
- workspaceId,
-}: {
- flatApplication: FlatApplication;
- objectMetadata: UniversalFlatObjectMetadata & { id: string };
- recordPageFieldsView: UniversalFlatView & { id: string };
- workspaceId: string;
-}): {
- pageLayouts: FlatPageLayout[];
- pageLayoutTabs: FlatPageLayoutTab[];
- pageLayoutWidgets: FlatPageLayoutWidget[];
-} => {
- const now = new Date().toISOString();
- const pageLayoutId = v4();
- const pageLayoutUniversalIdentifier = v4();
-
- const tabDefinitions = [
- { key: 'home' as const, widgetKey: 'fields' as const },
- { key: 'timeline' as const, widgetKey: 'timeline' as const },
- { key: 'tasks' as const, widgetKey: 'tasks' as const },
- { key: 'notes' as const, widgetKey: 'notes' as const },
- { key: 'files' as const, widgetKey: 'files' as const },
- ];
-
- const pageLayoutTabs: FlatPageLayoutTab[] = [];
- const pageLayoutWidgets: FlatPageLayoutWidget[] = [];
-
- for (const { key, widgetKey } of tabDefinitions) {
- const tabProps = TAB_PROPS[key];
- const widgetProps = WIDGET_PROPS[widgetKey];
- const tabId = v4();
- const tabUniversalIdentifier = v4();
- const widgetId = v4();
- const widgetUniversalIdentifier = v4();
-
- pageLayoutTabs.push({
- id: tabId,
- universalIdentifier: tabUniversalIdentifier,
- applicationId: flatApplication.id,
- applicationUniversalIdentifier: flatApplication.universalIdentifier,
- workspaceId,
- title: tabProps.title,
- position: tabProps.position,
- pageLayoutId,
- pageLayoutUniversalIdentifier,
- widgetIds: [widgetId],
- widgetUniversalIdentifiers: [widgetUniversalIdentifier],
- isActive: true,
- isSystemSideEffect: true,
- createdAt: now,
- updatedAt: now,
- deletedAt: null,
- icon: tabProps.icon,
- layoutMode: tabProps.layoutMode,
- overrides: null,
- });
-
- const isFieldsWidget = widgetKey === 'fields';
-
- const configuration = isFieldsWidget
- ? {
- configurationType: WidgetConfigurationType.FIELDS,
- viewId: recordPageFieldsView.id,
- newFieldDefaultVisibility: true,
- }
- : {
- configurationType:
- WidgetConfigurationType[
- widgetKey.toUpperCase() as keyof typeof WidgetConfigurationType
- ],
- };
-
- const universalConfiguration = isFieldsWidget
- ? {
- configurationType: WidgetConfigurationType.FIELDS,
- viewUniversalIdentifier: recordPageFieldsView.universalIdentifier,
- newFieldDefaultVisibility: true,
- }
- : {
- configurationType:
- WidgetConfigurationType[
- widgetKey.toUpperCase() as keyof typeof WidgetConfigurationType
- ],
- };
-
- pageLayoutWidgets.push({
- id: widgetId,
- universalIdentifier: widgetUniversalIdentifier,
- applicationId: flatApplication.id,
- applicationUniversalIdentifier: flatApplication.universalIdentifier,
- workspaceId,
- pageLayoutTabId: tabId,
- pageLayoutTabUniversalIdentifier: tabUniversalIdentifier,
- title: widgetProps.title,
- type: widgetProps.type,
- gridPosition: widgetProps.gridPosition,
- position: widgetProps.position,
- // @ts-expect-error - configurationType is validated but TS can't match to discriminated union
- configuration,
- // @ts-expect-error - configurationType is validated but TS can't match to discriminated union
- universalConfiguration,
- objectMetadataId: objectMetadata.id,
- objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
- isActive: true,
- isSystemSideEffect: true,
- createdAt: now,
- updatedAt: now,
- deletedAt: null,
- conditionalDisplay: null,
- overrides: null,
- });
- }
-
- const pageLayout: FlatPageLayout = {
- id: pageLayoutId,
- universalIdentifier: pageLayoutUniversalIdentifier,
- applicationId: flatApplication.id,
- applicationUniversalIdentifier: flatApplication.universalIdentifier,
- workspaceId,
- name: `Default ${objectMetadata.labelSingular} Layout`,
- type: PageLayoutType.RECORD_PAGE,
- objectMetadataId: objectMetadata.id,
- objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
- tabIds: pageLayoutTabs.map((tab) => tab.id),
- tabUniversalIdentifiers: pageLayoutTabs.map(
- (tab) => tab.universalIdentifier,
- ),
- isSystemSideEffect: true,
- createdAt: now,
- updatedAt: now,
- deletedAt: null,
- defaultTabToFocusOnMobileAndSidePanelId: null,
- defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier: null,
- };
-
- return { pageLayouts: [pageLayout], pageLayoutTabs, pageLayoutWidgets };
-};
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util.ts
deleted file mode 100644
index d7bde82f908..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import {
- ViewOpenRecordIn,
- ViewType,
- ViewVisibility,
-} from 'twenty-shared/types';
-import { v4 } from 'uuid';
-
-import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
-import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
-import { type UniversalFlatView } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-view.type';
-
-export const computeFlatRecordPageFieldsViewToCreate = ({
- objectMetadata,
- flatApplication,
-}: {
- flatApplication: FlatApplication;
- objectMetadata: UniversalFlatObjectMetadata & { id: string };
-}): UniversalFlatView & { id: string } => {
- const createdAt = new Date().toISOString();
-
- return {
- id: v4(),
- objectMetadataUniversalIdentifier: objectMetadata.universalIdentifier,
- name: `${objectMetadata.labelSingular} Record Page Fields`,
- key: null,
- icon: 'IconList',
- type: ViewType.FIELDS_WIDGET,
- createdAt,
- updatedAt: createdAt,
- deletedAt: null,
- isCustom: true,
- anyFieldFilterValue: null,
- calendarFieldMetadataUniversalIdentifier: null,
- calendarEndFieldMetadataUniversalIdentifier: null,
- calendarLayout: null,
- isCompact: false,
- shouldHideEmptyGroups: false,
- kanbanColumnWidth: null,
- kanbanAggregateOperation: null,
- kanbanAggregateOperationFieldMetadataUniversalIdentifier: null,
- mainGroupByFieldMetadataUniversalIdentifier: null,
- openRecordIn: ViewOpenRecordIn.SIDE_PANEL,
- position: 0,
- universalIdentifier: v4(),
- visibility: ViewVisibility.WORKSPACE,
- createdByUserWorkspaceId: null,
- isActive: true,
- isSystemSideEffect: true,
- universalOverrides: null,
- viewFieldUniversalIdentifiers: [],
- viewFieldGroupUniversalIdentifiers: [],
- viewFilterUniversalIdentifiers: [],
- viewGroupUniversalIdentifiers: [],
- viewFilterGroupUniversalIdentifiers: [],
- viewSortUniversalIdentifiers: [],
- applicationUniversalIdentifier: flatApplication.universalIdentifier,
- };
-};
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-tab/dtos/page-layout-tab.dto.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-tab/dtos/page-layout-tab.dto.ts
index bb2331b43af..d143eb89ac6 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-tab/dtos/page-layout-tab.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-tab/dtos/page-layout-tab.dto.ts
@@ -20,6 +20,12 @@ export class PageLayoutTabDTO {
@Field(() => UUIDScalarType)
id: string;
+ @Field(() => UUIDScalarType, { nullable: false })
+ universalIdentifier: string;
+
+ @Field({ nullable: false })
+ isSystemSideEffect: boolean;
+
@Field(() => UUIDScalarType, { nullable: false })
applicationId: string;
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto.ts
index 1c3bd8eeff0..ca7f3dc133b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto.ts
@@ -39,6 +39,12 @@ export class PageLayoutWidgetDTO {
@Field(() => UUIDScalarType)
id: string;
+ @Field(() => UUIDScalarType, { nullable: false })
+ universalIdentifier: string;
+
+ @Field({ nullable: false })
+ isSystemSideEffect: boolean;
+
@Field(() => UUIDScalarType, { nullable: false })
applicationId: string;
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout/dtos/page-layout.dto.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout/dtos/page-layout.dto.ts
index f82fb11d48c..cf83933dfe2 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout/dtos/page-layout.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout/dtos/page-layout.dto.ts
@@ -33,6 +33,12 @@ export class PageLayoutDTO {
@Field(() => UUIDScalarType, { nullable: false })
universalIdentifier: string;
+ @Field(() => UUIDScalarType, { nullable: false })
+ applicationId: string;
+
+ @Field({ nullable: false })
+ isSystemSideEffect: boolean;
+
@Field()
createdAt: Date;
diff --git a/packages/twenty-server/src/engine/metadata-modules/view-field-group/entities/view-field-group.entity.ts b/packages/twenty-server/src/engine/metadata-modules/view-field-group/entities/view-field-group.entity.ts
index 4824fe569a8..c8678238166 100644
--- a/packages/twenty-server/src/engine/metadata-modules/view-field-group/entities/view-field-group.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/view-field-group/entities/view-field-group.entity.ts
@@ -12,6 +12,8 @@ import {
UpdateDateColumn,
} from 'typeorm';
+import { ADD_IS_SYSTEM_SIDE_EFFECT_TO_VIEW_FIELD_GROUP_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-31/add-is-system-side-effect-to-view-field-group-upgrade-command-name.constant';
+import { WasIntroducedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-introduced-in-upgrade.decorator';
import { ViewFieldEntity } from 'src/engine/metadata-modules/view-field/entities/view-field.entity';
import { ViewEntity } from 'src/engine/metadata-modules/view/entities/view.entity';
import { OverridableEntity } from 'src/engine/workspace-manager/types/overridable-entity';
@@ -44,6 +46,13 @@ export class ViewFieldGroupEntity
@Column({ nullable: false, type: 'uuid' })
viewId: string;
+ @WasIntroducedInUpgrade({
+ upgradeCommandName:
+ ADD_IS_SYSTEM_SIDE_EFFECT_TO_VIEW_FIELD_GROUP_UPGRADE_COMMAND_NAME,
+ })
+ @Column({ nullable: false, default: false, type: 'boolean' })
+ isSystemSideEffect: boolean;
+
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
diff --git a/packages/twenty-server/src/engine/metadata-modules/view-field-group/services/fields-widget-upsert.service.ts b/packages/twenty-server/src/engine/metadata-modules/view-field-group/services/fields-widget-upsert.service.ts
index 34c759af403..ab30b681f11 100644
--- a/packages/twenty-server/src/engine/metadata-modules/view-field-group/services/fields-widget-upsert.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/view-field-group/services/fields-widget-upsert.service.ts
@@ -876,6 +876,7 @@ export class FieldsWidgetUpsertService {
viewId,
viewUniversalIdentifier,
isActive: true,
+ isSystemSideEffect: false,
overrides: null,
createdAt: now,
updatedAt: now,
diff --git a/packages/twenty-server/src/engine/metadata-modules/view-field/dtos/view-field.dto.ts b/packages/twenty-server/src/engine/metadata-modules/view-field/dtos/view-field.dto.ts
index b9fc53ef5cc..3ea27d8dd78 100644
--- a/packages/twenty-server/src/engine/metadata-modules/view-field/dtos/view-field.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/view-field/dtos/view-field.dto.ts
@@ -16,6 +16,15 @@ export class ViewFieldDTO {
@Field(() => UUIDScalarType)
id: string;
+ @Field(() => UUIDScalarType, { nullable: false })
+ universalIdentifier: string;
+
+ @Field(() => UUIDScalarType, { nullable: false })
+ applicationId: string;
+
+ @Field({ nullable: false })
+ isSystemSideEffect: boolean;
+
@Field(() => UUIDScalarType, { nullable: false })
fieldMetadataId: string;
diff --git a/packages/twenty-server/src/engine/metadata-modules/view/dtos/view.dto.ts b/packages/twenty-server/src/engine/metadata-modules/view/dtos/view.dto.ts
index b3978e37147..5c798f9e069 100644
--- a/packages/twenty-server/src/engine/metadata-modules/view/dtos/view.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/view/dtos/view.dto.ts
@@ -35,6 +35,15 @@ export class ViewDTO {
@Field(() => UUIDScalarType)
id: string;
+ @Field(() => UUIDScalarType, { nullable: false })
+ universalIdentifier: string;
+
+ @Field(() => UUIDScalarType, { nullable: false })
+ applicationId: string;
+
+ @Field({ nullable: false })
+ isSystemSideEffect: boolean;
+
@Field({ nullable: false })
name: string;
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util.ts
index 41062b30c1f..77dfe85238d 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util.ts
@@ -70,6 +70,7 @@ export const createStandardViewFieldGroupFlatMetadata = <
name,
position,
isVisible,
+ isSystemSideEffect: true,
overrides: null,
createdAt: now,
updatedAt: now,
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-view-validator.service.spec.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-view-validator.service.spec.ts
index c85e794c300..96739bc3118 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-view-validator.service.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/__tests__/flat-view-validator.service.spec.ts
@@ -133,7 +133,9 @@ describe('FlatViewValidatorService INDEX key reservation', () => {
);
expect(result.errors).toHaveLength(1);
- expect(result.errors[0].message).toContain('already has an INDEX view');
+ expect(result.errors[0].message).toContain(
+ 'already has a view with the INDEX key',
+ );
});
it('ignores a soft-deleted INDEX view when checking the singleton', () => {
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-view-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-view-validator.service.ts
index 0e5c6baec39..5e0056662df 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-view-validator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-view-validator.service.ts
@@ -5,7 +5,6 @@ import {
FieldMetadataType,
RelationType,
ViewCalendarLayout,
- ViewKey,
ViewType,
} from 'twenty-shared/types';
import { getViewLayoutFromViewType, isDefined } from 'twenty-shared/utils';
@@ -460,16 +459,20 @@ export class FlatViewValidatorService {
});
}
- if (flatViewToValidate.key === ViewKey.INDEX) {
+ // Every ViewKey value is reserved for an engine-owned singleton view per
+ // object (INDEX table view, FIELDS_WIDGET record-page view).
+ const reservedViewKey = flatViewToValidate.key;
+
+ if (isDefined(reservedViewKey)) {
if (flatViewToValidate.isSystemSideEffect !== true) {
validationResult.errors.push({
code: ViewExceptionCode.INVALID_VIEW_DATA,
- message: t`The INDEX view key is reserved for the engine-owned default view; remove the key from the view definition`,
- userFriendlyMessage: msg`The INDEX view key is reserved for the default view`,
+ message: t`The ${reservedViewKey} view key is reserved for the engine-owned default view; remove the key from the view definition`,
+ userFriendlyMessage: msg`The ${reservedViewKey} view key is reserved for the default view`,
});
}
- const objectAlreadyHasIndexFlatView =
+ const objectAlreadyHasFlatViewWithSameKey =
isDefined(optimisticFlatObjectMetadata) &&
optimisticFlatObjectMetadata.viewUniversalIdentifiers.some(
(viewUniversalIdentifier) => {
@@ -480,16 +483,16 @@ export class FlatViewValidatorService {
return (
isDefined(flatView) &&
- flatView.key === ViewKey.INDEX &&
+ flatView.key === reservedViewKey &&
!isDefined(flatView.deletedAt)
);
},
);
- if (objectAlreadyHasIndexFlatView) {
+ if (objectAlreadyHasFlatViewWithSameKey) {
validationResult.errors.push({
code: ViewExceptionCode.INVALID_VIEW_DATA,
- message: t`Object already has an INDEX view`,
+ message: t`Object already has a view with the ${reservedViewKey} key`,
userFriendlyMessage: msg`This object already has a default view`,
});
}
diff --git a/packages/twenty-server/test/integration/constants/view-gql-fields.constants.ts b/packages/twenty-server/test/integration/constants/view-gql-fields.constants.ts
index d6d02bdecf4..790f8eff0d0 100644
--- a/packages/twenty-server/test/integration/constants/view-gql-fields.constants.ts
+++ b/packages/twenty-server/test/integration/constants/view-gql-fields.constants.ts
@@ -18,6 +18,9 @@ export const VIEW_GQL_FIELDS = `
export const VIEW_FIELD_GQL_FIELDS = `
id
+ universalIdentifier
+ applicationId
+ isSystemSideEffect
fieldMetadataId
position
isVisible
diff --git a/packages/twenty-server/test/integration/graphql/suites/view/__snapshots__/successful-find-view.integration-spec.ts.snap b/packages/twenty-server/test/integration/graphql/suites/view/__snapshots__/successful-find-view.integration-spec.ts.snap
index fb440f0b4e1..df2b007b228 100644
--- a/packages/twenty-server/test/integration/graphql/suites/view/__snapshots__/successful-find-view.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/graphql/suites/view/__snapshots__/successful-find-view.integration-spec.ts.snap
@@ -18,169 +18,211 @@ exports[`successful find view with all sub-relations (e2e) Company View Structur
"updatedAt": Any<String>,
"viewFields": [
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 0,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 1,
"size": 100,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 2,
"size": 150,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 3,
"size": 150,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 4,
"size": 150,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 5,
"size": 170,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 6,
"size": 170,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 7,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 8,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 9,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 10,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 11,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 12,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
},
{
+ "applicationId": Any<String>,
"createdAt": Any<String>,
"deletedAt": null,
"fieldMetadataId": Any<String>,
"id": Any<String>,
+ "isSystemSideEffect": true,
"isVisible": true,
"position": 13,
"size": 180,
+ "universalIdentifier": Any<String>,
"updatedAt": Any<String>,
"viewFieldGroupId": null,
"viewId": Any<String>,
diff --git a/packages/twenty-server/test/integration/graphql/suites/view/successful-find-view.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/view/successful-find-view.integration-spec.ts
index c34c98bc397..97885b5a034 100644
--- a/packages/twenty-server/test/integration/graphql/suites/view/successful-find-view.integration-spec.ts
+++ b/packages/twenty-server/test/integration/graphql/suites/view/successful-find-view.integration-spec.ts
@@ -76,6 +76,9 @@ describe('successful find view with all sub-relations (e2e)', () => {
),
};
+ // universalIdentifier stays normalized: the sample-app fields seeded on
+ // the company view get per-seed identifiers, so the engine-derived view
+ // field identifiers displaying them differ across seeds too.
expect(stableTestView).toMatchSnapshot(
extractRecordIdsAndDatesAsExpectAny({ ...stableTestView }),
);
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-update-view-field.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-update-view-field.integration-spec.ts.snap
index 6ec91ce174b..2d6e5401478 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-update-view-field.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-update-view-field.integration-spec.ts.snap
@@ -1,5 +1,42 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`Failing manifest update - standalone view fields on existing views rejects a standalone view field claiming the pair the engine emits for the created field 1`] = `
+{
+ "extensions": {
+ "code": "METADATA_VALIDATION_FAILED",
+ "errors": {
+ "viewField": [
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "View field with same fieldMetadataUniversalIdentifier and viewUniversalIdentifier already exists",
+ "userFriendlyMessage": "View field already exists",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
+ ],
+ },
+ "message": "Validation failed for 1 viewField",
+ "summary": {
+ "totalErrors": 1,
+ "viewField": 1,
+ },
+ "userFriendlyMessage": "View field already exists",
+ },
+ "message": "Validation errors occurred while syncing application manifest metadata",
+ "name": "GraphQLError",
+}
+`;
+
exports[`Failing manifest update - standalone view fields on existing views rejects a standalone view field whose target view does not exist 1`] = `
{
"extensions": {
@@ -60,14 +97,31 @@ exports[`Failing manifest update - standalone view fields on existing views reje
"status": "fail",
"type": "create",
},
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "View field with same fieldMetadataUniversalIdentifier and viewUniversalIdentifier already exists",
+ "userFriendlyMessage": "View field already exists",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
],
},
- "message": "Validation failed for 1 viewField",
+ "message": "Validation failed for 2 viewFields",
"summary": {
- "totalErrors": 1,
- "viewField": 1,
+ "totalErrors": 2,
+ "viewField": 2,
},
- "userFriendlyMessage": "View field already exists",
+ "userFriendlyMessage": "Many validation errors",
},
"message": "Validation errors occurred while syncing application manifest metadata",
"name": "GraphQLError",
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-sync-application-search-vector-identifier-hijack.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-sync-application-search-vector-identifier-hijack.integration-spec.ts.snap
index 4e63c9954e7..81a13367cb8 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-sync-application-search-vector-identifier-hijack.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-sync-application-search-vector-identifier-hijack.integration-spec.ts.snap
@@ -80,13 +80,30 @@ exports[`Sync application should reject hijacking the searchVector system field
"status": "fail",
"type": "create",
},
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "Field metadata not found",
+ "userFriendlyMessage": "Field metadata not found",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
],
},
- "message": "Validation failed for 1 fieldMetadata, 1 viewField",
+ "message": "Validation failed for 1 fieldMetadata, 2 viewFields",
"summary": {
"fieldMetadata": 1,
- "totalErrors": 2,
- "viewField": 1,
+ "totalErrors": 3,
+ "viewField": 2,
},
"userFriendlyMessage": "Many validation errors",
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
index ca33b8f0603..fb2e5542484 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
@@ -56,6 +56,27 @@ exports[`syncApplication should create a TEXT field on the standard Company obje
"metadataName": "viewField",
"type": "create",
},
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 7,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "create",
+ },
{
"flatEntity": {
"applicationUniversalIdentifier": Any<String>,
@@ -796,6 +817,42 @@ exports[`syncApplication should delete old field and create equivalent one when
"metadataName": "view",
"type": "create",
},
+ {
+ "flatEntity": {
+ "anyFieldFilterValue": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "calendarEndFieldMetadataUniversalIdentifier": null,
+ "calendarFieldMetadataUniversalIdentifier": null,
+ "calendarLayout": null,
+ "createdAt": Any<String>,
+ "createdByUserWorkspaceId": null,
+ "deletedAt": null,
+ "icon": "IconList",
+ "id": Any<String>,
+ "isActive": true,
+ "isCompact": false,
+ "isCustom": true,
+ "isSystemSideEffect": true,
+ "kanbanAggregateOperation": null,
+ "kanbanAggregateOperationFieldMetadataUniversalIdentifier": null,
+ "kanbanColumnWidth": null,
+ "key": null,
+ "mainGroupByFieldMetadataUniversalIdentifier": null,
+ "name": "Ticket Record Page Fields",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "openRecordIn": "SIDE_PANEL",
+ "position": 0,
+ "shouldHideEmptyGroups": false,
+ "type": "FIELDS_WIDGET",
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "visibility": "WORKSPACE",
+ },
+ "id": Any<String>,
+ "metadataName": "view",
+ "type": "create",
+ },
{
"flatEntity": {
"aggregateOperation": null,
@@ -848,7 +905,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 2,
+ "position": 0,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -869,7 +926,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 3,
+ "position": 2,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -890,7 +947,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 4,
+ "position": 3,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -911,7 +968,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 5,
+ "position": 4,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -924,108 +981,65 @@ exports[`syncApplication should delete old field and create equivalent one when
},
{
"flatEntity": {
+ "aggregateOperation": null,
"applicationUniversalIdentifier": Any<String>,
- "canAccessAllTools": false,
- "canBeAssignedToAgents": true,
- "canBeAssignedToApiKeys": true,
- "canBeAssignedToUsers": true,
- "canDestroyAllObjectRecords": false,
- "canReadAllObjectRecords": false,
- "canSoftDeleteAllObjectRecords": false,
- "canUpdateAllObjectRecords": false,
- "canUpdateAllSettings": false,
"createdAt": Any<String>,
- "description": "A test role",
- "icon": null,
- "isEditable": true,
- "label": "Test Role",
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 5,
+ "size": 180,
"universalIdentifier": Any<String>,
+ "universalOverrides": null,
"updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
},
- "metadataName": "role",
+ "metadataName": "viewField",
"type": "create",
},
- ],
- "applicationUniversalIdentifier": Any<String>,
- },
-}
-`;
-
-exports[`syncApplication should delete old field and create equivalent one when field universalIdentifier changes 2`] = `
-{
- "syncApplication": {
- "actions": [
{
"flatEntity": {
+ "aggregateOperation": null,
"applicationUniversalIdentifier": Any<String>,
- "calendarEndViewUniversalIdentifiers": [],
- "calendarViewUniversalIdentifiers": [],
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "Ticket description",
- "fieldPermissionUniversalIdentifiers": [],
- "icon": "IconFileDescription",
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
"isActive": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isSystemSideEffect": false,
- "isUIEditable": true,
- "isUnique": false,
- "kanbanAggregateOperationViewUniversalIdentifiers": [],
- "label": "Description",
- "mainGroupByFieldMetadataViewUniversalIdentifiers": [],
- "morphId": null,
- "name": "description",
- "objectMetadataUniversalIdentifier": Any<String>,
- "options": null,
- "overrides": null,
- "relationTargetFieldMetadataUniversalIdentifier": null,
- "relationTargetObjectMetadataUniversalIdentifier": null,
- "searchFieldMetadataUniversalIdentifiers": [],
- "type": "TEXT",
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 1,
+ "size": 180,
"universalIdentifier": Any<String>,
- "universalSettings": null,
+ "universalOverrides": null,
"updatedAt": Any<String>,
- "viewFieldUniversalIdentifiers": [
- "da099a9e-dfb5-5eb3-bc29-e7a789e4b765",
- ],
- "viewFilterUniversalIdentifiers": [],
- "viewSortUniversalIdentifiers": [],
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
},
- "metadataName": "fieldMetadata",
- "type": "delete",
- "universalIdentifier": Any<String>,
+ "metadataName": "viewField",
+ "type": "create",
},
{
"flatEntity": {
+ "aggregateOperation": null,
"applicationUniversalIdentifier": Any<String>,
"createdAt": Any<String>,
- "defaultValue": null,
- "description": "Ticket description",
- "icon": "IconFileDescription",
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
"isActive": true,
- "isLabelSyncedWithName": false,
- "isNullable": true,
- "isSystem": false,
- "isSystemSideEffect": false,
- "isUIEditable": true,
- "isUnique": false,
- "label": "Description",
- "morphId": null,
- "name": "description",
- "objectMetadataUniversalIdentifier": Any<String>,
- "options": null,
- "overrides": null,
- "relationTargetFieldMetadataUniversalIdentifier": null,
- "relationTargetObjectMetadataUniversalIdentifier": null,
- "type": "TEXT",
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 2,
+ "size": 180,
"universalIdentifier": Any<String>,
- "universalSettings": null,
+ "universalOverrides": null,
"updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
},
- "id": Any<String>,
- "metadataName": "fieldMetadata",
+ "metadataName": "viewField",
"type": "create",
},
{
@@ -1038,7 +1052,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 1,
+ "position": 3,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1047,8 +1061,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"viewUniversalIdentifier": Any<String>,
},
"metadataName": "viewField",
- "type": "delete",
- "universalIdentifier": Any<String>,
+ "type": "create",
},
{
"flatEntity": {
@@ -1060,7 +1073,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 6,
+ "position": 4,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1071,55 +1084,521 @@ exports[`syncApplication should delete old field and create equivalent one when
"metadataName": "viewField",
"type": "create",
},
- ],
- "applicationUniversalIdentifier": Any<String>,
- },
-}
-`;
-
-exports[`syncApplication should return workspace migration actions on initial sync then on second sync with field rename and new role 1`] = `
-{
- "syncApplication": {
- "actions": [
{
- "fieldIdByUniversalIdentifier": Any<Object>,
"flatEntity": {
"applicationUniversalIdentifier": Any<String>,
- "color": null,
+ "canAccessAllTools": false,
+ "canBeAssignedToAgents": true,
+ "canBeAssignedToApiKeys": true,
+ "canBeAssignedToUsers": true,
+ "canDestroyAllObjectRecords": false,
+ "canReadAllObjectRecords": false,
+ "canSoftDeleteAllObjectRecords": false,
+ "canUpdateAllObjectRecords": false,
+ "canUpdateAllSettings": false,
"createdAt": Any<String>,
- "description": "A support ticket",
- "duplicateCriteria": null,
- "icon": "IconTicket",
- "imageIdentifierFieldMetadataUniversalIdentifier": null,
+ "description": "A test role",
+ "icon": null,
+ "isEditable": true,
+ "label": "Test Role",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "role",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier": null,
+ "deletedAt": null,
+ "isSystemSideEffect": true,
+ "name": "Default Ticket Layout",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "type": "RECORD_PAGE",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayout",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconHome",
"isActive": true,
- "isAuditLogged": true,
- "isLabelSyncedWithName": false,
- "isRemote": false,
- "isSearchable": true,
- "isSystem": false,
- "isUICreatable": true,
- "isUIEditable": true,
- "labelIdentifierFieldMetadataUniversalIdentifier": Any<String>,
- "labelPlural": "Tickets",
- "labelSingular": "Ticket",
- "namePlural": "tickets",
- "nameSingular": "ticket",
- "openRecordIn": "USER_CHOICE",
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
"overrides": null,
- "shortcut": null,
- "targetTableName": "DEPRECATED",
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 10,
+ "title": "Home",
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
},
- "id": Any<String>,
- "metadataName": "objectMetadata",
+ "metadataName": "pageLayoutTab",
"type": "create",
- "universalFlatFieldMetadatas": [
- {
- "applicationUniversalIdentifier": Any<String>,
- "createdAt": Any<String>,
- "defaultValue": null,
- "description": "Ticket description",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconTimelineEvent",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 20,
+ "title": "Timeline",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconCheckbox",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 30,
+ "title": "Tasks",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconNotes",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 40,
+ "title": "Notes",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconPaperclip",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 50,
+ "title": "Files",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 12,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Fields",
+ "type": "FIELDS",
+ "universalConfiguration": {
+ "configurationType": "FIELDS",
+ "newFieldDefaultVisibility": true,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Timeline",
+ "type": "TIMELINE",
+ "universalConfiguration": {
+ "configurationType": "TIMELINE",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Tasks",
+ "type": "TASKS",
+ "universalConfiguration": {
+ "configurationType": "TASKS",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Notes",
+ "type": "NOTES",
+ "universalConfiguration": {
+ "configurationType": "NOTES",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Files",
+ "type": "FILES",
+ "universalConfiguration": {
+ "configurationType": "FILES",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ ],
+ "applicationUniversalIdentifier": Any<String>,
+ },
+}
+`;
+
+exports[`syncApplication should delete old field and create equivalent one when field universalIdentifier changes 2`] = `
+{
+ "syncApplication": {
+ "actions": [
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "calendarEndViewUniversalIdentifiers": [],
+ "calendarViewUniversalIdentifiers": [],
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Ticket description",
+ "fieldPermissionUniversalIdentifiers": [],
+ "icon": "IconFileDescription",
+ "isActive": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isSystemSideEffect": false,
+ "isUIEditable": true,
+ "isUnique": false,
+ "kanbanAggregateOperationViewUniversalIdentifiers": [],
+ "label": "Description",
+ "mainGroupByFieldMetadataViewUniversalIdentifiers": [],
+ "morphId": null,
+ "name": "description",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "options": null,
+ "overrides": null,
+ "relationTargetFieldMetadataUniversalIdentifier": null,
+ "relationTargetObjectMetadataUniversalIdentifier": null,
+ "searchFieldMetadataUniversalIdentifiers": [],
+ "type": "TEXT",
+ "universalIdentifier": Any<String>,
+ "universalSettings": null,
+ "updatedAt": Any<String>,
+ "viewFieldUniversalIdentifiers": [
+ "da099a9e-dfb5-5eb3-bc29-e7a789e4b765",
+ "b88222e0-79b6-5e7c-b4d1-d8aa56b8af23",
+ ],
+ "viewFilterUniversalIdentifiers": [],
+ "viewSortUniversalIdentifiers": [],
+ },
+ "metadataName": "fieldMetadata",
+ "type": "delete",
+ "universalIdentifier": Any<String>,
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Ticket description",
+ "icon": "IconFileDescription",
+ "isActive": true,
+ "isLabelSyncedWithName": false,
+ "isNullable": true,
+ "isSystem": false,
+ "isSystemSideEffect": false,
+ "isUIEditable": true,
+ "isUnique": false,
+ "label": "Description",
+ "morphId": null,
+ "name": "description",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "options": null,
+ "overrides": null,
+ "relationTargetFieldMetadataUniversalIdentifier": null,
+ "relationTargetObjectMetadataUniversalIdentifier": null,
+ "type": "TEXT",
+ "universalIdentifier": Any<String>,
+ "universalSettings": null,
+ "updatedAt": Any<String>,
+ },
+ "id": Any<String>,
+ "metadataName": "fieldMetadata",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 1,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "delete",
+ "universalIdentifier": Any<String>,
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 0,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "delete",
+ "universalIdentifier": Any<String>,
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 6,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 5,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "create",
+ },
+ ],
+ "applicationUniversalIdentifier": Any<String>,
+ },
+}
+`;
+
+exports[`syncApplication should return workspace migration actions on initial sync then on second sync with field rename and new role 1`] = `
+{
+ "syncApplication": {
+ "actions": [
+ {
+ "fieldIdByUniversalIdentifier": Any<Object>,
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "color": null,
+ "createdAt": Any<String>,
+ "description": "A support ticket",
+ "duplicateCriteria": null,
+ "icon": "IconTicket",
+ "imageIdentifierFieldMetadataUniversalIdentifier": null,
+ "isActive": true,
+ "isAuditLogged": true,
+ "isLabelSyncedWithName": false,
+ "isRemote": false,
+ "isSearchable": true,
+ "isSystem": false,
+ "isUICreatable": true,
+ "isUIEditable": true,
+ "labelIdentifierFieldMetadataUniversalIdentifier": Any<String>,
+ "labelPlural": "Tickets",
+ "labelSingular": "Ticket",
+ "namePlural": "tickets",
+ "nameSingular": "ticket",
+ "openRecordIn": "USER_CHOICE",
+ "overrides": null,
+ "shortcut": null,
+ "targetTableName": "DEPRECATED",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "id": Any<String>,
+ "metadataName": "objectMetadata",
+ "type": "create",
+ "universalFlatFieldMetadatas": [
+ {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "defaultValue": null,
+ "description": "Ticket description",
"icon": "IconFileDescription",
"isActive": true,
"isLabelSyncedWithName": false,
@@ -1722,70 +2201,211 @@ exports[`syncApplication should return workspace migration actions on initial sy
"universalIdentifier": Any<String>,
"updatedAt": Any<String>,
},
- "metadataName": "index",
+ "metadataName": "index",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "indexType": "GIN",
+ "indexWhereClause": null,
+ "isCustom": false,
+ "isSystemSideEffect": true,
+ "isUnique": false,
+ "name": "IDX_72b74c26016bcd3cd20b85c4a28",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "universalFlatIndexFieldMetadatas": [
+ {
+ "createdAt": Any<String>,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "indexMetadataUniversalIdentifier": Any<String>,
+ "order": 0,
+ "subFieldName": null,
+ "updatedAt": Any<String>,
+ },
+ ],
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "index",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "anyFieldFilterValue": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "calendarEndFieldMetadataUniversalIdentifier": null,
+ "calendarFieldMetadataUniversalIdentifier": null,
+ "calendarLayout": null,
+ "createdAt": Any<String>,
+ "createdByUserWorkspaceId": null,
+ "deletedAt": null,
+ "icon": "IconList",
+ "id": Any<String>,
+ "isActive": true,
+ "isCompact": false,
+ "isCustom": true,
+ "isSystemSideEffect": true,
+ "kanbanAggregateOperation": null,
+ "kanbanAggregateOperationFieldMetadataUniversalIdentifier": null,
+ "kanbanColumnWidth": null,
+ "key": "INDEX",
+ "mainGroupByFieldMetadataUniversalIdentifier": null,
+ "name": "All {objectLabelPlural}",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "openRecordIn": "SIDE_PANEL",
+ "position": 0,
+ "shouldHideEmptyGroups": false,
+ "type": "TABLE",
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "visibility": "WORKSPACE",
+ },
+ "id": Any<String>,
+ "metadataName": "view",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "anyFieldFilterValue": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "calendarEndFieldMetadataUniversalIdentifier": null,
+ "calendarFieldMetadataUniversalIdentifier": null,
+ "calendarLayout": null,
+ "createdAt": Any<String>,
+ "createdByUserWorkspaceId": null,
+ "deletedAt": null,
+ "icon": "IconList",
+ "id": Any<String>,
+ "isActive": true,
+ "isCompact": false,
+ "isCustom": true,
+ "isSystemSideEffect": true,
+ "kanbanAggregateOperation": null,
+ "kanbanAggregateOperationFieldMetadataUniversalIdentifier": null,
+ "kanbanColumnWidth": null,
+ "key": null,
+ "mainGroupByFieldMetadataUniversalIdentifier": null,
+ "name": "Ticket Record Page Fields",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "openRecordIn": "SIDE_PANEL",
+ "position": 0,
+ "shouldHideEmptyGroups": false,
+ "type": "FIELDS_WIDGET",
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "visibility": "WORKSPACE",
+ },
+ "id": Any<String>,
+ "metadataName": "view",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 1,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 0,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "aggregateOperation": null,
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "isVisible": true,
+ "position": 0,
+ "size": 180,
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
"type": "create",
},
{
"flatEntity": {
+ "aggregateOperation": null,
"applicationUniversalIdentifier": Any<String>,
"createdAt": Any<String>,
- "indexType": "GIN",
- "indexWhereClause": null,
- "isCustom": false,
+ "deletedAt": null,
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "isActive": true,
"isSystemSideEffect": true,
- "isUnique": false,
- "name": "IDX_72b74c26016bcd3cd20b85c4a28",
- "objectMetadataUniversalIdentifier": Any<String>,
- "universalFlatIndexFieldMetadatas": [
- {
- "createdAt": Any<String>,
- "fieldMetadataUniversalIdentifier": Any<String>,
- "indexMetadataUniversalIdentifier": Any<String>,
- "order": 0,
- "subFieldName": null,
- "updatedAt": Any<String>,
- },
- ],
+ "isVisible": true,
+ "position": 2,
+ "size": 180,
"universalIdentifier": Any<String>,
+ "universalOverrides": null,
"updatedAt": Any<String>,
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
},
- "metadataName": "index",
+ "metadataName": "viewField",
"type": "create",
},
{
"flatEntity": {
- "anyFieldFilterValue": null,
+ "aggregateOperation": null,
"applicationUniversalIdentifier": Any<String>,
- "calendarEndFieldMetadataUniversalIdentifier": null,
- "calendarFieldMetadataUniversalIdentifier": null,
- "calendarLayout": null,
"createdAt": Any<String>,
- "createdByUserWorkspaceId": null,
"deletedAt": null,
- "icon": "IconList",
- "id": Any<String>,
+ "fieldMetadataUniversalIdentifier": Any<String>,
"isActive": true,
- "isCompact": false,
- "isCustom": true,
"isSystemSideEffect": true,
- "kanbanAggregateOperation": null,
- "kanbanAggregateOperationFieldMetadataUniversalIdentifier": null,
- "kanbanColumnWidth": null,
- "key": "INDEX",
- "mainGroupByFieldMetadataUniversalIdentifier": null,
- "name": "All {objectLabelPlural}",
- "objectMetadataUniversalIdentifier": Any<String>,
- "openRecordIn": "SIDE_PANEL",
- "position": 0,
- "shouldHideEmptyGroups": false,
- "type": "TABLE",
+ "isVisible": true,
+ "position": 3,
+ "size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
"updatedAt": Any<String>,
- "visibility": "WORKSPACE",
+ "viewFieldGroupUniversalIdentifier": null,
+ "viewUniversalIdentifier": Any<String>,
},
- "id": Any<String>,
- "metadataName": "view",
+ "metadataName": "viewField",
"type": "create",
},
{
@@ -1798,7 +2418,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 1,
+ "position": 4,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1819,7 +2439,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 0,
+ "position": 5,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1840,7 +2460,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 2,
+ "position": 1,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1861,7 +2481,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 3,
+ "position": 2,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1882,7 +2502,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 4,
+ "position": 3,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1903,7 +2523,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"isActive": true,
"isSystemSideEffect": true,
"isVisible": true,
- "position": 5,
+ "position": 4,
"size": 180,
"universalIdentifier": Any<String>,
"universalOverrides": null,
@@ -1956,6 +2576,279 @@ This is a test skill.",
"metadataName": "skill",
"type": "create",
},
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier": null,
+ "deletedAt": null,
+ "isSystemSideEffect": true,
+ "name": "Default Ticket Layout",
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "type": "RECORD_PAGE",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayout",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconHome",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 10,
+ "title": "Home",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconTimelineEvent",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 20,
+ "title": "Timeline",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconCheckbox",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 30,
+ "title": "Tasks",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconNotes",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 40,
+ "title": "Notes",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "icon": "IconPaperclip",
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "layoutMode": "VERTICAL_LIST",
+ "overrides": null,
+ "pageLayoutUniversalIdentifier": Any<String>,
+ "position": 50,
+ "title": "Files",
+ "universalIdentifier": Any<String>,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutTab",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 12,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Fields",
+ "type": "FIELDS",
+ "universalConfiguration": {
+ "configurationType": "FIELDS",
+ "newFieldDefaultVisibility": true,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Timeline",
+ "type": "TIMELINE",
+ "universalConfiguration": {
+ "configurationType": "TIMELINE",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Tasks",
+ "type": "TASKS",
+ "universalConfiguration": {
+ "configurationType": "TASKS",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Notes",
+ "type": "NOTES",
+ "universalConfiguration": {
+ "configurationType": "NOTES",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
+ {
+ "flatEntity": {
+ "applicationUniversalIdentifier": Any<String>,
+ "conditionalDisplay": null,
+ "createdAt": Any<String>,
+ "deletedAt": null,
+ "gridPosition": {
+ "column": 0,
+ "columnSpan": 12,
+ "row": 0,
+ "rowSpan": 6,
+ },
+ "isActive": true,
+ "isSystemSideEffect": true,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
+ "index": 0,
+ "layoutMode": "VERTICAL_LIST",
+ },
+ "title": "Files",
+ "type": "FILES",
+ "universalConfiguration": {
+ "configurationType": "FILES",
+ },
+ "universalIdentifier": Any<String>,
+ "universalOverrides": null,
+ "updatedAt": Any<String>,
+ },
+ "metadataName": "pageLayoutWidget",
+ "type": "create",
+ },
],
"applicationUniversalIdentifier": Any<String>,
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-update-view-field.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-update-view-field.integration-spec.ts
index 5bef48a05a9..4ab7132676d 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-update-view-field.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-update-view-field.integration-spec.ts
@@ -59,6 +59,29 @@ describe('Failing manifest update - standalone view fields on existing views', (
});
});
+ it('rejects a standalone view field claiming the pair the engine emits for the created field', async () => {
+ const { errors } = await syncApplication({
+ manifest: buildManifest({
+ fields: [personFieldManifest],
+ viewFields: [
+ {
+ universalIdentifier: TEST_VIEW_FIELD_ID,
+ viewUniversalIdentifier:
+ PERSON_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ viewFieldGroupUniversalIdentifier:
+ PERSON_RECORD_PAGE_GENERAL_GROUP_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: TEST_FIELD_ID,
+ position: 10,
+ isVisible: true,
+ },
+ ],
+ }),
+ expectToFail: true,
+ });
+
+ expectOneNotInternalServerErrorSnapshot({ errors });
+ }, 60000);
+
it('rejects two standalone view fields targeting the same field on the same view', async () => {
const { errors } = await syncApplication({
manifest: buildManifest({
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/record-page-side-effects-manifest-sync.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/record-page-side-effects-manifest-sync.integration-spec.ts
new file mode 100644
index 00000000000..16ffa34d64a
--- /dev/null
+++ b/packages/twenty-server/test/integration/metadata/suites/application/record-page-side-effects-manifest-sync.integration-spec.ts
@@ -0,0 +1,337 @@
+import { VIEW_FIELD_GQL_FIELDS } from 'test/integration/constants/view-gql-fields.constants';
+import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
+import { buildDefaultObjectManifest } from 'test/integration/metadata/suites/application/utils/build-default-object-manifest.util';
+import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
+import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
+import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';
+import { findManyObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata.util';
+import { findPageLayoutTabs } from 'test/integration/metadata/suites/page-layout-tab/utils/find-page-layout-tabs.util';
+import { findPageLayouts } from 'test/integration/metadata/suites/page-layout/utils/find-page-layouts.util';
+import { findViewFields } from 'test/integration/metadata/suites/view-field/utils/find-view-fields.util';
+import { findViews } from 'test/integration/metadata/suites/view/utils/find-views.util';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemPageLayoutTabUniversalIdentifier,
+ getSystemRecordPageLayoutUniversalIdentifier,
+ getSystemViewFieldUniversalIdentifier,
+ getSystemViewUniversalIdentifier,
+ type ObjectManifest,
+} from 'twenty-shared/application';
+import { FieldMetadataType } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+import { v4 as uuidv4 } from 'uuid';
+
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+
+const TEST_APP_ID = uuidv4();
+const TEST_ROLE_ID = uuidv4();
+const TEST_OBJECT_ID = uuidv4();
+const NAME_FIELD_ID = uuidv4();
+const CODE_FIELD_ID = uuidv4();
+
+const NAME_FIELD: ObjectManifest['fields'][number] = {
+ universalIdentifier: NAME_FIELD_ID,
+ type: FieldMetadataType.TEXT,
+ name: 'name',
+ label: 'Name',
+};
+
+const CODE_FIELD: ObjectManifest['fields'][number] = {
+ universalIdentifier: CODE_FIELD_ID,
+ type: FieldMetadataType.TEXT,
+ name: 'code',
+ label: 'Code',
+};
+
+const buildTicketObject = ({
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ additionalFields,
+}: {
+ labelIdentifierFieldMetadataUniversalIdentifier: string;
+ additionalFields: ObjectManifest['fields'];
+}) =>
+ buildDefaultObjectManifest({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ universalIdentifier: TEST_OBJECT_ID,
+ nameSingular: 'ticket',
+ namePlural: 'tickets',
+ labelSingular: 'Ticket',
+ labelPlural: 'Tickets',
+ description: 'A support ticket',
+ icon: 'IconTicket',
+ labelIdentifierFieldMetadataUniversalIdentifier,
+ additionalFields,
+ });
+
+const buildManifest = (object: ObjectManifest) =>
+ buildBaseManifest({
+ appId: TEST_APP_ID,
+ roleId: TEST_ROLE_ID,
+ overrides: { objects: [object] },
+ });
+
+const DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER =
+ getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ objectUniversalIdentifier: TEST_OBJECT_ID,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+const DERIVED_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ objectUniversalIdentifier: TEST_OBJECT_ID,
+ });
+
+const findTicketObject = async () => {
+ const { objects } = await findManyObjectMetadata({
+ input: {
+ filter: {},
+ paging: { first: 100 },
+ },
+ gqlFields: `
+ id
+ universalIdentifier
+ labelIdentifierFieldMetadataId
+ fieldsList {
+ id
+ name
+ applicationId
+ universalIdentifier
+ }
+ `,
+ expectToFail: false,
+ });
+
+ return objects.find(
+ (object) => object.universalIdentifier === TEST_OBJECT_ID,
+ );
+};
+
+const findTicketRecordPageView = async (objectMetadataId: string) => {
+ const { data } = await findViews({
+ objectMetadataId,
+ gqlFields:
+ 'id key type universalIdentifier applicationId isSystemSideEffect',
+ expectToFail: false,
+ });
+
+ // The key is never persisted for the record-page view: it resolves strictly
+ // by its derived universal identifier.
+ return data?.getViews.find(
+ (view) =>
+ view.universalIdentifier ===
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+};
+
+const findRecordPageViewFields = async (viewId: string) => {
+ const { data } = await findViewFields({
+ viewId,
+ gqlFields: VIEW_FIELD_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ return data?.getViewFields ?? [];
+};
+
+// Coverage of the record-page side-effect handlers through the manifest path:
+// objectRecordPageOnCreate on object creation and
+// objectRecordPageLabelIdentifierOnUpdate on relabel.
+describe('Manifest sync - engine-provisioned record-page stack', () => {
+ beforeEach(async () => {
+ await setupApplicationForSync({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ name: 'Test Application',
+ description: 'App for testing the engine-provisioned record-page stack',
+ sourcePath: 'test-record-page-side-effects',
+ });
+ }, 60000);
+
+ afterEach(async () => {
+ await cleanupApplicationAndAppRegistration({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ });
+ });
+
+ it('provisions the FIELDS_WIDGET view (label identifier excluded) and the RECORD_PAGE layout with its 5 tabs on object creation', async () => {
+ await syncApplication({
+ manifest: buildManifest(
+ buildTicketObject({
+ labelIdentifierFieldMetadataUniversalIdentifier: NAME_FIELD_ID,
+ additionalFields: [NAME_FIELD, CODE_FIELD],
+ }),
+ ),
+ expectToFail: false,
+ });
+
+ const ticket = await findTicketObject();
+
+ if (!isDefined(ticket)) {
+ throw new Error('expected the ticket object');
+ }
+
+ const recordPageView = await findTicketRecordPageView(ticket.id);
+
+ expect(recordPageView).toBeDefined();
+
+ if (!isDefined(recordPageView)) {
+ throw new Error('expected the engine record-page view');
+ }
+
+ expect(recordPageView.universalIdentifier).toBe(
+ DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ );
+ expect(recordPageView.isSystemSideEffect).toBe(true);
+
+ const nameField = ticket.fieldsList?.find((field) => field.name === 'name');
+ const codeField = ticket.fieldsList?.find((field) => field.name === 'code');
+
+ if (!isDefined(nameField) || !isDefined(codeField)) {
+ throw new Error('expected the name and code fields');
+ }
+
+ const recordPageViewFields = await findRecordPageViewFields(
+ recordPageView.id,
+ );
+
+ // The label identifier is displayed in the record title, never in the
+ // fields widget.
+ expect(
+ recordPageViewFields.some(
+ (viewField) => viewField.fieldMetadataId === nameField.id,
+ ),
+ ).toBe(false);
+ const codeViewField = recordPageViewFields.find(
+ (viewField) => viewField.fieldMetadataId === codeField.id,
+ );
+
+ expect(codeViewField).toBeDefined();
+ expect(codeViewField?.universalIdentifier).toBe(
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: CODE_FIELD_ID,
+ }),
+ );
+ expect(codeViewField?.applicationId).toBe(codeField.applicationId);
+ expect(codeViewField?.isSystemSideEffect).toBe(true);
+
+ const { data: pageLayoutsData } = await findPageLayouts({
+ input: { objectMetadataId: ticket.id },
+ gqlFields:
+ 'id type objectMetadataId universalIdentifier applicationId isSystemSideEffect',
+ expectToFail: false,
+ });
+
+ const recordPageLayout = pageLayoutsData?.getPageLayouts.find(
+ (pageLayout) => pageLayout.type === PageLayoutType.RECORD_PAGE,
+ );
+
+ expect(recordPageLayout).toBeDefined();
+ expect(recordPageLayout?.universalIdentifier).toBe(
+ DERIVED_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ );
+ expect(recordPageLayout?.applicationId).toBe(codeField.applicationId);
+ expect(recordPageLayout?.isSystemSideEffect).toBe(true);
+
+ if (!isDefined(recordPageLayout)) {
+ throw new Error('expected the engine record-page layout');
+ }
+
+ const { data: tabsData } = await findPageLayoutTabs({
+ input: { pageLayoutId: recordPageLayout.id },
+ gqlFields: 'id title universalIdentifier isSystemSideEffect',
+ expectToFail: false,
+ });
+
+ const tabs = tabsData?.getPageLayoutTabs ?? [];
+ const tabTitles = tabs.map((tab) => tab.title);
+
+ expect(tabTitles).toHaveLength(5);
+ expect(tabTitles).toEqual(
+ expect.arrayContaining(['Home', 'Timeline', 'Tasks', 'Notes', 'Files']),
+ );
+
+ // Tabs carry title-keyed derived identifiers under the engine layout.
+ for (const tab of tabs) {
+ expect(tab.universalIdentifier).toBe(
+ getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ pageLayoutUniversalIdentifier:
+ DERIVED_RECORD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIER,
+ title: tab.title,
+ }),
+ );
+ expect(tab.isSystemSideEffect).toBe(true);
+ }
+ }, 60000);
+
+ it('swaps the record-page view fields when the label identifier changes', async () => {
+ await syncApplication({
+ manifest: buildManifest(
+ buildTicketObject({
+ labelIdentifierFieldMetadataUniversalIdentifier: NAME_FIELD_ID,
+ additionalFields: [NAME_FIELD, CODE_FIELD],
+ }),
+ ),
+ expectToFail: false,
+ });
+
+ await syncApplication({
+ manifest: buildManifest(
+ buildTicketObject({
+ labelIdentifierFieldMetadataUniversalIdentifier: CODE_FIELD_ID,
+ additionalFields: [NAME_FIELD, CODE_FIELD],
+ }),
+ ),
+ expectToFail: false,
+ });
+
+ const ticket = await findTicketObject();
+
+ if (!isDefined(ticket)) {
+ throw new Error('expected the ticket object');
+ }
+
+ const recordPageView = await findTicketRecordPageView(ticket.id);
+
+ if (!isDefined(recordPageView)) {
+ throw new Error('expected the engine record-page view');
+ }
+
+ const nameField = ticket.fieldsList?.find((field) => field.name === 'name');
+ const codeField = ticket.fieldsList?.find((field) => field.name === 'code');
+
+ if (!isDefined(nameField) || !isDefined(codeField)) {
+ throw new Error('expected the name and code fields');
+ }
+
+ const recordPageViewFields = await findRecordPageViewFields(
+ recordPageView.id,
+ );
+
+ // The new label identifier leaves the fields widget (displayed in the
+ // title), the previous one is restored into it.
+ expect(
+ recordPageViewFields.some(
+ (viewField) => viewField.fieldMetadataId === codeField.id,
+ ),
+ ).toBe(false);
+
+ const restoredNameViewField = recordPageViewFields.find(
+ (viewField) => viewField.fieldMetadataId === nameField.id,
+ );
+
+ expect(restoredNameViewField).toBeDefined();
+ expect(restoredNameViewField?.isVisible).toBe(true);
+ expect(restoredNameViewField?.universalIdentifier).toBe(
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ viewUniversalIdentifier: DERIVED_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
+ fieldMetadataUniversalIdentifier: NAME_FIELD_ID,
+ }),
+ );
+ expect(restoredNameViewField?.isSystemSideEffect).toBe(true);
+ }, 60000);
+});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-view-field.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/record-page-view-field-manifest-sync.integration-spec.ts
similarity index 72%
rename from packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-view-field.integration-spec.ts
rename to packages/twenty-server/test/integration/metadata/suites/application/record-page-view-field-manifest-sync.integration-spec.ts
index 413f34dae6c..b6a34532a01 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-view-field.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/record-page-view-field-manifest-sync.integration-spec.ts
@@ -7,7 +7,11 @@ import { uninstallApplication } from 'test/integration/metadata/suites/applicati
import { findManyObjectMetadataWithIndexes } from 'test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util';
import { findViewFields } from 'test/integration/metadata/suites/view-field/utils/find-view-fields.util';
import { findViews } from 'test/integration/metadata/suites/view/utils/find-views.util';
-import { type FieldManifest, type Manifest } from 'twenty-shared/application';
+import {
+ getSystemViewFieldUniversalIdentifier,
+ type FieldManifest,
+ type Manifest,
+} from 'twenty-shared/application';
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
import { FieldMetadataType, ViewType } from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
@@ -15,15 +19,9 @@ import { v4 as uuidv4 } from 'uuid';
const TEST_APP_ID = uuidv4();
const TEST_ROLE_ID = uuidv4();
const TEST_FIELD_ID = uuidv4();
-const TEST_VIEW_FIELD_ID = uuidv4();
const PERSON_OBJECT_UNIVERSAL_IDENTIFIER =
STANDARD_OBJECTS.person.universalIdentifier;
-const PERSON_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER =
- STANDARD_OBJECTS.person.views.personRecordPageFields.universalIdentifier;
-const PERSON_RECORD_PAGE_GENERAL_GROUP_UNIVERSAL_IDENTIFIER =
- STANDARD_OBJECTS.person.views.personRecordPageFields.viewFieldGroups.general
- .universalIdentifier;
const CUSTOM_FIELD_NAME = 'integrationContributedColumn';
@@ -37,9 +35,7 @@ const personFieldManifest: FieldManifest = {
objectUniversalIdentifier: PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
};
-const buildManifest = (
- overrides?: Partial<Pick<Manifest, 'fields' | 'viewFields'>>,
-) =>
+const buildManifest = (overrides?: Partial<Pick<Manifest, 'fields'>>) =>
buildBaseManifest({
appId: TEST_APP_ID,
roleId: TEST_ROLE_ID,
@@ -91,13 +87,13 @@ const findRecordPageViewFields = async (viewId: string) => {
return data?.getViewFields ?? [];
};
-describe('Manifest update - standalone view fields on existing views', () => {
+describe('Manifest sync - engine-emitted record-page view field for an app field on a standard object', () => {
beforeEach(async () => {
await setupApplicationForSync({
applicationUniversalIdentifier: TEST_APP_ID,
name: 'Test Application',
- description: 'App for testing standalone view field manifest updates',
- sourcePath: 'test-manifest-update-view-field',
+ description: 'App for testing engine-emitted record-page view fields',
+ sourcePath: 'test-record-page-view-field-manifest-sync',
});
}, 60000);
@@ -107,7 +103,7 @@ describe('Manifest update - standalone view fields on existing views', () => {
});
});
- it('attaches a standalone view field to the standard record-page view without recreating the view', async () => {
+ it('emits a record-page view field for the app field without any manifest declaration', async () => {
const person = await findPersonObject();
const recordPageViewId = await findRecordPageViewId(person.id);
const standardViewFields = await findRecordPageViewFields(recordPageViewId);
@@ -118,22 +114,7 @@ describe('Manifest update - standalone view fields on existing views', () => {
expect(standardViewFields.length).toBeGreaterThan(0);
const { data, errors } = await syncApplication({
- manifest: buildManifest({
- fields: [personFieldManifest],
- viewFields: [
- {
- universalIdentifier: TEST_VIEW_FIELD_ID,
- viewUniversalIdentifier:
- PERSON_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
- viewFieldGroupUniversalIdentifier:
- PERSON_RECORD_PAGE_GENERAL_GROUP_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: TEST_FIELD_ID,
- position: 10,
- isVisible: true,
- size: 150,
- },
- ],
- }),
+ manifest: buildManifest({ fields: [personFieldManifest] }),
expectToFail: false,
});
@@ -150,17 +131,27 @@ describe('Manifest update - standalone view fields on existing views', () => {
const viewFieldsAfterSync =
await findRecordPageViewFields(recordPageViewId);
- const contributedViewField = viewFieldsAfterSync.find(
+ const emittedViewField = viewFieldsAfterSync.find(
(viewField) => viewField.fieldMetadataId === customField?.id,
);
- expect(contributedViewField).toBeDefined();
- expect(contributedViewField).toMatchObject({
- viewId: recordPageViewId,
- position: 10,
- isVisible: true,
- size: 150,
- });
+ expect(emittedViewField).toBeDefined();
+ expect(emittedViewField?.isVisible).toBe(true);
+ expect(emittedViewField?.viewFieldGroupId).not.toBeNull();
+
+ // Engine-owned but attributed to the contributing app: the identifier is
+ // keyed on the displayed field's application.
+ expect(emittedViewField?.universalIdentifier).toBe(
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ viewUniversalIdentifier:
+ STANDARD_OBJECTS.person.views.personRecordPageFields
+ .universalIdentifier,
+ fieldMetadataUniversalIdentifier: TEST_FIELD_ID,
+ }),
+ );
+ expect(emittedViewField?.applicationId).toBe(customField?.applicationId);
+ expect(emittedViewField?.isSystemSideEffect).toBe(true);
expect(viewFieldsAfterSync.length).toBe(standardViewFields.length + 1);
for (const standardViewFieldId of standardViewFieldIds) {
@@ -172,7 +163,7 @@ describe('Manifest update - standalone view fields on existing views', () => {
}
}, 60000);
- it('removes the contributed view field on uninstall while keeping the standard view intact', async () => {
+ it('removes the emitted view field on uninstall while keeping the standard view intact', async () => {
const person = await findPersonObject();
const recordPageViewId = await findRecordPageViewId(person.id);
const standardViewFields = await findRecordPageViewFields(recordPageViewId);
@@ -181,22 +172,7 @@ describe('Manifest update - standalone view fields on existing views', () => {
);
await syncApplication({
- manifest: buildManifest({
- fields: [personFieldManifest],
- viewFields: [
- {
- universalIdentifier: TEST_VIEW_FIELD_ID,
- viewUniversalIdentifier:
- PERSON_RECORD_PAGE_VIEW_UNIVERSAL_IDENTIFIER,
- viewFieldGroupUniversalIdentifier:
- PERSON_RECORD_PAGE_GENERAL_GROUP_UNIVERSAL_IDENTIFIER,
- fieldMetadataUniversalIdentifier: TEST_FIELD_ID,
- position: 10,
- isVisible: true,
- size: 150,
- },
- ],
- }),
+ manifest: buildManifest({ fields: [personFieldManifest] }),
expectToFail: false,
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/standard-object-index-view-field-manifest-sync.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/standard-object-index-view-field-manifest-sync.integration-spec.ts
new file mode 100644
index 00000000000..7f8f8d63995
--- /dev/null
+++ b/packages/twenty-server/test/integration/metadata/suites/application/standard-object-index-view-field-manifest-sync.integration-spec.ts
@@ -0,0 +1,153 @@
+import { VIEW_FIELD_GQL_FIELDS } from 'test/integration/constants/view-gql-fields.constants';
+import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
+import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
+import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
+import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';
+import { findManyObjectMetadataWithIndexes } from 'test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util';
+import { findViewFields } from 'test/integration/metadata/suites/view-field/utils/find-view-fields.util';
+import { findViews } from 'test/integration/metadata/suites/view/utils/find-views.util';
+import {
+ getSystemViewFieldUniversalIdentifier,
+ type FieldManifest,
+ type Manifest,
+} from 'twenty-shared/application';
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+import { FieldMetadataType, ViewKey } from 'twenty-shared/types';
+import { v4 as uuidv4 } from 'uuid';
+
+const TEST_APP_ID = uuidv4();
+const TEST_ROLE_ID = uuidv4();
+const TEST_FIELD_ID = uuidv4();
+
+const PERSON_OBJECT_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.person.universalIdentifier;
+
+const CUSTOM_FIELD_NAME = 'integrationContributedColumn';
+
+const personFieldManifest: FieldManifest = {
+ universalIdentifier: TEST_FIELD_ID,
+ type: FieldMetadataType.TEXT,
+ name: CUSTOM_FIELD_NAME,
+ label: 'Integration Contributed Column',
+ description: 'Custom field contributed to the standard Person object',
+ icon: 'IconStar',
+ objectUniversalIdentifier: PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
+};
+
+const buildManifest = (overrides?: Partial<Pick<Manifest, 'fields'>>) =>
+ buildBaseManifest({
+ appId: TEST_APP_ID,
+ roleId: TEST_ROLE_ID,
+ overrides,
+ });
+
+const findPersonObject = async () => {
+ const objects = await findManyObjectMetadataWithIndexes({
+ expectToFail: false,
+ });
+
+ const person = objects.find(
+ (object) =>
+ object.universalIdentifier === PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
+ );
+
+ if (!person) {
+ throw new Error('Standard Person object not found in workspace');
+ }
+
+ return person;
+};
+
+const findIndexViewId = async (personObjectId: string) => {
+ const { data } = await findViews({
+ objectMetadataId: personObjectId,
+ gqlFields: 'id key type',
+ expectToFail: false,
+ });
+
+ const indexView = data?.getViews.find((view) => view.key === ViewKey.INDEX);
+
+ if (!indexView) {
+ throw new Error('Standard INDEX view not found for Person');
+ }
+
+ return indexView.id;
+};
+
+// Coverage of fieldIndexViewFieldOnCreate through the manifest path on a
+// standard object: the own-object variants live in
+// same-batch-relation-index-view-field-manifest-sync.
+describe('Manifest sync - engine-emitted INDEX view field for an app field on a standard object', () => {
+ beforeEach(async () => {
+ await setupApplicationForSync({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ name: 'Test Application',
+ description: 'App for testing engine-emitted INDEX view fields',
+ sourcePath: 'test-standard-object-index-view-field-manifest-sync',
+ });
+ }, 60000);
+
+ afterEach(async () => {
+ await cleanupApplicationAndAppRegistration({
+ applicationUniversalIdentifier: TEST_APP_ID,
+ });
+ });
+
+ it('emits a visible INDEX view field appended after the standard columns', async () => {
+ const person = await findPersonObject();
+ const indexViewId = await findIndexViewId(person.id);
+
+ const { data: viewFieldsBeforeSyncData } = await findViewFields({
+ viewId: indexViewId,
+ gqlFields: VIEW_FIELD_GQL_FIELDS,
+ expectToFail: false,
+ });
+ const viewFieldsBeforeSync = viewFieldsBeforeSyncData?.getViewFields ?? [];
+ const highestExistingActivePosition = Math.max(
+ ...viewFieldsBeforeSync.map((viewField) => viewField.position),
+ );
+
+ await syncApplication({
+ manifest: buildManifest({ fields: [personFieldManifest] }),
+ expectToFail: false,
+ });
+
+ const personAfterSync = await findPersonObject();
+ const customField = personAfterSync.fieldsList.find(
+ (field) => field.universalIdentifier === TEST_FIELD_ID,
+ );
+
+ expect(customField).toBeDefined();
+
+ const { data: viewFieldsAfterSyncData } = await findViewFields({
+ viewId: indexViewId,
+ gqlFields: VIEW_FIELD_GQL_FIELDS,
+ expectToFail: false,
+ });
+
+ const emittedIndexViewField = (
+ viewFieldsAfterSyncData?.getViewFields ?? []
+ ).find((viewField) => viewField.fieldMetadataId === customField?.id);
+
+ expect(emittedIndexViewField).toBeDefined();
+ expect(emittedIndexViewField?.isVisible).toBe(true);
+ expect(emittedIndexViewField?.position).toBeGreaterThan(
+ highestExistingActivePosition,
+ );
+
+ // Engine-owned but attributed to the contributing app: the identifier is
+ // keyed on the displayed field's application.
+ expect(emittedIndexViewField?.universalIdentifier).toBe(
+ getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier: TEST_APP_ID,
+ viewUniversalIdentifier:
+ STANDARD_OBJECTS.person.views.allPeople.universalIdentifier,
+ fieldMetadataUniversalIdentifier: TEST_FIELD_ID,
+ }),
+ );
+ expect(emittedIndexViewField?.applicationId).toBe(
+ customField?.applicationId,
+ );
+ expect(emittedIndexViewField?.isSystemSideEffect).toBe(true);
+ }, 60000);
+});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
index b8304836a90..92a6b3e97a4 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
@@ -4,6 +4,7 @@ import { setupApplicationForSync } from 'test/integration/metadata/suites/applic
import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';
import { findPageLayoutTabs } from 'test/integration/metadata/suites/page-layout-tab/utils/find-page-layout-tabs.util';
import { type Manifest } from 'twenty-shared/application';
+import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
@@ -12,7 +13,8 @@ const TEST_ROLE_ID = uuidv4();
const TEST_TAB_ID = uuidv4();
const STANDARD_PERSON_PAGE_LAYOUT_UNIVERSAL_ID =
- '20202020-a102-4002-8002-ae0a1ea11002';
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.personRecordPage
+ .universalIdentifier;
const PAGE_LAYOUT_TAB_GQL_FIELDS = `
id
diff --git a/packages/twenty-server/test/integration/metadata/suites/field-metadata/morph-relation/__snapshots__/failing-add-one-target-to-metadata-morph-relation-v2.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/field-metadata/morph-relation/__snapshots__/failing-add-one-target-to-metadata-morph-relation-v2.integration-spec.ts.snap
index 0f2612960e4..19aef3b7099 100644
--- a/packages/twenty-server/test/integration/metadata/suites/field-metadata/morph-relation/__snapshots__/failing-add-one-target-to-metadata-morph-relation-v2.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/field-metadata/morph-relation/__snapshots__/failing-add-one-target-to-metadata-morph-relation-v2.integration-spec.ts.snap
@@ -106,14 +106,48 @@ exports[`updateOne FieldMetadataService morph relation fields v2 - Add one targe
"status": "fail",
"type": "create",
},
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "Field metadata not found",
+ "userFriendlyMessage": "Field metadata not found",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "Field metadata not found",
+ "userFriendlyMessage": "Field metadata not found",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
],
},
- "message": "Validation failed for 2 fieldMetadata, 2 viewFields, 1 index",
+ "message": "Validation failed for 2 fieldMetadata, 4 viewFields, 1 index",
"summary": {
"fieldMetadata": 2,
"index": 1,
- "totalErrors": 5,
- "viewField": 2,
+ "totalErrors": 7,
+ "viewField": 4,
},
"userFriendlyMessage": "Many validation errors",
},
@@ -216,14 +250,48 @@ exports[`updateOne FieldMetadataService morph relation fields v2 - Add one targe
"status": "fail",
"type": "create",
},
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "Field metadata not found",
+ "userFriendlyMessage": "Field metadata not found",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
+ {
+ "errors": [
+ {
+ "code": "INVALID_VIEW_DATA",
+ "message": "Field metadata not found",
+ "userFriendlyMessage": "Field metadata not found",
+ },
+ ],
+ "flatEntityMinimalInformation": {
+ "fieldMetadataUniversalIdentifier": Any<String>,
+ "universalIdentifier": Any<String>,
+ "viewUniversalIdentifier": Any<String>,
+ },
+ "metadataName": "viewField",
+ "status": "fail",
+ "type": "create",
+ },
],
},
- "message": "Validation failed for 2 fieldMetadata, 2 viewFields, 1 index",
+ "message": "Validation failed for 2 fieldMetadata, 4 viewFields, 1 index",
"summary": {
"fieldMetadata": 2,
"index": 1,
- "totalErrors": 5,
- "viewField": 2,
+ "totalErrors": 7,
+ "viewField": 4,
},
"userFriendlyMessage": "Many validation errors",
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util.ts b/packages/twenty-server/test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util.ts
index 5f001443ab6..49ce444b896 100644
--- a/packages/twenty-server/test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata-with-indexes.util.ts
@@ -27,6 +27,7 @@ export const findManyObjectMetadataWithIndexes = async ({
id
type
name
+ applicationId
description
icon
label
diff --git a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-deletion.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-deletion.integration-spec.ts.snap
index 023b4ffe78c..8cdebef5f8e 100644
--- a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-deletion.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-deletion.integration-spec.ts.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
+// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Skill deletion should fail should fail when attempting to delete a standard skill 1`] = `
{
diff --git a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
index ad2add569e5..6a7cb4a3a75 100644
--- a/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/skill/__snapshots__/failing-skill-update.integration-spec.ts.snap
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
+// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Skill update should fail should fail when attempting to update a standard skill 1`] = `
{
diff --git a/packages/twenty-server/test/utils/extract-record-ids-and-dates-as-expect-any.ts b/packages/twenty-server/test/utils/extract-record-ids-and-dates-as-expect-any.ts
index 2d8b5aafd4e..9ad009daf30 100644
--- a/packages/twenty-server/test/utils/extract-record-ids-and-dates-as-expect-any.ts
+++ b/packages/twenty-server/test/utils/extract-record-ids-and-dates-as-expect-any.ts
@@ -4,7 +4,7 @@ export const extractRecordIdsAndDatesAsExpectAny = (
record: Record<string, unknown> | Array<Record<string, unknown>>,
): any => {
if (Array.isArray(record)) {
- return record.map(extractRecordIdsAndDatesAsExpectAny);
+ return record.map((item) => extractRecordIdsAndDatesAsExpectAny(item));
}
if (typeof record !== 'object') {
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-fields-widget-view-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-fields-widget-view-universal-identifier.util.spec.ts
deleted file mode 100644
index 69cdfbb67ac..00000000000
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-fields-widget-view-universal-identifier.util.spec.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { getFieldsWidgetViewUniversalIdentifier } from '@/application/deterministic-identifier/get-fields-widget-view-universal-identifier.util';
-
-const APP = '11111111-1111-4111-8111-111111111111';
-const WIDGET = '88888888-8888-4888-8888-888888888888';
-
-describe('getFieldsWidgetViewUniversalIdentifier', () => {
- it('derives a deterministic id from its 1:1 FIELDS page-layout widget', () => {
- expect(
- getFieldsWidgetViewUniversalIdentifier({
- applicationUniversalIdentifier: APP,
- pageLayoutWidgetUniversalIdentifier: WIDGET,
- }),
- ).toBe('5f45a1bd-97df-56f7-a8ad-7839ef0045b5');
- });
-});
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-universal-identifier.util.spec.ts
index 5ce075aa498..e44bb2405ba 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-universal-identifier.util.spec.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-universal-identifier.util.spec.ts
@@ -1,7 +1,5 @@
-import {
- getPageLayoutUniversalIdentifier,
- getRecordPageLayoutUniversalIdentifier,
-} from '@/application/deterministic-identifier/get-page-layout-universal-identifier.util';
+import { getPageLayoutUniversalIdentifier } from '@/application/deterministic-identifier/get-page-layout-universal-identifier.util';
+import { getSystemRecordPageLayoutUniversalIdentifier } from '@/application/deterministic-identifier/get-system-record-page-layout-universal-identifier.util';
const APP = '11111111-1111-4111-8111-111111111111';
const OBJECT = '22222222-2222-4222-8222-222222222222';
@@ -27,11 +25,11 @@ describe('getPageLayoutUniversalIdentifier', () => {
});
});
-describe('getRecordPageLayoutUniversalIdentifier', () => {
+describe('getSystemRecordPageLayoutUniversalIdentifier', () => {
it('derives a deterministic id from the RECORD_PAGE role within its object', () => {
expect(
- getRecordPageLayoutUniversalIdentifier({
- applicationUniversalIdentifier: APP,
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: APP,
objectUniversalIdentifier: OBJECT,
}),
).toBe('80289fa4-d714-5883-bd1d-bc59c7b9a1c2');
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-tab-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-tab-universal-identifier.util.spec.ts
similarity index 52%
rename from packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-tab-universal-identifier.util.spec.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-tab-universal-identifier.util.spec.ts
index db61b0d9936..c9ce93fdeac 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-tab-universal-identifier.util.spec.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-tab-universal-identifier.util.spec.ts
@@ -1,13 +1,13 @@
-import { getPageLayoutTabUniversalIdentifier } from '@/application/deterministic-identifier/get-page-layout-tab-universal-identifier.util';
+import { getSystemPageLayoutTabUniversalIdentifier } from '@/application/deterministic-identifier/get-system-page-layout-tab-universal-identifier.util';
const APP = '11111111-1111-4111-8111-111111111111';
const PAGE_LAYOUT = '66666666-6666-4666-8666-666666666666';
-describe('getPageLayoutTabUniversalIdentifier', () => {
+describe('getSystemPageLayoutTabUniversalIdentifier', () => {
it('derives a deterministic id from the tab title within its page layout', () => {
expect(
- getPageLayoutTabUniversalIdentifier({
- applicationUniversalIdentifier: APP,
+ getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: APP,
pageLayoutUniversalIdentifier: PAGE_LAYOUT,
title: 'Home',
}),
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-widget-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-widget-universal-identifier.util.spec.ts
similarity index 50%
rename from packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-widget-universal-identifier.util.spec.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-widget-universal-identifier.util.spec.ts
index 06f6b162169..724f7efab61 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-page-layout-widget-universal-identifier.util.spec.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-page-layout-widget-universal-identifier.util.spec.ts
@@ -1,13 +1,13 @@
-import { getPageLayoutWidgetUniversalIdentifier } from '@/application/deterministic-identifier/get-page-layout-widget-universal-identifier.util';
+import { getSystemPageLayoutWidgetUniversalIdentifier } from '@/application/deterministic-identifier/get-system-page-layout-widget-universal-identifier.util';
const APP = '11111111-1111-4111-8111-111111111111';
const TAB = '77777777-7777-4777-8777-777777777777';
-describe('getPageLayoutWidgetUniversalIdentifier', () => {
+describe('getSystemPageLayoutWidgetUniversalIdentifier', () => {
it('derives a deterministic id from the widget title within its tab', () => {
expect(
- getPageLayoutWidgetUniversalIdentifier({
- applicationUniversalIdentifier: APP,
+ getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: APP,
pageLayoutTabUniversalIdentifier: TAB,
title: 'Fields',
}),
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-view-field-group-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-field-group-universal-identifier.util.spec.ts
similarity index 50%
rename from packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-view-field-group-universal-identifier.util.spec.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-field-group-universal-identifier.util.spec.ts
index 9bff7c3fd54..451db5a8dcd 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-view-field-group-universal-identifier.util.spec.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-field-group-universal-identifier.util.spec.ts
@@ -1,13 +1,13 @@
-import { getViewFieldGroupUniversalIdentifier } from '@/application/deterministic-identifier/get-view-field-group-universal-identifier.util';
+import { getSystemViewFieldGroupUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-field-group-universal-identifier.util';
const APP = '11111111-1111-4111-8111-111111111111';
const VIEW = '44444444-4444-4444-8444-444444444444';
-describe('getViewFieldGroupUniversalIdentifier', () => {
+describe('getSystemViewFieldGroupUniversalIdentifier', () => {
it('derives a deterministic id from the group name within its view', () => {
expect(
- getViewFieldGroupUniversalIdentifier({
- applicationUniversalIdentifier: APP,
+ getSystemViewFieldGroupUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier: APP,
viewUniversalIdentifier: VIEW,
name: 'General',
}),
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-universal-identifier.util.spec.ts b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-universal-identifier.util.spec.ts
index 3930f3ca881..897c3ac4803 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-universal-identifier.util.spec.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/__tests__/get-system-view-universal-identifier.util.spec.ts
@@ -1,5 +1,7 @@
-import { getSystemViewUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-universal-identifier.util';
-import { ViewKey } from '@/types/ViewKey';
+import {
+ getSystemViewUniversalIdentifier,
+ SYSTEM_VIEW_KEYS,
+} from '@/application/deterministic-identifier/get-system-view-universal-identifier.util';
const APP = '11111111-1111-4111-8111-111111111111';
const OBJECT = '22222222-2222-4222-8222-222222222222';
@@ -10,7 +12,7 @@ describe('getSystemViewUniversalIdentifier', () => {
getSystemViewUniversalIdentifier({
objectMetadataApplicationUniversalIdentifier: APP,
objectUniversalIdentifier: OBJECT,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
}),
).toBe('3803a536-0158-554c-bfb4-e5492323e57f');
});
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-fields-widget-view-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-fields-widget-view-universal-identifier.util.ts
deleted file mode 100644
index c896b4b4840..00000000000
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-fields-widget-view-universal-identifier.util.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
-
-export const getFieldsWidgetViewUniversalIdentifier = ({
- applicationUniversalIdentifier,
- pageLayoutWidgetUniversalIdentifier,
-}: {
- applicationUniversalIdentifier: string;
- pageLayoutWidgetUniversalIdentifier: string;
-}): string =>
- computeDeterministicUuid({
- entityNamespace: 'view',
- value: pageLayoutWidgetUniversalIdentifier,
- applicationUniversalIdentifier,
- });
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-universal-identifier.util.ts
index 2eebf635e12..8a0c046ec50 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-universal-identifier.util.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-universal-identifier.util.ts
@@ -1,7 +1,5 @@
import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
-const RECORD_PAGE_LAYOUT_DISCRIMINATOR = 'RECORD_PAGE';
-
// A page layout is identified by its name within its object (or the app for standalone layouts).
export const getPageLayoutUniversalIdentifier = ({
applicationUniversalIdentifier,
@@ -19,17 +17,3 @@ export const getPageLayoutUniversalIdentifier = ({
: name,
applicationUniversalIdentifier,
});
-
-// An object's singleton record page layout (its name is server-generated), keyed by the object + the RECORD_PAGE role.
-export const getRecordPageLayoutUniversalIdentifier = ({
- applicationUniversalIdentifier,
- objectUniversalIdentifier,
-}: {
- applicationUniversalIdentifier: string;
- objectUniversalIdentifier: string;
-}): string =>
- computeDeterministicUuid({
- entityNamespace: 'pageLayout',
- value: `${objectUniversalIdentifier}:${RECORD_PAGE_LAYOUT_DISCRIMINATOR}`,
- applicationUniversalIdentifier,
- });
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-tab-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-tab-universal-identifier.util.ts
similarity index 62%
rename from packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-tab-universal-identifier.util.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-tab-universal-identifier.util.ts
index 656758b7fa0..61a02d12fcf 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-tab-universal-identifier.util.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-tab-universal-identifier.util.ts
@@ -1,17 +1,18 @@
import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
// A tab is identified by its title within its page layout.
-export const getPageLayoutTabUniversalIdentifier = ({
- applicationUniversalIdentifier,
+export const getSystemPageLayoutTabUniversalIdentifier = ({
+ objectMetadataApplicationUniversalIdentifier,
pageLayoutUniversalIdentifier,
title,
}: {
- applicationUniversalIdentifier: string;
+ objectMetadataApplicationUniversalIdentifier: string;
pageLayoutUniversalIdentifier: string;
title: string;
}): string =>
computeDeterministicUuid({
entityNamespace: 'pageLayoutTab',
value: `${pageLayoutUniversalIdentifier}:${title}`,
- applicationUniversalIdentifier,
+ applicationUniversalIdentifier:
+ objectMetadataApplicationUniversalIdentifier,
});
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-widget-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-widget-universal-identifier.util.ts
similarity index 62%
rename from packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-widget-universal-identifier.util.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-widget-universal-identifier.util.ts
index 330d1068901..00b03a4a99e 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-page-layout-widget-universal-identifier.util.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-system-page-layout-widget-universal-identifier.util.ts
@@ -1,17 +1,18 @@
import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
// A widget is identified by its title within its tab.
-export const getPageLayoutWidgetUniversalIdentifier = ({
- applicationUniversalIdentifier,
+export const getSystemPageLayoutWidgetUniversalIdentifier = ({
+ objectMetadataApplicationUniversalIdentifier,
pageLayoutTabUniversalIdentifier,
title,
}: {
- applicationUniversalIdentifier: string;
+ objectMetadataApplicationUniversalIdentifier: string;
pageLayoutTabUniversalIdentifier: string;
title: string;
}): string =>
computeDeterministicUuid({
entityNamespace: 'pageLayoutWidget',
value: `${pageLayoutTabUniversalIdentifier}:${title}`,
- applicationUniversalIdentifier,
+ applicationUniversalIdentifier:
+ objectMetadataApplicationUniversalIdentifier,
});
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-system-record-page-layout-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-system-record-page-layout-universal-identifier.util.ts
new file mode 100644
index 00000000000..da7084a3e98
--- /dev/null
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-system-record-page-layout-universal-identifier.util.ts
@@ -0,0 +1,19 @@
+import { getPageLayoutUniversalIdentifier } from '@/application/deterministic-identifier/get-page-layout-universal-identifier.util';
+import { PageLayoutType } from '@/types';
+
+// An object's singleton record page layout (its name is server-generated),
+// keyed on the object + the reserved RECORD_PAGE discriminator through the
+// generic name-keyed derivation, so both stay on a single scheme.
+export const getSystemRecordPageLayoutUniversalIdentifier = ({
+ objectMetadataApplicationUniversalIdentifier,
+ objectUniversalIdentifier,
+}: {
+ objectMetadataApplicationUniversalIdentifier: string;
+ objectUniversalIdentifier: string;
+}): string =>
+ getPageLayoutUniversalIdentifier({
+ applicationUniversalIdentifier:
+ objectMetadataApplicationUniversalIdentifier,
+ objectUniversalIdentifier,
+ name: PageLayoutType.RECORD_PAGE,
+ });
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-view-field-group-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-field-group-universal-identifier.util.ts
similarity index 61%
rename from packages/twenty-shared/src/application/deterministic-identifier/get-view-field-group-universal-identifier.util.ts
rename to packages/twenty-shared/src/application/deterministic-identifier/get-system-view-field-group-universal-identifier.util.ts
index 818f1e1437e..9b8c45337f0 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-view-field-group-universal-identifier.util.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-field-group-universal-identifier.util.ts
@@ -1,17 +1,18 @@
import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
// A view field group is identified by its name within its view.
-export const getViewFieldGroupUniversalIdentifier = ({
- applicationUniversalIdentifier,
+export const getSystemViewFieldGroupUniversalIdentifier = ({
+ objectMetadataApplicationUniversalIdentifier,
viewUniversalIdentifier,
name,
}: {
- applicationUniversalIdentifier: string;
+ objectMetadataApplicationUniversalIdentifier: string;
viewUniversalIdentifier: string;
name: string;
}): string =>
computeDeterministicUuid({
entityNamespace: 'viewFieldGroup',
value: `${viewUniversalIdentifier}:${name}`,
- applicationUniversalIdentifier,
+ applicationUniversalIdentifier:
+ objectMetadataApplicationUniversalIdentifier,
});
diff --git a/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-universal-identifier.util.ts b/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-universal-identifier.util.ts
index 1f18f57789c..7d9a155fcea 100644
--- a/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-universal-identifier.util.ts
+++ b/packages/twenty-shared/src/application/deterministic-identifier/get-system-view-universal-identifier.util.ts
@@ -1,5 +1,12 @@
import { computeDeterministicUuid } from '@/application/deterministic-identifier/compute-deterministic-uuid.util';
-import { type ViewKey } from '@/types/ViewKey';
+
+export const SYSTEM_VIEW_KEYS = {
+ INDEX: 'INDEX',
+ FIELDS_WIDGET: 'FIELDS_WIDGET',
+} as const;
+
+export type SystemViewKey =
+ (typeof SYSTEM_VIEW_KEYS)[keyof typeof SYSTEM_VIEW_KEYS];
export const getSystemViewUniversalIdentifier = ({
objectMetadataApplicationUniversalIdentifier,
@@ -8,7 +15,7 @@ export const getSystemViewUniversalIdentifier = ({
}: {
objectMetadataApplicationUniversalIdentifier: string;
objectUniversalIdentifier: string;
- viewKey: ViewKey;
+ viewKey: SystemViewKey;
}): string =>
computeDeterministicUuid({
entityNamespace: 'view',
diff --git a/packages/twenty-shared/src/application/index.ts b/packages/twenty-shared/src/application/index.ts
index 07b64f47472..7414e2c1c58 100644
--- a/packages/twenty-shared/src/application/index.ts
+++ b/packages/twenty-shared/src/application/index.ts
@@ -54,7 +54,6 @@ export {
export { getConnectionProviderUniversalIdentifier } from './deterministic-identifier/get-connection-provider-universal-identifier.util';
export { getFieldPermissionUniversalIdentifier } from './deterministic-identifier/get-field-permission-universal-identifier.util';
export { getFieldUniversalIdentifier } from './deterministic-identifier/get-field-universal-identifier.util';
-export { getFieldsWidgetViewUniversalIdentifier } from './deterministic-identifier/get-fields-widget-view-universal-identifier.util';
export { getFrontComponentUniversalIdentifier } from './deterministic-identifier/get-front-component-universal-identifier.util';
export { getIndexUniversalIdentifier } from './deterministic-identifier/get-index-universal-identifier.util';
export { getLogicFunctionUniversalIdentifier } from './deterministic-identifier/get-logic-function-universal-identifier.util';
@@ -66,12 +65,7 @@ export {
} from './deterministic-identifier/get-navigation-menu-item-universal-identifier.util';
export { getObjectPermissionUniversalIdentifier } from './deterministic-identifier/get-object-permission-universal-identifier.util';
export { getObjectUniversalIdentifier } from './deterministic-identifier/get-object-universal-identifier.util';
-export { getPageLayoutTabUniversalIdentifier } from './deterministic-identifier/get-page-layout-tab-universal-identifier.util';
-export {
- getPageLayoutUniversalIdentifier,
- getRecordPageLayoutUniversalIdentifier,
-} from './deterministic-identifier/get-page-layout-universal-identifier.util';
-export { getPageLayoutWidgetUniversalIdentifier } from './deterministic-identifier/get-page-layout-widget-universal-identifier.util';
+export { getPageLayoutUniversalIdentifier } from './deterministic-identifier/get-page-layout-universal-identifier.util';
export { getPermissionFlagUniversalIdentifier } from './deterministic-identifier/get-permission-flag-universal-identifier.util';
export { getRolePermissionFlagUniversalIdentifier } from './deterministic-identifier/get-role-permission-flag-universal-identifier.util';
export { getRoleTargetUniversalIdentifier } from './deterministic-identifier/get-role-target-universal-identifier.util';
@@ -79,10 +73,17 @@ export { getRoleUniversalIdentifier } from './deterministic-identifier/get-role-
export { getSearchFieldUniversalIdentifier } from './deterministic-identifier/get-search-field-universal-identifier.util';
export { getSelectOptionUniversalIdentifier } from './deterministic-identifier/get-select-option-universal-identifier.util';
export { getSkillUniversalIdentifier } from './deterministic-identifier/get-skill-universal-identifier.util';
+export { getSystemPageLayoutTabUniversalIdentifier } from './deterministic-identifier/get-system-page-layout-tab-universal-identifier.util';
+export { getSystemPageLayoutWidgetUniversalIdentifier } from './deterministic-identifier/get-system-page-layout-widget-universal-identifier.util';
+export { getSystemRecordPageLayoutUniversalIdentifier } from './deterministic-identifier/get-system-record-page-layout-universal-identifier.util';
export { getSystemRelationFieldUniversalIdentifier } from './deterministic-identifier/get-system-relation-field-universal-identifier.util';
+export { getSystemViewFieldGroupUniversalIdentifier } from './deterministic-identifier/get-system-view-field-group-universal-identifier.util';
export { getSystemViewFieldUniversalIdentifier } from './deterministic-identifier/get-system-view-field-universal-identifier.util';
-export { getSystemViewUniversalIdentifier } from './deterministic-identifier/get-system-view-universal-identifier.util';
-export { getViewFieldGroupUniversalIdentifier } from './deterministic-identifier/get-view-field-group-universal-identifier.util';
+export type { SystemViewKey } from './deterministic-identifier/get-system-view-universal-identifier.util';
+export {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from './deterministic-identifier/get-system-view-universal-identifier.util';
export { getViewFieldUniversalIdentifier } from './deterministic-identifier/get-view-field-universal-identifier.util';
export { getViewFilterUniversalIdentifier } from './deterministic-identifier/get-view-filter-universal-identifier.util';
export { getViewGroupUniversalIdentifier } from './deterministic-identifier/get-view-group-universal-identifier.util';
diff --git a/packages/twenty-shared/src/application/viewManifestType.ts b/packages/twenty-shared/src/application/viewManifestType.ts
index 061f7c3e4eb..adb9c0ce76e 100644
--- a/packages/twenty-shared/src/application/viewManifestType.ts
+++ b/packages/twenty-shared/src/application/viewManifestType.ts
@@ -69,9 +69,10 @@ export type ViewManifest = SyncableEntityOptions & {
objectUniversalIdentifier: string;
type?: ViewType;
/**
- * @deprecated The INDEX key is reserved for the engine-owned default view,
- * which the server provisions automatically for every object. This field is
- * ignored: manifest views are always created as additional views.
+ * @deprecated View keys (INDEX, FIELDS_WIDGET) are reserved for the
+ * engine-owned default views, which the server provisions automatically for
+ * every object. This field is ignored: manifest views are always created as
+ * additional views.
*/
key?: ViewKey;
icon?: string;
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.snap
index 38b5cbca4b5..391521fbdde 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
@@ -187,24 +187,24 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"blocklistRecordPageFields": {
- "universalIdentifier": "5c679d04-7a1c-41be-9429-c9317ac7a0ea",
+ "universalIdentifier": "0bc1b728-8d75-5510-a1d2-4cf2e08ba726",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "94009e34-52fb-4534-89ce-6c6d0a774056",
+ "universalIdentifier": "bc1927df-6851-5983-9086-96a203ce808c",
},
"system": {
- "universalIdentifier": "35dace44-6e63-4cdb-b761-a92bcf126a7e",
+ "universalIdentifier": "4f102106-8fb3-56a0-b127-bc9ecb64cb61",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "b2594a03-e00f-4de9-89da-b34bb95c2221",
+ "universalIdentifier": "df323a31-23fe-5bc5-af28-e50f0ee68446",
},
"createdBy": {
- "universalIdentifier": "80a60507-6c7a-4713-b5de-b94ac293bf23",
+ "universalIdentifier": "06496327-d51f-5ee0-8fa9-e0ccbc05268d",
},
"workspaceMember": {
- "universalIdentifier": "f2f5732f-7435-44be-986b-4c4d834fdfeb",
+ "universalIdentifier": "f06f1418-1398-543f-8fb3-f70c02e89b77",
},
},
},
@@ -277,30 +277,30 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"calendarChannelEventAssociationRecordPageFields": {
- "universalIdentifier": "766f254a-a0eb-45c8-b4d2-12311201e08f",
+ "universalIdentifier": "c5ba2278-7ad7-5ceb-80a2-575303b8aeca",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "9c27f771-9f85-492f-b1f1-9bc7a175f6f3",
+ "universalIdentifier": "b4565a10-f3cb-58af-9fed-4a94d1bf4d76",
},
"system": {
- "universalIdentifier": "c7b18e05-dd60-4ee4-911a-290790e8c425",
+ "universalIdentifier": "f90abbe1-c130-5980-bca3-71fc02d0de23",
},
},
"viewFields": {
"calendarChannelId": {
- "universalIdentifier": "cd6c6714-fc1d-4511-a664-ec5e8dfd8692",
+ "universalIdentifier": "6d87ed50-19f4-5c70-a172-2e71cb539b47",
},
"calendarEvent": {
- "universalIdentifier": "4790ca84-255e-4cb7-9b20-c17f4d94df8e",
+ "universalIdentifier": "531e0316-391a-58a5-8799-ef237ea0a5a6",
},
"createdAt": {
- "universalIdentifier": "2702ae80-9108-4757-8a25-317a4357484e",
+ "universalIdentifier": "cdaafd87-630c-59ba-bfcd-e4809cc3b2bc",
},
"createdBy": {
- "universalIdentifier": "201e0c45-fddc-4217-bfd4-40c13d7f7916",
+ "universalIdentifier": "47fc2a28-d574-57b2-95f4-31b0c5b3b5ee",
},
"eventExternalId": {
- "universalIdentifier": "dbe16c1b-ece2-4d2f-b634-094742ac3e16",
+ "universalIdentifier": "d2a0f993-ce27-5771-8b28-dd1fdf4e23f7",
},
},
},
@@ -411,51 +411,51 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"calendarEventRecordPageFields": {
- "universalIdentifier": "c73668d1-022d-4eaf-b825-4e2548180db6",
+ "universalIdentifier": "e911d23f-5b84-5af0-9d22-747992894d6e",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "aeadeb9e-3673-4c0c-8845-f59cb1e6ca42",
+ "universalIdentifier": "4aada5ef-a335-5b94-96a7-9b20089a24bc",
},
"system": {
- "universalIdentifier": "eb1aadeb-7feb-44d1-9f9a-e9929e8690fc",
+ "universalIdentifier": "eafb4df9-39df-5537-b719-ff88d3719bd2",
},
},
"viewFields": {
"conferenceLink": {
- "universalIdentifier": "5ad748ae-e1bb-47bb-ac34-d82663c31b6e",
+ "universalIdentifier": "a4520a9a-427d-5fca-af4b-9b7fc83be97a",
},
"conferenceSolution": {
- "universalIdentifier": "795905b6-c6f8-42cf-b8ea-3e5b6d32145f",
+ "universalIdentifier": "29203729-1cac-5fbc-899f-9c91339a2c37",
},
"description": {
- "universalIdentifier": "a09449be-b23f-48d4-b0dc-0bd36813220a",
+ "universalIdentifier": "a4356ac7-7ac3-53ea-8c1c-77eb8df9c72d",
},
"endsAt": {
- "universalIdentifier": "ed7ca7e9-c8b3-4516-be4c-6491a27af847",
+ "universalIdentifier": "5984833a-5f07-5250-8818-5fbc0b8d8154",
},
"externalCreatedAt": {
- "universalIdentifier": "689c3eba-bedf-4a52-b9f1-3e34ce718251",
+ "universalIdentifier": "ef16fe85-5741-5a89-92fa-afd58bb74a6b",
},
"externalUpdatedAt": {
- "universalIdentifier": "7823fa45-8cba-47ba-8dfb-5841bef44fc6",
+ "universalIdentifier": "82b811c0-3b62-5c2d-b029-23ad9d3eb724",
},
"iCalUid": {
- "universalIdentifier": "8be763dd-6217-47fb-a7d2-ac223af881d2",
+ "universalIdentifier": "b646b59a-28f9-52d2-8b8f-3504f79cc4dc",
},
"isCanceled": {
- "universalIdentifier": "a01f490d-cf67-4458-801e-13d81e74b45a",
+ "universalIdentifier": "f502b2ca-07b8-5a53-9501-8be33a21626f",
},
"isFullDay": {
- "universalIdentifier": "5d8f89b7-ec9e-41d6-9efe-96f9c32e6c20",
+ "universalIdentifier": "1dae839d-f84a-5911-ad6b-a67958fa2918",
},
"location": {
- "universalIdentifier": "66c73e74-56e6-40c3-b776-0081ee757b8a",
+ "universalIdentifier": "7f9550fb-4aba-56f4-8abc-de2f8178e056",
},
"startsAt": {
- "universalIdentifier": "7bbd3744-d870-4704-882c-071732ed23d9",
+ "universalIdentifier": "108049c7-5296-58e9-b59b-4fc6025117ae",
},
"title": {
- "universalIdentifier": "d17fc76f-2c3a-4c84-8249-27227bf71638",
+ "universalIdentifier": "eb5bfeff-f9ca-5568-b7d7-d4c1a3cec8eb",
},
},
},
@@ -552,42 +552,42 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"calendarEventParticipantRecordPageFields": {
- "universalIdentifier": "e01ebdb3-8fb8-46d2-8230-82242d593f7a",
+ "universalIdentifier": "1553a9bb-be54-5afa-9760-ba6f513c3c26",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "3d842777-436e-467d-90ae-9e1fa0aa7e9c",
+ "universalIdentifier": "476b3601-0171-56cb-a63d-cfe66b511518",
},
"system": {
- "universalIdentifier": "098836d8-15c1-44c1-a58e-2ff7fd6a05f9",
+ "universalIdentifier": "bc3996af-ebf5-5a06-b0f5-0e7e111dd693",
},
},
"viewFields": {
"calendarEvent": {
- "universalIdentifier": "865a1278-c356-4b99-a5e9-1ca3d33c7665",
+ "universalIdentifier": "d990f89d-803b-5130-a1a1-1cd02da1f887",
},
"createdAt": {
- "universalIdentifier": "1447c7fa-fe2b-4ff7-8036-8de682537e23",
+ "universalIdentifier": "4ba94b77-5f75-501a-8844-e4c70658ba67",
},
"createdBy": {
- "universalIdentifier": "6d7dff75-0230-45bd-8db9-dc25ef007e6e",
+ "universalIdentifier": "3a042796-c5e2-5a0d-bf02-ce8cda4a8e1a",
},
"displayName": {
- "universalIdentifier": "23b97527-6ad3-4f07-bf68-559b97321673",
+ "universalIdentifier": "9c3f856e-6778-52c4-8bcc-7b0b77e0eb8c",
},
"handle": {
- "universalIdentifier": "eb09af9c-b3f4-403c-8cb2-172243f83958",
+ "universalIdentifier": "200de67b-de9b-5bbf-82e2-21af86d63247",
},
"isOrganizer": {
- "universalIdentifier": "3c126f3c-bd01-4029-b58a-724513fa5fff",
+ "universalIdentifier": "266dfd7b-b394-570b-a83b-1ef39121ef58",
},
"person": {
- "universalIdentifier": "46be729d-091c-4012-aeca-16a743008513",
+ "universalIdentifier": "666831b4-70ef-5c5e-bb8f-64516d608d0e",
},
"responseStatus": {
- "universalIdentifier": "cd02fc91-8fa4-4fa3-b0e3-1a1fc891e6ee",
+ "universalIdentifier": "f441068f-8000-5eb3-8431-c641cc84942b",
},
"workspaceMember": {
- "universalIdentifier": "c38c1111-f6e0-4698-9b36-db59f8d97de3",
+ "universalIdentifier": "361dd3d5-8158-5c72-b696-6ae355cc4a8f",
},
},
},
@@ -684,39 +684,39 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"callRecordingRecordPageFields": {
- "universalIdentifier": "99fa8b47-3b11-4f9b-8fbc-e67a9e1da682",
+ "universalIdentifier": "512247d5-bf43-5e2e-85ac-2b0355a12568",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "068426eb-dd20-49b0-ae9c-68727f3be2fb",
+ "universalIdentifier": "0317e574-372a-57bc-8836-8d509eeebeed",
},
},
"viewFields": {
"audio": {
- "universalIdentifier": "9445a547-1d1e-4da3-916b-2c2269c951c9",
+ "universalIdentifier": "a254b983-f513-5e5d-8094-bc581ed55f98",
},
"endedAt": {
- "universalIdentifier": "ba8c8d41-c112-4173-b927-5b5c5a5c047b",
+ "universalIdentifier": "72d3d9f3-40ea-5d65-a3b6-b6b97db40ba9",
},
"recordingRequestStatus": {
- "universalIdentifier": "364a90b1-e9aa-4606-996b-46e579ebeb28",
+ "universalIdentifier": "9a9ca8a1-368a-5fa9-af65-cbcb8eac46f2",
},
"startedAt": {
- "universalIdentifier": "3fd00fbb-c153-45e3-b6e6-43d18d34052a",
+ "universalIdentifier": "b1602b52-5e5d-5480-a7e2-721bb00c86e3",
},
"status": {
- "universalIdentifier": "93483569-fcd2-46cf-b576-9f0318ad2b3b",
+ "universalIdentifier": "129bcb12-57e1-57ba-a9c0-cc51b23ad9da",
},
"summary": {
- "universalIdentifier": "a0ace064-cc72-4631-ade3-07cdded86b0e",
+ "universalIdentifier": "deb0e75d-7e49-5a31-9645-924b0baec5f6",
},
"title": {
- "universalIdentifier": "6308d574-8579-4cf2-a020-c208df97cf3e",
+ "universalIdentifier": "bc472b07-4d2f-5dd6-acb8-a64db250d8c9",
},
"transcript": {
- "universalIdentifier": "782c97f6-e6b1-472b-8992-bbb60d25791b",
+ "universalIdentifier": "b61c3df7-69a9-567c-bff4-07a702aef5a8",
},
"video": {
- "universalIdentifier": "acc54ade-cd26-4be2-9391-a42715ad1523",
+ "universalIdentifier": "98e1c8b9-5fff-5e46-9a63-373bd4e0553b",
},
},
},
@@ -825,66 +825,66 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"companyRecordPageFields": {
- "universalIdentifier": "20202020-a001-4a01-8a01-c0aba11c1001",
+ "universalIdentifier": "eb92fc36-9465-5a96-84c0-d9406526ae6d",
"viewFieldGroups": {
"business": {
- "universalIdentifier": "20202020-a001-4a01-8a01-c0aba11c1102",
+ "universalIdentifier": "0aae2c81-b579-57c9-839d-b1efba26e3ad",
},
"contact": {
- "universalIdentifier": "20202020-a001-4a01-8a01-c0aba11c1103",
+ "universalIdentifier": "d6eb9a6b-6444-5edc-a216-f8a0df6e6760",
},
"general": {
- "universalIdentifier": "20202020-a001-4a01-8a01-c0aba11c1101",
+ "universalIdentifier": "86a2ae09-5c4c-5164-85a1-f29a8c088ab3",
},
"system": {
- "universalIdentifier": "20202020-a001-4a01-8a01-c0aba11c1104",
+ "universalIdentifier": "ad572e0b-e463-5717-b8e5-1709d1ad0c31",
},
},
"viewFields": {
"accountOwner": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1202",
+ "universalIdentifier": "2e315686-760c-5254-82ae-ff4647dd5a93",
},
"address": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1208",
+ "universalIdentifier": "d35b27ea-34f2-5da7-b09f-f991d2aba59b",
},
"annualRevenue": {
- "universalIdentifier": "2a35f734-dea2-4de9-8395-acbce8df0f97",
+ "universalIdentifier": "3a06f7d1-e663-560b-8ee0-60700460867e",
},
"attachments": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1219",
+ "universalIdentifier": "a12cc1c6-8386-5d13-a595-64d949934a1a",
},
"createdAt": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1209",
+ "universalIdentifier": "16144a13-0538-52d7-9c8d-302c88fb5497",
},
"createdBy": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1210",
+ "universalIdentifier": "3f619afa-0c23-5bf9-818a-028d07c24e1d",
},
"domainName": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1201",
+ "universalIdentifier": "6b6e3983-d7b4-51a8-b314-4feb20465761",
},
"linkedinLink": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1206",
+ "universalIdentifier": "51702655-5b87-50c4-bb7a-8906b528a1eb",
},
"noteTargets": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1216",
+ "universalIdentifier": "39746e75-b159-5a5d-be21-4b9bc4cd74f6",
},
"opportunities": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1217",
+ "universalIdentifier": "440111ea-8281-58e8-9bfd-6d23622e31bc",
},
"people": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1214",
+ "universalIdentifier": "79ad7cba-e2fd-5642-9830-455147d1c5a6",
},
"taskTargets": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1215",
+ "universalIdentifier": "de282136-d59c-5e7a-bbc6-12e2900ad58d",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c121a",
+ "universalIdentifier": "8dfe9340-0a54-5fb0-a0ec-59983d2f07ba",
},
"updatedAt": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1212",
+ "universalIdentifier": "7361b63e-639f-507c-a129-457c1d52ec7b",
},
"updatedBy": {
- "universalIdentifier": "20202020-af01-4a01-8a01-c0aba11c1213",
+ "universalIdentifier": "1a1f9704-9097-5998-810c-595011efbe38",
},
},
},
@@ -1177,30 +1177,30 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"messageCampaignRecordPageFields": {
- "universalIdentifier": "20202020-a009-4a09-8a09-fa9de11ca901",
+ "universalIdentifier": "4a122254-a75a-5873-98d7-0a257447c4cb",
"viewFieldGroups": {
"stats": {
- "universalIdentifier": "20202020-a009-4a09-8a09-fa9de11ca902",
+ "universalIdentifier": "743a40bf-e008-5628-a547-d3ab3eccc32b",
},
},
"viewFields": {
"bouncedCount": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca907",
+ "universalIdentifier": "4c4caad8-5d4c-5584-b7ae-22766c382843",
},
"complainedCount": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca908",
+ "universalIdentifier": "7188a9aa-4821-5ae6-adec-642a7aca271b",
},
"failedCount": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca906",
+ "universalIdentifier": "a46efdb6-a451-5dfe-bd85-a5b9a6a0306a",
},
"sentAt": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca904",
+ "universalIdentifier": "4de342aa-3734-5dfd-9612-88d3e7f4b808",
},
"sentCount": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca905",
+ "universalIdentifier": "46bd8f8e-4053-5418-9abc-e67e0842701b",
},
"status": {
- "universalIdentifier": "20202020-af09-4a09-8a09-fa9de11ca903",
+ "universalIdentifier": "246db7b1-e241-5d06-87df-99af5d4ba9bc",
},
},
},
@@ -1288,33 +1288,33 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"messageChannelMessageAssociationRecordPageFields": {
- "universalIdentifier": "680b43e2-5d50-49d8-bbdd-2d208e7b7071",
+ "universalIdentifier": "ff16e878-5ab4-5a02-a779-476781fb981c",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "86d7066c-ba38-4f6a-996f-77345bedd549",
+ "universalIdentifier": "bda968ec-9198-52fb-bdf4-4f2cc895e1c0",
},
"system": {
- "universalIdentifier": "6044c58c-a63c-4f3f-a283-b8803553628f",
+ "universalIdentifier": "d7e5254e-f54a-5467-87ac-e7fe73b8066f",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "8651c5c4-db87-427c-8a57-6a9f75c74976",
+ "universalIdentifier": "cebd8571-9a83-51f2-8e2b-de7007076aa3",
},
"createdBy": {
- "universalIdentifier": "af4adf31-f698-4aad-9f29-71908924fc9a",
+ "universalIdentifier": "af4b7da8-2849-58c5-8018-f5a308d5c197",
},
"direction": {
- "universalIdentifier": "9edfbd44-4624-4cf8-b81c-8e169b4e8281",
+ "universalIdentifier": "6440b5da-149f-5c7f-b8cc-c11259343445",
},
"message": {
- "universalIdentifier": "166aa5a0-d825-40dc-be6d-e94b87edd56d",
+ "universalIdentifier": "e4fd7cd1-3a1c-5bc3-b9ea-ecdca90bd308",
},
"messageChannelId": {
- "universalIdentifier": "376c7685-9ebe-4c95-b820-424b1c2f264f",
+ "universalIdentifier": "e97f3642-f0be-51f7-8751-00b959dfc8ce",
},
"messageExternalId": {
- "universalIdentifier": "1910bd21-2472-4a83-b8cd-7de51bdd2675",
+ "universalIdentifier": "50ca8334-26b3-55d6-9f10-5c4d6dbf341b",
},
},
},
@@ -1381,27 +1381,27 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"messageChannelMessageAssociationMessageFolderRecordPageFields": {
- "universalIdentifier": "331ec548-07d2-4f9d-a0a2-ef91a9f96184",
+ "universalIdentifier": "4e51381e-3ee8-5e90-aa43-ec1d19f6fdc5",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "4928521b-ae24-4013-a69a-1392017d57af",
+ "universalIdentifier": "5b552010-5ce7-5f96-8e4d-9bc1e597a28b",
},
"system": {
- "universalIdentifier": "b76cebb3-39b2-477a-9212-8bf1190227a4",
+ "universalIdentifier": "5c599e3c-40bd-5196-8d8f-5a93f00d9c90",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "39297559-a747-481e-a4c5-b80b8faf1aac",
+ "universalIdentifier": "24941c7f-62c5-5ed4-ba91-2f563ec710ad",
},
"createdBy": {
- "universalIdentifier": "4692eb91-7fc6-4436-9175-87caa5f6b668",
+ "universalIdentifier": "0a2907d9-1710-55f0-b837-cbeaaf0746cc",
},
"messageChannelMessageAssociation": {
- "universalIdentifier": "d34ed53e-5156-4a18-a8df-572269496aac",
+ "universalIdentifier": "52264f34-d1c3-59bb-a83e-6c8166d68250",
},
"messageFolderId": {
- "universalIdentifier": "04f14582-caf9-49ee-81ea-e5d4f977bfe1",
+ "universalIdentifier": "8e0b6f4e-de11-52e7-9cce-fa8a6c961802",
},
},
},
@@ -1606,36 +1606,36 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"messageParticipantRecordPageFields": {
- "universalIdentifier": "209ab5c5-4a68-4d32-8255-515919a6c5f5",
+ "universalIdentifier": "bf40d332-701d-565b-84e4-29dd5f05d781",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "41c18430-34c3-430f-b86b-fc3963281277",
+ "universalIdentifier": "aa7b0941-b255-5b05-912f-a60fb7465b19",
},
"system": {
- "universalIdentifier": "add21830-a7c6-4cde-9eed-430afbcbf557",
+ "universalIdentifier": "6e8e0769-287c-5032-a546-b3964d843d78",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "8d66ecb8-825d-4c6c-91c0-23a82c87ab46",
+ "universalIdentifier": "177500c4-2c57-5145-9772-dbfe76e15606",
},
"createdBy": {
- "universalIdentifier": "17c3acfc-71f1-4b3c-820e-aea23871e850",
+ "universalIdentifier": "5d32a18d-0d19-57bf-8c90-71268fd8c3a8",
},
"displayName": {
- "universalIdentifier": "c50748fe-9f54-4e09-b572-111f076ec7db",
+ "universalIdentifier": "8fed8425-3b33-51f5-a63f-7dbd7b06e199",
},
"message": {
- "universalIdentifier": "dd8ccf4f-64d7-468c-bc0c-dc4e0efef08d",
+ "universalIdentifier": "ea408219-a8fb-5afa-849f-1afe07b5b607",
},
"person": {
- "universalIdentifier": "bf2e30dd-df03-4fb2-820a-166a93a2ce2c",
+ "universalIdentifier": "f766db0a-3fc1-5062-bae2-715c0191510f",
},
"role": {
- "universalIdentifier": "5d1f9a65-85cc-41b2-a8bf-8e2c97aab4b3",
+ "universalIdentifier": "f1a605d4-1816-557a-b2df-2de0b2994b00",
},
"workspaceMember": {
- "universalIdentifier": "00336686-0d63-43e2-b247-599f1227bd85",
+ "universalIdentifier": "ac9b9689-7e91-55f3-a798-b7a569af4a38",
},
},
},
@@ -1769,39 +1769,39 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"noteRecordPageFields": {
- "universalIdentifier": "20202020-a005-4a05-8a05-a0be5a115001",
+ "universalIdentifier": "497f7600-fcdb-5025-8e4c-d53d706e1fa8",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "20202020-a005-4a05-8a05-a0be5a115101",
+ "universalIdentifier": "6e673f29-b3c9-58be-b830-352cc1274806",
},
"system": {
- "universalIdentifier": "20202020-a005-4a05-8a05-a0be5a115103",
+ "universalIdentifier": "f8b067db-b793-5b4e-b6c6-5b7884d436e0",
},
},
"viewFields": {
"attachments": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115208",
+ "universalIdentifier": "0417604b-fe0a-5c43-a0b2-a1f71664e25d",
},
"bodyV2": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115205",
+ "universalIdentifier": "de624e40-0c8e-58dc-ab30-4dc6239dd758",
},
"createdAt": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115202",
+ "universalIdentifier": "e45009c4-c19a-5907-a18d-da1df196c788",
},
"createdBy": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115203",
+ "universalIdentifier": "c367e175-8ded-5ef6-987f-7dafc91252da",
},
"noteTargets": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115204",
+ "universalIdentifier": "447e46f9-81a2-5c99-a865-f6efa6e892c5",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115209",
+ "universalIdentifier": "113232e3-ba0e-566f-98fa-016a1e8d44d9",
},
"updatedAt": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115206",
+ "universalIdentifier": "556a3d3e-cc58-5863-a36e-3f742f019676",
},
"updatedBy": {
- "universalIdentifier": "20202020-af05-4a05-8a05-a0be5a115207",
+ "universalIdentifier": "c4c7e2f7-3827-53e4-aae0-ef14dbd15ca2",
},
},
},
@@ -2029,60 +2029,60 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"opportunityRecordPageFields": {
- "universalIdentifier": "20202020-a003-4a03-8a03-0aa0b1ca3001",
+ "universalIdentifier": "fce925c5-5d4e-51df-a589-69f6bb7ecc90",
"viewFieldGroups": {
"deal": {
- "universalIdentifier": "20202020-a003-4a03-8a03-0aa0b1ca3101",
+ "universalIdentifier": "066a9a90-e529-553a-81f0-41cdd4451f1a",
},
"relations": {
- "universalIdentifier": "20202020-a003-4a03-8a03-0aa0b1ca3102",
+ "universalIdentifier": "f7b308d8-df15-5eb8-b2a5-9cc1fb4405a1",
},
"system": {
- "universalIdentifier": "20202020-a003-4a03-8a03-0aa0b1ca3103",
+ "universalIdentifier": "e19e7949-9176-55bd-940d-4d65da33b35c",
},
},
"viewFields": {
"amount": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3201",
+ "universalIdentifier": "9a75cc35-95b0-5274-849c-bec1b9f378fa",
},
"attachments": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca320f",
+ "universalIdentifier": "f47f579f-2f6b-5873-9213-72e40b9d59b8",
},
"closeDate": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3202",
+ "universalIdentifier": "d625ed61-4e68-5235-8f64-05549d370d54",
},
"company": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3204",
+ "universalIdentifier": "758ca844-65a9-5e28-9c4c-1ec856db679e",
},
"createdAt": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3207",
+ "universalIdentifier": "1e6d1930-d49e-5cd1-ba2f-5d5bbef06277",
},
"createdBy": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3208",
+ "universalIdentifier": "11bc1e10-def4-549a-bb50-ec5c49cc3c79",
},
"noteTargets": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca320e",
+ "universalIdentifier": "2f6dc99d-bd0b-58c3-8748-3c1b30dbafbb",
},
"owner": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3206",
+ "universalIdentifier": "d098a83e-cecd-5d35-a8db-576fbe5ee58f",
},
"pointOfContact": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3205",
+ "universalIdentifier": "65909364-13fd-56ed-83b2-e84b623855ff",
},
"stage": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3203",
+ "universalIdentifier": "988d6bec-ad3f-53e6-9dcd-4d906583bff2",
},
"taskTargets": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca320d",
+ "universalIdentifier": "b38eecb2-88d1-5475-a129-5c6f1dc13bb2",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca3210",
+ "universalIdentifier": "933eb137-205f-5595-9f2f-7fc3e67332fc",
},
"updatedAt": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca320a",
+ "universalIdentifier": "22c8d3ee-6601-5cfd-b674-7a9814da6a98",
},
"updatedBy": {
- "universalIdentifier": "20202020-af03-4a03-8a03-0aa0b1ca320b",
+ "universalIdentifier": "8d3099e5-5301-5658-95d3-0f84aad97eba",
},
},
},
@@ -2206,75 +2206,75 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"personRecordPageFields": {
- "universalIdentifier": "20202020-a002-4a02-8a02-ae0a1ea12001",
+ "universalIdentifier": "7f34ab76-9b33-595a-bd22-d8d434147c8e",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "20202020-a002-4a02-8a02-ae0a1ea12101",
+ "universalIdentifier": "cda957f5-5dd7-585a-8e2c-8cd524714bd6",
},
"social": {
- "universalIdentifier": "20202020-a002-4a02-8a02-ae0a1ea12103",
+ "universalIdentifier": "fbbc5bb5-f39e-58e6-b7d2-5fe1c3cb2d1b",
},
"system": {
- "universalIdentifier": "20202020-a002-4a02-8a02-ae0a1ea12104",
+ "universalIdentifier": "f80c3fd7-b618-53e9-9ee5-bb27a0fc0a47",
},
"work": {
- "universalIdentifier": "20202020-a002-4a02-8a02-ae0a1ea12102",
+ "universalIdentifier": "2e43cfd3-3ee7-5e3d-83a3-f5f6824358bb",
},
},
"viewFields": {
"attachments": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12219",
+ "universalIdentifier": "9c9bc013-59fd-581d-9285-2f9432230cbc",
},
"avatarFile": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12214",
+ "universalIdentifier": "616f80a2-0961-5804-af13-5ab0fde0f5b7",
},
"avatarUrl": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12208",
+ "universalIdentifier": "9883b102-c338-5730-856b-51e9078965a3",
},
"calendarEventParticipants": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea1221b",
+ "universalIdentifier": "79c51779-0a93-5fbe-8f96-78b4e16c0ae3",
},
"company": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12203",
+ "universalIdentifier": "1818aee4-f077-5f18-bca2-6cd0cfbd56d5",
},
"createdAt": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12209",
+ "universalIdentifier": "af8d7b3e-9bb0-5428-8f9d-f1c0fef037b2",
},
"createdBy": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12210",
+ "universalIdentifier": "70971f69-dada-5a8c-899c-ef0ca8c77063",
},
"emails": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12201",
+ "universalIdentifier": "1d6d1486-bee4-5aa2-aa59-13bedc0f561d",
},
"jobTitle": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12204",
+ "universalIdentifier": "c538777d-d58b-517b-a486-e8cf60552417",
},
"linkedinLink": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12205",
+ "universalIdentifier": "32ceb4f7-87e4-541a-8440-004c654e29ce",
},
"messageParticipants": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea1221a",
+ "universalIdentifier": "4f15ca6d-40c4-52cb-a683-189a8f06175f",
},
"noteTargets": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12217",
+ "universalIdentifier": "26918a6e-f33e-5c99-a0b6-2fdb6a807ecf",
},
"phones": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12202",
+ "universalIdentifier": "8512d1f6-6469-56bf-8f22-5e70a0781c28",
},
"pointOfContactForOpportunities": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12215",
+ "universalIdentifier": "27f019c1-61a2-5ba3-b99a-d5049b2935ee",
},
"taskTargets": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12216",
+ "universalIdentifier": "4a7edd5d-9a49-51a7-9d38-65da20dcf64a",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea1221c",
+ "universalIdentifier": "d8189f4b-46ad-50ac-8648-d0efbc20b4c1",
},
"updatedAt": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12212",
+ "universalIdentifier": "f2fcdc5e-bd33-53ed-9998-fcc6198c7b0a",
},
"updatedBy": {
- "universalIdentifier": "20202020-af02-4a02-8a02-ae0a1ea12213",
+ "universalIdentifier": "8783172f-3146-5a14-9939-81bef3bf4cca",
},
},
},
@@ -2447,48 +2447,48 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"taskRecordPageFields": {
- "universalIdentifier": "20202020-a006-4a06-8a06-ba5ca11a6001",
+ "universalIdentifier": "1258ef22-3391-5f63-8e3b-6cdfbe892f07",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "20202020-a006-4a06-8a06-ba5ca11a6101",
+ "universalIdentifier": "0e7ffa21-9969-50ca-9daf-25078563e697",
},
"system": {
- "universalIdentifier": "20202020-a006-4a06-8a06-ba5ca11a6103",
+ "universalIdentifier": "e48c1875-31be-511f-b229-d85cecc319b3",
},
},
"viewFields": {
"assignee": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6204",
+ "universalIdentifier": "661c126a-7e1c-5111-aa4b-508dbc5627c6",
},
"attachments": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a620b",
+ "universalIdentifier": "db69d80b-8e9e-5351-bd08-f4b625b9f721",
},
"bodyV2": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6208",
+ "universalIdentifier": "1481e9a9-d79c-5d97-9ea3-0babff9d6535",
},
"createdAt": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6205",
+ "universalIdentifier": "fc5d2a89-8d8d-56f2-96bd-fcde0a04e1cb",
},
"createdBy": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6206",
+ "universalIdentifier": "6e98e5c0-e188-56f8-a5a8-1f6569e7b2e8",
},
"dueAt": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6202",
+ "universalIdentifier": "42a26270-40be-557d-9bd9-99b0f8f013dd",
},
"status": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6203",
+ "universalIdentifier": "74ce69ba-b31f-502e-aa18-8727452e4b2a",
},
"taskTargets": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6207",
+ "universalIdentifier": "c6073432-22ad-575c-9c83-e583d3b524f2",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a620c",
+ "universalIdentifier": "3f0dd6fd-3b96-5f34-b96c-c7018b6b7230",
},
"updatedAt": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a6209",
+ "universalIdentifier": "466bec84-2ac8-5a73-9c44-43e905c29a6b",
},
"updatedBy": {
- "universalIdentifier": "20202020-af06-4a06-8a06-ba5ca11a620a",
+ "universalIdentifier": "2a224a0a-0fd7-5e0e-9872-53eaec638ebf",
},
},
},
@@ -2883,27 +2883,27 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"workflowAutomatedTriggerRecordPageFields": {
- "universalIdentifier": "10aff295-f7ac-475d-8528-661eb9aa9759",
+ "universalIdentifier": "726cd0e6-fad0-5ab0-b815-bd8d927eae32",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "c5261eae-f2fe-416e-8ef9-eda5d377f8ca",
+ "universalIdentifier": "cd93e6a9-298c-5399-96d8-2cdadaf6c0de",
},
"system": {
- "universalIdentifier": "e6da0410-7f63-41b7-b977-421fc37d67f5",
+ "universalIdentifier": "f14d5e18-bc68-59ef-b846-b5b66d6a4dbd",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "98ef45e8-c6bf-42e6-96f6-e94cd17911bc",
+ "universalIdentifier": "6e37e868-05a8-5e8a-863c-71b684aa6fbb",
},
"createdBy": {
- "universalIdentifier": "d3933427-de7f-4fa1-b80c-47302273d848",
+ "universalIdentifier": "d901af0e-43fe-5a20-b744-2e57961e36e9",
},
"type": {
- "universalIdentifier": "3b3a0cf7-f171-4ad8-9aad-aed84eca0250",
+ "universalIdentifier": "5798f060-3be3-5d79-83d1-ddf057015b68",
},
"workflow": {
- "universalIdentifier": "ddc5a9f6-f577-4e4b-a258-3d656c32babc",
+ "universalIdentifier": "779e6a36-818a-5610-903d-4655a66db500",
},
},
},
@@ -2994,51 +2994,51 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"workflowRunRecordPageFields": {
- "universalIdentifier": "20202020-a011-4a11-8a11-a0bcf10abcf1",
+ "universalIdentifier": "ee70a5da-029a-583e-a318-7d0c6cf02745",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "20202020-a011-4a11-8a11-a0bcf10abcf2",
+ "universalIdentifier": "f5809a65-08da-50a6-ac5c-dc43ed19cbd5",
},
"system": {
- "universalIdentifier": "20202020-a011-4a11-8a11-a0bcf10abcf4",
+ "universalIdentifier": "493c108f-9eff-5e86-bbd2-d65b3d401240",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcfb",
+ "universalIdentifier": "c9d89cd5-73f2-5937-a1b8-d4049d1eca7d",
},
"createdBy": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcfc",
+ "universalIdentifier": "f924d70a-5066-5424-b884-5f822da7505a",
},
"endedAt": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcfa",
+ "universalIdentifier": "68d4f9b6-389e-57fe-bd7c-3b41bc86cc6e",
},
"enqueuedAt": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcfd",
+ "universalIdentifier": "79a0e596-5b2d-592b-93ed-15c5c16c5339",
},
"startedAt": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcf9",
+ "universalIdentifier": "12eb0b03-916c-5102-92af-c6d0eef57a89",
},
"state": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abd01",
+ "universalIdentifier": "f07915cc-9eb3-5960-8d0c-0783b94b135b",
},
"status": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcf6",
+ "universalIdentifier": "d7cc4d63-ed7c-5063-960d-b38856ff00ad",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abd05",
+ "universalIdentifier": "3cfab202-0e2e-5d9c-a341-9e3707c56c6e",
},
"updatedAt": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abd02",
+ "universalIdentifier": "1c12647d-eaae-537a-aab1-9f779efc36b2",
},
"updatedBy": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abd03",
+ "universalIdentifier": "adba3145-4271-5477-b3f0-d26928c06cbe",
},
"workflow": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcf7",
+ "universalIdentifier": "b4533c40-0bdd-5059-8105-d4174e40d7e9",
},
"workflowVersion": {
- "universalIdentifier": "20202020-af11-4a11-8a11-a0bcf10abcf8",
+ "universalIdentifier": "725c75f2-a07e-5740-8b6b-62574e5f3acf",
},
},
},
@@ -3126,45 +3126,45 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"workflowVersionRecordPageFields": {
- "universalIdentifier": "20202020-a010-4a10-8a10-a0bcf10aaef1",
+ "universalIdentifier": "4325242c-c819-5ecf-8b66-4c7b02627a77",
"viewFieldGroups": {
"general": {
- "universalIdentifier": "20202020-a010-4a10-8a10-a0bcf10aaef2",
+ "universalIdentifier": "86ed1b24-a576-5498-8fb8-b7819ace07c3",
},
"system": {
- "universalIdentifier": "20202020-a010-4a10-8a10-a0bcf10aaef4",
+ "universalIdentifier": "e08b6ee2-ade7-541b-b4e2-2c0cd03b1a5c",
},
},
"viewFields": {
"createdAt": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaef9",
+ "universalIdentifier": "4e95828c-c5f8-5b7e-a8a3-7f247d8bdfac",
},
"createdBy": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaefb",
+ "universalIdentifier": "2885fb8d-a2c0-5198-bbc3-c6b77bfdd570",
},
"runs": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaefe",
+ "universalIdentifier": "cd54fd1a-bd06-5c9a-ab49-5569ec37f12f",
},
"status": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaef6",
+ "universalIdentifier": "73f2e3f5-38b3-541e-9d96-797f0ae6455a",
},
"steps": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaefa",
+ "universalIdentifier": "300eae90-9f50-5e85-8e5f-9da4a4c6ec28",
},
"timelineActivities": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaf01",
+ "universalIdentifier": "f94ccbfc-4cbf-5a62-b857-b6874698f9da",
},
"trigger": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaef8",
+ "universalIdentifier": "b03c8136-8e0a-5f40-826f-77e5db12ae26",
},
"updatedAt": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaefc",
+ "universalIdentifier": "2467c5d2-a894-59f4-a11c-2e121d02badc",
},
"updatedBy": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaefd",
+ "universalIdentifier": "c9412819-e456-58a8-bae9-8d6110772f09",
},
"workflow": {
- "universalIdentifier": "20202020-af10-4a10-8a10-a0bcf10aaef7",
+ "universalIdentifier": "3ca9ea65-0539-5185-8762-a51c26bf08c7",
},
},
},
diff --git a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
index 00908600d2b..1e03addcf24 100644
--- a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
+++ b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
@@ -1,6 +1,7 @@
import { STANDARD_OBJECT_FIELDS } from '@/metadata/constants/standard-object-fields.constant';
import { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from '@/metadata/constants/standard-object-universal-identifiers.constant';
import { buildStandardObjectIndexView } from '@/metadata/utils/internal/build-standard-object-index-view.util';
+import { buildStandardObjectRecordPageFieldsView } from '@/metadata/utils/internal/build-standard-object-record-page-fields-view.util';
// Important notice:
// - Never ever mutate an existing universal identifier
@@ -13,6 +14,11 @@ import { buildStandardObjectIndexView } from '@/metadata/utils/internal/build-st
// deterministically derived by buildStandardObjectIndexView
// (getSystemViewUniversalIdentifier for the view,
// getSystemViewFieldUniversalIdentifier for each view field).
+// - FIELDS_WIDGET record-page view universal identifiers (keyed on
+// SYSTEM_VIEW_KEYS.FIELDS_WIDGET), their view fields and their view field groups are
+// deterministically derived by buildStandardObjectRecordPageFieldsView; the group
+// names passed there MUST match the ones the server standard view-field-group
+// builders assign.
export const STANDARD_OBJECTS = {
attachment: {
universalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.attachment,
@@ -79,28 +85,16 @@ export const STANDARD_OBJECTS = {
fields: STANDARD_OBJECT_FIELDS.blocklist,
viewFieldNames: ['handle', 'workspaceMember', 'createdAt'],
}),
- blocklistRecordPageFields: {
- universalIdentifier: '5c679d04-7a1c-41be-9429-c9317ac7a0ea',
- viewFieldGroups: {
- general: {
- universalIdentifier: '94009e34-52fb-4534-89ce-6c6d0a774056',
- },
- system: {
- universalIdentifier: '35dace44-6e63-4cdb-b761-a92bcf126a7e',
- },
- },
- viewFields: {
- workspaceMember: {
- universalIdentifier: 'f2f5732f-7435-44be-986b-4c4d834fdfeb',
- },
- createdAt: {
- universalIdentifier: 'b2594a03-e00f-4de9-89da-b34bb95c2221',
- },
- createdBy: {
- universalIdentifier: '80a60507-6c7a-4713-b5de-b94ac293bf23',
- },
+ blocklistRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.blocklist,
+ fields: STANDARD_OBJECT_FIELDS.blocklist,
+ viewFieldNames: ['workspaceMember', 'createdAt', 'createdBy'],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
calendarChannelEventAssociation: {
@@ -127,34 +121,23 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- calendarChannelEventAssociationRecordPageFields: {
- universalIdentifier: '766f254a-a0eb-45c8-b4d2-12311201e08f',
- viewFieldGroups: {
- general: {
- universalIdentifier: '9c27f771-9f85-492f-b1f1-9bc7a175f6f3',
- },
- system: {
- universalIdentifier: 'c7b18e05-dd60-4ee4-911a-290790e8c425',
- },
- },
- viewFields: {
- calendarChannelId: {
- universalIdentifier: 'cd6c6714-fc1d-4511-a664-ec5e8dfd8692',
- },
- calendarEvent: {
- universalIdentifier: '4790ca84-255e-4cb7-9b20-c17f4d94df8e',
- },
- eventExternalId: {
- universalIdentifier: 'dbe16c1b-ece2-4d2f-b634-094742ac3e16',
- },
- createdAt: {
- universalIdentifier: '2702ae80-9108-4757-8a25-317a4357484e',
- },
- createdBy: {
- universalIdentifier: '201e0c45-fddc-4217-bfd4-40c13d7f7916',
+ calendarChannelEventAssociationRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarChannelEventAssociation,
+ fields: STANDARD_OBJECT_FIELDS.calendarChannelEventAssociation,
+ viewFieldNames: [
+ 'calendarChannelId',
+ 'calendarEvent',
+ 'eventExternalId',
+ 'createdAt',
+ 'createdBy',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
calendarEventParticipant: {
@@ -188,46 +171,27 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- calendarEventParticipantRecordPageFields: {
- universalIdentifier: 'e01ebdb3-8fb8-46d2-8230-82242d593f7a',
- viewFieldGroups: {
- general: {
- universalIdentifier: '3d842777-436e-467d-90ae-9e1fa0aa7e9c',
- },
- system: {
- universalIdentifier: '098836d8-15c1-44c1-a58e-2ff7fd6a05f9',
- },
- },
- viewFields: {
- calendarEvent: {
- universalIdentifier: '865a1278-c356-4b99-a5e9-1ca3d33c7665',
- },
- handle: {
- universalIdentifier: 'eb09af9c-b3f4-403c-8cb2-172243f83958',
- },
- displayName: {
- universalIdentifier: '23b97527-6ad3-4f07-bf68-559b97321673',
- },
- isOrganizer: {
- universalIdentifier: '3c126f3c-bd01-4029-b58a-724513fa5fff',
- },
- responseStatus: {
- universalIdentifier: 'cd02fc91-8fa4-4fa3-b0e3-1a1fc891e6ee',
- },
- person: {
- universalIdentifier: '46be729d-091c-4012-aeca-16a743008513',
- },
- workspaceMember: {
- universalIdentifier: 'c38c1111-f6e0-4698-9b36-db59f8d97de3',
- },
- createdAt: {
- universalIdentifier: '1447c7fa-fe2b-4ff7-8036-8de682537e23',
- },
- createdBy: {
- universalIdentifier: '6d7dff75-0230-45bd-8db9-dc25ef007e6e',
+ calendarEventParticipantRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEventParticipant,
+ fields: STANDARD_OBJECT_FIELDS.calendarEventParticipant,
+ viewFieldNames: [
+ 'calendarEvent',
+ 'handle',
+ 'displayName',
+ 'isOrganizer',
+ 'responseStatus',
+ 'person',
+ 'workspaceMember',
+ 'createdAt',
+ 'createdBy',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
calendarEvent: {
@@ -250,55 +214,29 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- calendarEventRecordPageFields: {
- universalIdentifier: 'c73668d1-022d-4eaf-b825-4e2548180db6',
- viewFieldGroups: {
- general: {
- universalIdentifier: 'aeadeb9e-3673-4c0c-8845-f59cb1e6ca42',
- },
- system: {
- universalIdentifier: 'eb1aadeb-7feb-44d1-9f9a-e9929e8690fc',
- },
- },
- viewFields: {
- title: {
- universalIdentifier: 'd17fc76f-2c3a-4c84-8249-27227bf71638',
- },
- startsAt: {
- universalIdentifier: '7bbd3744-d870-4704-882c-071732ed23d9',
- },
- endsAt: {
- universalIdentifier: 'ed7ca7e9-c8b3-4516-be4c-6491a27af847',
- },
- isFullDay: {
- universalIdentifier: '5d8f89b7-ec9e-41d6-9efe-96f9c32e6c20',
- },
- isCanceled: {
- universalIdentifier: 'a01f490d-cf67-4458-801e-13d81e74b45a',
- },
- conferenceLink: {
- universalIdentifier: '5ad748ae-e1bb-47bb-ac34-d82663c31b6e',
- },
- location: {
- universalIdentifier: '66c73e74-56e6-40c3-b776-0081ee757b8a',
- },
- description: {
- universalIdentifier: 'a09449be-b23f-48d4-b0dc-0bd36813220a',
- },
- externalCreatedAt: {
- universalIdentifier: '689c3eba-bedf-4a52-b9f1-3e34ce718251',
- },
- externalUpdatedAt: {
- universalIdentifier: '7823fa45-8cba-47ba-8dfb-5841bef44fc6',
- },
- iCalUid: {
- universalIdentifier: '8be763dd-6217-47fb-a7d2-ac223af881d2',
- },
- conferenceSolution: {
- universalIdentifier: '795905b6-c6f8-42cf-b8ea-3e5b6d32145f',
- },
+ calendarEventRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEvent,
+ fields: STANDARD_OBJECT_FIELDS.calendarEvent,
+ viewFieldNames: [
+ 'title',
+ 'startsAt',
+ 'endsAt',
+ 'isFullDay',
+ 'isCanceled',
+ 'conferenceLink',
+ 'location',
+ 'description',
+ 'externalCreatedAt',
+ 'externalUpdatedAt',
+ 'iCalUid',
+ 'conferenceSolution',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
callRecording: {
@@ -321,43 +259,25 @@ export const STANDARD_OBJECTS = {
'startedAt',
],
}),
- callRecordingRecordPageFields: {
- universalIdentifier: '99fa8b47-3b11-4f9b-8fbc-e67a9e1da682',
- viewFieldGroups: {
- general: {
- universalIdentifier: '068426eb-dd20-49b0-ae9c-68727f3be2fb',
- },
- },
- viewFields: {
- title: {
- universalIdentifier: '6308d574-8579-4cf2-a020-c208df97cf3e',
- },
- status: {
- universalIdentifier: '93483569-fcd2-46cf-b576-9f0318ad2b3b',
- },
- recordingRequestStatus: {
- universalIdentifier: '364a90b1-e9aa-4606-996b-46e579ebeb28',
- },
- startedAt: {
- universalIdentifier: '3fd00fbb-c153-45e3-b6e6-43d18d34052a',
- },
- endedAt: {
- universalIdentifier: 'ba8c8d41-c112-4173-b927-5b5c5a5c047b',
- },
- video: {
- universalIdentifier: 'acc54ade-cd26-4be2-9391-a42715ad1523',
- },
- audio: {
- universalIdentifier: '9445a547-1d1e-4da3-916b-2c2269c951c9',
- },
- transcript: {
- universalIdentifier: '782c97f6-e6b1-472b-8992-bbb60d25791b',
- },
- summary: {
- universalIdentifier: 'a0ace064-cc72-4631-ade3-07cdded86b0e',
- },
+ callRecordingRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.callRecording,
+ fields: STANDARD_OBJECT_FIELDS.callRecording,
+ viewFieldNames: [
+ 'title',
+ 'status',
+ 'recordingRequestStatus',
+ 'startedAt',
+ 'endedAt',
+ 'video',
+ 'audio',
+ 'transcript',
+ 'summary',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
},
- },
+ }),
},
},
company: {
@@ -389,70 +309,34 @@ export const STANDARD_OBJECTS = {
'address',
],
}),
- companyRecordPageFields: {
- universalIdentifier: '20202020-a001-4a01-8a01-c0aba11c1001',
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a001-4a01-8a01-c0aba11c1101',
- },
- business: {
- universalIdentifier: '20202020-a001-4a01-8a01-c0aba11c1102',
- },
- contact: {
- universalIdentifier: '20202020-a001-4a01-8a01-c0aba11c1103',
- },
- system: {
- universalIdentifier: '20202020-a001-4a01-8a01-c0aba11c1104',
- },
- },
- viewFields: {
- domainName: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1201',
- },
- accountOwner: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1202',
- },
- annualRevenue: {
- universalIdentifier: '2a35f734-dea2-4de9-8395-acbce8df0f97',
- },
- linkedinLink: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1206',
- },
- address: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1208',
- },
- createdAt: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1209',
- },
- createdBy: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1210',
- },
- updatedAt: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1212',
- },
- updatedBy: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1213',
- },
- people: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1214',
- },
- taskTargets: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1215',
- },
- noteTargets: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1216',
- },
- opportunities: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1217',
- },
- attachments: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c1219',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af01-4a01-8a01-c0aba11c121a',
- },
+ companyRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company,
+ fields: STANDARD_OBJECT_FIELDS.company,
+ viewFieldNames: [
+ 'domainName',
+ 'accountOwner',
+ 'annualRevenue',
+ 'linkedinLink',
+ 'address',
+ 'createdAt',
+ 'createdBy',
+ 'updatedAt',
+ 'updatedBy',
+ 'people',
+ 'taskTargets',
+ 'noteTargets',
+ 'opportunities',
+ 'attachments',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ business: 'Business',
+ contact: 'Contact',
+ system: 'System',
},
- },
+ }),
},
},
dashboard: {
@@ -506,34 +390,22 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- messageCampaignRecordPageFields: {
- universalIdentifier: '20202020-a009-4a09-8a09-fa9de11ca901',
- viewFieldGroups: {
- stats: {
- universalIdentifier: '20202020-a009-4a09-8a09-fa9de11ca902',
- },
- },
- viewFields: {
- status: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca903',
- },
- sentAt: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca904',
- },
- sentCount: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca905',
- },
- failedCount: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca906',
- },
- bouncedCount: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca907',
- },
- complainedCount: {
- universalIdentifier: '20202020-af09-4a09-8a09-fa9de11ca908',
- },
+ messageCampaignRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageCampaign,
+ fields: STANDARD_OBJECT_FIELDS.messageCampaign,
+ viewFieldNames: [
+ 'status',
+ 'sentAt',
+ 'sentCount',
+ 'failedCount',
+ 'bouncedCount',
+ 'complainedCount',
+ ],
+ viewFieldGroupNames: {
+ stats: 'Stats',
},
- },
+ }),
},
},
messageList: {
@@ -594,37 +466,24 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- messageChannelMessageAssociationRecordPageFields: {
- universalIdentifier: '680b43e2-5d50-49d8-bbdd-2d208e7b7071',
- viewFieldGroups: {
- general: {
- universalIdentifier: '86d7066c-ba38-4f6a-996f-77345bedd549',
- },
- system: {
- universalIdentifier: '6044c58c-a63c-4f3f-a283-b8803553628f',
- },
- },
- viewFields: {
- messageChannelId: {
- universalIdentifier: '376c7685-9ebe-4c95-b820-424b1c2f264f',
- },
- message: {
- universalIdentifier: '166aa5a0-d825-40dc-be6d-e94b87edd56d',
- },
- messageExternalId: {
- universalIdentifier: '1910bd21-2472-4a83-b8cd-7de51bdd2675',
- },
- direction: {
- universalIdentifier: '9edfbd44-4624-4cf8-b81c-8e169b4e8281',
- },
- createdAt: {
- universalIdentifier: '8651c5c4-db87-427c-8a57-6a9f75c74976',
- },
- createdBy: {
- universalIdentifier: 'af4adf31-f698-4aad-9f29-71908924fc9a',
+ messageChannelMessageAssociationRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociation,
+ fields: STANDARD_OBJECT_FIELDS.messageChannelMessageAssociation,
+ viewFieldNames: [
+ 'messageChannelId',
+ 'message',
+ 'messageExternalId',
+ 'direction',
+ 'createdAt',
+ 'createdBy',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
messageChannelMessageAssociationMessageFolder: {
@@ -656,31 +515,23 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- messageChannelMessageAssociationMessageFolderRecordPageFields: {
- universalIdentifier: '331ec548-07d2-4f9d-a0a2-ef91a9f96184',
- viewFieldGroups: {
- general: {
- universalIdentifier: '4928521b-ae24-4013-a69a-1392017d57af',
- },
- system: {
- universalIdentifier: 'b76cebb3-39b2-477a-9212-8bf1190227a4',
- },
- },
- viewFields: {
- messageChannelMessageAssociation: {
- universalIdentifier: 'd34ed53e-5156-4a18-a8df-572269496aac',
- },
- messageFolderId: {
- universalIdentifier: '04f14582-caf9-49ee-81ea-e5d4f977bfe1',
- },
- createdAt: {
- universalIdentifier: '39297559-a747-481e-a4c5-b80b8faf1aac',
- },
- createdBy: {
- universalIdentifier: '4692eb91-7fc6-4436-9175-87caa5f6b668',
+ messageChannelMessageAssociationMessageFolderRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociationMessageFolder,
+ fields:
+ STANDARD_OBJECT_FIELDS.messageChannelMessageAssociationMessageFolder,
+ viewFieldNames: [
+ 'messageChannelMessageAssociation',
+ 'messageFolderId',
+ 'createdAt',
+ 'createdBy',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
messageParticipant: {
@@ -716,40 +567,25 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- messageParticipantRecordPageFields: {
- universalIdentifier: '209ab5c5-4a68-4d32-8255-515919a6c5f5',
- viewFieldGroups: {
- general: {
- universalIdentifier: '41c18430-34c3-430f-b86b-fc3963281277',
- },
- system: {
- universalIdentifier: 'add21830-a7c6-4cde-9eed-430afbcbf557',
- },
- },
- viewFields: {
- message: {
- universalIdentifier: 'dd8ccf4f-64d7-468c-bc0c-dc4e0efef08d',
- },
- role: {
- universalIdentifier: '5d1f9a65-85cc-41b2-a8bf-8e2c97aab4b3',
- },
- displayName: {
- universalIdentifier: 'c50748fe-9f54-4e09-b572-111f076ec7db',
- },
- person: {
- universalIdentifier: 'bf2e30dd-df03-4fb2-820a-166a93a2ce2c',
- },
- workspaceMember: {
- universalIdentifier: '00336686-0d63-43e2-b247-599f1227bd85',
- },
- createdAt: {
- universalIdentifier: '8d66ecb8-825d-4c6c-91c0-23a82c87ab46',
- },
- createdBy: {
- universalIdentifier: '17c3acfc-71f1-4b3c-820e-aea23871e850',
+ messageParticipantRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageParticipant,
+ fields: STANDARD_OBJECT_FIELDS.messageParticipant,
+ viewFieldNames: [
+ 'message',
+ 'role',
+ 'displayName',
+ 'person',
+ 'workspaceMember',
+ 'createdAt',
+ 'createdBy',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
messageThread: {
@@ -813,43 +649,24 @@ export const STANDARD_OBJECTS = {
'createdAt',
],
}),
- noteRecordPageFields: {
- universalIdentifier: '20202020-a005-4a05-8a05-a0be5a115001',
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a005-4a05-8a05-a0be5a115101',
- },
- system: {
- universalIdentifier: '20202020-a005-4a05-8a05-a0be5a115103',
- },
- },
- viewFields: {
- createdAt: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115202',
- },
- createdBy: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115203',
- },
- noteTargets: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115204',
- },
- bodyV2: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115205',
- },
- updatedAt: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115206',
- },
- updatedBy: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115207',
- },
- attachments: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115208',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af05-4a05-8a05-a0be5a115209',
- },
+ noteRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.note,
+ fields: STANDARD_OBJECT_FIELDS.note,
+ viewFieldNames: [
+ 'createdAt',
+ 'createdBy',
+ 'noteTargets',
+ 'bodyV2',
+ 'updatedAt',
+ 'updatedBy',
+ 'attachments',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
noteTarget: {
@@ -958,64 +775,32 @@ export const STANDARD_OBJECTS = {
},
},
},
- opportunityRecordPageFields: {
- universalIdentifier: '20202020-a003-4a03-8a03-0aa0b1ca3001',
- viewFieldGroups: {
- deal: {
- universalIdentifier: '20202020-a003-4a03-8a03-0aa0b1ca3101',
- },
- relations: {
- universalIdentifier: '20202020-a003-4a03-8a03-0aa0b1ca3102',
- },
- system: {
- universalIdentifier: '20202020-a003-4a03-8a03-0aa0b1ca3103',
- },
- },
- viewFields: {
- amount: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3201',
- },
- closeDate: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3202',
- },
- stage: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3203',
- },
- company: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3204',
- },
- pointOfContact: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3205',
- },
- owner: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3206',
- },
- createdAt: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3207',
- },
- createdBy: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3208',
- },
- updatedAt: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca320a',
- },
- updatedBy: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca320b',
- },
- taskTargets: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca320d',
- },
- noteTargets: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca320e',
- },
- attachments: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca320f',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af03-4a03-8a03-0aa0b1ca3210',
- },
+ opportunityRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity,
+ fields: STANDARD_OBJECT_FIELDS.opportunity,
+ viewFieldNames: [
+ 'amount',
+ 'closeDate',
+ 'stage',
+ 'company',
+ 'pointOfContact',
+ 'owner',
+ 'createdAt',
+ 'createdBy',
+ 'updatedAt',
+ 'updatedBy',
+ 'taskTargets',
+ 'noteTargets',
+ 'attachments',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ deal: 'Deal',
+ relations: 'Relations',
+ system: 'System',
},
- },
+ }),
},
},
person: {
@@ -1047,79 +832,36 @@ export const STANDARD_OBJECTS = {
'linkedinLink',
],
}),
- personRecordPageFields: {
- universalIdentifier: '20202020-a002-4a02-8a02-ae0a1ea12001',
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a002-4a02-8a02-ae0a1ea12101',
- },
- work: {
- universalIdentifier: '20202020-a002-4a02-8a02-ae0a1ea12102',
- },
- social: {
- universalIdentifier: '20202020-a002-4a02-8a02-ae0a1ea12103',
- },
- system: {
- universalIdentifier: '20202020-a002-4a02-8a02-ae0a1ea12104',
- },
- },
- viewFields: {
- emails: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12201',
- },
- phones: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12202',
- },
- company: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12203',
- },
- jobTitle: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12204',
- },
- linkedinLink: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12205',
- },
- avatarUrl: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12208',
- },
- createdAt: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12209',
- },
- createdBy: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12210',
- },
- updatedAt: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12212',
- },
- updatedBy: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12213',
- },
- avatarFile: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12214',
- },
- pointOfContactForOpportunities: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12215',
- },
- taskTargets: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12216',
- },
- noteTargets: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12217',
- },
- attachments: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea12219',
- },
- messageParticipants: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea1221a',
- },
- calendarEventParticipants: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea1221b',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af02-4a02-8a02-ae0a1ea1221c',
- },
+ personRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.person,
+ fields: STANDARD_OBJECT_FIELDS.person,
+ viewFieldNames: [
+ 'emails',
+ 'phones',
+ 'company',
+ 'jobTitle',
+ 'linkedinLink',
+ 'avatarUrl',
+ 'createdAt',
+ 'createdBy',
+ 'updatedAt',
+ 'updatedBy',
+ 'avatarFile',
+ 'pointOfContactForOpportunities',
+ 'taskTargets',
+ 'noteTargets',
+ 'attachments',
+ 'messageParticipants',
+ 'calendarEventParticipants',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ work: 'Work',
+ social: 'Social',
+ system: 'System',
},
- },
+ }),
},
},
task: {
@@ -1224,52 +966,27 @@ export const STANDARD_OBJECTS = {
},
},
},
- taskRecordPageFields: {
- universalIdentifier: '20202020-a006-4a06-8a06-ba5ca11a6001',
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a006-4a06-8a06-ba5ca11a6101',
- },
- system: {
- universalIdentifier: '20202020-a006-4a06-8a06-ba5ca11a6103',
- },
- },
- viewFields: {
- dueAt: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6202',
- },
- status: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6203',
- },
- assignee: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6204',
- },
- createdAt: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6205',
- },
- createdBy: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6206',
- },
- taskTargets: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6207',
- },
- bodyV2: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6208',
- },
- updatedAt: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a6209',
- },
- updatedBy: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a620a',
- },
- attachments: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a620b',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af06-4a06-8a06-ba5ca11a620c',
- },
+ taskRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.task,
+ fields: STANDARD_OBJECT_FIELDS.task,
+ viewFieldNames: [
+ 'dueAt',
+ 'status',
+ 'assignee',
+ 'createdAt',
+ 'createdBy',
+ 'taskTargets',
+ 'bodyV2',
+ 'updatedAt',
+ 'updatedBy',
+ 'attachments',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
taskTarget: {
@@ -1407,31 +1124,17 @@ export const STANDARD_OBJECTS = {
fields: STANDARD_OBJECT_FIELDS.workflowAutomatedTrigger,
viewFieldNames: ['type', 'workflow', 'createdAt'],
}),
- workflowAutomatedTriggerRecordPageFields: {
- universalIdentifier: '10aff295-f7ac-475d-8528-661eb9aa9759',
- viewFieldGroups: {
- general: {
- universalIdentifier: 'c5261eae-f2fe-416e-8ef9-eda5d377f8ca',
- },
- system: {
- universalIdentifier: 'e6da0410-7f63-41b7-b977-421fc37d67f5',
- },
- },
- viewFields: {
- type: {
- universalIdentifier: '3b3a0cf7-f171-4ad8-9aad-aed84eca0250',
- },
- workflow: {
- universalIdentifier: 'ddc5a9f6-f577-4e4b-a258-3d656c32babc',
- },
- createdAt: {
- universalIdentifier: '98ef45e8-c6bf-42e6-96f6-e94cd17911bc',
- },
- createdBy: {
- universalIdentifier: 'd3933427-de7f-4fa1-b80c-47302273d848',
+ workflowAutomatedTriggerRecordPageFields:
+ buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowAutomatedTrigger,
+ fields: STANDARD_OBJECT_FIELDS.workflowAutomatedTrigger,
+ viewFieldNames: ['type', 'workflow', 'createdAt', 'createdBy'],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
- },
+ }),
},
},
workflowRun: {
@@ -1455,55 +1158,29 @@ export const STANDARD_OBJECTS = {
fields: STANDARD_OBJECT_FIELDS.workflowRun,
viewFieldNames: ['name', 'workflow', 'status'],
}),
- workflowRunRecordPageFields: {
- universalIdentifier: '20202020-a011-4a11-8a11-a0bcf10abcf1',
- viewFields: {
- status: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcf6',
- },
- workflow: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcf7',
- },
- workflowVersion: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcf8',
- },
- startedAt: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcf9',
- },
- endedAt: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcfa',
- },
- createdAt: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcfb',
- },
- createdBy: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcfc',
- },
- enqueuedAt: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abcfd',
- },
- state: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abd01',
- },
- updatedAt: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abd02',
- },
- updatedBy: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abd03',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af11-4a11-8a11-a0bcf10abd05',
- },
- },
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a011-4a11-8a11-a0bcf10abcf2',
- },
- system: {
- universalIdentifier: '20202020-a011-4a11-8a11-a0bcf10abcf4',
- },
+ workflowRunRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowRun,
+ fields: STANDARD_OBJECT_FIELDS.workflowRun,
+ viewFieldNames: [
+ 'status',
+ 'workflow',
+ 'workflowVersion',
+ 'startedAt',
+ 'endedAt',
+ 'createdAt',
+ 'createdBy',
+ 'enqueuedAt',
+ 'state',
+ 'updatedAt',
+ 'updatedBy',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
workflowVersion: {
@@ -1524,49 +1201,27 @@ export const STANDARD_OBJECTS = {
fields: STANDARD_OBJECT_FIELDS.workflowVersion,
viewFieldNames: ['name', 'workflow', 'status', 'updatedAt', 'runs'],
}),
- workflowVersionRecordPageFields: {
- universalIdentifier: '20202020-a010-4a10-8a10-a0bcf10aaef1',
- viewFields: {
- status: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaef6',
- },
- workflow: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaef7',
- },
- trigger: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaef8',
- },
- createdAt: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaef9',
- },
- steps: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaefa',
- },
- createdBy: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaefb',
- },
- updatedAt: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaefc',
- },
- updatedBy: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaefd',
- },
- runs: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaefe',
- },
- timelineActivities: {
- universalIdentifier: '20202020-af10-4a10-8a10-a0bcf10aaf01',
- },
- },
- viewFieldGroups: {
- general: {
- universalIdentifier: '20202020-a010-4a10-8a10-a0bcf10aaef2',
- },
- system: {
- universalIdentifier: '20202020-a010-4a10-8a10-a0bcf10aaef4',
- },
+ workflowVersionRecordPageFields: buildStandardObjectRecordPageFieldsView({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowVersion,
+ fields: STANDARD_OBJECT_FIELDS.workflowVersion,
+ viewFieldNames: [
+ 'status',
+ 'workflow',
+ 'trigger',
+ 'createdAt',
+ 'steps',
+ 'createdBy',
+ 'updatedAt',
+ 'updatedBy',
+ 'runs',
+ 'timelineActivities',
+ ],
+ viewFieldGroupNames: {
+ general: 'General',
+ system: 'System',
},
- },
+ }),
},
},
workspaceMember: {
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.ts
index 919e1dc103c..517373b78a0 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
@@ -1,5 +1,13 @@
+import { STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS } from '@/metadata/constants/standard-object-universal-identifiers.constant';
+import { buildStandardObjectRecordPageLayout } from '@/metadata/utils/internal/build-standard-object-record-page-layout.util';
+
// Never mutate an existing universal identifier
// Deleting an existing universal identifier should be very rare
+// Record-page layout universal identifiers are deterministically derived by
+// buildStandardObjectRecordPageLayout (layout keyed on the object + the
+// name-free RECORD_PAGE discriminator, tabs on their title within the layout,
+// widgets on their title within their tab). The titles passed here MUST match
+// the ones the server standard page-layout configs assign.
export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {
myFirstDashboard: {
@@ -36,617 +44,481 @@ export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {
},
},
},
- companyRecordPage: {
- universalIdentifier: '20202020-a101-4001-8001-c0aba11c0001',
+ companyRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.company,
tabs: {
home: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0101',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0111',
- },
- people: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0112',
- },
- opportunities: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0114',
- },
+ fields: 'Fields',
+ people: 'People',
+ opportunities: 'Opportunities',
},
},
timeline: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0102',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0121',
- },
+ timeline: 'Timeline',
},
},
tasks: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0103',
+ title: 'Tasks',
widgets: {
- tasks: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0131',
- },
+ tasks: 'Tasks',
},
},
notes: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0104',
+ title: 'Notes',
widgets: {
- notes: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0141',
- },
+ notes: 'Notes',
},
},
files: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0105',
+ title: 'Files',
widgets: {
- files: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0151',
- },
+ files: 'Files',
},
},
emails: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0106',
+ title: 'Emails',
widgets: {
- emails: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0161',
- },
+ emails: 'Emails',
},
},
calendar: {
- universalIdentifier: '20202020-ab01-4001-8001-c0aba11c0107',
+ title: 'Calendar',
widgets: {
- calendar: {
- universalIdentifier: '20202020-ac01-4001-8001-c0aba11c0171',
- },
+ calendar: 'Calendar',
},
},
},
- },
- personRecordPage: {
- universalIdentifier: '20202020-a102-4002-8002-ae0a1ea11002',
+ }),
+ personRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.person,
tabs: {
home: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11201',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11211',
- },
- company: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11212',
- },
- pointOfContactForOpportunities: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11213',
- },
- listMemberships: {
- universalIdentifier: 'f344eb7d-23c1-457a-a29b-32fd548b6aba',
- },
+ fields: 'Fields',
+ company: 'Company',
+ pointOfContactForOpportunities: 'Opportunities',
+ listMemberships: 'Lists',
},
},
timeline: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11202',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11221',
- },
+ timeline: 'Timeline',
},
},
tasks: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11203',
+ title: 'Tasks',
widgets: {
- tasks: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11231',
- },
+ tasks: 'Tasks',
},
},
notes: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11204',
+ title: 'Notes',
widgets: {
- notes: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11241',
- },
+ notes: 'Notes',
},
},
files: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11205',
+ title: 'Files',
widgets: {
- files: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11251',
- },
+ files: 'Files',
},
},
emails: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11206',
+ title: 'Emails',
widgets: {
- emails: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11261',
- },
+ emails: 'Emails',
},
},
calendar: {
- universalIdentifier: '20202020-ab02-4002-8002-ae0a1ea11207',
+ title: 'Calendar',
widgets: {
- calendar: {
- universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11271',
- },
+ calendar: 'Calendar',
},
},
},
- },
- opportunityRecordPage: {
- universalIdentifier: '20202020-a103-4003-8003-0aa0b1ca1003',
+ }),
+ opportunityRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.opportunity,
tabs: {
home: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1301',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1311',
- },
- pointOfContact: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1312',
- },
- company: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1313',
- },
- owner: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1314',
- },
+ fields: 'Fields',
+ pointOfContact: 'Point of Contact',
+ company: 'Company',
+ owner: 'Owner',
},
},
timeline: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1302',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1321',
- },
+ timeline: 'Timeline',
},
},
tasks: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1303',
+ title: 'Tasks',
widgets: {
- tasks: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1331',
- },
+ tasks: 'Tasks',
},
},
notes: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1304',
+ title: 'Notes',
widgets: {
- notes: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1341',
- },
+ notes: 'Notes',
},
},
files: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1305',
+ title: 'Files',
widgets: {
- files: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1351',
- },
+ files: 'Files',
},
},
emails: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1306',
+ title: 'Emails',
widgets: {
- emails: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1361',
- },
+ emails: 'Emails',
},
},
calendar: {
- universalIdentifier: '20202020-ab03-4003-8003-0aa0b1ca1307',
+ title: 'Calendar',
widgets: {
- calendar: {
- universalIdentifier: '20202020-ac03-4003-8003-0aa0b1ca1371',
- },
+ calendar: 'Calendar',
},
},
},
- },
- noteRecordPage: {
- universalIdentifier: '20202020-a104-4004-8004-a0be5a11a004',
+ }),
+ noteRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.note,
tabs: {
home: {
- universalIdentifier: '20202020-ab04-4004-8004-a0be5a11a401',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac04-4004-8004-a0be5a11a411',
- },
- noteRichText: {
- universalIdentifier: '20202020-ac04-4004-8004-a0be5a11a412',
- },
+ fields: 'Fields',
+ noteRichText: 'Note',
},
},
note: {
- universalIdentifier: '20202020-ab04-4004-8004-a0be5a11a402',
+ title: 'Note',
widgets: {
- noteRichText: {
- universalIdentifier: '20202020-ac04-4004-8004-a0be5a11a421',
- },
+ noteRichText: 'Note',
},
},
timeline: {
- universalIdentifier: '20202020-ab04-4004-8004-a0be5a11a403',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac04-4004-8004-a0be5a11a431',
- },
+ timeline: 'Timeline',
},
},
files: {
- universalIdentifier: '20202020-ab04-4004-8004-a0be5a11a404',
+ title: 'Files',
widgets: {
- files: {
- universalIdentifier: '20202020-ac04-4004-8004-a0be5a11a441',
- },
+ files: 'Files',
},
},
},
- },
- taskRecordPage: {
- universalIdentifier: '20202020-a105-4005-8005-ba5ca11a1005',
+ }),
+ taskRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.task,
tabs: {
home: {
- universalIdentifier: '20202020-ab05-4005-8005-ba5ca11a5501',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac05-4005-8005-ba5ca11a5511',
- },
- taskRichText: {
- universalIdentifier: '20202020-ac05-4005-8005-ba5ca11a5512',
- },
+ fields: 'Fields',
+ taskRichText: 'Task',
},
},
note: {
- universalIdentifier: '20202020-ab05-4005-8005-ba5ca11a5502',
+ title: 'Note',
widgets: {
- taskRichText: {
- universalIdentifier: '20202020-ac05-4005-8005-ba5ca11a5521',
- },
+ taskRichText: 'Task',
},
},
timeline: {
- universalIdentifier: '20202020-ab05-4005-8005-ba5ca11a5503',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac05-4005-8005-ba5ca11a5531',
- },
+ timeline: 'Timeline',
},
},
files: {
- universalIdentifier: '20202020-ab05-4005-8005-ba5ca11a5504',
+ title: 'Files',
widgets: {
- files: {
- universalIdentifier: '20202020-ac05-4005-8005-ba5ca11a5541',
- },
+ files: 'Files',
},
},
},
- },
- workflowRecordPage: {
- universalIdentifier: '20202020-a106-4006-8006-a0bcf10aa006',
+ }),
+ workflowRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflow,
tabs: {
flow: {
- universalIdentifier: '20202020-ab06-4006-8006-a0bcf10a6601',
+ title: 'Flow',
widgets: {
- workflow: {
- universalIdentifier: '20202020-ac06-4006-8006-a0bcf10a6611',
- },
+ workflow: 'Flow',
},
},
},
- },
- workflowVersionRecordPage: {
- universalIdentifier: '20202020-a107-4007-8007-a0bcf10ab007',
+ }),
+ workflowVersionRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowVersion,
tabs: {
home: {
- universalIdentifier: '20202020-ab07-4007-8007-a0bcf10a7701',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac07-4007-8007-a0bcf10a7711',
- },
- workflow: {
- universalIdentifier: '20202020-ac07-4007-8007-a0bcf10a7712',
- },
+ fields: 'Fields',
+ workflow: 'Workflow',
},
},
flow: {
- universalIdentifier: '20202020-ab07-4007-8007-a0bcf10a7702',
+ title: 'Flow',
widgets: {
- workflowVersion: {
- universalIdentifier: '20202020-ac07-4007-8007-a0bcf10a7721',
- },
+ workflowVersion: 'Flow',
},
},
},
- },
- workflowRunRecordPage: {
- universalIdentifier: '20202020-a108-4008-8008-a0bcf10ac008',
+ }),
+ workflowRunRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowRun,
tabs: {
home: {
- universalIdentifier: '20202020-ab08-4008-8008-a0bcf10a8801',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac08-4008-8008-a0bcf10a8811',
- },
- workflow: {
- universalIdentifier: '20202020-ac08-4008-8008-a0bcf10a8813',
- },
+ fields: 'Fields',
+ workflow: 'Workflow',
},
},
flow: {
- universalIdentifier: '20202020-ab08-4008-8008-a0bcf10a8802',
+ title: 'Flow',
widgets: {
- workflowRun: {
- universalIdentifier: '20202020-ac08-4008-8008-a0bcf10a8821',
- },
+ workflowRun: 'Flow',
},
},
},
- },
- blocklistRecordPage: {
- universalIdentifier: '20202020-a109-4009-8009-b10c115b0001',
+ }),
+ blocklistRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier: STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.blocklist,
tabs: {
home: {
- universalIdentifier: '20202020-ab09-4009-8009-b10c115b0901',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac09-4009-8009-b10c115b0911',
- },
+ fields: 'Fields',
},
},
timeline: {
- universalIdentifier: '20202020-ab09-4009-8009-b10c115b0902',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac09-4009-8009-b10c115b0921',
- },
+ timeline: 'Timeline',
},
},
},
- },
- calendarChannelEventAssociationRecordPage: {
- universalIdentifier: '20202020-a10b-400b-800b-ca1c4e0b0001',
- tabs: {
- home: {
- universalIdentifier: '20202020-ab0b-400b-800b-ca1c4e0b0b01',
- widgets: {
- fields: {
- universalIdentifier: '20202020-ac0b-400b-800b-ca1c4e0b0b11',
+ }),
+ calendarChannelEventAssociationRecordPage:
+ buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarChannelEventAssociation,
+ tabs: {
+ home: {
+ title: 'Home',
+ widgets: {
+ fields: 'Fields',
},
},
- },
- timeline: {
- universalIdentifier: '20202020-ab0b-400b-800b-ca1c4e0b0b02',
- widgets: {
- timeline: {
- universalIdentifier: '20202020-ac0b-400b-800b-ca1c4e0b0b21',
+ timeline: {
+ title: 'Timeline',
+ widgets: {
+ timeline: 'Timeline',
},
},
},
- },
- },
- calendarEventRecordPage: {
- universalIdentifier: 'b9b10e40-9ce2-4704-8ac6-c6e92e2563c1',
+ }),
+ calendarEventRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEvent,
tabs: {
home: {
- universalIdentifier: 'c80a0407-25f5-438b-8c32-1ce9cde95657',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: 'fea5c1c2-0c1d-4d2e-a14c-a10108b0db0f',
- },
- participants: {
- universalIdentifier: '6faea537-02fa-4993-957c-f2e1654986bd',
- },
- callRecordings: {
- universalIdentifier: 'f473b435-e2d4-4928-8d90-1db0094389f7',
- },
+ fields: 'Fields',
+ participants: 'Participants',
+ callRecordings: 'Call Recordings',
},
},
timeline: {
- universalIdentifier: '9cb35d6d-932d-49bc-b303-593116ca5343',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '8273e2c4-cc17-4d3e-ba08-5bac612b5d44',
- },
+ timeline: 'Timeline',
},
},
callRecording: {
- universalIdentifier: 'a3dff71b-ca06-4709-9b39-ca4f30108ab4',
+ title: 'Call Recording',
widgets: {
- transcript: {
- universalIdentifier: 'dc2f3511-d72e-400b-adc9-fdb8d930dda8',
- },
+ transcript: 'Transcript',
},
},
},
- },
- calendarEventParticipantRecordPage: {
- universalIdentifier: '20202020-a10c-400c-800c-ca1e0a0c0001',
+ }),
+ calendarEventParticipantRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEventParticipant,
tabs: {
home: {
- universalIdentifier: '20202020-ab0c-400c-800c-ca1e0a0c0c01',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac0c-400c-800c-ca1e0a0c0c11',
- },
+ fields: 'Fields',
},
},
timeline: {
- universalIdentifier: '20202020-ab0c-400c-800c-ca1e0a0c0c02',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac0c-400c-800c-ca1e0a0c0c21',
- },
+ timeline: 'Timeline',
},
},
},
- },
- callRecordingRecordPage: {
- universalIdentifier: 'fa475fb3-3fe4-4ab8-8320-495eba5b2e58',
+ }),
+ callRecordingRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.callRecording,
tabs: {
home: {
- universalIdentifier: 'f61be659-f6f1-4f1f-b3f9-113370740f1b',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: 'e490d2dd-5b69-4518-b867-9dde815f9cb6',
- },
+ fields: 'Fields',
},
},
timeline: {
- universalIdentifier: '9fb360fa-bc10-430c-8425-25d4e9da4386',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '9347305a-73de-4651-a116-c67b2706beda',
- },
+ timeline: 'Timeline',
},
},
},
- },
- messageChannelMessageAssociationRecordPage: {
- universalIdentifier: '20202020-a111-4011-8011-a5c4a5110001',
- tabs: {
- home: {
- universalIdentifier: '20202020-ab11-4011-8011-a5c4a5111101',
- widgets: {
- fields: {
- universalIdentifier: '20202020-ac11-4011-8011-a5c4a5111111',
+ }),
+ messageChannelMessageAssociationRecordPage:
+ buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociation,
+ tabs: {
+ home: {
+ title: 'Home',
+ widgets: {
+ fields: 'Fields',
},
},
- },
- timeline: {
- universalIdentifier: '20202020-ab11-4011-8011-a5c4a5111102',
- widgets: {
- timeline: {
- universalIdentifier: '20202020-ac11-4011-8011-a5c4a5111121',
+ timeline: {
+ title: 'Timeline',
+ widgets: {
+ timeline: 'Timeline',
},
},
},
- },
- },
- messageChannelMessageAssociationMessageFolderRecordPage: {
- universalIdentifier: '20202020-a112-4012-8012-a5c4a6120001',
- tabs: {
- home: {
- universalIdentifier: '20202020-ab12-4012-8012-a5c4a6121201',
- widgets: {
- fields: {
- universalIdentifier: '20202020-ac12-4012-8012-a5c4a6121211',
+ }),
+ messageChannelMessageAssociationMessageFolderRecordPage:
+ buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageChannelMessageAssociationMessageFolder,
+ tabs: {
+ home: {
+ title: 'Home',
+ widgets: {
+ fields: 'Fields',
},
},
- },
- timeline: {
- universalIdentifier: '20202020-ab12-4012-8012-a5c4a6121202',
- widgets: {
- timeline: {
- universalIdentifier: '20202020-ac12-4012-8012-a5c4a6121221',
+ timeline: {
+ title: 'Timeline',
+ widgets: {
+ timeline: 'Timeline',
},
},
},
- },
- },
- messageParticipantRecordPage: {
- universalIdentifier: '20202020-a114-4014-8014-a5ea10140001',
+ }),
+ messageParticipantRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageParticipant,
tabs: {
home: {
- universalIdentifier: '20202020-ab14-4014-8014-a5ea10141401',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac14-4014-8014-a5ea10141411',
- },
+ fields: 'Fields',
},
},
timeline: {
- universalIdentifier: '20202020-ab14-4014-8014-a5ea10141402',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac14-4014-8014-a5ea10141421',
- },
+ timeline: 'Timeline',
},
},
},
- },
- workflowAutomatedTriggerRecordPage: {
- universalIdentifier: '20202020-a115-4015-8015-a0bcf1150001',
+ }),
+ workflowAutomatedTriggerRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.workflowAutomatedTrigger,
tabs: {
home: {
- universalIdentifier: '20202020-ab15-4015-8015-a0bcf1151501',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: '20202020-ac15-4015-8015-a0bcf1151511',
- },
+ fields: 'Fields',
},
},
timeline: {
- universalIdentifier: '20202020-ab15-4015-8015-a0bcf1151502',
+ title: 'Timeline',
widgets: {
- timeline: {
- universalIdentifier: '20202020-ac15-4015-8015-a0bcf1151521',
- },
+ timeline: 'Timeline',
},
},
},
- },
- messageThreadRecordPage: {
- universalIdentifier: '20202020-95bb-40eb-a699-70e7ea02a79e',
+ }),
+ messageThreadRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageThread,
tabs: {
home: {
- universalIdentifier: '20202020-f639-48a0-9a44-027cf4e3cd15',
+ title: 'Home',
widgets: {
- emailThread: {
- universalIdentifier: '20202020-d57e-44cb-b220-69a881feb9c3',
- },
+ emailThread: 'Thread',
},
},
},
- },
- messageListRecordPage: {
- universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f60',
+ }),
+ messageListRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageList,
tabs: {
home: {
- universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f61',
+ title: 'Home',
widgets: {
- fields: {
- universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f62',
- },
- members: {
- universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f63',
- },
+ fields: 'Fields',
+ members: 'Members',
},
},
},
- },
- messageCampaignRecordPage: {
- universalIdentifier: '8704b091-94bd-4f8f-82b1-e2f3eab92217',
+ }),
+ messageCampaignRecordPage: buildStandardObjectRecordPageLayout({
+ objectUniversalIdentifier:
+ STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.messageCampaign,
tabs: {
- composer: {
- universalIdentifier: '5f21c19d-6c3e-4b8a-9d47-1e8f02a63b71',
+ home: {
+ title: 'Home',
widgets: {
- messageCampaign: {
- universalIdentifier: '9c74d8e2-0b5f-4a19-8630-57d2ba14ce92',
- },
+ details: 'Details',
+ list: 'List',
+ recipients: 'Recipients',
+ fields: 'Fields',
},
},
- home: {
- universalIdentifier: 'f16785cd-a5b7-4ec1-8f20-ff8b80fb94b9',
+ composer: {
+ title: 'Email',
widgets: {
- fields: {
- universalIdentifier: '886296e0-a5b6-4054-b450-ad624180c2ef',
- },
- details: {
- universalIdentifier: 'ce2f82cc-9340-45a2-90a0-c34207e8e3b0',
- },
- messages: {
- universalIdentifier: 'a33b43f4-72a1-476d-9372-30e82f450377',
- },
- recipients: {
- universalIdentifier: 'b667f20a-1d38-453e-b888-3ecab00a1044',
- },
- list: {
- universalIdentifier: 'b04fb8a5-f471-49a7-b82c-8434ea8276c5',
- },
+ messageCampaign: 'Email',
},
},
},
- },
-};
+ }),
+} as const;
diff --git a/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-index-view.util.ts b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-index-view.util.ts
index 04e3db24639..92732e34cb1 100644
--- a/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-index-view.util.ts
+++ b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-index-view.util.ts
@@ -1,7 +1,9 @@
import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from '@/application/constants/TwentyStandardApplicationUniversalIdentifier';
import { getSystemViewFieldUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-field-universal-identifier.util';
-import { getSystemViewUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-universal-identifier.util';
-import { ViewKey } from '@/types/ViewKey';
+import {
+ getSystemViewUniversalIdentifier,
+ SYSTEM_VIEW_KEYS,
+} from '@/application/deterministic-identifier/get-system-view-universal-identifier.util';
type StandardViewFieldUniversalIdentifier = { universalIdentifier: string };
@@ -23,7 +25,7 @@ export const buildStandardObjectIndexView = <
objectMetadataApplicationUniversalIdentifier:
TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier,
- viewKey: ViewKey.INDEX,
+ viewKey: SYSTEM_VIEW_KEYS.INDEX,
});
const viewFields = Object.fromEntries(
diff --git a/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-fields-view.util.ts b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-fields-view.util.ts
new file mode 100644
index 00000000000..4856d6db08f
--- /dev/null
+++ b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-fields-view.util.ts
@@ -0,0 +1,84 @@
+import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from '@/application/constants/TwentyStandardApplicationUniversalIdentifier';
+import { getSystemViewFieldGroupUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-field-group-universal-identifier.util';
+import { getSystemViewFieldUniversalIdentifier } from '@/application/deterministic-identifier/get-system-view-field-universal-identifier.util';
+import {
+ SYSTEM_VIEW_KEYS,
+ getSystemViewUniversalIdentifier,
+} from '@/application/deterministic-identifier/get-system-view-universal-identifier.util';
+
+type StandardUniversalIdentifierHolder = { universalIdentifier: string };
+
+export const buildStandardObjectRecordPageFieldsView = <
+ const TViewFieldName extends string,
+ const TViewFieldGroupName extends string,
+>({
+ objectUniversalIdentifier,
+ fields,
+ viewFieldNames,
+ viewFieldGroupNames,
+}: {
+ objectUniversalIdentifier: string;
+ fields: Record<string, StandardUniversalIdentifierHolder>;
+ viewFieldNames: readonly TViewFieldName[];
+ viewFieldGroupNames: Record<TViewFieldGroupName, string>;
+}): {
+ universalIdentifier: string;
+ viewFields: Record<TViewFieldName, StandardUniversalIdentifierHolder>;
+ viewFieldGroups: Record<
+ TViewFieldGroupName,
+ StandardUniversalIdentifierHolder
+ >;
+} => {
+ const viewUniversalIdentifier = getSystemViewUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier,
+ viewKey: SYSTEM_VIEW_KEYS.FIELDS_WIDGET,
+ });
+
+ const viewFields = Object.fromEntries(
+ viewFieldNames.map((viewFieldName) => {
+ const field = fields[viewFieldName];
+
+ if (field === undefined) {
+ throw new Error(
+ `Missing field "${viewFieldName}" for the record-page view of object ${objectUniversalIdentifier}`,
+ );
+ }
+
+ return [
+ viewFieldName,
+ {
+ universalIdentifier: getSystemViewFieldUniversalIdentifier({
+ fieldMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier,
+ fieldMetadataUniversalIdentifier: field.universalIdentifier,
+ }),
+ },
+ ];
+ }),
+ ) as Record<TViewFieldName, StandardUniversalIdentifierHolder>;
+
+ const viewFieldGroups = Object.fromEntries(
+ (
+ Object.entries(viewFieldGroupNames) as [TViewFieldGroupName, string][]
+ ).map(([viewFieldGroupKey, viewFieldGroupName]) => [
+ viewFieldGroupKey,
+ {
+ universalIdentifier: getSystemViewFieldGroupUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ viewUniversalIdentifier,
+ name: viewFieldGroupName,
+ }),
+ },
+ ]),
+ ) as Record<TViewFieldGroupName, StandardUniversalIdentifierHolder>;
+
+ return {
+ universalIdentifier: viewUniversalIdentifier,
+ viewFields,
+ viewFieldGroups,
+ };
+};
diff --git a/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-layout.util.ts b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-layout.util.ts
new file mode 100644
index 00000000000..31e5e679907
--- /dev/null
+++ b/packages/twenty-shared/src/metadata/utils/internal/build-standard-object-record-page-layout.util.ts
@@ -0,0 +1,84 @@
+import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from '@/application/constants/TwentyStandardApplicationUniversalIdentifier';
+import { getSystemPageLayoutTabUniversalIdentifier } from '@/application/deterministic-identifier/get-system-page-layout-tab-universal-identifier.util';
+import { getSystemRecordPageLayoutUniversalIdentifier } from '@/application/deterministic-identifier/get-system-record-page-layout-universal-identifier.util';
+import { getSystemPageLayoutWidgetUniversalIdentifier } from '@/application/deterministic-identifier/get-system-page-layout-widget-universal-identifier.util';
+
+type RecordPageLayoutTabsSpec = Record<
+ string,
+ { title: string; widgets: Record<string, string> }
+>;
+
+export const buildStandardObjectRecordPageLayout = <
+ const TTabs extends RecordPageLayoutTabsSpec,
+>({
+ objectUniversalIdentifier,
+ tabs,
+}: {
+ objectUniversalIdentifier: string;
+ tabs: TTabs;
+}): {
+ universalIdentifier: string;
+ tabs: {
+ [TTabKey in keyof TTabs]: {
+ universalIdentifier: string;
+ widgets: {
+ [TWidgetKey in keyof TTabs[TTabKey]['widgets']]: {
+ universalIdentifier: string;
+ };
+ };
+ };
+ };
+} => {
+ const pageLayoutUniversalIdentifier =
+ getSystemRecordPageLayoutUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ objectUniversalIdentifier,
+ });
+
+ const derivedTabs = Object.fromEntries(
+ Object.entries(tabs).map(([tabKey, { title, widgets }]) => {
+ const tabUniversalIdentifier = getSystemPageLayoutTabUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ pageLayoutUniversalIdentifier,
+ title,
+ });
+
+ return [
+ tabKey,
+ {
+ universalIdentifier: tabUniversalIdentifier,
+ widgets: Object.fromEntries(
+ Object.entries(widgets).map(([widgetKey, widgetTitle]) => [
+ widgetKey,
+ {
+ universalIdentifier:
+ getSystemPageLayoutWidgetUniversalIdentifier({
+ objectMetadataApplicationUniversalIdentifier:
+ TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+ pageLayoutTabUniversalIdentifier: tabUniversalIdentifier,
+ title: widgetTitle,
+ }),
+ },
+ ]),
+ ),
+ },
+ ];
+ }),
+ ) as {
+ [TTabKey in keyof TTabs]: {
+ universalIdentifier: string;
+ widgets: {
+ [TWidgetKey in keyof TTabs[TTabKey]['widgets']]: {
+ universalIdentifier: string;
+ };
+ };
+ };
+ };
+
+ return {
+ universalIdentifier: pageLayoutUniversalIdentifier,
+ tabs: derivedTabs,
+ };
+};