Skip to content

The open alternative to Salesforce, designed for AI.

Remove legacy grid position from page layout widgets (#24876)

Corentin Deniaud942d1ceb44a1
diff --git a/packages/create-twenty-app/src/constants/template/src/page-layouts/main-page.page-layout.ts b/packages/create-twenty-app/src/constants/template/src/page-layouts/main-page.page-layout.ts
index 2301f49c8ad..67c4b98cf4d 100644
--- a/packages/create-twenty-app/src/constants/template/src/page-layouts/main-page.page-layout.ts
+++ b/packages/create-twenty-app/src/constants/template/src/page-layouts/main-page.page-layout.ts
@@ -24,7 +24,10 @@ export default definePageLayout({
universalIdentifier: MAIN_PAGE_WIDGET_UNIVERSAL_IDENTIFIER,
title: ' ',
type: 'FRONT_COMPONENT',
- gridPosition: { row: 0, column: 0, rowSpan: 12, columnSpan: 12 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
+ index: 0,
+ },
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier:
diff --git a/packages/twenty-apps/examples/document-generator/src/page-layouts/template-record.page-layout.ts b/packages/twenty-apps/examples/document-generator/src/page-layouts/template-record.page-layout.ts
index 8b95286f8a6..b2fdc2f16e2 100644
--- a/packages/twenty-apps/examples/document-generator/src/page-layouts/template-record.page-layout.ts
+++ b/packages/twenty-apps/examples/document-generator/src/page-layouts/template-record.page-layout.ts
@@ -46,7 +46,13 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 12, columnSpan: 12 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 12,
+ columnSpan: 12,
+ },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-apps/internal/real-estate/src/page-layouts/agency-dashboard.page-layout.ts b/packages/twenty-apps/internal/real-estate/src/page-layouts/agency-dashboard.page-layout.ts
index aff313068f4..753622accf9 100644
--- a/packages/twenty-apps/internal/real-estate/src/page-layouts/agency-dashboard.page-layout.ts
+++ b/packages/twenty-apps/internal/real-estate/src/page-layouts/agency-dashboard.page-layout.ts
@@ -53,7 +53,13 @@ export default definePageLayout({
title: 'Portfolio value',
type: 'GRAPH',
objectUniversalIdentifier: PROPERTY_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 3 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 3,
+ },
configuration: {
configurationType: 'AGGREGATE_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -69,7 +75,13 @@ export default definePageLayout({
title: 'Pipeline value',
type: 'GRAPH',
objectUniversalIdentifier: opportunityObjectId,
- gridPosition: { row: 0, column: 3, rowSpan: 2, columnSpan: 3 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 3,
+ rowSpan: 2,
+ columnSpan: 3,
+ },
configuration: {
configurationType: 'AGGREGATE_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -85,7 +97,13 @@ export default definePageLayout({
title: 'Properties sold',
type: 'GRAPH',
objectUniversalIdentifier: PROPERTY_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 0, column: 6, rowSpan: 2, columnSpan: 3 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 6,
+ rowSpan: 2,
+ columnSpan: 3,
+ },
configuration: {
configurationType: 'AGGREGATE_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -111,7 +129,13 @@ export default definePageLayout({
title: 'Showings',
type: 'GRAPH',
objectUniversalIdentifier: SHOWING_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 0, column: 9, rowSpan: 2, columnSpan: 3 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 9,
+ rowSpan: 2,
+ columnSpan: 3,
+ },
configuration: {
configurationType: 'AGGREGATE_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -127,7 +151,13 @@ export default definePageLayout({
title: 'Properties by status',
type: 'GRAPH',
objectUniversalIdentifier: PROPERTY_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 2, column: 0, rowSpan: 5, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 0,
+ rowSpan: 5,
+ columnSpan: 6,
+ },
configuration: {
configurationType: 'PIE_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -145,7 +175,13 @@ export default definePageLayout({
title: 'Pipeline by stage',
type: 'GRAPH',
objectUniversalIdentifier: opportunityObjectId,
- gridPosition: { row: 2, column: 6, rowSpan: 5, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 6,
+ rowSpan: 5,
+ columnSpan: 6,
+ },
configuration: {
configurationType: 'BAR_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -161,7 +197,13 @@ export default definePageLayout({
title: 'Listings by agent',
type: 'GRAPH',
objectUniversalIdentifier: PROPERTY_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 7, column: 0, rowSpan: 5, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 7,
+ column: 0,
+ rowSpan: 5,
+ columnSpan: 6,
+ },
configuration: {
configurationType: 'BAR_CHART',
aggregateFieldMetadataUniversalIdentifier:
@@ -178,7 +220,13 @@ export default definePageLayout({
title: 'Showings by agent',
type: 'GRAPH',
objectUniversalIdentifier: SHOWING_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 7, column: 6, rowSpan: 5, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 7,
+ column: 6,
+ rowSpan: 5,
+ columnSpan: 6,
+ },
configuration: {
configurationType: 'BAR_CHART',
aggregateFieldMetadataUniversalIdentifier:
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-case-studies.page-layout.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-case-studies.page-layout.ts
index 09fd4f97afb..e5b6e1076c8 100644
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-case-studies.page-layout.ts
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-case-studies.page-layout.ts
@@ -1,4 +1,4 @@
-import { PageLayoutTabLayoutMode, definePageLayout } from 'twenty-sdk/define';
+import { definePageLayout, PageLayoutTabLayoutMode } from 'twenty-sdk/define';
import {
MY_CASE_STUDIES_FRONT_COMPONENT_ID,
@@ -23,10 +23,11 @@ export default definePageLayout({
universalIdentifier: MY_CASE_STUDIES_PAGE_WIDGET_ID,
title: 'My Case Studies',
type: 'FRONT_COMPONENT',
- gridPosition: { row: 0, column: 0, rowSpan: 14, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.CANVAS },
configuration: {
configurationType: 'FRONT_COMPONENT',
- frontComponentUniversalIdentifier: MY_CASE_STUDIES_FRONT_COMPONENT_ID,
+ frontComponentUniversalIdentifier:
+ MY_CASE_STUDIES_FRONT_COMPONENT_ID,
},
},
],
diff --git a/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-profile.page-layout.ts b/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-profile.page-layout.ts
index a4cd57236fc..bbe3be3e074 100644
--- a/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-profile.page-layout.ts
+++ b/packages/twenty-apps/internal/twenty-partners/src/modules/partner/self-service/page-layouts/my-profile.page-layout.ts
@@ -1,4 +1,4 @@
-import { PageLayoutTabLayoutMode, definePageLayout } from 'twenty-sdk/define';
+import { definePageLayout, PageLayoutTabLayoutMode } from 'twenty-sdk/define';
import {
MY_PROFILE_FRONT_COMPONENT_ID,
@@ -23,7 +23,7 @@ export default definePageLayout({
universalIdentifier: MY_PROFILE_PAGE_WIDGET_ID,
title: 'My Profile',
type: 'FRONT_COMPONENT',
- gridPosition: { row: 0, column: 0, rowSpan: 14, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.CANVAS },
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier: MY_PROFILE_FRONT_COMPONENT_ID,
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index c8e29deade6..00ec298ba7c 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -957,7 +957,7 @@ type PageLayoutWidget {
title: String!
type: WidgetType!
objectMetadataId: UUID
- gridPosition: GridPosition! @deprecated(reason: "Use `position` instead. Will be removed in a future release.")
+ gridPosition: GridPosition @deprecated(reason: "Use `position` instead.")
position: PageLayoutWidgetPosition
configuration: WidgetConfiguration!
conditionalDisplay: JSON
@@ -4333,26 +4333,17 @@ input UpdatePageLayoutWidgetWithIdInput {
title: String!
type: WidgetType!
objectMetadataId: UUID
- gridPosition: GridPositionInput!
position: JSON
configuration: JSON
conditionalDisplay: JSON
conditionalAvailabilityExpression: String
}
-input GridPositionInput {
- row: Float!
- column: Float!
- rowSpan: Float!
- columnSpan: Float!
-}
-
input CreatePageLayoutWidgetInput {
pageLayoutTabId: UUID!
title: String!
type: WidgetType!
objectMetadataId: UUID
- gridPosition: GridPositionInput!
position: JSON
configuration: JSON!
}
@@ -4362,7 +4353,6 @@ input UpdatePageLayoutWidgetInput {
title: String
type: WidgetType
objectMetadataId: UUID
- gridPosition: GridPositionInput
position: JSON
configuration: JSON
conditionalDisplay: JSON
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 5f48ebde79c..5dd630829ce 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -696,8 +696,8 @@ export interface PageLayoutWidget {
title: Scalars['String']
type: WidgetType
objectMetadataId?: Scalars['UUID']
- /** @deprecated Use `position` instead. Will be removed in a future release. */
- gridPosition: GridPosition
+ /** @deprecated Use `position` instead. */
+ gridPosition?: GridPosition
position?: PageLayoutWidgetPosition
configuration: WidgetConfiguration
conditionalDisplay?: Scalars['JSON']
@@ -4065,7 +4065,7 @@ export interface PageLayoutWidgetGenqlSelection{
title?: boolean | number
type?: boolean | number
objectMetadataId?: boolean | number
- /** @deprecated Use `position` instead. Will be removed in a future release. */
+ /** @deprecated Use `position` instead. */
gridPosition?: GridPositionGenqlSelection
position?: PageLayoutWidgetPositionGenqlSelection
configuration?: WidgetConfigurationGenqlSelection
@@ -7061,13 +7061,11 @@ export interface UpdatePageLayoutWithTabsInput {name: Scalars['String'],type: Pa
export interface UpdatePageLayoutTabWithWidgetsInput {id: Scalars['UUID'],title: Scalars['String'],position: Scalars['Float'],icon?: (Scalars['String'] | null),layoutMode?: (PageLayoutTabLayoutMode | null),widgets: UpdatePageLayoutWidgetWithIdInput[]}
-export interface UpdatePageLayoutWidgetWithIdInput {id: Scalars['UUID'],pageLayoutTabId: Scalars['UUID'],title: Scalars['String'],type: WidgetType,objectMetadataId?: (Scalars['UUID'] | null),gridPosition: GridPositionInput,position?: (Scalars['JSON'] | null),configuration?: (Scalars['JSON'] | null),conditionalDisplay?: (Scalars['JSON'] | null),conditionalAvailabilityExpression?: (Scalars['String'] | null)}
+export interface UpdatePageLayoutWidgetWithIdInput {id: Scalars['UUID'],pageLayoutTabId: Scalars['UUID'],title: Scalars['String'],type: WidgetType,objectMetadataId?: (Scalars['UUID'] | null),position?: (Scalars['JSON'] | null),configuration?: (Scalars['JSON'] | null),conditionalDisplay?: (Scalars['JSON'] | null),conditionalAvailabilityExpression?: (Scalars['String'] | null)}
-export interface GridPositionInput {row: Scalars['Float'],column: Scalars['Float'],rowSpan: Scalars['Float'],columnSpan: Scalars['Float']}
+export interface CreatePageLayoutWidgetInput {pageLayoutTabId: Scalars['UUID'],title: Scalars['String'],type: WidgetType,objectMetadataId?: (Scalars['UUID'] | null),position?: (Scalars['JSON'] | null),configuration: Scalars['JSON']}
-export interface CreatePageLayoutWidgetInput {pageLayoutTabId: Scalars['UUID'],title: Scalars['String'],type: WidgetType,objectMetadataId?: (Scalars['UUID'] | null),gridPosition: GridPositionInput,position?: (Scalars['JSON'] | null),configuration: Scalars['JSON']}
-
-export interface UpdatePageLayoutWidgetInput {pageLayoutTabId?: (Scalars['UUID'] | null),title?: (Scalars['String'] | null),type?: (WidgetType | null),objectMetadataId?: (Scalars['UUID'] | null),gridPosition?: (GridPositionInput | null),position?: (Scalars['JSON'] | null),configuration?: (Scalars['JSON'] | null),conditionalDisplay?: (Scalars['JSON'] | null),conditionalAvailabilityExpression?: (Scalars['String'] | null)}
+export interface UpdatePageLayoutWidgetInput {pageLayoutTabId?: (Scalars['UUID'] | null),title?: (Scalars['String'] | null),type?: (WidgetType | null),objectMetadataId?: (Scalars['UUID'] | null),position?: (Scalars['JSON'] | null),configuration?: (Scalars['JSON'] | null),conditionalDisplay?: (Scalars['JSON'] | null),conditionalAvailabilityExpression?: (Scalars['String'] | null)}
export interface CreateAgentInput {name?: (Scalars['String'] | null),label: Scalars['String'],icon?: (Scalars['String'] | null),description?: (Scalars['String'] | null),prompt: Scalars['String'],modelId: Scalars['String'],roleId?: (Scalars['UUID'] | null),responseFormat?: (Scalars['JSON'] | null),modelConfiguration?: (Scalars['JSON'] | null),evaluationInputs?: (Scalars['String'][] | null)}
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 073621ae2be..22628b76986 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -93,8 +93,8 @@ export default {
371,
385,
398,
- 512,
- 536
+ 511,
+ 535
],
"types": {
"BillingProductDTO": {
@@ -8546,7 +8546,7 @@ export default {
78,
{
"input": [
- 447,
+ 446,
"CreatePageLayoutWidgetInput!"
]
}
@@ -8559,7 +8559,7 @@ export default {
"String!"
],
"input": [
- 448,
+ 447,
"UpdatePageLayoutWidgetInput!"
]
}
@@ -8577,7 +8577,7 @@ export default {
10,
{
"input": [
- 449,
+ 448,
"CreateAgentInput!"
]
}
@@ -8586,7 +8586,7 @@ export default {
10,
{
"input": [
- 450,
+ 449,
"UpdateAgentInput!"
]
}
@@ -8604,7 +8604,7 @@ export default {
23,
{
"input": [
- 451,
+ 450,
"CreateOneObjectInput!"
]
}
@@ -8613,7 +8613,7 @@ export default {
23,
{
"input": [
- 453,
+ 452,
"DeleteOneObjectInput!"
]
}
@@ -8622,7 +8622,7 @@ export default {
23,
{
"input": [
- 454,
+ 453,
"UpdateOneObjectInput!"
]
}
@@ -8631,7 +8631,7 @@ export default {
240,
{
"input": [
- 457,
+ 456,
"CreateOneIndexInput!"
]
}
@@ -8640,7 +8640,7 @@ export default {
240,
{
"input": [
- 460,
+ 459,
"DeleteOneIndexInput!"
]
}
@@ -8658,7 +8658,7 @@ export default {
21,
{
"input": [
- 461,
+ 460,
"CreateLogicFunctionFromSourceInput!"
]
}
@@ -8667,7 +8667,7 @@ export default {
142,
{
"input": [
- 462,
+ 461,
"ExecuteOneLogicFunctionInput!"
]
}
@@ -8676,7 +8676,7 @@ export default {
8,
{
"input": [
- 463,
+ 462,
"UpdateLogicFunctionFromSourceInput!"
]
}
@@ -8685,7 +8685,7 @@ export default {
14,
{
"input": [
- 465,
+ 464,
"CreateCommandMenuItemInput!"
]
}
@@ -8694,7 +8694,7 @@ export default {
14,
{
"input": [
- 466,
+ 465,
"UpdateCommandMenuItemInput!"
]
}
@@ -8721,7 +8721,7 @@ export default {
13,
{
"input": [
- 467,
+ 466,
"CreateFrontComponentInput!"
]
}
@@ -8730,7 +8730,7 @@ export default {
13,
{
"input": [
- 468,
+ 467,
"UpdateFrontComponentInput!"
]
}
@@ -8748,7 +8748,7 @@ export default {
67,
{
"data": [
- 470,
+ 469,
"ActivateWorkspaceInput!"
]
}
@@ -8757,7 +8757,7 @@ export default {
67,
{
"data": [
- 471,
+ 470,
"UpdateWorkspaceInput!"
]
}
@@ -8788,7 +8788,7 @@ export default {
209,
{
"input": [
- 472,
+ 471,
"CreateApplicationRegistrationInput!"
]
}
@@ -8797,7 +8797,7 @@ export default {
73,
{
"input": [
- 473,
+ 472,
"UpdateApplicationRegistrationInput!"
]
}
@@ -8824,7 +8824,7 @@ export default {
182,
{
"input": [
- 475,
+ 474,
"CreateApplicationRegistrationVariableInput!"
]
}
@@ -8833,7 +8833,7 @@ export default {
182,
{
"input": [
- 476,
+ 475,
"UpdateApplicationRegistrationVariableInput!"
]
}
@@ -8913,7 +8913,7 @@ export default {
"UUID!"
],
"input": [
- 478,
+ 477,
"UpdateApplicationInput!"
]
}
@@ -8934,7 +8934,7 @@ export default {
232,
{
"input": [
- 479,
+ 478,
"CreateOneFieldMetadataInput!"
]
}
@@ -8943,7 +8943,7 @@ export default {
232,
{
"input": [
- 481,
+ 480,
"UpdateOneFieldMetadataInput!"
]
}
@@ -8952,7 +8952,7 @@ export default {
232,
{
"input": [
- 483,
+ 482,
"DeleteOneFieldInput!"
]
}
@@ -8961,7 +8961,7 @@ export default {
57,
{
"input": [
- 484,
+ 483,
"CreateViewGroupInput!"
]
}
@@ -8970,7 +8970,7 @@ export default {
57,
{
"inputs": [
- 484,
+ 483,
"[CreateViewGroupInput!]!"
]
}
@@ -8979,7 +8979,7 @@ export default {
57,
{
"input": [
- 485,
+ 484,
"UpdateViewGroupInput!"
]
}
@@ -8988,7 +8988,7 @@ export default {
57,
{
"inputs": [
- 485,
+ 484,
"[UpdateViewGroupInput!]!"
]
}
@@ -8997,7 +8997,7 @@ export default {
57,
{
"input": [
- 487,
+ 486,
"DeleteViewGroupInput!"
]
}
@@ -9006,7 +9006,7 @@ export default {
57,
{
"input": [
- 488,
+ 487,
"DestroyViewGroupInput!"
]
}
@@ -9028,7 +9028,7 @@ export default {
46,
{
"createRoleInput": [
- 489,
+ 488,
"CreateRoleInput!"
]
}
@@ -9037,7 +9037,7 @@ export default {
46,
{
"updateRoleInput": [
- 490,
+ 489,
"UpdateRoleInput!"
]
}
@@ -9055,7 +9055,7 @@ export default {
43,
{
"upsertObjectPermissionsInput": [
- 492,
+ 491,
"UpsertObjectPermissionsInput!"
]
}
@@ -9064,7 +9064,7 @@ export default {
44,
{
"upsertPermissionFlagsInput": [
- 494,
+ 493,
"UpsertPermissionFlagsInput!"
]
}
@@ -9073,7 +9073,7 @@ export default {
38,
{
"upsertFieldPermissionsInput": [
- 495,
+ 494,
"UpsertFieldPermissionsInput!"
]
}
@@ -9082,7 +9082,7 @@ export default {
253,
{
"input": [
- 497,
+ 496,
"UpsertRowLevelPermissionPredicatesInput!"
]
}
@@ -9113,7 +9113,7 @@ export default {
305,
{
"input": [
- 500,
+ 499,
"SendEmailViaDomainInput!"
]
}
@@ -9122,7 +9122,7 @@ export default {
307,
{
"input": [
- 501,
+ 500,
"SendMessageCampaignInput!"
]
}
@@ -9131,7 +9131,7 @@ export default {
305,
{
"input": [
- 502,
+ 501,
"SendMessageCampaignTestInput!"
]
}
@@ -9140,7 +9140,7 @@ export default {
312,
{
"input": [
- 503,
+ 502,
"CreateUnsubscribeTopicInput!"
]
}
@@ -9149,7 +9149,7 @@ export default {
312,
{
"input": [
- 504,
+ 503,
"UpdateUnsubscribeTopicInput!"
]
}
@@ -9167,7 +9167,7 @@ export default {
295,
{
"input": [
- 505,
+ 504,
"UpdateMessageChannelInput!"
]
}
@@ -9176,7 +9176,7 @@ export default {
303,
{
"input": [
- 507,
+ 506,
"CreateEmailGroupChannelInput!"
]
}
@@ -9185,7 +9185,7 @@ export default {
295,
{
"input": [
- 508,
+ 507,
"UpdateEmailGroupChannelInput!"
]
}
@@ -9203,7 +9203,7 @@ export default {
293,
{
"input": [
- 509,
+ 508,
"CreateEmailingDomainInput!"
]
}
@@ -9230,7 +9230,7 @@ export default {
324,
{
"input": [
- 510,
+ 509,
"RunAgentInput!"
]
}
@@ -9239,7 +9239,7 @@ export default {
321,
{
"input": [
- 513,
+ 512,
"CreateWebhookInput!"
]
}
@@ -9248,7 +9248,7 @@ export default {
321,
{
"input": [
- 514,
+ 513,
"UpdateWebhookInput!"
]
}
@@ -9266,7 +9266,7 @@ export default {
363,
{
"input": [
- 516,
+ 515,
"UpdateMessageFolderInput!"
]
}
@@ -9275,7 +9275,7 @@ export default {
363,
{
"input": [
- 518,
+ 517,
"UpdateMessageFoldersInput!"
]
}
@@ -9284,7 +9284,7 @@ export default {
358,
{
"input": [
- 519,
+ 518,
"UpdateCalendarChannelInput!"
]
}
@@ -9293,7 +9293,7 @@ export default {
356,
{
"input": [
- 521,
+ 520,
"SetAppKeyValueInput!"
]
}
@@ -9314,7 +9314,7 @@ export default {
354,
{
"input": [
- 522,
+ 521,
"EnqueueJobInput!"
]
}
@@ -9323,7 +9323,7 @@ export default {
355,
{
"input": [
- 523,
+ 522,
"EnqueueJobsInput!"
]
}
@@ -9353,7 +9353,7 @@ export default {
1
],
"fileAttachments": [
- 524,
+ 523,
"[FileAttachmentInput!]"
]
}
@@ -9382,14 +9382,14 @@ export default {
"UUID!"
],
"answers": [
- 525,
+ 524,
"[AgentChatQuestionAnswerInput!]!"
],
"modelId": [
1
],
"fileAttachments": [
- 524,
+ 523,
"[FileAttachmentInput!]"
]
}
@@ -9467,7 +9467,7 @@ export default {
340,
{
"input": [
- 526,
+ 525,
"CreateSkillInput!"
]
}
@@ -9476,7 +9476,7 @@ export default {
340,
{
"input": [
- 527,
+ 526,
"UpdateSkillInput!"
]
}
@@ -9534,7 +9534,7 @@ export default {
369,
{
"input": [
- 528,
+ 527,
"UpdateTimelineActivityTypeInput!"
]
}
@@ -9552,7 +9552,7 @@ export default {
262,
{
"input": [
- 529,
+ 528,
"GetAuthorizationUrlForSSOInput!"
]
}
@@ -9718,7 +9718,7 @@ export default {
265,
{
"input": [
- 530
+ 529
]
}
],
@@ -9896,7 +9896,7 @@ export default {
8,
{
"input": [
- 531,
+ 530,
"UpdateWorkspaceMemberSettingsInput!"
]
}
@@ -9930,7 +9930,7 @@ export default {
219,
{
"input": [
- 532,
+ 531,
"SetupOIDCSsoInput!"
]
}
@@ -9939,7 +9939,7 @@ export default {
219,
{
"input": [
- 533,
+ 532,
"SetupSAMLSsoInput!"
]
}
@@ -9948,7 +9948,7 @@ export default {
215,
{
"input": [
- 534,
+ 533,
"DeleteSsoInput!"
]
}
@@ -9957,7 +9957,7 @@ export default {
216,
{
"input": [
- 535,
+ 534,
"EditSsoInput!"
]
}
@@ -9986,7 +9986,7 @@ export default {
336,
{
"type": [
- 536,
+ 535,
"AnalyticsType!"
],
"name": [
@@ -10029,7 +10029,7 @@ export default {
326,
{
"input": [
- 537,
+ 536,
"CreateCalendarEventInput!"
]
}
@@ -10038,7 +10038,7 @@ export default {
335,
{
"input": [
- 538,
+ 537,
"SendEmailInput!"
]
}
@@ -10060,7 +10060,7 @@ export default {
"String!"
],
"connectionParameters": [
- 540,
+ 539,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -10072,7 +10072,7 @@ export default {
179,
{
"input": [
- 542,
+ 541,
"UpdateLabPublicFeatureFlagInput!"
]
}
@@ -10162,7 +10162,7 @@ export default {
"String!"
],
"files": [
- 543,
+ 542,
"[ApplicationFileUploadRequestInput!]!"
]
}
@@ -11170,9 +11170,6 @@ export default {
"objectMetadataId": [
3
],
- "gridPosition": [
- 446
- ],
"position": [
9
],
@@ -11189,23 +11186,6 @@ export default {
1
]
},
- "GridPositionInput": {
- "row": [
- 15
- ],
- "column": [
- 15
- ],
- "rowSpan": [
- 15
- ],
- "columnSpan": [
- 15
- ],
- "__typename": [
- 1
- ]
- },
"CreatePageLayoutWidgetInput": {
"pageLayoutTabId": [
3
@@ -11219,9 +11199,6 @@ export default {
"objectMetadataId": [
3
],
- "gridPosition": [
- 446
- ],
"position": [
9
],
@@ -11245,9 +11222,6 @@ export default {
"objectMetadataId": [
3
],
- "gridPosition": [
- 446
- ],
"position": [
9
],
@@ -11339,7 +11313,7 @@ export default {
},
"CreateOneObjectInput": {
"object": [
- 452
+ 451
],
"__typename": [
1
@@ -11399,7 +11373,7 @@ export default {
},
"UpdateOneObjectInput": {
"update": [
- 455
+ 454
],
"id": [
3
@@ -11452,7 +11426,7 @@ export default {
24
],
"translations": [
- 456
+ 455
],
"__typename": [
1
@@ -11474,7 +11448,7 @@ export default {
},
"CreateOneIndexInput": {
"index": [
- 458
+ 457
],
"__typename": [
1
@@ -11485,7 +11459,7 @@ export default {
3
],
"fields": [
- 459
+ 458
],
"indexType": [
241
@@ -11570,7 +11544,7 @@ export default {
3
],
"update": [
- 464
+ 463
],
"__typename": [
1
@@ -11730,7 +11704,7 @@ export default {
3
],
"update": [
- 469
+ 468
],
"__typename": [
1
@@ -11857,7 +11831,7 @@ export default {
1
],
"update": [
- 474
+ 473
],
"__typename": [
1
@@ -11911,7 +11885,7 @@ export default {
1
],
"update": [
- 477
+ 476
],
"__typename": [
1
@@ -11941,7 +11915,7 @@ export default {
},
"CreateOneFieldMetadataInput": {
"field": [
- 480
+ 479
],
"__typename": [
1
@@ -12014,7 +11988,7 @@ export default {
3
],
"update": [
- 482
+ 481
],
"__typename": [
1
@@ -12073,7 +12047,7 @@ export default {
9
],
"translations": [
- 456
+ 455
],
"__typename": [
1
@@ -12112,7 +12086,7 @@ export default {
3
],
"update": [
- 486
+ 485
],
"__typename": [
1
@@ -12197,7 +12171,7 @@ export default {
},
"UpdateRoleInput": {
"update": [
- 491
+ 490
],
"id": [
3
@@ -12252,7 +12226,7 @@ export default {
3
],
"objectPermissions": [
- 493
+ 492
],
"__typename": [
1
@@ -12294,7 +12268,7 @@ export default {
3
],
"fieldPermissions": [
- 496
+ 495
],
"__typename": [
1
@@ -12325,10 +12299,10 @@ export default {
3
],
"predicates": [
- 498
+ 497
],
"predicateGroups": [
- 499
+ 498
],
"__typename": [
1
@@ -12482,7 +12456,7 @@ export default {
3
],
"update": [
- 506
+ 505
],
"__typename": [
1
@@ -12555,7 +12529,7 @@ export default {
3
],
"messages": [
- 511
+ 510
],
"__typename": [
1
@@ -12563,7 +12537,7 @@ export default {
},
"RunAgentMessageInput": {
"role": [
- 512
+ 511
],
"content": [
1
@@ -12598,7 +12572,7 @@ export default {
3
],
"update": [
- 515
+ 514
],
"__typename": [
1
@@ -12626,7 +12600,7 @@ export default {
3
],
"update": [
- 517
+ 516
],
"__typename": [
1
@@ -12645,7 +12619,7 @@ export default {
3
],
"update": [
- 517
+ 516
],
"__typename": [
1
@@ -12656,7 +12630,7 @@ export default {
3
],
"update": [
- 520
+ 519
],
"__typename": [
1
@@ -12815,7 +12789,7 @@ export default {
8
],
"translations": [
- 456
+ 455
],
"__typename": [
1
@@ -12981,7 +12955,7 @@ export default {
1
],
"files": [
- 539
+ 538
],
"__typename": [
1
@@ -13003,13 +12977,13 @@ export default {
1
],
"IMAP": [
- 541
+ 540
],
"SMTP": [
- 541
+ 540
],
"CALDAV": [
- 541
+ 540
],
"__typename": [
1
@@ -13074,7 +13048,7 @@ export default {
254,
{
"input": [
- 545,
+ 544,
"LogicFunctionLogsInput!"
]
}
diff --git a/packages/twenty-codex-plugin/references/develop-app/standalone-pages.md b/packages/twenty-codex-plugin/references/develop-app/standalone-pages.md
index 16e8410165b..bb8f69d806e 100644
--- a/packages/twenty-codex-plugin/references/develop-app/standalone-pages.md
+++ b/packages/twenty-codex-plugin/references/develop-app/standalone-pages.md
@@ -113,7 +113,7 @@ export default definePageLayout({
universalIdentifier: '18ce05bb-ee3c-4332-80a7-f8fb84f7f70a',
title: 'Mission Control',
type: 'FRONT_COMPONENT',
- gridPosition: { row: 0, column: 0, rowSpan: 12, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.CANVAS },
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier:
@@ -198,7 +198,7 @@ This section only calls out the fields that matter for standalone pages. Use `la
- Use `type: 'STANDALONE_PAGE'`.
- Do not set `objectUniversalIdentifier`; standalone pages are not record scoped.
- Define at least one tab. Use one tab unless the page needs real top-level modes.
-- Use `PageLayoutTabLayoutMode.CANVAS`; put the `FRONT_COMPONENT` first and keep a 12 x 12 `gridPosition` as fallback/editing intent.
+- Use `PageLayoutTabLayoutMode.CANVAS`; put the `FRONT_COMPONENT` first and set its `position.layoutMode` to `PageLayoutTabLayoutMode.CANVAS`.
- Use a `FRONT_COMPONENT` widget with `configurationType: 'FRONT_COMPONENT'` and `frontComponentUniversalIdentifier`.
`defineFrontComponent` owns the actual page experience:
@@ -368,7 +368,7 @@ For a black screen, check the simplest causes first:
- Token or fetch failure: log the caught error, confirm `CoreApiClient` generation, and show an error state.
- Public asset failure: verify `getPublicAssetUrl(...)` output in the network tab and render without the asset.
- CSS layer covering content: remove absolute overlays, `zIndex`, and full-screen backgrounds until text is visible.
-- Zero-height container: add visible borders and confirm `height: '100%'`, `minHeight: '100%'`, `minHeight: 0`, and the 12 x 12 widget grid position.
+- Zero-height container: add visible borders and confirm `height: '100%'`, `minHeight: '100%'`, `minHeight: 0`, and the widget canvas position.
- Unsupported browser or Remote DOM behavior: remove unusual DOM APIs, portals, global document access, and third-party components until the minimal UI renders.
- Stale deployed app version: confirm the installed app version is the one you just synced or deployed.
diff --git a/packages/twenty-codex-plugin/scripts/validators/cross-doc-contracts.js b/packages/twenty-codex-plugin/scripts/validators/cross-doc-contracts.js
index 0cebd7e96e1..47c540a829d 100644
--- a/packages/twenty-codex-plugin/scripts/validators/cross-doc-contracts.js
+++ b/packages/twenty-codex-plugin/scripts/validators/cross-doc-contracts.js
@@ -106,7 +106,7 @@ const assertFrontComponentGuidance = (fail) => {
"type: 'STANDALONE_PAGE'",
'NavigationMenuItemType.PAGE_LAYOUT',
'PageLayoutTabLayoutMode.CANVAS',
- 'gridPosition: { row: 0, column: 0, rowSpan: 12, columnSpan: 12 }',
+ 'position: { layoutMode: PageLayoutTabLayoutMode.CANVAS }',
'12 x 12 fill pattern',
'Full-Page Layout Guidance',
'black screen',
diff --git a/packages/twenty-docs/developers/extend/apps/layout/page-layouts.mdx b/packages/twenty-docs/developers/extend/apps/layout/page-layouts.mdx
index 8b8c863d7fa..82b437e59b1 100644
--- a/packages/twenty-docs/developers/extend/apps/layout/page-layouts.mdx
+++ b/packages/twenty-docs/developers/extend/apps/layout/page-layouts.mdx
@@ -53,7 +53,8 @@ export default definePageLayout({
- `type` is one of `'RECORD_INDEX'`, `'RECORD_PAGE'`, `'DASHBOARD'` or `'STANDALONE_PAGE'`. Use `'RECORD_PAGE'` to customize the detail view of a specific object.
- `objectUniversalIdentifier` specifies which object this layout applies to.
-- Each `tab` defines a section of the page with a `title`, `position`, and `layoutMode`: `VERTICAL_LIST` for record pages and standalone pages, `GRID` for dashboards, and `CANVAS` for a single widget that should fill the tab viewport. A `VERTICAL_LIST` tab stacks widgets vertically. Built-in widgets that manage their own scrolling, such as timelines, files, notes, tasks, and workflows, fill one viewport; fields, front components, graphs, and other fit-content widgets render at their content or configured height. A `GRID` tab always lays its widgets out as cards on a 12-column grid. A `CANVAS` widget has no explicit position; if a canvas tab contains multiple widgets, they render at their content height instead of filling the viewport.
+- Each `tab` defines a section of the page with a `title`, `position`, and `layoutMode`: `VERTICAL_LIST` for record pages and standalone pages, `GRID` for dashboards, and `CANVAS` for a single widget that should fill the tab viewport. A `VERTICAL_LIST` tab stacks widgets vertically. Built-in widgets that manage their own scrolling, such as timelines, files, notes, tasks, and workflows, fill one viewport; fields, front components, graphs, and other fit-content widgets render at their content or configured height. A `GRID` tab always lays its widgets out as cards on a 12-column grid. A `CANVAS` widget has no coordinates and can omit `position`; Twenty normalizes it to `{ layoutMode: PageLayoutTabLayoutMode.CANVAS }` from the tab layout mode. If a canvas tab contains multiple widgets, they render at their content height instead of filling the viewport.
+- A widget `position` matches its tab layout mode. `VERTICAL_LIST` uses `{ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index }`, `GRID` uses `{ layoutMode: PageLayoutTabLayoutMode.GRID, row, column, rowSpan, columnSpan }`, and `CANVAS` uses `{ layoutMode: PageLayoutTabLayoutMode.CANVAS }` or omits `position`.
- Set `layoutMode` explicitly. Omitting it gives you `VERTICAL_LIST` on a `STANDALONE_PAGE` and `GRID` everywhere else, which is rarely what you want on a record page.
- Each `widget` inside a tab can render a [front component](/developers/extend/apps/layout/front-components), a relation list, or other built-in widget types.
- A `FRONT_COMPONENT` widget can set `headerCommandMenuItemUniversalIdentifiers` to an ordered array of command menu item universal identifiers from the same app. These actions appear as icon buttons in the widget card header and keep their command-level availability and permission checks. Identifiers must be unique and must resolve when the app is installed.
diff --git a/packages/twenty-docs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index f7462a7f457..41ef80fae8f 100644
--- a/packages/twenty-docs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -278,7 +278,7 @@ field via `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/ar/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/ar/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index d9ecf719a6f..df787b1fd56 100644
--- a/packages/twenty-docs/l/ar/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/ar/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -268,7 +268,7 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/cs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/cs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index 64be5d282e5..31f3ad34a16 100644
--- a/packages/twenty-docs/l/cs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/cs/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -276,7 +276,7 @@ pomocí `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/de/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/de/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index 5e5b340e4af..3a7629f43e1 100644
--- a/packages/twenty-docs/l/de/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/de/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -275,7 +275,7 @@ Füge einen Tab mit einem `FIELD` Widget im `EDITOR` Anzeigemodus hinzu und zeig
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/es/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/es/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index f57ce29935b..7e76f850e03 100644
--- a/packages/twenty-docs/l/es/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/es/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -275,7 +275,7 @@ a través de `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/fr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/fr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index cbe713af046..b72b66ef8d5 100644
--- a/packages/twenty-docs/l/fr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/fr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -273,7 +273,7 @@ via `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/it/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/it/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index 76a6cde5836..b4437a0861e 100644
--- a/packages/twenty-docs/l/it/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/it/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -276,7 +276,7 @@ tramite `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/ja/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/ja/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index d7715fef2b6..2437edda4a8 100644
--- a/packages/twenty-docs/l/ja/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/ja/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -268,7 +268,7 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/ko/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/ko/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index 4652103d03f..da1f0bf9a38 100644
--- a/packages/twenty-docs/l/ko/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/ko/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -250,7 +250,7 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/pt/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/pt/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index fabafcbfa7a..ded8fce7daa 100644
--- a/packages/twenty-docs/l/pt/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/pt/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -276,7 +276,7 @@ através de `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/ro/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/ro/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index cceef82b31b..f08ecde9630 100644
--- a/packages/twenty-docs/l/ro/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/ro/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -275,7 +275,7 @@ prin `fieldMetadataId`:
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/ru/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/ru/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index f31abdc53cf..98b55f62957 100644
--- a/packages/twenty-docs/l/ru/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/ru/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -278,7 +278,7 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/tr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/tr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index b8567ce9906..936c5fa8478 100644
--- a/packages/twenty-docs/l/tr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/tr/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -254,7 +254,7 @@ Herhangi bir belgeyi açın — **Preview** sekmesi, belgeyi paylaşılabilir we
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-docs/l/zh/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx b/packages/twenty-docs/l/zh/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
index c048ef4b817..8890014f6c8 100644
--- a/packages/twenty-docs/l/zh/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
+++ b/packages/twenty-docs/l/zh/developers/extend/apps/tutorials/document-generator/building-the-ui.mdx
@@ -264,7 +264,7 @@ export default definePageLayout({
universalIdentifier: TEMPLATE_PAGE_LAYOUT_WIDGET_UNIVERSAL_IDENTIFIER,
title: 'Template',
type: 'FIELD',
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
+ position: { layoutMode: PageLayoutTabLayoutMode.GRID, row: 0, column: 0, rowSpan: 6, columnSpan: 12 },
configuration: {
configurationType: 'FIELD',
fieldMetadataId: TEMPLATE_BODY_FIELD_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index d6c72844ddb..bcd2ea8346f 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1335,7 +1335,6 @@ export type CreatePageLayoutTabInput = {
export type CreatePageLayoutWidgetInput = {
configuration: Scalars['JSON']['input'];
- gridPosition: GridPositionInput;
objectMetadataId?: InputMaybe<Scalars['UUID']['input']>;
pageLayoutTabId: Scalars['UUID']['input'];
position?: InputMaybe<Scalars['JSON']['input']>;
@@ -2147,13 +2146,6 @@ export type GridPosition = {
rowSpan: Scalars['Float']['output'];
};
-export type GridPositionInput = {
- column: Scalars['Float']['input'];
- columnSpan: Scalars['Float']['input'];
- row: Scalars['Float']['input'];
- rowSpan: Scalars['Float']['input'];
-};
-
export enum IdentityProviderType {
OIDC = 'OIDC',
SAML = 'SAML'
@@ -4494,8 +4486,8 @@ export type PageLayoutWidget = {
configuration: WidgetConfiguration;
createdAt: Scalars['DateTime']['output'];
deletedAt?: Maybe<Scalars['DateTime']['output']>;
- /** @deprecated Use `position` instead. Will be removed in a future release. */
- gridPosition: GridPosition;
+ /** @deprecated Use `position` instead. */
+ gridPosition?: Maybe<GridPosition>;
id: Scalars['UUID']['output'];
isActive: Scalars['Boolean']['output'];
/** @deprecated isOverridden is deprecated */
@@ -6029,7 +6021,6 @@ export type UpdatePageLayoutWidgetInput = {
conditionalAvailabilityExpression?: InputMaybe<Scalars['String']['input']>;
conditionalDisplay?: InputMaybe<Scalars['JSON']['input']>;
configuration?: InputMaybe<Scalars['JSON']['input']>;
- gridPosition?: InputMaybe<GridPositionInput>;
objectMetadataId?: InputMaybe<Scalars['UUID']['input']>;
pageLayoutTabId?: InputMaybe<Scalars['UUID']['input']>;
position?: InputMaybe<Scalars['JSON']['input']>;
@@ -6041,7 +6032,6 @@ export type UpdatePageLayoutWidgetWithIdInput = {
conditionalAvailabilityExpression?: InputMaybe<Scalars['String']['input']>;
conditionalDisplay?: InputMaybe<Scalars['JSON']['input']>;
configuration?: InputMaybe<Scalars['JSON']['input']>;
- gridPosition: GridPositionInput;
id: Scalars['UUID']['input'];
objectMetadataId?: InputMaybe<Scalars['UUID']['input']>;
pageLayoutTabId: Scalars['UUID']['input'];
@@ -7682,7 +7672,7 @@ export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuI
| { __typename?: 'PathCommandMenuItemPayload', path: string }
| null }> };
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7715,7 +7705,7 @@ export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string
| { __typename?: 'WorkflowVersionConfiguration', configurationType: WidgetConfigurationType }
}> | null }> | null };
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -7760,7 +7750,7 @@ export type FindOnePageLayoutQueryVariables = Exact<{
}>;
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8149,7 +8139,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, 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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8187,7 +8177,7 @@ export type ResetPageLayoutTabToDefaultMutationVariables = Exact<{
}>;
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8225,7 +8215,7 @@ export type ResetPageLayoutToDefaultMutationVariables = Exact<{
}>;
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8263,7 +8253,7 @@ export type ResetPageLayoutWidgetToDefaultMutationVariables = Exact<{
}>;
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8302,7 +8292,7 @@ export type UpdatePageLayoutWithTabsAndWidgetsMutationVariables = Exact<{
}>;
-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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8352,7 +8342,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, 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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
@@ -8388,7 +8378,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, 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?:
+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 } | null, position?:
| { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode }
| { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number }
| { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number }
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 b871473af07..a0f19ae9c7e 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
@@ -17,6 +17,7 @@ import {
BarChartLayout,
FindOnePageLayoutDocument,
GraphOrderBy,
+ PageLayoutTabLayoutMode,
PageLayoutType,
type PageLayoutWidget,
WidgetConfigurationType,
@@ -83,8 +84,9 @@ const mixedGraphsPageLayoutMocks = {
type: WidgetType.GRAPH,
title: 'Revenue',
objectMetadataId: mockPersonObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -111,8 +113,9 @@ const mixedGraphsPageLayoutMocks = {
type: WidgetType.GRAPH,
title: 'Revenue Sources',
objectMetadataId: mockPersonObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 6,
rowSpan: 4,
@@ -141,8 +144,9 @@ const mixedGraphsPageLayoutMocks = {
type: WidgetType.GRAPH,
title: 'Quarterly Comparison',
objectMetadataId: mockPersonObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 2,
column: 0,
rowSpan: 4,
diff --git a/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutContent.test.tsx b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutContent.test.tsx
index 783d066c3d3..0dd7afbbced 100644
--- a/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutContent.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutContent.test.tsx
@@ -21,8 +21,9 @@ const mockWidget = {
},
createdAt: '2026-08-19T00:00:00.000Z',
deletedAt: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
column: 0,
columnSpan: 1,
row: 0,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDuplicatePageLayoutTab.test.tsx b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDuplicatePageLayoutTab.test.tsx
index 54a77022cf5..6ee38d0ba1a 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDuplicatePageLayoutTab.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/hooks/__tests__/useDuplicatePageLayoutTab.test.tsx
@@ -58,7 +58,6 @@ const makeRecordTableWidget = (): PageLayoutWidget =>
title: 'Companies',
type: WidgetType.RECORD_TABLE,
objectMetadataId: 'object-metadata-id',
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
position: {
__typename: 'PageLayoutWidgetGridPosition',
layoutMode: PageLayoutTabLayoutMode.GRID,
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 fde65f11b8e..665a7c8b801 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
@@ -4,6 +4,7 @@ import {
AggregateOperations,
BarChartLayout,
GraphOrderBy,
+ PageLayoutTabLayoutMode,
PageLayoutType,
WidgetConfigurationType,
WidgetType,
@@ -108,7 +109,14 @@ describe('usePageLayoutDraftState', () => {
title: 'New Widget',
isActive: true,
type: WidgetType.GRAPH,
- gridPosition: { row: 2, column: 2, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 2,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
configuration: {
configurationType: WidgetConfigurationType.BAR_CHART,
layout: BarChartLayout.VERTICAL,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutFrontComponentWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutFrontComponentWidget.ts
index 23d8f6c4628..353e267f108 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutFrontComponentWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutFrontComponentWidget.ts
@@ -16,7 +16,10 @@ import { useStore } from 'jotai';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
-import { WidgetType } from '~/generated-metadata/graphql';
+import {
+ PageLayoutTabLayoutMode,
+ WidgetType,
+} from '~/generated-metadata/graphql';
export const useCreatePageLayoutFrontComponentWidget = ({
pageLayoutId: pageLayoutIdFromProps,
@@ -80,6 +83,7 @@ export const useCreatePageLayoutFrontComponentWidget = ({
title,
frontComponentId,
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: position.y,
column: position.x,
rowSpan: position.h,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutGraphWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutGraphWidget.ts
index 8e0344a9116..3d407bd58a1 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutGraphWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutGraphWidget.ts
@@ -21,6 +21,7 @@ import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
import {
BarChartLayout,
+ PageLayoutTabLayoutMode,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -121,7 +122,8 @@ export const useCreatePageLayoutGraphWidget = ({
id: widgetId,
pageLayoutTabId: activeTabId,
title,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: position.y,
column: position.x,
rowSpan: position.h,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutIframeWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutIframeWidget.ts
index cca0a67c032..9c3415da022 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutIframeWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutIframeWidget.ts
@@ -16,7 +16,10 @@ import { useStore } from 'jotai';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
-import { WidgetType } from '~/generated-metadata/graphql';
+import {
+ PageLayoutTabLayoutMode,
+ WidgetType,
+} from '~/generated-metadata/graphql';
export const useCreatePageLayoutIframeWidget = ({
pageLayoutId: pageLayoutIdFromProps,
@@ -78,6 +81,7 @@ export const useCreatePageLayoutIframeWidget = ({
title,
url,
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: position.y,
column: position.x,
rowSpan: position.h,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutRecordTableWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutRecordTableWidget.ts
index 594186963ad..46a2d07cc4d 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutRecordTableWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutRecordTableWidget.ts
@@ -18,7 +18,10 @@ import { useStore } from 'jotai';
import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
-import { WidgetType } from '~/generated-metadata/graphql';
+import {
+ PageLayoutTabLayoutMode,
+ WidgetType,
+} from '~/generated-metadata/graphql';
export const useCreatePageLayoutRecordTableWidget = (
pageLayoutIdFromProps?: string,
@@ -77,7 +80,8 @@ export const useCreatePageLayoutRecordTableWidget = (
id: widgetId,
pageLayoutTabId: activeTabId,
title: objectMetadata?.labelPlural ?? 'Record Table',
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: position.y,
column: position.x,
rowSpan: position.h,
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutStandaloneRichTextWidget.ts b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutStandaloneRichTextWidget.ts
index 7d3a66bb493..52ad5d7ce18 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutStandaloneRichTextWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useCreatePageLayoutStandaloneRichTextWidget.ts
@@ -15,6 +15,7 @@ import { useCallback } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
import {
+ PageLayoutTabLayoutMode,
type PageLayoutWidget,
type RichTextBody,
WidgetType,
@@ -83,6 +84,7 @@ export const useCreatePageLayoutStandaloneRichTextWidget = ({
body,
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: position.y,
column: position.x,
rowSpan: position.h,
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 dec05215f87..af3e380e9ef 100644
--- a/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts
+++ b/packages/twenty-front/src/modules/page-layout/testing/pageLayoutDraftFixtures.ts
@@ -18,7 +18,6 @@ export const makeWidget = (
title: id,
isActive: true,
type: WidgetType.FIELDS,
- gridPosition: { column: 0, columnSpan: 1, row: 0, rowSpan: 1 },
configuration: { __typename: 'FieldsConfiguration' as const },
position: {
__typename: 'PageLayoutWidgetVerticalListPosition' as const,
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 81ed084353c..b518472d015 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
@@ -3,9 +3,9 @@ import { addWidgetToTab } from '@/page-layout/utils/addWidgetToTab';
import {
AggregateOperations,
PageLayoutTabLayoutMode,
+ type PageLayoutWidget,
WidgetConfigurationType,
WidgetType,
- type PageLayoutWidget,
} from '~/generated-metadata/graphql';
describe('addWidgetToTab', () => {
@@ -25,7 +25,14 @@ describe('addWidgetToTab', () => {
aggregateFieldMetadataId: 'id',
displayDataLabel: false,
},
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: null,
createdAt: '2024-01-01T00:00:00Z',
updatedAt: '2024-01-01T00:00:00Z',
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 ed5969d275d..2c0e37b966f 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
@@ -2,9 +2,9 @@ import {
AggregateOperations,
GraphOrderBy,
PageLayoutTabLayoutMode,
+ type PageLayoutWidget,
WidgetConfigurationType,
WidgetType,
- type PageLayoutWidget,
} from '~/generated-metadata/graphql';
import { convertLayoutsToWidgets } from '@/page-layout/utils/convertLayoutsToWidgets';
@@ -20,7 +20,9 @@ describe('convertLayoutsToWidgets', () => {
title: 'Widget 1',
type: WidgetType.GRAPH,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
@@ -46,7 +48,9 @@ describe('convertLayoutsToWidgets', () => {
title: 'Widget 2',
type: WidgetType.GRAPH,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 2,
rowSpan: 2,
@@ -76,7 +80,9 @@ describe('convertLayoutsToWidgets', () => {
const result = convertLayoutsToWidgets(mockWidgets, layouts);
- expect(result[0].gridPosition).toEqual({
+ expect(result[0].position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
column: 2,
row: 3,
columnSpan: 4,
@@ -90,7 +96,9 @@ describe('convertLayoutsToWidgets', () => {
columnSpan: 4,
rowSpan: 5,
});
- expect(result[1].gridPosition).toEqual({
+ expect(result[1].position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
column: 6,
row: 7,
columnSpan: 8,
@@ -113,7 +121,9 @@ describe('convertLayoutsToWidgets', () => {
const result = convertLayoutsToWidgets(mockWidgets, layouts);
- expect(result[1].gridPosition).toEqual({
+ expect(result[1].position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
column: 0,
row: 0,
columnSpan: 2,
@@ -128,7 +138,9 @@ describe('convertLayoutsToWidgets', () => {
const result = convertLayoutsToWidgets(mockWidgets, layouts);
- expect(result[0].gridPosition).toEqual({
+ expect(result[0].position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
column: 0,
row: 4,
columnSpan: 1,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutDraftToUpdateInput.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutDraftToUpdateInput.test.ts
index 7b3ae3c5f59..409d7a977a7 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutDraftToUpdateInput.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/convertPageLayoutDraftToUpdateInput.test.ts
@@ -1,3 +1,5 @@
+import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
+
import { type DraftPageLayout } from '@/page-layout/types/DraftPageLayout';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { convertPageLayoutDraftToUpdateInput } from '@/page-layout/utils/convertPageLayoutDraftToUpdateInput';
@@ -14,7 +16,14 @@ const makeWidget = (
title: 'Widget',
type: WidgetType.FIELDS,
pageLayoutTabId: 'tab-1',
- gridPosition: { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
configuration: null,
objectMetadataId: null,
...overrides,
@@ -77,16 +86,24 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
expect(result.tabs[0].widgets.map((w) => w.id)).toEqual(['w1', 'w2']);
});
- it('should map gridPosition correctly', () => {
+ it('should map position correctly', () => {
const widget = makeWidget({
id: 'w1',
- gridPosition: { row: 2, column: 3, rowSpan: 4, columnSpan: 5 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 3,
+ rowSpan: 4,
+ columnSpan: 5,
+ },
});
const draft = makeDraft([makeTab('tab-1', [widget])]);
const result = convertPageLayoutDraftToUpdateInput(draft);
- expect(result.tabs[0].widgets[0].gridPosition).toEqual({
+ expect(result.tabs[0].widgets[0].position).toEqual({
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
column: 3,
rowSpan: 4,
@@ -244,7 +261,7 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
});
});
- it('should produce GRID position from gridPosition when tab layoutMode is undefined', () => {
+ it('should fall back to legacy grid coordinates when position is null', () => {
const widget = makeWidget({
id: 'w1',
position: null,
@@ -266,7 +283,14 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
it('should produce GRID position when tab layoutMode is explicitly GRID', () => {
const widget = makeWidget({
id: 'w1',
- gridPosition: { row: 5, column: 6, rowSpan: 7, columnSpan: 8 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 5,
+ column: 6,
+ rowSpan: 7,
+ columnSpan: 8,
+ },
});
const draft = makeDraft([
makeTab('tab-1', [widget], PageLayoutTabLayoutMode.GRID),
@@ -283,14 +307,13 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
});
});
- it('should use tab layoutMode over widget position layoutMode when they differ', () => {
+ it('should use default grid coordinates when moving from another layout mode', () => {
const widget = makeWidget({
id: 'w1',
position: {
__typename: 'PageLayoutWidgetCanvasPosition',
layoutMode: PageLayoutTabLayoutMode.CANVAS,
},
- gridPosition: { row: 1, column: 2, rowSpan: 3, columnSpan: 4 },
});
const draft = makeDraft([
makeTab('tab-1', [widget], PageLayoutTabLayoutMode.GRID),
@@ -300,10 +323,10 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
expect(result.tabs[0].widgets[0].position).toEqual({
layoutMode: PageLayoutTabLayoutMode.GRID,
- row: 1,
- column: 2,
- rowSpan: 3,
- columnSpan: 4,
+ row: 0,
+ column: 0,
+ rowSpan: DEFAULT_WIDGET_SIZE.default.h,
+ columnSpan: DEFAULT_WIDGET_SIZE.default.w,
});
});
@@ -319,7 +342,14 @@ describe('convertPageLayoutDraftToUpdateInput', () => {
const canvasWidget = makeWidget({ id: 'w2' });
const gridWidget = makeWidget({
id: 'w3',
- gridPosition: { row: 1, column: 0, rowSpan: 2, columnSpan: 6 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 1,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 6,
+ },
});
const draft = makeDraft([
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 4ea85fef1f3..1b114791d38 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
@@ -48,7 +48,20 @@ describe('convertPageLayoutToTabLayouts', () => {
aggregateFieldMetadataId: 'id',
displayDataLabel: false,
},
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ gridPosition: {
+ row: 9,
+ column: 9,
+ rowSpan: 9,
+ columnSpan: 9,
+ },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: 'object-metadata-1',
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
@@ -72,7 +85,13 @@ describe('convertPageLayoutToTabLayouts', () => {
orderBy: GraphOrderBy.VALUE_DESC,
displayDataLabel: false,
},
- gridPosition: { row: 2, column: 0, rowSpan: 2, columnSpan: 2 },
+ gridPosition: {
+ row: 2,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
+ position: null,
objectMetadataId: 'object-metadata-1',
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
@@ -105,7 +124,7 @@ describe('convertPageLayoutToTabLayouts', () => {
});
});
- it('should use default widget size when gridPosition is undefined', () => {
+ it('should use default widget size when position is undefined', () => {
const pageLayout: PageLayout = {
id: 'page-layout-1',
applicationId: 'application-id-mock',
@@ -139,7 +158,6 @@ describe('convertPageLayoutToTabLayouts', () => {
configurationType: WidgetConfigurationType.FRONT_COMPONENT,
frontComponentId: 'my-component',
},
- gridPosition: undefined as any,
position: {
__typename: 'PageLayoutWidgetCanvasPosition' as const,
layoutMode: PageLayoutTabLayoutMode.CANVAS,
@@ -205,7 +223,14 @@ describe('convertPageLayoutToTabLayouts', () => {
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT,
body: { blocknote: '[]' },
},
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 4,
+ },
objectMetadataId: null,
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
@@ -267,7 +292,14 @@ describe('convertPageLayoutToTabLayouts', () => {
configurationType: WidgetConfigurationType.IFRAME,
url: 'https://example.com',
},
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 6 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 6,
+ columnSpan: 6,
+ },
objectMetadataId: null,
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFieldsWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFieldsWidget.test.ts
index 31ddc4cc33e..8011c82686c 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFieldsWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFieldsWidget.test.ts
@@ -27,13 +27,6 @@ describe('createDefaultFieldsWidget', () => {
configurationType: WidgetConfigurationType.FIELDS,
viewId: 'view-1',
},
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 1,
- columnSpan: 12,
- },
position: {
__typename: 'PageLayoutWidgetVerticalListPosition',
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFrontComponentWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFrontComponentWidget.test.ts
index 055a451f50d..8653c75e0f4 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFrontComponentWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultFrontComponentWidget.test.ts
@@ -1,15 +1,16 @@
import { createDefaultFrontComponentWidget } from '@/page-layout/utils/createDefaultFrontComponentWidget';
import {
- type GridPosition,
PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
describe('createDefaultFrontComponentWidget', () => {
it('should return a FRONT_COMPONENT widget with grid position mapped to position', () => {
- const gridPosition: GridPosition = {
- __typename: 'GridPosition',
+ const position: PageLayoutWidgetGridPosition = {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 2,
column: 3,
rowSpan: 4,
@@ -21,7 +22,7 @@ describe('createDefaultFrontComponentWidget', () => {
'tab-1',
'My Component',
'front-comp-1',
- gridPosition,
+ position,
);
expect(widget).toMatchObject({
@@ -36,7 +37,6 @@ describe('createDefaultFrontComponentWidget', () => {
configurationType: WidgetConfigurationType.FRONT_COMPONENT,
frontComponentId: 'front-comp-1',
},
- gridPosition,
position: {
__typename: 'PageLayoutWidgetGridPosition',
layoutMode: PageLayoutTabLayoutMode.GRID,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultGraphWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultGraphWidget.test.ts
index 4c9b4dc3432..8b9cdc203ac 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultGraphWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultGraphWidget.test.ts
@@ -13,7 +13,14 @@ describe('createDefaultGraphWidget', () => {
id: 'widget-1',
pageLayoutTabId: 'tab-1',
title: 'Test Widget',
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: 'object-1',
};
@@ -67,7 +74,7 @@ describe('createDefaultGraphWidget', () => {
expect(widget.id).toBe('widget-1');
expect(widget.pageLayoutTabId).toBe('tab-1');
expect(widget.title).toBe('Test Widget');
- expect(widget.gridPosition).toEqual(baseParams.gridPosition);
+ expect(widget.position).toEqual(baseParams.position);
expect(widget.position).toEqual({
__typename: 'PageLayoutWidgetGridPosition',
layoutMode: PageLayoutTabLayoutMode.GRID,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultRecordTableWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultRecordTableWidget.test.ts
index caf3b6b34ab..8283c13f0eb 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultRecordTableWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultRecordTableWidget.test.ts
@@ -9,13 +9,20 @@ describe('createDefaultRecordTableWidget', () => {
const widgetId = 'widget-id-1';
const pageLayoutTabId = 'tab-id-1';
const title = 'My Record Table';
- const gridPosition = { row: 1, column: 2, rowSpan: 3, columnSpan: 4 };
+ const position = {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
+ row: 1,
+ column: 2,
+ rowSpan: 3,
+ columnSpan: 4,
+ };
const widget = createDefaultRecordTableWidget({
id: widgetId,
pageLayoutTabId,
title,
- gridPosition,
+ position,
});
it('should return correct shape with all required fields', () => {
@@ -38,15 +45,15 @@ describe('createDefaultRecordTableWidget', () => {
});
});
- it('should correctly map grid position values to both gridPosition and position fields', () => {
- expect(widget.gridPosition).toEqual(gridPosition);
+ it('should correctly map grid position values to both position and position fields', () => {
+ expect(widget.position).toEqual(position);
expect(widget.position).toEqual({
__typename: 'PageLayoutWidgetGridPosition',
layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
+ row: position.row,
+ column: position.column,
+ rowSpan: position.rowSpan,
+ columnSpan: position.columnSpan,
});
});
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultStandaloneRichTextWidget.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultStandaloneRichTextWidget.test.ts
index 8bc1bc53e8c..7fb25b2944b 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultStandaloneRichTextWidget.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/createDefaultStandaloneRichTextWidget.test.ts
@@ -10,7 +10,13 @@ describe('createDefaultStandaloneRichTextWidget', () => {
'widget-1',
'tab-1',
{ blocknote: '[{"type":"paragraph","content":"Test"}]' },
- { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
+ {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 4,
+ },
);
expect(widget).toMatchObject({
@@ -22,7 +28,6 @@ describe('createDefaultStandaloneRichTextWidget', () => {
configuration: {
body: { blocknote: '[{"type":"paragraph","content":"Test"}]' },
},
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
position: {
__typename: 'PageLayoutWidgetGridPosition',
layoutMode: PageLayoutTabLayoutMode.GRID,
@@ -39,7 +44,13 @@ describe('createDefaultStandaloneRichTextWidget', () => {
'w1',
't1',
{ blocknote: '[]' },
- { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
'object-1',
);
@@ -47,7 +58,13 @@ describe('createDefaultStandaloneRichTextWidget', () => {
'w2',
't1',
{ blocknote: '[]' },
- { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
);
expect(withObjectId.objectMetadataId).toBe('object-1');
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 4bb7544a8fb..1e51b6897d2 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
@@ -1,8 +1,9 @@
import { extractFieldMetadataIdsFromWidget } from '@/page-layout/utils/extractFieldMetadataIdsFromWidget';
import {
+ PageLayoutTabLayoutMode,
type PageLayoutWidget,
- WidgetType,
type WidgetConfiguration,
+ WidgetType,
} from '~/generated-metadata/graphql';
import {
TEST_AGGREGATE_CHART_CONFIGURATION,
@@ -29,7 +30,14 @@ const createMockWidget = (
type: WidgetType.GRAPH,
title: 'Test',
objectMetadataId: null,
- gridPosition: { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
pageLayoutTabId: 'tab-1',
createdAt: '2024-01-01',
updatedAt: '2024-01-01',
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 16c3168cd8b..5a8b9669937 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
@@ -1,6 +1,7 @@
import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
import { filterVisibleWidgets } from '@/page-layout/utils/filterVisibleWidgets';
import {
+ PageLayoutTabLayoutMode,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -20,8 +21,9 @@ describe('filterVisibleWidgets', () => {
title: `Widget ${id}`,
type: WidgetType.FIELDS,
objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
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 1ed802e5743..649684e51d9 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
@@ -3,6 +3,7 @@ import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
import { getTabsRenderableForTargetObject } from '@/page-layout/utils/getTabsRenderableForTargetObject';
import { FieldMetadataType } from 'twenty-shared/types';
import {
+ PageLayoutTabLayoutMode,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -22,8 +23,9 @@ describe('getTabsRenderableForTargetObject', () => {
title: `Widget ${id}`,
type,
objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
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 f7be51ec688..af97a5d7d02 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
@@ -2,6 +2,7 @@ import { type PageLayoutTab } from '@/page-layout/types/PageLayoutTab';
import { buildWidgetVisibilityContext } from '@/page-layout/utils/buildWidgetVisibilityContext';
import { getTabsWithVisibleWidgets } from '@/page-layout/utils/getTabsWithVisibleWidgets';
import {
+ PageLayoutTabLayoutMode,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -21,8 +22,9 @@ describe('getTabsWithVisibleWidgets', () => {
title: `Widget ${id}`,
type: WidgetType.FIELDS,
objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/__tests__/moveWidgetToGridTabInDraft.test.ts b/packages/twenty-front/src/modules/page-layout/utils/__tests__/moveWidgetToGridTabInDraft.test.ts
index 056285c3c9b..96b06cb5cee 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/__tests__/moveWidgetToGridTabInDraft.test.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/__tests__/moveWidgetToGridTabInDraft.test.ts
@@ -5,24 +5,20 @@ import {
} from '@/page-layout/testing/pageLayoutDraftFixtures';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { moveWidgetToGridTabInDraft } from '@/page-layout/utils/moveWidgetToGridTabInDraft';
-import { PageLayoutTabLayoutMode } from '~/generated-metadata/graphql';
+import {
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
+} from '~/generated-metadata/graphql';
const makeGridWidget = (
id: string,
tabId: string,
- gridPosition: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- },
+ position: PageLayoutWidgetGridPosition,
): PageLayoutWidget => ({
...makeWidget(id, 0, tabId),
- gridPosition,
position: {
__typename: 'PageLayoutWidgetGridPosition' as const,
- layoutMode: PageLayoutTabLayoutMode.GRID,
- ...gridPosition,
+ ...position,
},
});
@@ -34,6 +30,8 @@ describe('moveWidgetToGridTabInDraft', () => {
const draft = makeDraft([
makeGridTab('tab-1', [
makeGridWidget('widget-a', 'tab-1', {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 4,
@@ -44,6 +42,8 @@ describe('moveWidgetToGridTabInDraft', () => {
'tab-2',
[
makeGridWidget('widget-b', 'tab-2', {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
column: 3,
rowSpan: 5,
@@ -69,7 +69,9 @@ describe('moveWidgetToGridTabInDraft', () => {
(widget) => widget.id === 'widget-a',
);
expect(movedWidget?.pageLayoutTabId).toBe('tab-2');
- expect(movedWidget?.gridPosition).toEqual({
+ expect(movedWidget?.position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 7,
column: 0,
rowSpan: 4,
@@ -81,6 +83,8 @@ describe('moveWidgetToGridTabInDraft', () => {
const draft = makeDraft([
makeGridTab('tab-1', [
makeGridWidget('widget-a', 'tab-1', {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 3,
column: 2,
rowSpan: 2,
@@ -96,7 +100,9 @@ describe('moveWidgetToGridTabInDraft', () => {
});
const movedWidget = result.tabs[1].widgets[0];
- expect(movedWidget?.gridPosition).toEqual({
+ expect(movedWidget?.position).toEqual({
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
@@ -108,6 +114,8 @@ describe('moveWidgetToGridTabInDraft', () => {
const draft = makeDraft([
makeGridTab('tab-1', [
makeGridWidget('widget-a', 'tab-1', {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
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 4d0583f6767..00900becb85 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
@@ -2,9 +2,10 @@ import { PENDING_WIDGET_PLACEHOLDER_LAYOUT_KEY } from '@/page-layout/constants/P
import { prepareGridLayoutItemsWithPlaceholders } from '@/page-layout/utils/prepareGridLayoutItemsWithPlaceholders';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidget,
WidgetConfigurationType,
WidgetType,
- type PageLayoutWidget,
} from '~/generated-metadata/graphql';
describe('prepareGridLayoutItemsWithPlaceholders', () => {
@@ -18,7 +19,9 @@ describe('prepareGridLayoutItemsWithPlaceholders', () => {
title: `Test Widget ${id}`,
type: WidgetType.GRAPH,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
@@ -212,7 +215,7 @@ describe('prepareGridLayoutItemsWithPlaceholders', () => {
expect(resultWidget.title).toBe(widget.title);
expect(resultWidget.type).toBe(widget.type);
expect(resultWidget.objectMetadataId).toBe(widget.objectMetadataId);
- expect(resultWidget.gridPosition).toEqual(widget.gridPosition);
+ expect(resultWidget.position).toEqual(widget.position);
expect(resultWidget.configuration).toEqual(widget.configuration);
expect(resultWidget.createdAt).toBe(widget.createdAt);
expect(resultWidget.updatedAt).toBe(widget.updatedAt);
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 8a3cc0d1a3b..3a8611ec0c7 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
@@ -3,6 +3,7 @@ import { removeWidgetFromTab } from '@/page-layout/utils/removeWidgetFromTab';
import {
AggregateOperations,
GraphOrderBy,
+ PageLayoutTabLayoutMode,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -35,7 +36,14 @@ describe('removeWidgetFromTab', () => {
aggregateFieldMetadataId: 'id',
displayDataLabel: false,
},
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: null,
createdAt: '2024-01-01T00:00:00Z',
updatedAt: '2024-01-01T00:00:00Z',
@@ -59,7 +67,14 @@ describe('removeWidgetFromTab', () => {
orderBy: GraphOrderBy.VALUE_DESC,
displayDataLabel: false,
},
- gridPosition: { row: 2, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: null,
createdAt: '2024-01-01T00:00:00Z',
updatedAt: '2024-01-01T00:00:00Z',
@@ -94,7 +109,14 @@ describe('removeWidgetFromTab', () => {
configurationType: WidgetConfigurationType.IFRAME,
url: 'https://example.com',
},
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: null,
createdAt: '2024-01-01T00:00:00Z',
updatedAt: '2024-01-01T00:00:00Z',
diff --git a/packages/twenty-front/src/modules/page-layout/utils/convertLayoutsToWidgets.ts b/packages/twenty-front/src/modules/page-layout/utils/convertLayoutsToWidgets.ts
index e4d4ec7ec20..eb1a03a8777 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/convertLayoutsToWidgets.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/convertLayoutsToWidgets.ts
@@ -18,12 +18,6 @@ export const convertLayoutsToWidgets = (
return {
...widget,
- gridPosition: {
- row,
- column,
- rowSpan,
- columnSpan,
- },
position: {
__typename: 'PageLayoutWidgetGridPosition' as const,
layoutMode: PageLayoutTabLayoutMode.GRID,
diff --git a/packages/twenty-front/src/modules/page-layout/utils/convertPageLayoutDraftToUpdateInput.ts b/packages/twenty-front/src/modules/page-layout/utils/convertPageLayoutDraftToUpdateInput.ts
index a862b81dd78..d17e492c535 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/convertPageLayoutDraftToUpdateInput.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/convertPageLayoutDraftToUpdateInput.ts
@@ -1,5 +1,8 @@
+import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
+
import { type DraftPageLayout } from '@/page-layout/types/DraftPageLayout';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
+import { getWidgetGridPosition } from '@/page-layout/utils/getWidgetGridPosition';
import {
PageLayoutTabLayoutMode,
type UpdatePageLayoutWithTabsInput,
@@ -26,14 +29,17 @@ const buildWidgetPosition = (
return {
layoutMode: PageLayoutTabLayoutMode.CANVAS,
};
- case PageLayoutTabLayoutMode.GRID:
+ case PageLayoutTabLayoutMode.GRID: {
+ const position = getWidgetGridPosition(widget);
+
return {
layoutMode: PageLayoutTabLayoutMode.GRID,
- row: widget.gridPosition.row,
- column: widget.gridPosition.column,
- rowSpan: widget.gridPosition.rowSpan,
- columnSpan: widget.gridPosition.columnSpan,
+ row: position?.row ?? 0,
+ column: position?.column ?? 0,
+ rowSpan: position?.rowSpan ?? DEFAULT_WIDGET_SIZE.default.h,
+ columnSpan: position?.columnSpan ?? DEFAULT_WIDGET_SIZE.default.w,
};
+ }
}
};
@@ -59,12 +65,6 @@ export const convertPageLayoutDraftToUpdateInput = (
title: widget.title,
type: widget.type,
objectMetadataId: widget.objectMetadataId ?? null,
- gridPosition: {
- row: widget.gridPosition.row,
- column: widget.gridPosition.column,
- rowSpan: widget.gridPosition.rowSpan,
- columnSpan: widget.gridPosition.columnSpan,
- },
position: buildWidgetPosition(
widget,
widgetIndex,
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 ba01aac135b..7195d5a0cf5 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldWidget.ts
@@ -39,13 +39,6 @@ export const createDefaultFieldWidget = ({
fieldMetadataId,
fieldDisplayMode,
},
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 1,
- columnSpan: 12,
- },
position: {
__typename: 'PageLayoutWidgetVerticalListPosition',
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
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 40af0218439..146c606ac25 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFieldsWidget.ts
@@ -34,13 +34,6 @@ export const createDefaultFieldsWidget = ({
viewId,
newFieldDefaultVisibility: true,
},
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 1,
- columnSpan: 12,
- },
position: {
__typename: 'PageLayoutWidgetVerticalListPosition',
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
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 d9ce94e58c7..097f8eae120 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultFrontComponentWidget.ts
@@ -1,6 +1,5 @@
import {
- type GridPosition,
- PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -11,7 +10,7 @@ export const createDefaultFrontComponentWidget = (
pageLayoutTabId: string,
title: string,
frontComponentId: string,
- gridPosition: GridPosition,
+ position: PageLayoutWidgetGridPosition,
): PageLayoutWidget => {
return {
__typename: 'PageLayoutWidget',
@@ -28,14 +27,9 @@ export const createDefaultFrontComponentWidget = (
configurationType: WidgetConfigurationType.FRONT_COMPONENT,
frontComponentId,
},
- gridPosition,
position: {
+ ...position,
__typename: 'PageLayoutWidgetGridPosition',
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
},
objectMetadataId: null,
createdAt: new Date().toISOString(),
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 364d3866634..7e341bdd493 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultGraphWidget.ts
@@ -3,9 +3,8 @@ import {
AxisNameDisplay,
BarChartLayout,
GraphOrderBy,
- type GridPosition,
- PageLayoutTabLayoutMode,
type PageLayoutWidget,
+ type PageLayoutWidgetGridPosition,
type WidgetConfiguration,
WidgetConfigurationType,
WidgetType,
@@ -41,7 +40,7 @@ type CreateDefaultGraphWidgetParams = {
id: string;
pageLayoutTabId: string;
title: string;
- gridPosition: GridPosition;
+ position: PageLayoutWidgetGridPosition;
objectMetadataId?: string | null;
fieldSelection?: GraphWidgetFieldSelection;
timezone?: string;
@@ -52,7 +51,7 @@ export const createDefaultGraphWidget = ({
id,
pageLayoutTabId,
title,
- gridPosition,
+ position,
objectMetadataId,
fieldSelection,
timezone,
@@ -78,14 +77,9 @@ export const createDefaultGraphWidget = ({
isActive: true,
type: WidgetType.GRAPH,
configuration,
- gridPosition,
position: {
+ ...position,
__typename: 'PageLayoutWidgetGridPosition',
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
},
objectMetadataId: resolvedObjectMetadataId,
createdAt: new Date().toISOString(),
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 68c42a5b04c..5b29b5a42e8 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultIframeWidget.ts
@@ -1,7 +1,6 @@
import {
- type GridPosition,
- PageLayoutTabLayoutMode,
type PageLayoutWidget,
+ type PageLayoutWidgetGridPosition,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -11,7 +10,7 @@ export const createDefaultIframeWidget = (
pageLayoutTabId: string,
title: string,
url: string | null,
- gridPosition: GridPosition,
+ position: PageLayoutWidgetGridPosition,
objectMetadataId?: string | null,
): PageLayoutWidget => {
return {
@@ -28,14 +27,9 @@ export const createDefaultIframeWidget = (
configurationType: WidgetConfigurationType.IFRAME,
url,
},
- gridPosition,
position: {
+ ...position,
__typename: 'PageLayoutWidgetGridPosition',
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
},
objectMetadataId: objectMetadataId ?? null,
createdAt: new Date().toISOString(),
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 1ce65107a6c..13dc7c1ba99 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultRecordTableWidget.ts
@@ -1,7 +1,6 @@
import {
- type GridPosition,
- PageLayoutTabLayoutMode,
type PageLayoutWidget,
+ type PageLayoutWidgetGridPosition,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -10,13 +9,13 @@ export const createDefaultRecordTableWidget = ({
id,
pageLayoutTabId,
title,
- gridPosition,
+ position,
objectMetadataId,
}: {
id: string;
pageLayoutTabId: string;
title: string;
- gridPosition: GridPosition;
+ position: PageLayoutWidgetGridPosition;
objectMetadataId?: string;
}): PageLayoutWidget => {
return {
@@ -32,14 +31,9 @@ export const createDefaultRecordTableWidget = ({
configuration: {
configurationType: WidgetConfigurationType.RECORD_TABLE,
},
- gridPosition,
position: {
+ ...position,
__typename: 'PageLayoutWidgetGridPosition',
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
},
objectMetadataId: objectMetadataId ?? null,
isOverridden: false,
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 598ab319105..9763bb5ad59 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/createDefaultStandaloneRichTextWidget.ts
@@ -1,7 +1,6 @@
import {
- type GridPosition,
- PageLayoutTabLayoutMode,
type PageLayoutWidget,
+ type PageLayoutWidgetGridPosition,
type RichTextBody,
WidgetConfigurationType,
WidgetType,
@@ -11,7 +10,7 @@ export const createDefaultStandaloneRichTextWidget = (
id: string,
pageLayoutTabId: string,
body: RichTextBody,
- gridPosition: GridPosition,
+ position: PageLayoutWidgetGridPosition,
objectMetadataId?: string | null,
): PageLayoutWidget => {
return {
@@ -28,14 +27,9 @@ export const createDefaultStandaloneRichTextWidget = (
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT,
body,
},
- gridPosition,
position: {
+ ...position,
__typename: 'PageLayoutWidgetGridPosition',
- layoutMode: PageLayoutTabLayoutMode.GRID,
- row: gridPosition.row,
- column: gridPosition.column,
- rowSpan: gridPosition.rowSpan,
- columnSpan: gridPosition.columnSpan,
},
objectMetadataId: objectMetadataId ?? null,
createdAt: new Date().toISOString(),
diff --git a/packages/twenty-front/src/modules/page-layout/utils/getWidgetGridPosition.ts b/packages/twenty-front/src/modules/page-layout/utils/getWidgetGridPosition.ts
index 198d17233fe..fcb840f45aa 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/getWidgetGridPosition.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/getWidgetGridPosition.ts
@@ -1,11 +1,6 @@
-import { isDefined } from 'twenty-shared/utils';
-
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
-// Widgets carry their grid position either as the GraphQL union or as the
-// plain gridPosition field depending on where they came from; the union wins.
export const getWidgetGridPosition = (widget: PageLayoutWidget) =>
- isDefined(widget.position) &&
- widget.position.__typename === 'PageLayoutWidgetGridPosition'
+ widget.position?.__typename === 'PageLayoutWidgetGridPosition'
? widget.position
- : widget.gridPosition;
+ : (widget.gridPosition ?? undefined);
diff --git a/packages/twenty-front/src/modules/page-layout/utils/moveWidgetToGridTabInDraft.ts b/packages/twenty-front/src/modules/page-layout/utils/moveWidgetToGridTabInDraft.ts
index 5d470d9f7aa..641a1e845bd 100644
--- a/packages/twenty-front/src/modules/page-layout/utils/moveWidgetToGridTabInDraft.ts
+++ b/packages/twenty-front/src/modules/page-layout/utils/moveWidgetToGridTabInDraft.ts
@@ -43,11 +43,11 @@ export const moveWidgetToGridTabInDraft = (
const destinationBottomRow = destinationTab.widgets.reduce(
(bottomRow, destinationWidget) => {
- const gridPosition = getWidgetGridPosition(destinationWidget);
+ const position = getWidgetGridPosition(destinationWidget);
return Math.max(
bottomRow,
- (gridPosition?.row ?? 0) + (gridPosition?.rowSpan ?? 0),
+ (position?.row ?? 0) + (position?.rowSpan ?? 0),
);
},
0,
@@ -60,12 +60,6 @@ export const moveWidgetToGridTabInDraft = (
const movedWidget: PageLayoutWidget = {
...widget,
pageLayoutTabId: destinationTabId,
- gridPosition: {
- row: destinationBottomRow,
- column: 0,
- rowSpan,
- columnSpan,
- },
position: {
__typename: 'PageLayoutWidgetGridPosition' as const,
layoutMode: PageLayoutTabLayoutMode.GRID,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
index 3b86fb30e49..d5d99190558 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
@@ -8,6 +8,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { expect, waitFor, within } from 'storybook/test';
import { ComponentDecorator } from 'twenty-ui/testing';
import {
+ PageLayoutTabLayoutMode,
PageLayoutType,
WidgetConfigurationType,
WidgetType,
@@ -28,8 +29,9 @@ const summaryWidget: PageLayoutWidget = {
type: WidgetType.CALL_RECORDING_SUMMARY,
title: 'Summary',
objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 4,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
index b421e036117..4201953d6e1 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
@@ -25,6 +25,7 @@ import {
} from 'twenty-shared/utils';
import { ComponentDecorator } from 'twenty-ui/testing';
import {
+ PageLayoutTabLayoutMode,
PageLayoutType,
WidgetConfigurationType,
WidgetType,
@@ -49,8 +50,9 @@ const transcriptWidget: PageLayoutWidget = {
type: WidgetType.CALL_RECORDING_TRANSCRIPT,
title: 'Transcript',
objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 4,
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 931bcf8b074..df3b4cd4ca5 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
@@ -264,8 +264,9 @@ export const WithNumberChart: Story = {
type: WidgetType.GRAPH,
title: 'Sales Pipeline',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -355,8 +356,9 @@ export const WithBarChart: Story = {
type: WidgetType.GRAPH,
title: 'Monthly Trends',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 5,
@@ -457,8 +459,9 @@ export const SmallWidget: Story = {
type: WidgetType.GRAPH,
title: 'Small Widget (2x2 grid)',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -555,8 +558,9 @@ export const MediumWidget: Story = {
type: WidgetType.GRAPH,
title: 'Medium Widget (4x3 grid)',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 3,
@@ -657,8 +661,9 @@ export const LargeWidget: Story = {
type: WidgetType.GRAPH,
title: 'Large Widget (6x4 grid)',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 4,
@@ -759,8 +764,9 @@ export const WideWidget: Story = {
type: WidgetType.GRAPH,
title: 'Wide Widget (8x2 grid)',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -857,8 +863,9 @@ export const TallWidget: Story = {
type: WidgetType.GRAPH,
title: 'Tall Widget (3x6 grid)',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 6,
@@ -960,8 +967,9 @@ export const WithManyToOneRelationFieldWidget: Story = {
type: WidgetType.FIELD,
title: 'Account Owner',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
@@ -1082,8 +1090,9 @@ export const WithOneToManyRelationFieldWidget: Story = {
type: WidgetType.FIELD,
title: 'People',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
@@ -1197,8 +1206,9 @@ export const OneToManyRelationFieldWidgetWithSeeAllButton: Story = {
type: WidgetType.FIELD,
title: 'People',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
@@ -1335,8 +1345,9 @@ export const OnMobile: Story = {
type: WidgetType.GRAPH,
title: 'Mobile Widget',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -1436,8 +1447,9 @@ export const InSidePanel: Story = {
type: WidgetType.GRAPH,
title: 'Side Panel Widget',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
@@ -1599,8 +1611,9 @@ export const Catalog: CatalogStory<Story, typeof WidgetRenderer> = {
type: WidgetType.GRAPH,
title: 'Widget name',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 2,
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 1b4f459ee5d..0b46655f6b1 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
@@ -337,8 +337,9 @@ const buildFieldWidget = ({
type: WidgetType.FIELD,
title,
objectMetadataId,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 1,
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 330de2449aa..b8f5dbbc558 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
@@ -25,10 +25,10 @@ import { type ViewWithRelations } from '@/views/types/ViewWithRelations';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { ComponentDecorator } from 'twenty-ui/testing';
import {
- ViewType,
- ViewVisibility,
PageLayoutTabLayoutMode,
PageLayoutType,
+ ViewType,
+ ViewVisibility,
WidgetConfigurationType,
WidgetType,
} from '~/generated-metadata/graphql';
@@ -173,8 +173,9 @@ const createFieldsWidget = (viewId: string | null): PageLayoutWidget => ({
type: WidgetType.FIELDS,
title: 'Fields',
objectMetadataId: companyObjectMetadataItem.id,
- gridPosition: {
- __typename: 'GridPosition',
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ __typename: 'PageLayoutWidgetGridPosition',
row: 0,
column: 0,
rowSpan: 4,
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 cce2c5ae1cc..6ab11f02201 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
@@ -290,13 +290,6 @@ export const SidePanelPageLayoutRecordPageWidgetTypeSelect = () => {
configurationType: WidgetConfigurationType.FRONT_COMPONENT,
frontComponentId: frontComponent.id,
},
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 1,
- columnSpan: 12,
- },
position: {
__typename: 'PageLayoutWidgetVerticalListPosition',
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
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 00280116a91..e282a2395d9 100644
--- a/packages/twenty-front/src/testing/mock-data/widget-configurations.ts
+++ b/packages/twenty-front/src/testing/mock-data/widget-configurations.ts
@@ -11,6 +11,7 @@ import {
type FieldsConfiguration,
GraphOrderBy,
type IframeConfiguration,
+ PageLayoutTabLayoutMode,
type StandaloneRichTextConfiguration,
type WidgetConfiguration,
WidgetConfigurationType,
@@ -119,7 +120,14 @@ export const createTestWidget = (
pageLayoutTabId: 'tab-1',
title: 'Test Widget',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 2 },
+ position: {
+ __typename: 'PageLayoutWidgetGridPosition' as const,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 2,
+ },
objectMetadataId: TEST_OBJECT_METADATA_ID,
configuration: TEST_BAR_CHART_CONFIGURATION,
createdAt: '2024-01-01',
diff --git a/packages/twenty-sdk/src/sdk/define/index.ts b/packages/twenty-sdk/src/sdk/define/index.ts
index ba73349f472..07d7d4bb638 100644
--- a/packages/twenty-sdk/src/sdk/define/index.ts
+++ b/packages/twenty-sdk/src/sdk/define/index.ts
@@ -40,37 +40,37 @@ export type { TimelineActivityTypeConfig } from '@/sdk/define/timeline-activity-
export type { TimelineActivityTypeManifest } from 'twenty-shared/application';
export {
- pageType,
- isInSidePanel,
+ canAccessFullAdminPanel,
+ canImpersonate,
+ every,
+ everyDefined,
+ everyEquals,
+ favoriteRecordIds,
+ featureFlags,
+ hasAnySoftDeleteFilterOnView,
+ includes,
+ includesEvery,
isDashboardPageLayoutInEditMode,
+ isDefined,
+ isInSidePanel,
isLayoutCustomizationModeEnabled,
- favoriteRecordIds,
+ isNonEmptyString,
isSelectAll,
- hasAnySoftDeleteFilterOnView,
+ none,
+ noneDefined,
+ noneEquals,
numberOfSelectedRecords,
+ objectMetadataItem,
+ objectMetadataLabel,
objectPermissions,
+ pageType,
selectedRecords,
- featureFlags,
- targetObjectReadPermissions,
- targetObjectWritePermissions,
- canImpersonate,
- canAccessFullAdminPanel,
- isDefined,
- isNonEmptyString,
- includes,
- every,
- everyDefined,
- everyEquals,
some,
someDefined,
someEquals,
- none,
- noneDefined,
- noneEquals,
someNonEmptyString,
- includesEvery,
- objectMetadataItem,
- objectMetadataLabel,
+ targetObjectReadPermissions,
+ targetObjectWritePermissions,
} from '@/sdk/define/conditional-availability/conditional-availability-variables';
export { defineFrontComponent } from '@/sdk/define/front-component/define-front-component';
@@ -212,7 +212,10 @@ export {
WidgetType,
} from 'twenty-shared/types';
export type {
- GridPosition,
+ PageLayoutWidgetCanvasPosition,
PageLayoutWidgetConditionalDisplay,
+ PageLayoutWidgetGridPosition,
+ PageLayoutWidgetPosition,
PageLayoutWidgetUniversalConfiguration,
+ PageLayoutWidgetVerticalListPosition,
} from 'twenty-shared/types';
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-37/2-37-instance-command-slow-1787838153752-backfill-missing-page-layout-widget-positions.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-37/2-37-instance-command-slow-1787838153752-backfill-missing-page-layout-widget-positions.ts
new file mode 100644
index 00000000000..dfd73290150
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-37/2-37-instance-command-slow-1787838153752-backfill-missing-page-layout-widget-positions.ts
@@ -0,0 +1,51 @@
+import { DataSource, QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { SlowInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/slow-instance-command.interface';
+
+@RegisteredInstanceCommand('2.37.0', 1787838153752, { type: 'slow' })
+export class BackfillMissingPageLayoutWidgetPositionsSlowInstanceCommand implements SlowInstanceCommand {
+ async runDataMigration(dataSource: DataSource): Promise<void> {
+ await dataSource.query(`
+ WITH missing_positions AS (
+ SELECT widget."id",
+ CASE tab."layoutMode"
+ WHEN 'CANVAS' THEN jsonb_build_object('layoutMode', 'CANVAS')
+ WHEN 'VERTICAL_LIST' THEN jsonb_build_object(
+ 'layoutMode', 'VERTICAL_LIST',
+ 'index', COALESCE((
+ SELECT MAX((existing."position"->>'index')::integer) + 1
+ FROM "core"."pageLayoutWidget" existing
+ WHERE existing."pageLayoutTabId" = widget."pageLayoutTabId"
+ AND existing."position"->>'layoutMode' = 'VERTICAL_LIST'
+ ), 0) + ROW_NUMBER() OVER (
+ PARTITION BY widget."pageLayoutTabId"
+ ORDER BY (widget."gridPosition"->>'row')::integer,
+ (widget."gridPosition"->>'column')::integer,
+ widget."createdAt", widget."id"
+ ) - 1
+ )
+ ELSE COALESCE(
+ widget."gridPosition",
+ '{"row": 0, "column": 0, "rowSpan": 1, "columnSpan": 12}'::jsonb
+ ) || jsonb_build_object('layoutMode', 'GRID')
+ END AS "position"
+ FROM "core"."pageLayoutWidget" widget
+ JOIN "core"."pageLayoutTab" tab ON tab."id" = widget."pageLayoutTabId"
+ WHERE widget."position" IS NULL
+ )
+ UPDATE "core"."pageLayoutWidget" widget
+ SET "position" = missing_positions."position"
+ FROM missing_positions
+ WHERE widget."id" = missing_positions."id"
+ `);
+ }
+
+ public async up(_queryRunner: QueryRunner): Promise<void> {
+ return;
+ }
+
+ public async down(_queryRunner: QueryRunner): Promise<void> {
+ return;
+ }
+}
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 989659d9a26..bc17c45e6f9 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
@@ -160,6 +160,7 @@ import { DropTimelineActivityTypeRendererFastInstanceCommand } from 'src/databas
import { AddLabelToApplicationVariableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-36/2-36-instance-command-fast-1787761629092-add-label-to-application-variable';
import { AddUsageLimitFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-36/2-36-instance-command-fast-1787821567133-add-usage-limit';
import { MakeUserEmailCaseInsensitiveFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-37/2-37-instance-command-fast-1787836741000-make-user-email-case-insensitive';
+import { BackfillMissingPageLayoutWidgetPositionsSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-37/2-37-instance-command-slow-1787838153752-backfill-missing-page-layout-widget-positions';
export const INSTANCE_COMMANDS = [
AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand,
@@ -322,4 +323,5 @@ export const INSTANCE_COMMANDS = [
AddLabelToApplicationVariableFastInstanceCommand,
AddUsageLimitFastInstanceCommand,
MakeUserEmailCaseInsensitiveFastInstanceCommand,
+ BackfillMissingPageLayoutWidgetPositionsSlowInstanceCommand,
];
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
index b54a380dd23..8c1a3c6969b 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
@@ -1,7 +1,12 @@
+import { type PageLayoutWidgetManifest } from 'twenty-shared/application';
import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
+import {
+ type GridPosition,
+ PageLayoutTabLayoutMode,
+ WidgetType,
+} from 'twenty-shared/types';
import { fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget } from 'src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util';
-import { WidgetType } from 'twenty-shared/types';
describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
const now = '2026-01-01T00:00:00.000Z';
@@ -32,13 +37,13 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
expect(result.type).toBe(WidgetType.VIEW);
expect(result.objectMetadataUniversalIdentifier).toBeNull();
expect(result.conditionalDisplay).toBeNull();
- expect(result.gridPosition).toEqual({
+ expect(result.position).toEqual({
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: DEFAULT_WIDGET_SIZE.default.h,
columnSpan: DEFAULT_WIDGET_SIZE.default.w,
});
- expect(result.position).toBeNull();
expect(result.universalConfiguration).toEqual({
configurationType: 'VIEW',
});
@@ -64,7 +69,8 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
expect(result.title).toBe('Iframe Widget');
expect(result.type).toBe('IFRAME');
expect(result.objectMetadataUniversalIdentifier).toBe('obj-uuid-1');
- expect(result.gridPosition).toEqual({
+ expect(result.position).toEqual({
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: DEFAULT_WIDGET_SIZE.default.h,
@@ -76,13 +82,19 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
});
});
- it('should use manifest gridPosition when provided', () => {
+ it('should use manifest position when provided', () => {
const result = fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
universalIdentifier: 'widget-uuid-3',
title: 'Positioned Widget',
type: WidgetType.GRAPH,
- gridPosition: { row: 2, column: 6, rowSpan: 4, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 6,
+ rowSpan: 4,
+ columnSpan: 6,
+ },
configuration: { configurationType: 'VIEW' },
},
pageLayoutTabUniversalIdentifier,
@@ -90,11 +102,61 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
now,
});
- expect(result.gridPosition).toEqual({
+ expect(result.position).toEqual({
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 2,
+ column: 6,
+ rowSpan: 4,
+ columnSpan: 6,
+ });
+ });
+
+ it('should use legacy manifest grid position when provided', () => {
+ const result = fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget({
+ pageLayoutWidgetManifest: {
+ universalIdentifier: 'widget-uuid-legacy',
+ title: 'Legacy Positioned Widget',
+ type: WidgetType.GRAPH,
+ gridPosition: {
+ row: 2,
+ column: 6,
+ rowSpan: 4,
+ columnSpan: 6,
+ },
+ configuration: { configurationType: 'VIEW' },
+ } as PageLayoutWidgetManifest & { gridPosition: GridPosition },
+ pageLayoutTabUniversalIdentifier,
+ applicationUniversalIdentifier,
+ now,
+ });
+
+ expect(result.position).toEqual({
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
column: 6,
rowSpan: 4,
columnSpan: 6,
});
});
+
+ it.each([
+ { layoutMode: PageLayoutTabLayoutMode.CANVAS },
+ { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 2 },
+ ])('should default position for $layoutMode tabs', (expectedPosition) => {
+ const result = fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget({
+ pageLayoutWidgetManifest: {
+ universalIdentifier: 'widget-uuid-4',
+ title: 'Widget',
+ type: WidgetType.VIEW,
+ configuration: { configurationType: 'VIEW' },
+ },
+ pageLayoutTabUniversalIdentifier,
+ pageLayoutTabLayoutMode: expectedPosition.layoutMode,
+ widgetIndex: 2,
+ applicationUniversalIdentifier,
+ now,
+ });
+
+ expect(result.position).toEqual(expectedPosition);
+ });
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
index 7652f8f86db..ae68316e2e7 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
@@ -1,17 +1,76 @@
import { type PageLayoutWidgetManifest } from 'twenty-shared/application';
import { DEFAULT_WIDGET_SIZE } from 'twenty-shared/constants';
-import { type WidgetType } from 'twenty-shared/types';
+import {
+ type GridPosition,
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidgetPosition,
+ type WidgetType,
+} from 'twenty-shared/types';
+import { assertUnreachable, isDefined } from 'twenty-shared/utils';
import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
+type PageLayoutWidgetManifestWithLegacyGridPosition =
+ PageLayoutWidgetManifest & {
+ gridPosition?: GridPosition;
+ };
+
+const getPageLayoutWidgetPosition = ({
+ pageLayoutWidgetManifest,
+ pageLayoutTabLayoutMode,
+ widgetIndex,
+}: {
+ pageLayoutWidgetManifest: PageLayoutWidgetManifest;
+ pageLayoutTabLayoutMode: PageLayoutTabLayoutMode;
+ widgetIndex: number;
+}): PageLayoutWidgetPosition => {
+ if (isDefined(pageLayoutWidgetManifest.position)) {
+ return pageLayoutWidgetManifest.position;
+ }
+
+ const { gridPosition } =
+ pageLayoutWidgetManifest as PageLayoutWidgetManifestWithLegacyGridPosition;
+
+ if (isDefined(gridPosition)) {
+ return {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ ...gridPosition,
+ };
+ }
+
+ switch (pageLayoutTabLayoutMode) {
+ case PageLayoutTabLayoutMode.GRID:
+ return {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: DEFAULT_WIDGET_SIZE.default.h,
+ columnSpan: DEFAULT_WIDGET_SIZE.default.w,
+ };
+ case PageLayoutTabLayoutMode.VERTICAL_LIST:
+ return {
+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
+ index: widgetIndex,
+ };
+ case PageLayoutTabLayoutMode.CANVAS:
+ return { layoutMode: PageLayoutTabLayoutMode.CANVAS };
+ default:
+ return assertUnreachable(pageLayoutTabLayoutMode);
+ }
+};
+
export const fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget = ({
pageLayoutWidgetManifest,
pageLayoutTabUniversalIdentifier,
+ pageLayoutTabLayoutMode = PageLayoutTabLayoutMode.GRID,
+ widgetIndex = 0,
applicationUniversalIdentifier,
now,
}: {
pageLayoutWidgetManifest: PageLayoutWidgetManifest;
pageLayoutTabUniversalIdentifier: string;
+ pageLayoutTabLayoutMode?: PageLayoutTabLayoutMode;
+ widgetIndex?: number;
applicationUniversalIdentifier: string;
now: string;
}): UniversalFlatPageLayoutWidget => {
@@ -26,13 +85,11 @@ export const fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget = ({
objectMetadataUniversalIdentifier:
pageLayoutWidgetManifest.objectUniversalIdentifier ?? null,
conditionalDisplay: pageLayoutWidgetManifest.conditionalDisplay ?? null,
- gridPosition: pageLayoutWidgetManifest.gridPosition ?? {
- row: 0,
- column: 0,
- rowSpan: DEFAULT_WIDGET_SIZE.default.h,
- columnSpan: DEFAULT_WIDGET_SIZE.default.w,
- },
- position: null,
+ position: getPageLayoutWidgetPosition({
+ pageLayoutWidgetManifest,
+ pageLayoutTabLayoutMode,
+ widgetIndex,
+ }),
universalConfiguration:
pageLayoutWidgetManifest.configuration as UniversalFlatPageLayoutWidget['universalConfiguration'],
createdAt: now,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
index 96919b16754..1fc73599076 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/services/compute-application-manifest-all-universal-flat-entity-maps.service.ts
@@ -506,27 +506,32 @@ export class ComputeApplicationManifestAllUniversalFlatEntityMapsService {
});
for (const pageLayoutTabManifest of pageLayoutManifest.tabs ?? []) {
+ const pageLayoutTab =
+ fromPageLayoutTabManifestToUniversalFlatPageLayoutTab({
+ pageLayoutTabManifest,
+ pageLayoutUniversalIdentifier:
+ pageLayoutManifest.universalIdentifier,
+ pageLayoutType: pageLayoutManifest.type,
+ applicationUniversalIdentifier,
+ now,
+ });
+
addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow({
- universalFlatEntity:
- fromPageLayoutTabManifestToUniversalFlatPageLayoutTab({
- pageLayoutTabManifest,
- pageLayoutUniversalIdentifier:
- pageLayoutManifest.universalIdentifier,
- pageLayoutType: pageLayoutManifest.type,
- applicationUniversalIdentifier,
- now,
- }),
+ universalFlatEntity: pageLayoutTab,
universalFlatEntityMapsToMutate:
allUniversalFlatEntityMaps.flatPageLayoutTabMaps,
});
- for (const pageLayoutWidgetManifest of pageLayoutTabManifest.widgets ??
- []) {
+ for (const [widgetIndex, pageLayoutWidgetManifest] of (
+ pageLayoutTabManifest.widgets ?? []
+ ).entries()) {
addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow(
{
universalFlatEntity:
fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget({
pageLayoutWidgetManifest,
+ pageLayoutTabLayoutMode: pageLayoutTab.layoutMode,
+ widgetIndex,
pageLayoutTabUniversalIdentifier:
pageLayoutTabManifest.universalIdentifier,
applicationUniversalIdentifier,
@@ -553,26 +558,31 @@ export class ComputeApplicationManifestAllUniversalFlatEntityMapsService {
pageLayoutTabManifest.pageLayoutUniversalIdentifier,
);
+ const pageLayoutTab =
+ fromPageLayoutTabManifestToUniversalFlatPageLayoutTab({
+ pageLayoutTabManifest,
+ pageLayoutUniversalIdentifier:
+ pageLayoutTabManifest.pageLayoutUniversalIdentifier,
+ pageLayoutType: referencedPageLayoutManifest?.type,
+ applicationUniversalIdentifier,
+ now,
+ });
+
addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow({
- universalFlatEntity:
- fromPageLayoutTabManifestToUniversalFlatPageLayoutTab({
- pageLayoutTabManifest,
- pageLayoutUniversalIdentifier:
- pageLayoutTabManifest.pageLayoutUniversalIdentifier,
- pageLayoutType: referencedPageLayoutManifest?.type,
- applicationUniversalIdentifier,
- now,
- }),
+ universalFlatEntity: pageLayoutTab,
universalFlatEntityMapsToMutate:
allUniversalFlatEntityMaps.flatPageLayoutTabMaps,
});
- for (const pageLayoutWidgetManifest of pageLayoutTabManifest.widgets ??
- []) {
+ for (const [widgetIndex, pageLayoutWidgetManifest] of (
+ pageLayoutTabManifest.widgets ?? []
+ ).entries()) {
addUniversalFlatEntityToUniversalFlatEntityMapsThroughMutationOrThrow({
universalFlatEntity:
fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget({
pageLayoutWidgetManifest,
+ pageLayoutTabLayoutMode: pageLayoutTab.layoutMode,
+ widgetIndex,
pageLayoutTabUniversalIdentifier:
pageLayoutTabManifest.universalIdentifier,
applicationUniversalIdentifier,
diff --git a/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts b/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts
index 072c774b9e0..ec1d8f85b45 100644
--- a/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts
+++ b/packages/twenty-server/src/engine/core-modules/open-api/utils/components.utils.ts
@@ -1216,7 +1216,8 @@ export const computeMetadataSchemaComponents = (
case 'pageLayoutWidget': {
schemas['GridPosition'] = {
type: 'object',
- description: 'Grid position for widget placement',
+ description: 'Legacy grid position for widget placement',
+ deprecated: true,
properties: {
row: { type: 'number', minimum: 0 },
column: { type: 'number', minimum: 0 },
@@ -1226,6 +1227,43 @@ export const computeMetadataSchemaComponents = (
required: ['row', 'column', 'rowSpan', 'columnSpan'],
};
+ schemas['PageLayoutWidgetPosition'] = {
+ oneOf: [
+ {
+ type: 'object',
+ properties: {
+ layoutMode: { type: 'string', enum: ['GRID'] },
+ row: { type: 'integer', minimum: 0 },
+ column: { type: 'integer', minimum: 0 },
+ rowSpan: { type: 'integer', minimum: 1 },
+ columnSpan: { type: 'integer', minimum: 1 },
+ },
+ required: [
+ 'layoutMode',
+ 'row',
+ 'column',
+ 'rowSpan',
+ 'columnSpan',
+ ],
+ },
+ {
+ type: 'object',
+ properties: {
+ layoutMode: { type: 'string', enum: ['VERTICAL_LIST'] },
+ index: { type: 'integer', minimum: 0 },
+ },
+ required: ['layoutMode', 'index'],
+ },
+ {
+ type: 'object',
+ properties: {
+ layoutMode: { type: 'string', enum: ['CANVAS'] },
+ },
+ required: ['layoutMode'],
+ },
+ ],
+ };
+
schemas[`${capitalize(item.nameSingular)}`] = {
type: 'object',
description: `A page layout widget`,
@@ -1249,15 +1287,15 @@ export const computeMetadataSchemaComponents = (
default: 'VIEW',
},
objectMetadataId: { type: 'string', format: 'uuid' },
- gridPosition: {
- $ref: '#/components/schemas/GridPosition',
+ position: {
+ $ref: '#/components/schemas/PageLayoutWidgetPosition',
},
configuration: {
type: 'object',
description: 'Widget-specific configuration',
},
},
- required: ['pageLayoutTabId', 'title', 'gridPosition'],
+ required: ['pageLayoutTabId', 'title'],
};
schemas[`${capitalize(item.namePlural)}`] = {
type: 'array',
@@ -1276,8 +1314,8 @@ export const computeMetadataSchemaComponents = (
enum: ['VIEW', 'IFRAME', 'FIELDS', 'GRAPH'],
},
objectMetadataId: { type: 'string', format: 'uuid' },
- gridPosition: {
- $ref: '#/components/schemas/GridPosition',
+ position: {
+ $ref: '#/components/schemas/PageLayoutWidgetPosition',
},
configuration: {
type: 'object',
@@ -1298,7 +1336,14 @@ export const computeMetadataSchemaComponents = (
},
objectMetadataId: { type: 'string', format: 'uuid' },
gridPosition: {
- $ref: '#/components/schemas/GridPosition',
+ oneOf: [
+ { $ref: '#/components/schemas/GridPosition' },
+ { type: 'null' },
+ ],
+ deprecated: true,
+ },
+ position: {
+ $ref: '#/components/schemas/PageLayoutWidgetPosition',
},
configuration: {
type: 'object',
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
index b9deae48b3b..7b5b0a0eb76 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
@@ -233,7 +233,6 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma
"title",
"type",
"objectMetadataUniversalIdentifier",
- "gridPosition",
"position",
"universalConfiguration",
"deletedAt",
@@ -244,7 +243,6 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma
"universalOverrides",
],
"propertiesToStringify": [
- "gridPosition",
"position",
"universalConfiguration",
"conditionalDisplay",
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 c26d2fcd6eb..2ede3a887b4 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
@@ -1030,7 +1030,7 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {
universalProperty: 'objectMetadataUniversalIdentifier',
},
gridPosition: {
- toCompare: true,
+ toCompare: false,
toStringify: true,
universalProperty: undefined,
},
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/constants/flat-page-layout-widget-editable-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/constants/flat-page-layout-widget-editable-properties.constant.ts
index b17da2a2a73..7e4cbe1038b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/constants/flat-page-layout-widget-editable-properties.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/constants/flat-page-layout-widget-editable-properties.constant.ts
@@ -4,7 +4,6 @@ export const FLAT_PAGE_LAYOUT_WIDGET_EDITABLE_PROPERTIES = [
'title',
'type',
'objectMetadataId',
- 'gridPosition',
'position',
'configuration',
'conditionalDisplay',
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/build-flat-page-layout-widget-common-properties.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/build-flat-page-layout-widget-common-properties.util.ts
index ef98b292fb1..b207d30a619 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/build-flat-page-layout-widget-common-properties.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/build-flat-page-layout-widget-common-properties.util.ts
@@ -10,12 +10,7 @@ export const buildFlatPageLayoutWidgetCommonProperties = ({
}: {
widgetInput: Pick<
CreatePageLayoutWidgetInput,
- | 'pageLayoutTabId'
- | 'title'
- | 'type'
- | 'objectMetadataId'
- | 'gridPosition'
- | 'position'
+ 'pageLayoutTabId' | 'title' | 'type' | 'objectMetadataId' | 'position'
>;
} & Pick<
AllFlatEntityMaps,
@@ -28,7 +23,6 @@ export const buildFlatPageLayoutWidgetCommonProperties = ({
| 'type'
| 'objectMetadataId'
| 'objectMetadataUniversalIdentifier'
- | 'gridPosition'
| 'position'
> => {
const {
@@ -50,7 +44,6 @@ export const buildFlatPageLayoutWidgetCommonProperties = ({
type: widgetInput.type,
objectMetadataId: widgetInput.objectMetadataId ?? null,
objectMetadataUniversalIdentifier,
- gridPosition: widgetInput.gridPosition,
position: widgetInput.position ?? null,
};
};
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-create-page-layout-widget-input-to-flat-page-layout-widget-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-create-page-layout-widget-input-to-flat-page-layout-widget-to-create.util.ts
index 656710defb7..6b796f73db1 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-create-page-layout-widget-input-to-flat-page-layout-widget-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-create-page-layout-widget-input-to-flat-page-layout-widget-to-create.util.ts
@@ -54,7 +54,6 @@ export const fromCreatePageLayoutWidgetInputToFlatPageLayoutWidgetToCreate = ({
title: createPageLayoutWidgetInput.title,
type: createPageLayoutWidgetInput.type,
objectMetadataId: createPageLayoutWidgetInput.objectMetadataId,
- gridPosition: createPageLayoutWidgetInput.gridPosition,
position: createPageLayoutWidgetInput.position,
},
flatPageLayoutTabMaps,
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
index 4462bb69c60..1bcf0e4cb41 100644
--- 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
@@ -127,7 +127,6 @@ export const computeSystemRecordPageLayoutToCreate = ({
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,
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input.ts
index 5fe7f52b002..affe52aef1f 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input.ts
@@ -1,6 +1,5 @@
import { Field, InputType } from '@nestjs/graphql';
-import { Type } from 'class-transformer';
import {
IsEnum,
IsNotEmpty,
@@ -8,13 +7,11 @@ import {
IsOptional,
IsString,
IsUUID,
- ValidateNested,
} from 'class-validator';
import { GraphQLJSON } from 'graphql-type-json';
import { PageLayoutWidgetPosition, WidgetType } from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { GridPositionInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input';
import { AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
@InputType()
@@ -38,13 +35,6 @@ export class CreatePageLayoutWidgetInput {
@IsOptional()
objectMetadataId?: string | null;
- @Field(() => GridPositionInput, {
- nullable: false,
- })
- @ValidateNested()
- @Type(() => GridPositionInput)
- gridPosition: GridPositionInput;
-
@Field(() => GraphQLJSON, { nullable: true })
@IsObject()
@IsOptional()
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input.ts
deleted file mode 100644
index 0c5995be7b0..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Field, InputType } from '@nestjs/graphql';
-
-import { IsInt, IsNotEmpty, Min } from 'class-validator';
-import { type GridPosition } from 'twenty-shared/types';
-
-@InputType('GridPositionInput')
-export class GridPositionInput implements GridPosition {
- @Field()
- @IsInt()
- @Min(0)
- @IsNotEmpty()
- row: number;
-
- @Field()
- @IsInt()
- @Min(0)
- @IsNotEmpty()
- column: number;
-
- @Field()
- @IsInt()
- @Min(1)
- @IsNotEmpty()
- rowSpan: number;
-
- @Field()
- @IsInt()
- @Min(1)
- @IsNotEmpty()
- columnSpan: number;
-}
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget-with-id.input.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget-with-id.input.ts
index f230eefe88b..89b3d01953a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget-with-id.input.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget-with-id.input.ts
@@ -1,6 +1,5 @@
import { Field, InputType } from '@nestjs/graphql';
-import { Type } from 'class-transformer';
import {
IsEnum,
IsNotEmpty,
@@ -8,7 +7,6 @@ import {
IsOptional,
IsString,
IsUUID,
- ValidateNested,
} from 'class-validator';
import { GraphQLJSON } from 'graphql-type-json';
import {
@@ -18,7 +16,6 @@ import {
} from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { GridPositionInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input';
import { AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
@InputType()
@@ -48,12 +45,6 @@ export class UpdatePageLayoutWidgetWithIdInput {
@IsOptional()
objectMetadataId: string | null;
- @Field(() => GridPositionInput, {})
- @ValidateNested()
- @Type(() => GridPositionInput)
- @IsNotEmpty()
- gridPosition: GridPositionInput;
-
@Field(() => GraphQLJSON, { nullable: true })
@IsObject()
@IsOptional()
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input.ts
index 8f7f74dc637..b737a30cd9a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input.ts
@@ -1,13 +1,11 @@
import { Field, InputType } from '@nestjs/graphql';
-import { Type } from 'class-transformer';
import {
IsEnum,
IsObject,
IsOptional,
IsString,
IsUUID,
- ValidateNested,
} from 'class-validator';
import { GraphQLJSON } from 'graphql-type-json';
import {
@@ -17,7 +15,6 @@ import {
} from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { GridPositionInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/grid-position.input';
import { AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
@InputType()
@@ -42,14 +39,6 @@ export class UpdatePageLayoutWidgetInput {
@IsOptional()
objectMetadataId?: string | null;
- @Field(() => GridPositionInput, {
- nullable: true,
- })
- @ValidateNested()
- @Type(() => GridPositionInput)
- @IsOptional()
- gridPosition?: GridPositionInput;
-
@Field(() => GraphQLJSON, { nullable: true })
@IsObject()
@IsOptional()
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 71bb6a74317..833116823b4 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
@@ -61,11 +61,10 @@ export class PageLayoutWidgetDTO {
objectMetadataId?: string;
@Field(() => GridPositionDTO, {
- nullable: false,
- deprecationReason:
- 'Use `position` instead. Will be removed in a future release.',
+ nullable: true,
+ deprecationReason: 'Use `position` instead.',
})
- gridPosition: GridPositionDTO;
+ gridPosition?: GridPositionDTO | null;
@Field(() => PageLayoutWidgetPositionUnion, { nullable: true })
position?: PageLayoutWidgetPosition | null;
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity.ts
index 4d61f726cbc..ef0911e9874 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/entities/page-layout-widget.entity.ts
@@ -22,6 +22,7 @@ import {
import { ADD_IS_SYSTEM_SIDE_EFFECT_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-15/is-system-side-effect-upgrade-command-name.constant';
import { WasIntroducedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-introduced-in-upgrade.decorator';
+import { type WasRemovedInUpgrade } from 'src/engine/core-modules/upgrade/decorators/was-removed-in-upgrade.decorator';
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
import { PageLayoutTabEntity } from 'src/engine/metadata-modules/page-layout-tab/entities/page-layout-tab.entity';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
@@ -93,7 +94,7 @@ export class PageLayoutWidgetEntity<
conditionalAvailabilityExpression: string | null;
@Column({ type: 'jsonb', nullable: false })
- gridPosition: JsonbProperty<GridPosition>;
+ gridPosition: WasRemovedInUpgrade<JsonbProperty<GridPosition>>;
@Column({ type: 'jsonb', nullable: true })
position: JsonbProperty<PageLayoutWidgetPosition | null>;
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception.ts
index f6bed415994..df47c9fba8c 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception.ts
@@ -15,7 +15,6 @@ export enum PageLayoutWidgetExceptionMessageKey {
PAGE_LAYOUT_TAB_ID_REQUIRED = 'PAGE_LAYOUT_TAB_ID_REQUIRED',
PAGE_LAYOUT_TAB_NOT_FOUND = 'PAGE_LAYOUT_TAB_NOT_FOUND',
PAGE_LAYOUT_WIDGET_NOT_DELETED = 'PAGE_LAYOUT_WIDGET_NOT_DELETED',
- GRID_POSITION_REQUIRED = 'GRID_POSITION_REQUIRED',
INVALID_WIDGET_POSITION = 'INVALID_WIDGET_POSITION',
INVALID_WIDGET_CONFIGURATION = 'INVALID_WIDGET_CONFIGURATION',
}
@@ -64,8 +63,6 @@ export const generatePageLayoutWidgetExceptionMessage = (
return 'Page layout tab not found';
case PageLayoutWidgetExceptionMessageKey.PAGE_LAYOUT_WIDGET_NOT_DELETED:
return 'Page layout widget is not deleted and cannot be restored';
- case PageLayoutWidgetExceptionMessageKey.GRID_POSITION_REQUIRED:
- return 'Grid position is required';
case PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION:
if (widgetTitle && detailedError) {
return `Invalid widget position for widget "${widgetTitle}": ${detailedError}`;
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-widget-grid-position.util.spec.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-page-layout-widget-grid-position.util.spec.ts
similarity index 68%
rename from packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-widget-grid-position.util.spec.ts
rename to packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-page-layout-widget-grid-position.util.spec.ts
index d715d195c32..bf26edbfcb4 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-widget-grid-position.util.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/__tests__/validate-page-layout-widget-grid-position.util.spec.ts
@@ -1,10 +1,16 @@
+import {
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
+} from 'twenty-shared/types';
+
import { WIDGET_GRID_MAX_COLUMNS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-columns.constant';
import { WIDGET_GRID_MAX_ROWS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-rows.constant';
import { PageLayoutWidgetExceptionCode } from 'src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception';
-import { validateWidgetGridPosition } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-widget-grid-position.util';
+import { validatePageLayoutWidgetGridPosition } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util';
-describe('validateWidgetGridPosition', () => {
- const validGridPosition = {
+describe('validatePageLayoutWidgetGridPosition', () => {
+ const validGridPosition: PageLayoutWidgetGridPosition = {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
@@ -13,7 +19,7 @@ describe('validateWidgetGridPosition', () => {
describe('Valid grid positions', () => {
it('should return empty array for valid grid position', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
validGridPosition,
'Test Widget',
);
@@ -22,8 +28,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should return empty array for widget at max column boundary', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: WIDGET_GRID_MAX_COLUMNS - 1,
rowSpan: 1,
@@ -36,8 +43,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should return empty array for widget at max row boundary', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: WIDGET_GRID_MAX_ROWS - 1,
column: 0,
rowSpan: 1,
@@ -50,8 +58,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should return empty array for widget spanning to column grid edge', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 8,
rowSpan: 1,
@@ -64,8 +73,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should return empty array for widget spanning to row grid edge', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: WIDGET_GRID_MAX_ROWS - 5,
column: 0,
rowSpan: 5,
@@ -78,9 +88,35 @@ describe('validateWidgetGridPosition', () => {
});
});
+ it.each([
+ { row: -1 },
+ { column: -1 },
+ { rowSpan: 0 },
+ { columnSpan: 0 },
+ { row: 0.5 },
+ { column: 0.5 },
+ { rowSpan: 1.5 },
+ { columnSpan: 1.5 },
+ { row: undefined },
+ ])('rejects invalid grid coordinates: %j', (invalidCoordinates) => {
+ const errors = validatePageLayoutWidgetGridPosition(
+ {
+ ...validGridPosition,
+ ...invalidCoordinates,
+ } as PageLayoutWidgetGridPosition,
+ 'Test Widget',
+ );
+
+ expect(errors).toEqual([
+ expect.objectContaining({
+ code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
+ }),
+ ]);
+ });
+
describe('Invalid row positions', () => {
it('should return error for row exceeding max rows', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{ ...validGridPosition, row: WIDGET_GRID_MAX_ROWS },
'Test Widget',
);
@@ -92,8 +128,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should return error when widget extends beyond grid height', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: WIDGET_GRID_MAX_ROWS - 2,
column: 0,
rowSpan: 5,
@@ -113,7 +150,7 @@ describe('validateWidgetGridPosition', () => {
describe('Invalid column positions', () => {
it('should return error for column exceeding max columns', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{ ...validGridPosition, column: WIDGET_GRID_MAX_COLUMNS },
'Test Widget',
);
@@ -127,8 +164,9 @@ describe('validateWidgetGridPosition', () => {
describe('Widget extending beyond grid', () => {
it('should return error when widget extends beyond grid width', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 10,
rowSpan: 1,
@@ -148,8 +186,9 @@ describe('validateWidgetGridPosition', () => {
describe('Error messages', () => {
it('should include max columns value in error', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 10,
rowSpan: 1,
@@ -167,8 +206,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should include max rows value in error for row start', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: WIDGET_GRID_MAX_ROWS + 10,
column: 0,
rowSpan: 1,
@@ -186,8 +226,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should include max rows value in error for row extension', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 95,
column: 0,
rowSpan: 10,
@@ -205,8 +246,9 @@ describe('validateWidgetGridPosition', () => {
});
it('should include widget title in error message', () => {
- const errors = validateWidgetGridPosition(
+ const errors = validatePageLayoutWidgetGridPosition(
{
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: WIDGET_GRID_MAX_ROWS,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util.ts
index 405c5ff60d9..388b55b0cdb 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util.ts
@@ -4,9 +4,9 @@ import { type PageLayoutWidgetGridPosition } from 'twenty-shared/types';
import { WIDGET_GRID_MAX_COLUMNS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-columns.constant';
import { WIDGET_GRID_MAX_ROWS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-rows.constant';
import {
+ generatePageLayoutWidgetExceptionMessage,
PageLayoutWidgetExceptionCode,
PageLayoutWidgetExceptionMessageKey,
- generatePageLayoutWidgetExceptionMessage,
} from 'src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception';
import { type FlatEntityValidationError } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/builders/types/failed-flat-entity-validation.type';
@@ -18,6 +18,26 @@ export const validatePageLayoutWidgetGridPosition = (
const { row, column, rowSpan, columnSpan } = position;
+ for (const [property, minimum] of [
+ ['row', 0],
+ ['column', 0],
+ ['rowSpan', 1],
+ ['columnSpan', 1],
+ ] as const) {
+ if (!Number.isInteger(position[property]) || position[property] < minimum) {
+ errors.push({
+ code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
+ message: generatePageLayoutWidgetExceptionMessage(
+ PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION,
+ widgetTitle,
+ undefined,
+ `${property} must be an integer greater than or equal to ${minimum}`,
+ ),
+ userFriendlyMessage: msg`Invalid widget position`,
+ });
+ }
+ }
+
if (column >= WIDGET_GRID_MAX_COLUMNS) {
errors.push({
code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-widget-grid-position.util.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-widget-grid-position.util.ts
deleted file mode 100644
index 1eaeeb1b17f..00000000000
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout-widget/utils/validate-widget-grid-position.util.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { msg } from '@lingui/core/macro';
-import { type GridPosition } from 'twenty-shared/types';
-
-import { WIDGET_GRID_MAX_COLUMNS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-columns.constant';
-import { WIDGET_GRID_MAX_ROWS } from 'src/engine/metadata-modules/page-layout-widget/constants/widget-grid-max-rows.constant';
-import {
- PageLayoutWidgetExceptionCode,
- PageLayoutWidgetExceptionMessageKey,
- generatePageLayoutWidgetExceptionMessage,
-} from 'src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception';
-import { type FlatEntityValidationError } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/builders/types/failed-flat-entity-validation.type';
-
-// TODO: remove in favor of validatePageLayoutWidgetGridPosition once gridPosition is deprecated
-export const validateWidgetGridPosition = (
- gridPosition: GridPosition,
- widgetTitle: string,
-): FlatEntityValidationError[] => {
- const errors: FlatEntityValidationError[] = [];
-
- const { row, column, rowSpan, columnSpan } = gridPosition;
-
- if (column >= WIDGET_GRID_MAX_COLUMNS) {
- errors.push({
- code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
- message: generatePageLayoutWidgetExceptionMessage(
- PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION,
- widgetTitle,
- undefined,
- `column ${column} exceeds grid width (max column is ${WIDGET_GRID_MAX_COLUMNS - 1})`,
- ),
- userFriendlyMessage: msg`Widget extends beyond grid width`,
- });
- }
-
- if (column + columnSpan > WIDGET_GRID_MAX_COLUMNS) {
- errors.push({
- code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
- message: generatePageLayoutWidgetExceptionMessage(
- PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION,
- widgetTitle,
- undefined,
- `widget extends beyond grid width (column ${column} + columnSpan ${columnSpan} > ${WIDGET_GRID_MAX_COLUMNS})`,
- ),
- userFriendlyMessage: msg`Widget extends beyond grid width`,
- });
- }
-
- if (row >= WIDGET_GRID_MAX_ROWS) {
- errors.push({
- code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
- message: generatePageLayoutWidgetExceptionMessage(
- PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION,
- widgetTitle,
- undefined,
- `row ${row} exceeds maximum allowed rows (${WIDGET_GRID_MAX_ROWS})`,
- ),
- userFriendlyMessage: msg`Widget row exceeds grid height`,
- });
- }
-
- if (row + rowSpan > WIDGET_GRID_MAX_ROWS) {
- errors.push({
- code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
- message: generatePageLayoutWidgetExceptionMessage(
- PageLayoutWidgetExceptionMessageKey.INVALID_WIDGET_POSITION,
- widgetTitle,
- undefined,
- `widget extends beyond grid height (row ${row} + rowSpan ${rowSpan} > ${WIDGET_GRID_MAX_ROWS})`,
- ),
- userFriendlyMessage: msg`Widget extends beyond grid height`,
- });
- }
-
- return errors;
-};
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-duplication.service.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-duplication.service.ts
index 69cd25eabb7..24479feae9f 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-duplication.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-duplication.service.ts
@@ -22,10 +22,10 @@ import { fromCreatePageLayoutInputToFlatPageLayoutToCreate } from 'src/engine/me
import { reconstructFlatPageLayoutWithTabsAndWidgets } from 'src/engine/metadata-modules/flat-page-layout/utils/reconstruct-flat-page-layout-with-tabs-and-widgets.util';
import { type PageLayoutDTO } from 'src/engine/metadata-modules/page-layout/dtos/page-layout.dto';
import {
+ generatePageLayoutExceptionMessage,
PageLayoutException,
PageLayoutExceptionCode,
PageLayoutExceptionMessageKey,
- generatePageLayoutExceptionMessage,
} from 'src/engine/metadata-modules/page-layout/exceptions/page-layout.exception';
import { fromFlatPageLayoutWithTabsAndWidgetsToPageLayoutDto } from 'src/engine/metadata-modules/page-layout/utils/from-flat-page-layout-with-tabs-and-widgets-to-page-layout-dto.util';
import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';
@@ -324,7 +324,6 @@ export class PageLayoutDuplicationService {
fromCreatePageLayoutWidgetInputToFlatPageLayoutWidgetToCreate({
createPageLayoutWidgetInput: {
title: originalWidget.title,
- gridPosition: originalWidget.gridPosition,
position: originalWidget.position ?? undefined,
type: originalWidget.type,
objectMetadataId: originalWidget.objectMetadataId,
diff --git a/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-update.service.ts b/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-update.service.ts
index 35d6eecad48..19847c79335 100644
--- a/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-update.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/page-layout/services/page-layout-update.service.ts
@@ -30,10 +30,10 @@ import { validateFieldConfigurationNestedRelationOrThrow } from 'src/engine/meta
import { UpdatePageLayoutWithTabsInput } from 'src/engine/metadata-modules/page-layout/dtos/inputs/update-page-layout-with-tabs.input';
import { PageLayoutDTO } from 'src/engine/metadata-modules/page-layout/dtos/page-layout.dto';
import {
+ generatePageLayoutExceptionMessage,
PageLayoutException,
PageLayoutExceptionCode,
PageLayoutExceptionMessageKey,
- generatePageLayoutExceptionMessage,
} from 'src/engine/metadata-modules/page-layout/exceptions/page-layout.exception';
import { fromFlatPageLayoutWithTabsAndWidgetsToPageLayoutDto } from 'src/engine/metadata-modules/page-layout/utils/from-flat-page-layout-with-tabs-and-widgets-to-page-layout-dto.util';
import { isCallerOverridingEntity } from 'src/engine/metadata-modules/utils/is-caller-overriding-entity.util';
@@ -730,7 +730,6 @@ export class PageLayoutUpdateService {
title: widgetInput.title,
type: widgetInput.type,
objectMetadataId: widgetInput.objectMetadataId ?? null,
- gridPosition: widgetInput.gridPosition,
position: widgetInput.position ?? null,
configuration,
pageLayoutTabId: widgetInput.pageLayoutTabId,
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/types/seeder-flat-page-layout-widget.type.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/types/seeder-flat-page-layout-widget.type.ts
index 5fda8383993..7054da4458d 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/types/seeder-flat-page-layout-widget.type.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/types/seeder-flat-page-layout-widget.type.ts
@@ -6,7 +6,6 @@ export type SeederFlatPageLayoutWidget = Pick<
| 'pageLayoutTabId'
| 'title'
| 'type'
- | 'gridPosition'
| 'position'
| 'configuration'
| 'objectMetadataId'
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds-v2.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds-v2.util.ts
index 9c34bd601a1..6b320194a8c 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds-v2.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds-v2.util.ts
@@ -73,7 +73,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
),
title: 'Revenue Forecast',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 7, rowSpan: 8, columnSpan: 5 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -109,7 +108,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
),
title: 'New Customers Over Time',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 3, rowSpan: 6, columnSpan: 5 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -145,7 +143,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
),
title: 'Revenue Distribution',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 4, rowSpan: 2, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -180,7 +177,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
),
title: 'Companies by LinkedIn (Field Permission Test)',
type: WidgetType.GRAPH,
- gridPosition: { row: 6, column: 0, rowSpan: 4, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 6,
@@ -216,7 +212,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
),
title: 'Contact Roles',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds.util.ts
index 0e44f63f33b..d36d32e55c0 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-page-layout-widget-data-seeds.util.ts
@@ -160,7 +160,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Total Pipeline Value',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -192,7 +191,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Rocket Count (Object Permission Test)',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 3, rowSpan: 4, columnSpan: 4 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -226,7 +224,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Pipeline Value by Close Date (Stacked by Stage)',
type: WidgetType.GRAPH,
- gridPosition: { row: 4, column: 0, rowSpan: 8, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 4,
@@ -265,7 +262,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Rockets by Created Date (Object Permission Test)',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 5, columnSpan: 5 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -302,7 +298,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Opportunity Count',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 5, rowSpan: 5, columnSpan: 7 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -335,7 +330,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Total Customers',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -367,7 +361,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Annual Revenue',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -399,7 +392,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'LinkedIn Profiles Count (Field Permission Test)',
type: WidgetType.GRAPH,
- gridPosition: { row: 2, column: 0, rowSpan: 4, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
@@ -429,7 +421,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Team Size',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 5, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -461,7 +452,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Open Tasks',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 6, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -490,7 +480,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Front Component',
type: WidgetType.FRONT_COMPONENT,
- gridPosition: { row: 2, column: 7, rowSpan: 2, columnSpan: 5 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
@@ -517,7 +506,6 @@ export const getPageLayoutWidgetDataSeeds = (
),
title: 'Twenty Star History',
type: WidgetType.IFRAME,
- gridPosition: { row: 0, column: 0, rowSpan: 12, columnSpan: 12 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
index b2080861ab9..28442e788b4 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
@@ -1,5 +1,4 @@
import {
- type GridPosition,
PageLayoutTabLayoutMode,
type PageLayoutWidgetConditionalDisplay,
type PageLayoutWidgetGridPosition,
@@ -21,27 +20,6 @@ export const CONDITIONAL_AVAILABILITY_EXPRESSION_DEVICE_MOBILE =
export const CONDITIONAL_AVAILABILITY_EXPRESSION_DEVICE_DESKTOP =
'device == "DESKTOP"';
-export const GRID_POSITIONS = {
- FULL_WIDTH: {
- row: 0,
- column: 0,
- rowSpan: 12,
- columnSpan: 12,
- },
- HALF_HEIGHT: {
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- RICH_TEXT: {
- row: 12,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
-} as const satisfies Record<string, GridPosition>;
-
export const GRID_LAYOUT_POSITIONS = {
FULL_WIDTH: {
layoutMode: PageLayoutTabLayoutMode.GRID,
@@ -162,85 +140,71 @@ export const WIDGET_PROPS = {
fields: {
title: 'Fields',
type: WidgetType.FIELDS,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
timeline: {
title: 'Timeline',
type: WidgetType.TIMELINE,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
tasks: {
title: 'Tasks',
type: WidgetType.TASKS,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
notes: {
title: 'Notes',
type: WidgetType.NOTES,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
files: {
title: 'Files',
type: WidgetType.FILES,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
emails: {
title: 'Emails',
type: WidgetType.EMAILS,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
calendar: {
title: 'Calendar',
type: WidgetType.CALENDAR,
- gridPosition: GRID_POSITIONS.HALF_HEIGHT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
noteRichText: {
title: 'Note',
type: WidgetType.FIELD_RICH_TEXT,
- gridPosition: GRID_POSITIONS.RICH_TEXT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
taskRichText: {
title: 'Task',
type: WidgetType.FIELD_RICH_TEXT,
- gridPosition: GRID_POSITIONS.RICH_TEXT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
workflow: {
title: 'Flow',
type: WidgetType.WORKFLOW,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
messageCampaign: {
title: 'Email',
type: WidgetType.MESSAGE_CAMPAIGN_BODY,
- gridPosition: GRID_POSITIONS.RICH_TEXT,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
workflowVersion: {
title: 'Flow',
type: WidgetType.WORKFLOW_VERSION,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
workflowRun: {
title: 'Flow',
type: WidgetType.WORKFLOW_RUN,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
emailThread: {
title: 'Thread',
type: WidgetType.EMAIL_THREAD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
},
} as const;
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
index 10d60d11351..de044c7fc19 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
@@ -6,10 +6,7 @@ import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import {
- GRID_POSITIONS,
- VERTICAL_LIST_LAYOUT_POSITIONS,
-} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
+import { VERTICAL_LIST_LAYOUT_POSITIONS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
const WORKSPACE_ID = '20202020-1111-4111-8111-111111111111';
@@ -203,7 +200,6 @@ describe('CalendarEvent standard metadata build', () => {
title: 'Summary',
type: WidgetType.CALL_RECORDING_SUMMARY,
pageLayoutTabUniversalIdentifier: summaryTabUniversalIdentifier,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
universalConfiguration: {
configurationType: WidgetConfigurationType.CALL_RECORDING_SUMMARY,
@@ -238,7 +234,6 @@ describe('CalendarEvent standard metadata build', () => {
title: 'Transcript',
type: WidgetType.CALL_RECORDING_TRANSCRIPT,
pageLayoutTabUniversalIdentifier: callRecordingTabUniversalIdentifier,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
universalConfiguration: {
configurationType: WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-call-recording-standard-metadata.spec.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-call-recording-standard-metadata.spec.ts
index 52fd0c0ea94..05a0f77285b 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-call-recording-standard-metadata.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-call-recording-standard-metadata.spec.ts
@@ -11,10 +11,7 @@ import { isDefined } from 'twenty-shared/utils';
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import {
- GRID_POSITIONS,
- VERTICAL_LIST_LAYOUT_POSITIONS,
-} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
+import { VERTICAL_LIST_LAYOUT_POSITIONS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
const WORKSPACE_ID = '20202020-1111-4111-8111-111111111111';
@@ -175,7 +172,6 @@ describe('CallRecording standard metadata build', () => {
title: 'Summary',
type: WidgetType.CALL_RECORDING_SUMMARY,
pageLayoutTabUniversalIdentifier: summaryTabUniversalIdentifier,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
universalConfiguration: {
configurationType: WidgetConfigurationType.CALL_RECORDING_SUMMARY,
@@ -209,7 +205,6 @@ describe('CallRecording standard metadata build', () => {
title: 'Transcript',
type: WidgetType.CALL_RECORDING_TRANSCRIPT,
pageLayoutTabUniversalIdentifier: callRecordingTabUniversalIdentifier,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
universalConfiguration: {
configurationType: WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
index b4746ac86b2..e6954e44013 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-calendar-event-page-layout.config.ts
@@ -9,7 +9,6 @@ import {
} from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -38,7 +37,6 @@ const CALENDAR_EVENT_PAGE_TABS = {
.tabs.home.widgets.participants.universalIdentifier,
title: 'Participants',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.calendarEvent.fields.calendarEventParticipants
@@ -50,7 +48,6 @@ const CALENDAR_EVENT_PAGE_TABS = {
.tabs.home.widgets.callRecordings.universalIdentifier,
title: 'Call Recordings',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.calendarEvent.fields.callRecordings
@@ -87,7 +84,6 @@ const CALENDAR_EVENT_PAGE_TABS = {
.tabs.summary.widgets.summary.universalIdentifier,
title: 'Summary',
type: WidgetType.CALL_RECORDING_SUMMARY,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
},
@@ -107,7 +103,6 @@ const CALENDAR_EVENT_PAGE_TABS = {
.tabs.callRecording.widgets.transcript.universalIdentifier,
title: 'Transcript',
type: WidgetType.CALL_RECORDING_TRANSCRIPT,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-call-recording-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-call-recording-page-layout.config.ts
index 984527bd28d..951eb99360a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-call-recording-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-call-recording-page-layout.config.ts
@@ -9,7 +9,6 @@ import {
} from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -63,7 +62,6 @@ const CALL_RECORDING_PAGE_TABS = {
.tabs.summary.widgets.summary.universalIdentifier,
title: 'Summary',
type: WidgetType.CALL_RECORDING_SUMMARY,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
},
@@ -83,7 +81,6 @@ const CALL_RECORDING_PAGE_TABS = {
.tabs.callRecording.widgets.transcript.universalIdentifier,
title: 'Transcript',
type: WidgetType.CALL_RECORDING_TRANSCRIPT,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIRST,
},
},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-company-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-company-page-layout.config.ts
index 3a990af055b..08a5a0236af 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-company-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-company-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const COMPANY_PAGE_TABS = {
.widgets.people.universalIdentifier,
title: 'People',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.company.fields.people.universalIdentifier,
@@ -45,7 +43,6 @@ const COMPANY_PAGE_TABS = {
.widgets.opportunities.universalIdentifier,
title: 'Opportunities',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.company.fields.opportunities.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts
index 896f9540e06..08097e481c9 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -28,7 +27,6 @@ const MESSAGE_CAMPAIGN_PAGE_TABS = {
.tabs.home.widgets.recipients.universalIdentifier,
title: 'Recipients',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FOURTH,
fieldUniversalIdentifier:
STANDARD_OBJECTS.messageCampaign.fields.recipients
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts
index 0259a66292c..95160e323b3 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const MESSAGE_LIST_PAGE_TABS = {
.home.widgets.members.universalIdentifier,
title: 'Members',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.messageList.fields.members.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-note-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-note-page-layout.config.ts
index efeb8564de9..0355ff4c918 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-note-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-note-page-layout.config.ts
@@ -36,7 +36,6 @@ const NOTE_PAGE_TABS = {
.widgets.noteRichText.universalIdentifier,
title: WIDGET_PROPS.noteRichText.title,
type: WIDGET_PROPS.noteRichText.type,
- gridPosition: WIDGET_PROPS.noteRichText.gridPosition,
position: { layoutMode: TAB_PROPS.home.layoutMode, index: 1 },
conditionalDisplay: CONDITIONAL_DISPLAY_DEVICE_MOBILE,
conditionalAvailabilityExpression:
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-opportunity-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-opportunity-page-layout.config.ts
index b574a067e00..c6ac8272cc9 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-opportunity-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-opportunity-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const OPPORTUNITY_PAGE_TABS = {
.home.widgets.pointOfContact.universalIdentifier,
title: 'Point of Contact',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.opportunity.fields.pointOfContact
@@ -46,7 +44,6 @@ const OPPORTUNITY_PAGE_TABS = {
.home.widgets.company.universalIdentifier,
title: 'Company',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.opportunity.fields.company.universalIdentifier,
@@ -57,7 +54,6 @@ const OPPORTUNITY_PAGE_TABS = {
.home.widgets.owner.universalIdentifier,
title: 'Owner',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FOURTH,
fieldUniversalIdentifier:
STANDARD_OBJECTS.opportunity.fields.owner.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type.ts
index 6d2586edb54..ba0d1bfc199 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type.ts
@@ -1,5 +1,4 @@
import {
- type GridPosition,
type PageLayoutTabLayoutMode,
type PageLayoutType,
type PageLayoutWidgetConditionalDisplay,
@@ -11,7 +10,6 @@ export type StandardPageLayoutWidgetConfig = {
universalIdentifier: string;
title?: string;
type?: WidgetType;
- gridPosition?: GridPosition;
position?: PageLayoutWidgetPosition;
conditionalDisplay?: PageLayoutWidgetConditionalDisplay | null;
conditionalAvailabilityExpression?: string | null;
@@ -40,7 +38,6 @@ export type StandardRecordPageWidgetConfig = {
universalIdentifier: string;
title: string;
type: WidgetType;
- gridPosition: GridPosition;
position?: PageLayoutWidgetPosition;
conditionalDisplay?: PageLayoutWidgetConditionalDisplay | null;
conditionalAvailabilityExpression?: string | null;
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
index fbe562c921a..70055f53e55 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const PERSON_PAGE_TABS = {
.widgets.company.universalIdentifier,
title: 'Company',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.person.fields.company.universalIdentifier,
@@ -45,7 +43,6 @@ const PERSON_PAGE_TABS = {
.widgets.pointOfContactForOpportunities.universalIdentifier,
title: 'Opportunities',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.person.fields.pointOfContactForOpportunities
@@ -57,7 +54,6 @@ const PERSON_PAGE_TABS = {
.widgets.listMemberships.universalIdentifier,
title: 'Lists',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.FIFTH,
fieldUniversalIdentifier:
STANDARD_OBJECTS.person.fields.listMemberships.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-task-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-task-page-layout.config.ts
index a179b5e214f..16053cb9772 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-task-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-task-page-layout.config.ts
@@ -36,7 +36,6 @@ const TASK_PAGE_TABS = {
.widgets.taskRichText.universalIdentifier,
title: WIDGET_PROPS.taskRichText.title,
type: WIDGET_PROPS.taskRichText.type,
- gridPosition: WIDGET_PROPS.taskRichText.gridPosition,
position: { layoutMode: TAB_PROPS.home.layoutMode, index: 1 },
conditionalDisplay: CONDITIONAL_DISPLAY_DEVICE_MOBILE,
conditionalAvailabilityExpression:
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-run-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-run-page-layout.config.ts
index f63a5ddfe8f..a5deed61863 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-run-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-run-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const WORKFLOW_RUN_PAGE_TABS = {
.home.widgets.workflow.universalIdentifier,
title: 'Workflow',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.workflowRun.fields.workflow.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-version-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-version-page-layout.config.ts
index 6a036ea3b61..86442496c2d 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-version-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-workflow-version-page-layout.config.ts
@@ -5,7 +5,6 @@ import {
import { PageLayoutType, WidgetType } from 'twenty-shared/types';
import {
- GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
@@ -34,7 +33,6 @@ const WORKFLOW_VERSION_PAGE_TABS = {
.tabs.home.widgets.workflow.universalIdentifier,
title: 'Workflow',
type: WidgetType.FIELD,
- gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.workflowVersion.fields.workflow.universalIdentifier,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts
index 048ca1ae0eb..0c59a540b44 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/build-standard-flat-page-layout-widget-metadata-maps.util.ts
@@ -322,7 +322,6 @@ const computeRecordPageWidgets = ({
widgetName,
title: widget.title,
type: widget.type,
- gridPosition: widget.gridPosition,
position: widget.position ?? null,
configuration,
universalConfiguration,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/compute-my-first-dashboard-widgets.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/compute-my-first-dashboard-widgets.util.ts
index dfa54a4efde..ab8fcd6d24e 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/compute-my-first-dashboard-widgets.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/compute-my-first-dashboard-widgets.util.ts
@@ -230,7 +230,6 @@ const createWelcomeRichText = ({
widgetName: 'welcomeRichText',
title: 'Untitled Rich Text',
type: WidgetType.STANDALONE_RICH_TEXT,
- gridPosition: { row: 0, column: 0, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -267,7 +266,6 @@ const createDealsByCompany = ({
widgetName: 'dealsByCompany',
title: 'Deals by Company',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 6, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -332,7 +330,6 @@ const createPipelineValueByStage = ({
widgetName: 'pipelineValueByStage',
title: 'Pipeline Value by Stage',
type: WidgetType.GRAPH,
- gridPosition: { row: 6, column: 0, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 6,
@@ -410,7 +407,6 @@ const createRevenueTimeline = ({
widgetName: 'revenueTimeline',
title: 'Revenue Timeline',
type: WidgetType.GRAPH,
- gridPosition: { row: 6, column: 6, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 6,
@@ -477,7 +473,6 @@ const createOpportunitiesByOwner = ({
widgetName: 'opportunitiesByOwner',
title: 'Opportunities by Owner',
type: WidgetType.GRAPH,
- gridPosition: { row: 12, column: 0, rowSpan: 6, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 12,
@@ -554,7 +549,6 @@ const createStockMarketIframe = ({
widgetName: 'stockMarketIframe',
title: 'Stock market (Iframe)',
type: WidgetType.IFRAME,
- gridPosition: { row: 12, column: 6, rowSpan: 8, columnSpan: 6 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 12,
@@ -604,7 +598,6 @@ const createDealsCreatedThisMonth = ({
widgetName: 'dealsCreatedThisMonth',
title: 'Deals created this month',
type: WidgetType.GRAPH,
- gridPosition: { row: 18, column: 0, rowSpan: 2, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 18,
@@ -673,7 +666,6 @@ const createDealValueCreatedThisMonth = ({
widgetName: 'dealValueCreatedThisMonth',
title: 'Deal value created this month',
type: WidgetType.GRAPH,
- gridPosition: { row: 18, column: 3, rowSpan: 2, columnSpan: 3 },
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 18,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/create-standard-page-layout-widget-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/create-standard-page-layout-widget-flat-metadata.util.ts
index 439d27327fa..35e70d48be5 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/create-standard-page-layout-widget-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-widget/create-standard-page-layout-widget-flat-metadata.util.ts
@@ -1,5 +1,4 @@
import {
- type GridPosition,
PageLayoutType,
type PageLayoutWidgetConditionalDisplay,
type PageLayoutWidgetPosition,
@@ -25,7 +24,6 @@ export type CreateStandardPageLayoutWidgetContext = {
widgetName: string;
title: string;
type: WidgetType;
- gridPosition: GridPosition;
position: PageLayoutWidgetPosition | null;
configuration: AllPageLayoutWidgetConfiguration;
universalConfiguration: MetadataUniversalFlatEntity<'pageLayoutWidget'>['universalConfiguration'];
@@ -50,7 +48,6 @@ export const createStandardPageLayoutWidgetFlatMetadata = ({
widgetName,
title,
type,
- gridPosition,
position,
configuration,
universalConfiguration,
@@ -102,7 +99,6 @@ export const createStandardPageLayoutWidgetFlatMetadata = ({
pageLayoutTabUniversalIdentifier: tabDefinition.universalIdentifier,
title,
type,
- gridPosition,
position,
configuration,
universalConfiguration,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-flat-skill-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-flat-skill-metadata.util.ts
index 181d071a3ad..dfe59364de7 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-flat-skill-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/skill-metadata/create-standard-flat-skill-metadata.util.ts
@@ -533,7 +533,7 @@ Step 1 — upsert_complete_view: {
"filters": [{ "fieldName": "status", "operand": "IS_NOT", "value": ["DONE"] }],
"sorts": [{ "fieldName": "createdAt", "direction": "DESC" }]
} → { "id": "<view-uuid>" }
-Step 2 — add_dashboard_widget: { "type": "RECORD_TABLE", "objectMetadataId": "<repair-object-uuid>", "configuration": { "configurationType": "RECORD_TABLE", "viewId": "<view-uuid>" }, "gridPosition": { "row": 0, "column": 0, "rowSpan": 8, "columnSpan": 12 } }
+Step 2 — add_dashboard_widget: { "type": "RECORD_TABLE", "objectMetadataId": "<repair-object-uuid>", "configuration": { "configurationType": "RECORD_TABLE", "viewId": "<view-uuid>" }, "position": { "layoutMode": "GRID", "row": 0, "column": 0, "rowSpan": 8, "columnSpan": 12 } }
## Tabs
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-page-layout-widget-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-page-layout-widget-validator.service.ts
index b8648bb18dc..3725d44f90d 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-page-layout-widget-validator.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-page-layout-widget-validator.service.ts
@@ -5,7 +5,6 @@ import { ALL_METADATA_NAME } from 'twenty-shared/metadata';
import {
PageLayoutTabLayoutMode,
PageLayoutWidgetPosition,
- type GridPosition,
} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -15,7 +14,6 @@ import { PageLayoutTabExceptionCode } from 'src/engine/metadata-modules/page-lay
import { PageLayoutWidgetExceptionCode } from 'src/engine/metadata-modules/page-layout-widget/exceptions/page-layout-widget.exception';
import { validatePageLayoutWidgetGridPosition } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-grid-position.util';
import { validatePageLayoutWidgetVerticalListPosition } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-page-layout-widget-vertical-list-position.util';
-import { validateWidgetGridPosition } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-widget-grid-position.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 {
@@ -96,13 +94,6 @@ export class FlatPageLayoutWidgetValidatorService {
});
}
- const gridPositionErrors = this.validateGridPosition({
- gridPosition: updatedFlatPageLayoutWidget.gridPosition,
- widgetTitle: updatedFlatPageLayoutWidget.title,
- });
-
- validationResult.errors.push(...gridPositionErrors);
-
const positionErrors = this.validatePosition({
position: updatedFlatPageLayoutWidget.position,
pageLayoutTab: referencedPageLayoutTab,
@@ -216,13 +207,6 @@ export class FlatPageLayoutWidgetValidatorService {
});
}
- const gridPositionErrors = this.validateGridPosition({
- gridPosition: flatPageLayoutWidgetToValidate.gridPosition,
- widgetTitle: flatPageLayoutWidgetToValidate.title,
- });
-
- validationResult.errors.push(...gridPositionErrors);
-
const positionErrors = this.validatePosition({
position: flatPageLayoutWidgetToValidate.position,
pageLayoutTab: referencedPageLayoutTab,
@@ -260,26 +244,6 @@ export class FlatPageLayoutWidgetValidatorService {
);
}
- private validateGridPosition({
- gridPosition,
- widgetTitle,
- }: {
- gridPosition: GridPosition | undefined;
- widgetTitle: string;
- }): FlatEntityValidationError[] {
- if (!isDefined(gridPosition)) {
- return [
- {
- code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
- message: t`Grid position is required`,
- userFriendlyMessage: msg`Grid position is required`,
- },
- ];
- }
-
- return validateWidgetGridPosition(gridPosition, widgetTitle);
- }
-
private validatePosition({
position,
pageLayoutTab,
@@ -325,6 +289,12 @@ export class FlatPageLayoutWidgetValidatorService {
break;
case PageLayoutTabLayoutMode.CANVAS:
break;
+ default:
+ errors.push({
+ code: PageLayoutWidgetExceptionCode.INVALID_PAGE_LAYOUT_WIDGET_DATA,
+ message: t`Invalid widget position layout mode`,
+ userFriendlyMessage: msg`Invalid widget position layout mode`,
+ });
}
return errors;
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/create-page-layout-widget-action-handler.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/create-page-layout-widget-action-handler.service.ts
index df123d58d58..7e3f79ac4a0 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/create-page-layout-widget-action-handler.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/create-page-layout-widget-action-handler.service.ts
@@ -1,5 +1,9 @@
import { Injectable } from '@nestjs/common';
+import {
+ type GridPosition,
+ PageLayoutTabLayoutMode,
+} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
@@ -18,6 +22,13 @@ import {
WorkspaceMigrationActionRunnerContext,
} from 'src/engine/workspace-manager/workspace-migration/workspace-migration-runner/types/workspace-migration-action-runner-args.type';
+const DEFAULT_LEGACY_GRID_POSITION: GridPosition = {
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 12,
+};
+
@Injectable()
export class CreatePageLayoutWidgetActionHandlerService extends WorkspaceMigrationRunnerActionHandler(
'create',
@@ -82,10 +93,20 @@ export class CreatePageLayoutWidgetActionHandlerService extends WorkspaceMigrati
): Promise<void> {
const { flatAction, queryRunner } = context;
const { flatEntity } = flatAction;
+ const gridPosition =
+ flatEntity.gridPosition ??
+ (flatEntity.position?.layoutMode === PageLayoutTabLayoutMode.GRID
+ ? {
+ row: flatEntity.position.row,
+ column: flatEntity.position.column,
+ rowSpan: flatEntity.position.rowSpan,
+ columnSpan: flatEntity.position.columnSpan,
+ }
+ : DEFAULT_LEGACY_GRID_POSITION);
await this.insertFlatEntitiesInRepository({
queryRunner,
- flatEntities: [flatEntity],
+ flatEntities: [{ ...flatEntity, gridPosition }],
});
}
diff --git a/packages/twenty-server/src/modules/dashboard/tools/__tests__/get-dashboard.tool.spec.ts b/packages/twenty-server/src/modules/dashboard/tools/__tests__/get-dashboard.tool.spec.ts
index bea118436c9..a2ebce459d3 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/__tests__/get-dashboard.tool.spec.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/__tests__/get-dashboard.tool.spec.ts
@@ -1,4 +1,7 @@
-import { FieldMetadataType } from 'twenty-shared/types';
+import {
+ FieldMetadataType,
+ PageLayoutTabLayoutMode,
+} from 'twenty-shared/types';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
import { createGetDashboardTool } from 'src/modules/dashboard/tools/get-dashboard.tool';
@@ -70,7 +73,13 @@ describe('get_dashboard tool', () => {
id: 'widget-1',
title: 'Widget',
type: 'GRAPH',
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 4,
+ },
objectMetadataId: 'company',
configuration: {
configurationType: WidgetConfigurationType.BAR_CHART,
@@ -85,7 +94,13 @@ describe('get_dashboard tool', () => {
id: 'widget-2',
title: 'Widget 2',
type: 'GRAPH',
- gridPosition: { row: 4, column: 0, rowSpan: 4, columnSpan: 4 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 4,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 4,
+ },
objectMetadataId: 'company',
configuration: {
configurationType: WidgetConfigurationType.BAR_CHART,
diff --git a/packages/twenty-server/src/modules/dashboard/tools/__tests__/update-dashboard-widget.tool.spec.ts b/packages/twenty-server/src/modules/dashboard/tools/__tests__/update-dashboard-widget.tool.spec.ts
index 93ac4f4fe5e..b62f876474a 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/__tests__/update-dashboard-widget.tool.spec.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/__tests__/update-dashboard-widget.tool.spec.ts
@@ -1,5 +1,6 @@
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
ViewFilterOperand,
WidgetType,
} from 'twenty-shared/types';
@@ -54,7 +55,13 @@ const buildDeps = () => ({
id: WIDGET_ID,
title: 'Widget',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 4 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 4,
+ },
configuration: updateData.configuration,
})),
},
diff --git a/packages/twenty-server/src/modules/dashboard/tools/add-dashboard-widget.tool.ts b/packages/twenty-server/src/modules/dashboard/tools/add-dashboard-widget.tool.ts
index 6d67022e619..dde9b1023b5 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/add-dashboard-widget.tool.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/add-dashboard-widget.tool.ts
@@ -1,9 +1,12 @@
import { z } from 'zod';
import { type CreatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input';
-import { type WidgetType } from 'twenty-shared/types';
import {
- gridPositionSchema,
+ type PageLayoutWidgetGridPosition,
+ type WidgetType,
+} from 'twenty-shared/types';
+import {
+ widgetPositionSchema,
widgetConfigurationSchema,
widgetTypeSchema,
} from 'src/modules/dashboard/tools/schemas/widget.schema';
@@ -19,7 +22,7 @@ const addDashboardWidgetSchema = z.object({
pageLayoutTabId: z.string().uuid().describe('Tab UUID from get_dashboard'),
title: z.string().describe('Widget title'),
type: widgetTypeSchema.describe('Widget type'),
- gridPosition: gridPositionSchema.describe('Position in 12-column grid'),
+ position: widgetPositionSchema.describe('Position in 12-column grid'),
objectMetadataId: z
.uuid()
.optional()
@@ -58,12 +61,7 @@ See create_complete_dashboard for full configuration examples.`,
pageLayoutTabId: string;
title: string;
type: WidgetType;
- gridPosition: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position: PageLayoutWidgetGridPosition;
objectMetadataId?: string;
objectName?: string;
configuration?: WidgetConfigurationInput;
@@ -93,7 +91,7 @@ See create_complete_dashboard for full configuration examples.`,
widgetId: widget.id,
title: widget.title,
type: widget.type,
- gridPosition: widget.gridPosition,
+ position: widget.position,
pageLayoutTabId: parameters.pageLayoutTabId,
},
};
diff --git a/packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts b/packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts
index 3ab092493f4..ec026dfac58 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts
@@ -2,10 +2,14 @@ import { v4 as uuidv4 } from 'uuid';
import { z } from 'zod';
import { type CreatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input';
-import { PageLayoutType, type WidgetType } from 'twenty-shared/types';
+import {
+ PageLayoutType,
+ type PageLayoutWidgetGridPosition,
+ type WidgetType,
+} from 'twenty-shared/types';
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
import {
- gridPositionSchema,
+ widgetPositionSchema,
widgetConfigurationSchema,
widgetTypeSchema,
} from 'src/modules/dashboard/tools/schemas/widget.schema';
@@ -20,7 +24,7 @@ import { resolveWidgetFieldNamesToIds } from 'src/modules/dashboard/tools/utils/
const widgetSchema = z.object({
title: z.string().describe('Widget title displayed in the header'),
type: widgetTypeSchema.describe('Widget type'),
- gridPosition: gridPositionSchema.describe('Position in 12-column grid'),
+ position: widgetPositionSchema.describe('Position in 12-column grid'),
objectMetadataId: z
.uuid()
.optional()
@@ -113,12 +117,7 @@ AGGREGATION OPERATIONS: COUNT, SUM, AVG, MIN, MAX, COUNT_EMPTY, COUNT_NOT_EMPTY`
widgets?: Array<{
title: string;
type: WidgetType;
- gridPosition: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position: PageLayoutWidgetGridPosition;
objectMetadataId?: string;
objectName?: string;
configuration?: WidgetConfigurationInput;
diff --git a/packages/twenty-server/src/modules/dashboard/tools/get-dashboard.tool.ts b/packages/twenty-server/src/modules/dashboard/tools/get-dashboard.tool.ts
index 4b1fca1dbe2..f56414f2e0f 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/get-dashboard.tool.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/get-dashboard.tool.ts
@@ -113,7 +113,7 @@ export const createGetDashboardTool = (
id: w.id,
title: w.title,
type: w.type,
- gridPosition: w.gridPosition,
+ position: w.position,
objectMetadataId: w.objectMetadataId,
configuration: w.configuration,
};
@@ -183,7 +183,7 @@ export const createGetDashboardTool = (
id: w.id,
title: w.title,
type: w.type,
- gridPosition: w.gridPosition,
+ position: w.position,
objectMetadataId: w.objectMetadataId,
configuration: enrichedConfiguration,
};
diff --git a/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts b/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts
index 2949c4dfa5d..2156095b8a7 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts
@@ -2,6 +2,7 @@ import { isNumber } from '@sniptt/guards';
import {
AggregateOperations,
ObjectRecordGroupByDateGranularity,
+ PageLayoutTabLayoutMode,
ViewFilterOperand,
WidgetType,
} from 'twenty-shared/types';
@@ -270,7 +271,8 @@ const withRangeMinMaxRefinement = <T extends z.ZodType<RangeMinMaxFields>>(
},
);
-export const gridPositionSchema = z.object({
+export const widgetPositionSchema = z.object({
+ layoutMode: z.literal(PageLayoutTabLayoutMode.GRID),
row: z.number().min(0).describe('Row position (0-based)'),
column: z
.number()
diff --git a/packages/twenty-server/src/modules/dashboard/tools/types/widget-identifiers-input.type.ts b/packages/twenty-server/src/modules/dashboard/tools/types/widget-identifiers-input.type.ts
index 2633b68c9bf..0ec0bba40cc 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/types/widget-identifiers-input.type.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/types/widget-identifiers-input.type.ts
@@ -1,13 +1,13 @@
import { type z } from 'zod';
import { type WidgetType } from 'twenty-shared/types';
-import { type gridPositionSchema } from 'src/modules/dashboard/tools/schemas/widget.schema';
+import { type widgetPositionSchema } from 'src/modules/dashboard/tools/schemas/widget.schema';
import { type WidgetConfigurationInput } from 'src/modules/dashboard/tools/types/widget-configuration-input.type';
export type WidgetIdentifiersInput = {
title: string;
type: WidgetType;
- gridPosition: z.infer<typeof gridPositionSchema>;
+ position: z.infer<typeof widgetPositionSchema>;
objectMetadataId?: string;
objectName?: string;
configuration?: WidgetConfigurationInput;
diff --git a/packages/twenty-server/src/modules/dashboard/tools/types/widget-with-metadata-ids.type.ts b/packages/twenty-server/src/modules/dashboard/tools/types/widget-with-metadata-ids.type.ts
index c52780d9569..f4ad2390da6 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/types/widget-with-metadata-ids.type.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/types/widget-with-metadata-ids.type.ts
@@ -2,12 +2,12 @@ import { type z } from 'zod';
import { type WidgetType } from 'twenty-shared/types';
import { type AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
-import { type gridPositionSchema } from 'src/modules/dashboard/tools/schemas/widget.schema';
+import { type widgetPositionSchema } from 'src/modules/dashboard/tools/schemas/widget.schema';
export type WidgetWithMetadataIds = {
title: string;
type: WidgetType;
- gridPosition: z.infer<typeof gridPositionSchema>;
+ position: z.infer<typeof widgetPositionSchema>;
objectMetadataId?: string;
configuration?: AllPageLayoutWidgetConfiguration;
};
diff --git a/packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts b/packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts
index 49f6d1358a9..bf503890a66 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts
@@ -2,10 +2,13 @@ import { isNonEmptyString } from '@sniptt/guards';
import { isDefined, isEmptyObject } from 'twenty-shared/utils';
import { z } from 'zod';
-import { type WidgetType } from 'twenty-shared/types';
+import {
+ type PageLayoutWidgetGridPosition,
+ type WidgetType,
+} from 'twenty-shared/types';
import { type AllPageLayoutWidgetConfiguration } from 'src/engine/metadata-modules/page-layout-widget/types/all-page-layout-widget-configuration.type';
import {
- gridPositionSchema,
+ widgetPositionSchema,
widgetConfigurationSchemaWithoutDefaults,
widgetTypeSchema,
} from 'src/modules/dashboard/tools/schemas/widget.schema';
@@ -24,7 +27,7 @@ const updateDashboardWidgetSchema = z.object({
widgetId: z.string().uuid().describe('The UUID of the widget to update'),
title: z.string().optional().describe('New widget title'),
type: widgetTypeSchema.optional().describe('New widget type'),
- gridPosition: gridPositionSchema
+ position: widgetPositionSchema
.optional()
.describe('New position and size in the grid layout'),
objectMetadataId: z
@@ -60,12 +63,7 @@ Only provide fields you want to change - others remain unchanged.`,
widgetId: string;
title?: string;
type?: WidgetType;
- gridPosition?: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position?: PageLayoutWidgetGridPosition;
objectMetadataId?: string;
objectName?: string;
configuration?: WidgetConfigurationInput;
@@ -141,7 +139,7 @@ Only provide fields you want to change - others remain unchanged.`,
widgetId: widget.id,
title: widget.title,
type: widget.type,
- gridPosition: widget.gridPosition,
+ position: widget.position,
configuration: widget.configuration,
},
};
diff --git a/packages/twenty-server/src/modules/dashboard/tools/utils/__tests__/resolve-widget-field-names-to-metadata-ids.util.spec.ts b/packages/twenty-server/src/modules/dashboard/tools/utils/__tests__/resolve-widget-field-names-to-metadata-ids.util.spec.ts
index 6aed7d21f15..8e5682156ef 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/utils/__tests__/resolve-widget-field-names-to-metadata-ids.util.spec.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/utils/__tests__/resolve-widget-field-names-to-metadata-ids.util.spec.ts
@@ -1,6 +1,7 @@
import {
AggregateOperations,
FieldMetadataType,
+ PageLayoutTabLayoutMode,
ViewFilterOperand,
WidgetType,
} from 'twenty-shared/types';
@@ -53,7 +54,13 @@ const buildAggregateWidget = (
): WidgetIdentifiersInput => ({
title: 'KPI',
type: WidgetType.GRAPH,
- gridPosition: { row: 0, column: 0, rowSpan: 2, columnSpan: 4 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 2,
+ columnSpan: 4,
+ },
objectName: 'opportunity',
configuration: {
configurationType: WidgetConfigurationType.AGGREGATE_CHART,
diff --git a/packages/twenty-server/src/modules/dashboard/tools/utils/resolve-widget-field-names-to-metadata-ids.util.ts b/packages/twenty-server/src/modules/dashboard/tools/utils/resolve-widget-field-names-to-metadata-ids.util.ts
index c1ee1598704..24746045f2d 100644
--- a/packages/twenty-server/src/modules/dashboard/tools/utils/resolve-widget-field-names-to-metadata-ids.util.ts
+++ b/packages/twenty-server/src/modules/dashboard/tools/utils/resolve-widget-field-names-to-metadata-ids.util.ts
@@ -351,7 +351,7 @@ export const resolveWidgetFieldNamesToIds = (
return {
title: widget.title,
type: widget.type,
- gridPosition: widget.gridPosition,
+ position: widget.position,
objectMetadataId,
configuration: isDefined(widget.configuration)
? resolveConfigurationFieldNamesToIds(
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-record-table-view-universal-identifier.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-record-table-view-universal-identifier.integration-spec.ts.snap
index eae4c1b7792..70627b3024b 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-record-table-view-universal-identifier.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/failing-manifest-record-table-view-universal-identifier.integration-spec.ts.snap
@@ -11,17 +11,17 @@ exports[`Failing manifest sync - RECORD_TABLE widget with unknown view universal
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "isActive": true,
+ "isSystemSideEffect": false,
+ "objectMetadataUniversalIdentifier": Any<String>,
+ "pageLayoutTabUniversalIdentifier": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 6,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 4,
},
- "isActive": true,
- "isSystemSideEffect": false,
- "objectMetadataUniversalIdentifier": Any<String>,
- "pageLayoutTabUniversalIdentifier": Any<String>,
- "position": null,
"title": "RT test table",
"type": "RECORD_TABLE",
"universalConfiguration": {
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 ff3627f745d..edc95bab372 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
@@ -1269,12 +1269,6 @@ exports[`syncApplication should delete old field and create equivalent one when
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 12,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -1304,12 +1298,6 @@ exports[`syncApplication should delete old field and create equivalent one when
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -1337,12 +1325,6 @@ exports[`syncApplication should delete old field and create equivalent one when
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -1370,12 +1352,6 @@ exports[`syncApplication should delete old field and create equivalent one when
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -1403,12 +1379,6 @@ exports[`syncApplication should delete old field and create equivalent one when
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -2789,12 +2759,6 @@ This is a test skill.",
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 12,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -2824,12 +2788,6 @@ This is a test skill.",
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -2857,12 +2815,6 @@ This is a test skill.",
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -2890,12 +2842,6 @@ This is a test skill.",
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
@@ -2923,12 +2869,6 @@ This is a test skill.",
"conditionalDisplay": null,
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
- "column": 0,
- "columnSpan": 12,
- "row": 0,
- "rowSpan": 6,
- },
"isActive": true,
"isSystemSideEffect": true,
"objectMetadataUniversalIdentifier": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
index 3084e1f4313..e06b7b181a4 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
@@ -56,7 +56,7 @@ describe('Failing manifest sync - RECORD_TABLE widget with unknown view universa
universalIdentifier: TEST_TAB_ID,
title: 'Tables',
position: 0,
- layoutMode: PageLayoutTabLayoutMode.CANVAS,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
widgets: [
{
universalIdentifier: TEST_WIDGET_ID,
@@ -64,7 +64,8 @@ describe('Failing manifest sync - RECORD_TABLE widget with unknown view universa
type: 'RECORD_TABLE',
objectUniversalIdentifier:
PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 4,
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
index 06cef79400b..1081b25c6ca 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
@@ -52,14 +52,20 @@ const buildManifestWithRecordTableDashboard = () =>
universalIdentifier: TEST_TAB_ID,
title: 'Tables',
position: 0,
- layoutMode: PageLayoutTabLayoutMode.CANVAS,
+ layoutMode: PageLayoutTabLayoutMode.GRID,
widgets: [
{
universalIdentifier: TEST_WIDGET_ID,
title: 'RT test table',
type: 'RECORD_TABLE',
objectUniversalIdentifier: PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
- gridPosition: { row: 0, column: 0, rowSpan: 4, columnSpan: 6 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 4,
+ columnSpan: 6,
+ },
configuration: {
configurationType: 'RECORD_TABLE',
viewUniversalIdentifier: TEST_VIEW_ID,
diff --git a/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-duplication.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-duplication.integration-spec.ts
index 6063e9da68a..6e20ebd4ddc 100644
--- a/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-duplication.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-duplication.integration-spec.ts
@@ -17,6 +17,7 @@ import {
} from 'twenty-shared/testing';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
PageLayoutType,
ViewFilterOperand,
WidgetType,
@@ -127,7 +128,8 @@ describe('Dashboard duplication should succeed', () => {
title: 'Test Widget',
type: WidgetType.IFRAME,
pageLayoutTabId: testPageLayoutTabId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -235,7 +237,8 @@ describe('Dashboard duplication should succeed', () => {
type: WidgetType.GRAPH,
objectMetadataId: companyObject.id,
pageLayoutTabId: testPageLayoutTabId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-updated-at-sync.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-updated-at-sync.integration-spec.ts
index 15205123670..388481b76f3 100644
--- a/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-updated-at-sync.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/dashboard/successful-dashboard-updated-at-sync.integration-spec.ts
@@ -14,7 +14,11 @@ import { createOnePageLayout } from 'test/integration/metadata/suites/page-layou
import { destroyOnePageLayout } from 'test/integration/metadata/suites/page-layout/utils/destroy-one-page-layout.util';
import { updateOnePageLayout } from 'test/integration/metadata/suites/page-layout/utils/update-one-page-layout.util';
-import { PageLayoutType, WidgetType } from 'twenty-shared/types';
+import {
+ PageLayoutTabLayoutMode,
+ PageLayoutType,
+ WidgetType,
+} from 'twenty-shared/types';
type TestContext = {
pageLayoutId: string;
@@ -50,7 +54,8 @@ const createTestContext = async (): Promise<TestContext> => {
title: 'Widget for Dashboard Sync Test',
type: WidgetType.IFRAME,
pageLayoutTabId: tabId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -131,7 +136,8 @@ describe('Dashboard updatedAt should sync when linked page layout entities chang
title: 'New Widget for Dashboard Sync Test',
type: WidgetType.IFRAME,
pageLayoutTabId: context.tabId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 1,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-tab/utils/create-one-page-layout-tab-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-tab/utils/create-one-page-layout-tab-query-factory.util.ts
index 5844844b64d..ba49fe884b5 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-tab/utils/create-one-page-layout-tab-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-tab/utils/create-one-page-layout-tab-query-factory.util.ts
@@ -1,3 +1,4 @@
+import { WIDGET_POSITION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant';
import gql from 'graphql-tag';
import { WIDGET_CONFIGURATION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-configuration-gql-fields.constant';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
@@ -20,11 +21,8 @@ const DEFAULT_PAGE_LAYOUT_TAB_GQL_FIELDS = `
type
pageLayoutTabId
objectMetadataId
- gridPosition {
- row
- column
- rowSpan
- columnSpan
+ position {
+ ${WIDGET_POSITION_GQL_FIELDS}
}
configuration {
${WIDGET_CONFIGURATION_GQL_FIELDS}
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/failing-page-layout-widget-creation.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/failing-page-layout-widget-creation.integration-spec.ts.snap
index eb0314a1932..1176f2a5007 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/failing-page-layout-widget-creation.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/failing-page-layout-widget-creation.integration-spec.ts.snap
@@ -80,17 +80,6 @@ exports[`Page layout widget creation should fail Edge case configuration validat
}
`;
-exports[`Page layout widget creation should fail General validation failures when gridPosition has invalid values 1`] = `
-{
- "extensions": {
- "code": "BAD_USER_INPUT",
- "userFriendlyMessage": "An error occurred.",
- },
- "message": "row must not be less than 0",
- "name": "UserInputError",
-}
-`;
-
exports[`Page layout widget creation should fail General validation failures when pageLayoutTabId references non-existent tab 1`] = `
{
"extensions": {
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-creation.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-creation.integration-spec.ts.snap
index 655e7d89b89..374c82859cb 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-creation.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-creation.integration-spec.ts.snap
@@ -18,15 +18,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Number Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -51,15 +52,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Number Chart Widget Minimal",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -100,15 +102,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Horizontal Bar Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -149,15 +152,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Horizontal Bar Chart Widget Minimal",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -172,15 +176,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Iframe Widget",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -195,15 +200,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Iframe Widget Minimal",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -243,15 +249,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Line Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -291,15 +298,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Line Chart Widget Minimal",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -329,15 +337,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Pie Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -367,15 +376,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Pie Chart Widget Minimal",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -393,15 +403,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Rich Text Widget",
"type": "STANDALONE_RICH_TEXT",
"updatedAt": Any<String>,
@@ -419,15 +430,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Rich Text Widget Minimal",
"type": "STANDALONE_RICH_TEXT",
"updatedAt": Any<String>,
@@ -468,15 +480,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Vertical Bar Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -517,15 +530,16 @@ exports[`Page layout widget creation should succeed should create a page layout
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Vertical Bar Chart Widget Minimal",
"type": "GRAPH",
"updatedAt": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-update.integration-spec.ts.snap
index 9ed11a8052f..f3b799f486d 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/__snapshots__/successful-page-layout-widget-update.integration-spec.ts.snap
@@ -18,15 +18,16 @@ exports[`Page layout widget update should succeed from a GRAPH widget should upd
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Original Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -67,15 +68,16 @@ exports[`Page layout widget update should succeed from a GRAPH widget should upd
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Original Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -115,15 +117,16 @@ exports[`Page layout widget update should succeed from a GRAPH widget should upd
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Original Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -153,15 +156,16 @@ exports[`Page layout widget update should succeed from a GRAPH widget should upd
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Original Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -202,15 +206,16 @@ exports[`Page layout widget update should succeed from a GRAPH widget should upd
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Original Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -228,15 +233,16 @@ exports[`Page layout widget update should succeed from a STANDALONE_RICH_TEXT wi
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Original Rich Text Widget",
"type": "STANDALONE_RICH_TEXT",
"updatedAt": Any<String>,
@@ -251,15 +257,16 @@ exports[`Page layout widget update should succeed from an IFRAME widget should u
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 3,
"columnSpan": 4,
+ "layoutMode": "GRID",
"row": 2,
"rowSpan": 2,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Original Widget Title",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -274,15 +281,16 @@ exports[`Page layout widget update should succeed from an IFRAME widget should u
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Updated Widget Title",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -297,15 +305,16 @@ exports[`Page layout widget update should succeed from an IFRAME widget should u
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Original Widget Title",
"type": "IFRAME",
"updatedAt": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant.ts
new file mode 100644
index 00000000000..320c8243882
--- /dev/null
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant.ts
@@ -0,0 +1,16 @@
+export const WIDGET_POSITION_GQL_FIELDS = `
+ ... on PageLayoutWidgetGridPosition {
+ layoutMode
+ row
+ column
+ rowSpan
+ columnSpan
+ }
+ ... on PageLayoutWidgetVerticalListPosition {
+ layoutMode
+ index
+ }
+ ... on PageLayoutWidgetCanvasPosition {
+ layoutMode
+ }
+`;
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-creation.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-creation.integration-spec.ts
index 6f8bc063843..fc8958ea16f 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-creation.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-creation.integration-spec.ts
@@ -19,9 +19,10 @@ import { destroyOnePageLayout } from 'test/integration/metadata/suites/page-layo
import { type CreatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/create-page-layout-widget.input';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { WidgetType } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
const DEFAULT_GRID_POSITION = {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
row: 0,
column: 0,
rowSpan: 1,
@@ -69,7 +70,7 @@ describe('Page layout widget creation should fail', () => {
input: {
pageLayoutTabId: testPageLayoutTabId,
type: WidgetType.IFRAME,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
configuration: TEST_IFRAME_CONFIG,
} as CreatePageLayoutWidgetInput,
});
@@ -85,14 +86,14 @@ describe('Page layout widget creation should fail', () => {
pageLayoutTabId: faker.string.uuid(),
type: WidgetType.IFRAME,
configuration: TEST_IFRAME_CONFIG,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
expectOneNotInternalServerErrorSnapshot({ errors });
});
- it('when gridPosition has invalid values', async () => {
+ it('when position has invalid values', async () => {
const { errors } = await createOnePageLayoutWidget({
expectToFail: true,
input: {
@@ -100,7 +101,8 @@ describe('Page layout widget creation should fail', () => {
pageLayoutTabId: testPageLayoutTabId,
type: WidgetType.IFRAME,
configuration: TEST_IFRAME_CONFIG,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: -1,
column: 0,
rowSpan: 1,
@@ -109,7 +111,25 @@ describe('Page layout widget creation should fail', () => {
},
});
- expectOneNotInternalServerErrorSnapshot({ errors });
+ expect(errors).toMatchObject([
+ {
+ extensions: {
+ errors: {
+ pageLayoutWidget: [
+ {
+ errors: [
+ {
+ message: expect.stringContaining(
+ 'row must be an integer greater than or equal to 0',
+ ),
+ },
+ ],
+ },
+ ],
+ },
+ },
+ },
+ ]);
});
});
@@ -125,7 +145,7 @@ describe('Page layout widget creation should fail', () => {
...INVALID_IFRAME_CONFIG_BAD_URL,
configurationType: WidgetConfigurationType.IFRAME,
},
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -143,7 +163,7 @@ describe('Page layout widget creation should fail', () => {
...INVALID_IFRAME_CONFIG_EMPTY_URL,
configurationType: WidgetConfigurationType.IFRAME,
},
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -163,7 +183,7 @@ describe('Page layout widget creation should fail', () => {
...INVALID_STANDALONE_RICH_TEXT_CONFIG_MISSING_BODY,
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT,
} as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -181,7 +201,7 @@ describe('Page layout widget creation should fail', () => {
...INVALID_STANDALONE_RICH_TEXT_CONFIG_BODY_WRONG_TYPE,
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT,
} as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -199,7 +219,7 @@ describe('Page layout widget creation should fail', () => {
type: WidgetType.GRAPH,
configuration:
INVALID_NUMBER_CHART_CONFIG_MISSING_FIELDS as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -215,7 +235,7 @@ describe('Page layout widget creation should fail', () => {
type: WidgetType.GRAPH,
configuration:
INVALID_NUMBER_CHART_CONFIG_BAD_UUID as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -233,7 +253,7 @@ describe('Page layout widget creation should fail', () => {
type: WidgetType.GRAPH,
configuration:
INVALID_VERTICAL_BAR_CHART_CONFIG_MISSING_GROUP_BY as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -249,7 +269,7 @@ describe('Page layout widget creation should fail', () => {
type: WidgetType.GRAPH,
configuration:
INVALID_HORIZONTAL_BAR_CHART_CONFIG_MISSING_GROUP_BY as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -267,7 +287,7 @@ describe('Page layout widget creation should fail', () => {
type: WidgetType.IFRAME,
configuration:
null as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -284,7 +304,7 @@ describe('Page layout widget creation should fail', () => {
configuration: {
someField: 'value',
} as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -302,7 +322,7 @@ describe('Page layout widget creation should fail', () => {
configurationType: 'UNSUPPORTED_TYPE',
someField: 'value',
} as unknown as CreatePageLayoutWidgetInput['configuration'],
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-update.integration-spec.ts
index 076a5ac309a..95753269965 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/failing-page-layout-widget-update.integration-spec.ts
@@ -20,9 +20,10 @@ import { destroyOnePageLayout } from 'test/integration/metadata/suites/page-layo
import { type UpdatePageLayoutWidgetInput } from 'src/engine/metadata-modules/page-layout-widget/dtos/inputs/update-page-layout-widget.input';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { WidgetType } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
const DEFAULT_GRID_POSITION = {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
row: 0,
column: 0,
rowSpan: 1,
@@ -85,7 +86,7 @@ describe('Page layout widget update should fail', () => {
pageLayoutTabId: testPageLayoutTabId,
type: WidgetType.IFRAME,
configuration: TEST_IFRAME_CONFIG,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-creation.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-creation.integration-spec.ts
index 8a99cbcded5..8d9ee0acb43 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-creation.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-creation.integration-spec.ts
@@ -15,7 +15,12 @@ import {
type EachTestingContext,
eachTestingContextFilter,
} from 'twenty-shared/testing';
-import { AggregateOperations, WidgetType } from 'twenty-shared/types';
+import {
+ AggregateOperations,
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
+ WidgetType,
+} from 'twenty-shared/types';
import { AxisNameDisplay } from 'src/engine/metadata-modules/page-layout-widget/enums/axis-name-display.enum';
import { BarChartLayout } from 'src/engine/metadata-modules/page-layout-widget/enums/bar-chart-layout.enum';
@@ -29,12 +34,7 @@ type StaticTestContext = {
title: string;
type: WidgetType;
configuration: AllPageLayoutWidgetConfiguration;
- gridPosition: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position: PageLayoutWidgetGridPosition;
};
};
@@ -44,6 +44,7 @@ type GraphTestContext = {
};
const DEFAULT_GRID_POSITION = {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
row: 0,
column: 0,
rowSpan: 1,
@@ -58,7 +59,7 @@ const STATIC_TEST_CASES: EachTestingContext<StaticTestContext>[] = [
title: 'Iframe Widget',
type: WidgetType.IFRAME,
configuration: TEST_IFRAME_CONFIG,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
},
},
@@ -71,7 +72,7 @@ const STATIC_TEST_CASES: EachTestingContext<StaticTestContext>[] = [
configuration: {
configurationType: WidgetConfigurationType.IFRAME,
},
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
},
},
@@ -83,7 +84,7 @@ const STATIC_TEST_CASES: EachTestingContext<StaticTestContext>[] = [
title: 'Rich Text Widget',
type: WidgetType.STANDALONE_RICH_TEXT,
configuration: TEST_STANDALONE_RICH_TEXT_CONFIG,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
},
},
@@ -95,7 +96,7 @@ const STATIC_TEST_CASES: EachTestingContext<StaticTestContext>[] = [
title: 'Rich Text Widget Minimal',
type: WidgetType.STANDALONE_RICH_TEXT,
configuration: TEST_STANDALONE_RICH_TEXT_CONFIG_MINIMAL,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
},
},
@@ -374,7 +375,7 @@ describe('Page layout widget creation should succeed', () => {
objectMetadataId: testSetup.objectMetadataId,
configuration: buildConfiguration(),
pageLayoutTabId: testSetup.pageLayoutTabId,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-deletion.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-deletion.integration-spec.ts
index 8498ab3cbfe..a6c173ec278 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-deletion.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-deletion.integration-spec.ts
@@ -6,7 +6,7 @@ import { createOnePageLayout } from 'test/integration/metadata/suites/page-layou
import { destroyOnePageLayout } from 'test/integration/metadata/suites/page-layout/utils/destroy-one-page-layout.util';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
-import { WidgetType } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
describe('Page layout widget deletion should succeed', () => {
let testPageLayoutId: string;
@@ -52,7 +52,8 @@ describe('Page layout widget deletion should succeed', () => {
configuration: {
configurationType: WidgetConfigurationType.IFRAME,
},
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-update.integration-spec.ts
index cb04f51faaf..bb13cb2f7e2 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/successful-page-layout-widget-update.integration-spec.ts
@@ -16,7 +16,12 @@ import {
type EachTestingContext,
eachTestingContextFilter,
} from 'twenty-shared/testing';
-import { AggregateOperations, WidgetType } from 'twenty-shared/types';
+import {
+ AggregateOperations,
+ PageLayoutTabLayoutMode,
+ type PageLayoutWidgetGridPosition,
+ WidgetType,
+} from 'twenty-shared/types';
import { AxisNameDisplay } from 'src/engine/metadata-modules/page-layout-widget/enums/axis-name-display.enum';
import { BarChartLayout } from 'src/engine/metadata-modules/page-layout-widget/enums/bar-chart-layout.enum';
@@ -29,12 +34,7 @@ type StaticUpdateTestContext = {
input: {
title?: string;
configuration?: AllPageLayoutWidgetConfiguration;
- gridPosition?: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position?: PageLayoutWidgetGridPosition;
};
};
@@ -43,6 +43,7 @@ type GraphUpdateTestContext = {
};
const DEFAULT_GRID_POSITION = {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
row: 0,
column: 0,
rowSpan: 1,
@@ -63,7 +64,8 @@ const IFRAME_UPDATE_TEST_CASES: EachTestingContext<StaticUpdateTestContext>[] =
title: 'update page layout widget grid position',
context: {
input: {
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
column: 3,
rowSpan: 2,
@@ -138,7 +140,7 @@ describe('Page layout widget update should succeed', () => {
pageLayoutTabId: testSetup.pageLayoutTabId,
type: WidgetType.IFRAME,
configuration: TEST_IFRAME_CONFIG,
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -186,7 +188,7 @@ describe('Page layout widget update should succeed', () => {
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT,
body: { markdown: 'Initial content' },
},
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
@@ -332,7 +334,7 @@ describe('Page layout widget update should succeed', () => {
aggregateOperation: AggregateOperations.COUNT,
displayDataLabel: false,
},
- gridPosition: DEFAULT_GRID_POSITION,
+ position: DEFAULT_GRID_POSITION,
},
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/create-one-page-layout-widget-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/create-one-page-layout-widget-query-factory.util.ts
index 45c7149665c..fd3f2d7e47f 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/create-one-page-layout-widget-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/create-one-page-layout-widget-query-factory.util.ts
@@ -1,3 +1,4 @@
+import { WIDGET_POSITION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant';
import gql from 'graphql-tag';
import { WIDGET_CONFIGURATION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-configuration-gql-fields.constant';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
@@ -11,11 +12,8 @@ const DEFAULT_PAGE_LAYOUT_WIDGET_GQL_FIELDS = `
type
pageLayoutTabId
objectMetadataId
- gridPosition {
- row
- column
- rowSpan
- columnSpan
+ position {
+ ${WIDGET_POSITION_GQL_FIELDS}
}
configuration {
${WIDGET_CONFIGURATION_GQL_FIELDS}
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/find-page-layout-widgets-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/find-page-layout-widgets-query-factory.util.ts
index 5a4bd084dd4..862127c61f9 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/find-page-layout-widgets-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/find-page-layout-widgets-query-factory.util.ts
@@ -1,3 +1,4 @@
+import { WIDGET_POSITION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant';
import gql from 'graphql-tag';
import { WIDGET_CONFIGURATION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-configuration-gql-fields.constant';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
@@ -12,11 +13,8 @@ const DEFAULT_PAGE_LAYOUT_WIDGET_GQL_FIELDS = `
type
pageLayoutTabId
objectMetadataId
- gridPosition {
- row
- column
- rowSpan
- columnSpan
+ position {
+ ${WIDGET_POSITION_GQL_FIELDS}
}
configuration {
${WIDGET_CONFIGURATION_GQL_FIELDS}
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/update-one-page-layout-widget-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/update-one-page-layout-widget-query-factory.util.ts
index 4c2f5f3e58d..9ff16108ff9 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/update-one-page-layout-widget-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout-widget/utils/update-one-page-layout-widget-query-factory.util.ts
@@ -1,3 +1,4 @@
+import { WIDGET_POSITION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant';
import gql from 'graphql-tag';
import { WIDGET_CONFIGURATION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-configuration-gql-fields.constant';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
@@ -14,11 +15,8 @@ const DEFAULT_PAGE_LAYOUT_WIDGET_GQL_FIELDS = `
type
pageLayoutTabId
objectMetadataId
- gridPosition {
- row
- column
- rowSpan
- columnSpan
+ position {
+ ${WIDGET_POSITION_GQL_FIELDS}
}
configuration {
${WIDGET_CONFIGURATION_GQL_FIELDS}
@@ -46,7 +44,6 @@ export const updateOnePageLayoutWidgetQueryFactory = ({
title: input.title,
type: input.type,
objectMetadataId: input.objectMetadataId,
- gridPosition: input.gridPosition,
position: input.position,
configuration: input.configuration,
conditionalDisplay: input.conditionalDisplay,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-widget-restore-via-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-widget-restore-via-update.integration-spec.ts.snap
index b497ddd5726..ebc9be924a2 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-widget-restore-via-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-widget-restore-via-update.integration-spec.ts.snap
@@ -38,15 +38,16 @@ exports[`Page layout widget restore via bulk update should succeed should create
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Restored Graph Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -87,15 +88,16 @@ exports[`Page layout widget restore via bulk update should succeed should handle
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 2,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 2,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Updated Widget Title",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -117,15 +119,16 @@ exports[`Page layout widget restore via bulk update should succeed should handle
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 1,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Restored Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -137,15 +140,16 @@ exports[`Page layout widget restore via bulk update should succeed should handle
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 2,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Brand New Widget",
"type": "IFRAME",
"updatedAt": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts.snap
index 6e79f0731f6..7038c2bbe34 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts.snap
@@ -43,15 +43,16 @@ exports[`Page layout with tabs creation via update should succeed should create
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Existing Tab Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -77,15 +78,16 @@ exports[`Page layout with tabs creation via update should succeed should create
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "New Tab Iframe Widget",
"type": "IFRAME",
"updatedAt": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-update.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-update.integration-spec.ts.snap
index 58f69ce0eaa..4126e8753a1 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-update.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/__snapshots__/successful-page-layout-with-tabs-update.integration-spec.ts.snap
@@ -43,15 +43,16 @@ exports[`Page layout with tabs update should succeed should update page layout w
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Pie Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
@@ -77,15 +78,16 @@ exports[`Page layout with tabs update should succeed should update page layout w
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": null,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": null,
- "pageLayoutTabId": Any<String>,
"title": "Iframe Widget",
"type": "IFRAME",
"updatedAt": Any<String>,
@@ -141,15 +143,16 @@ exports[`Page layout with tabs update should succeed should update page layout w
},
"createdAt": Any<String>,
"deletedAt": null,
- "gridPosition": {
+ "id": Any<String>,
+ "objectMetadataId": Any<String>,
+ "pageLayoutTabId": Any<String>,
+ "position": {
"column": 0,
"columnSpan": 1,
+ "layoutMode": "GRID",
"row": 0,
"rowSpan": 1,
},
- "id": Any<String>,
- "objectMetadataId": Any<String>,
- "pageLayoutTabId": Any<String>,
"title": "Pie Chart Widget",
"type": "GRAPH",
"updatedAt": Any<String>,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/failing-page-layout-with-tabs-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout/failing-page-layout-with-tabs-update.integration-spec.ts
index ce748f54c35..0574b4e46d8 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/failing-page-layout-with-tabs-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/failing-page-layout-with-tabs-update.integration-spec.ts
@@ -14,6 +14,7 @@ import { updateOnePageLayoutWithTabsAndWidgets } from 'test/integration/metadata
import {
AggregateOperations,
FieldMetadataType,
+ PageLayoutTabLayoutMode,
PageLayoutType,
ViewFilterOperand,
WidgetType,
@@ -48,7 +49,13 @@ describe('Page layout with tabs update should fail', () => {
title: 'Widget 1',
type: WidgetType.FIELDS,
objectMetadataId: null,
- gridPosition: { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
configuration: {
configurationType: WidgetConfigurationType.IFRAME,
},
@@ -190,7 +197,8 @@ describe('Page layout with tabs update should fail', () => {
title: chartTitle,
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID as const,
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-widget-restore-via-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-widget-restore-via-update.integration-spec.ts
index eec17caf97d..8479fa46e8d 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-widget-restore-via-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-widget-restore-via-update.integration-spec.ts
@@ -7,6 +7,7 @@ import { updateOnePageLayoutWithTabsAndWidgets } from 'test/integration/metadata
import { extractRecordIdsAndDatesAsExpectAny } from 'test/utils/extract-record-ids-and-dates-as-expect-any';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
PageLayoutType,
WidgetType,
} from 'twenty-shared/types';
@@ -86,7 +87,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Graph Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -152,7 +154,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Restored Graph Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -211,7 +214,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Widget To Update',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -228,7 +232,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Widget To Restore',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 1,
column: 0,
rowSpan: 1,
@@ -267,7 +272,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Widget To Update',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -305,7 +311,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Updated Widget Title',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 2,
@@ -322,7 +329,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Restored Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 1,
column: 0,
rowSpan: 1,
@@ -342,7 +350,8 @@ describe('Page layout widget restore via bulk update should succeed', () => {
title: 'Brand New Widget',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 2,
column: 0,
rowSpan: 1,
@@ -394,9 +403,23 @@ describe('Page layout widget restore via bulk update should succeed', () => {
(tab) => ({
...tab,
widgets: [...(tab.widgets ?? [])].sort(
- (a, b) =>
- (a.gridPosition?.row ?? 0) - (b.gridPosition?.row ?? 0) ||
- (a.gridPosition?.column ?? 0) - (b.gridPosition?.column ?? 0),
+ (firstWidget, secondWidget) => {
+ const firstPosition =
+ firstWidget.position?.layoutMode ===
+ PageLayoutTabLayoutMode.GRID
+ ? firstWidget.position
+ : undefined;
+ const secondPosition =
+ secondWidget.position?.layoutMode ===
+ PageLayoutTabLayoutMode.GRID
+ ? secondWidget.position
+ : undefined;
+
+ return (
+ (firstPosition?.row ?? 0) - (secondPosition?.row ?? 0) ||
+ (firstPosition?.column ?? 0) - (secondPosition?.column ?? 0)
+ );
+ },
),
}),
),
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts
index 8bff5b49480..ee0449f528a 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-creation-via-update.integration-spec.ts
@@ -7,6 +7,7 @@ import { updateOnePageLayoutWithTabsAndWidgets } from 'test/integration/metadata
import { extractRecordIdsAndDatesAsExpectAny } from 'test/utils/extract-record-ids-and-dates-as-expect-any';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
PageLayoutType,
WidgetType,
} from 'twenty-shared/types';
@@ -98,7 +99,8 @@ describe('Page layout with tabs creation via update should succeed', () => {
title: 'Existing Tab Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -125,7 +127,8 @@ describe('Page layout with tabs creation via update should succeed', () => {
title: 'New Tab Iframe Widget',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-update.integration-spec.ts
index a65333f27f5..33030c3a695 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/successful-page-layout-with-tabs-update.integration-spec.ts
@@ -10,7 +10,9 @@ import {
} from 'twenty-shared/testing';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
PageLayoutType,
+ type PageLayoutWidgetGridPosition,
WidgetType,
} from 'twenty-shared/types';
import { v4 } from 'uuid';
@@ -40,12 +42,7 @@ type TestContext = {
title: string;
type: WidgetType;
objectMetadataId: string | null;
- gridPosition: {
- row: number;
- column: number;
- rowSpan: number;
- columnSpan: number;
- };
+ position: PageLayoutWidgetGridPosition;
configuration: AllPageLayoutWidgetConfiguration;
}>;
}>;
@@ -80,7 +77,8 @@ describe('Page layout with tabs update should succeed', () => {
title: 'Pie Chart Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -115,7 +113,8 @@ describe('Page layout with tabs update should succeed', () => {
title: 'Pie Chart Widget',
type: WidgetType.GRAPH,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -142,7 +141,8 @@ describe('Page layout with tabs update should succeed', () => {
title: 'Iframe Widget',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -254,7 +254,8 @@ describe('Page layout with tabs update should succeed', () => {
title: 'Iframe Widget',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
@@ -299,7 +300,8 @@ describe('Page layout with tabs update should succeed', () => {
title: 'Iframe Widget',
type: WidgetType.IFRAME,
objectMetadataId: null,
- gridPosition: {
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
column: 0,
rowSpan: 1,
diff --git a/packages/twenty-server/test/integration/metadata/suites/page-layout/utils/update-one-page-layout-with-tabs-and-widgets-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/page-layout/utils/update-one-page-layout-with-tabs-and-widgets-query-factory.util.ts
index 5256c6bcb62..b1d1b734c31 100644
--- a/packages/twenty-server/test/integration/metadata/suites/page-layout/utils/update-one-page-layout-with-tabs-and-widgets-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/page-layout/utils/update-one-page-layout-with-tabs-and-widgets-query-factory.util.ts
@@ -1,3 +1,4 @@
+import { WIDGET_POSITION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-position-gql-fields.constant';
import gql from 'graphql-tag';
import { WIDGET_CONFIGURATION_GQL_FIELDS } from 'test/integration/metadata/suites/page-layout-widget/constants/widget-configuration-gql-fields.constant';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
@@ -34,11 +35,8 @@ const DEFAULT_PAGE_LAYOUT_GQL_FIELDS = `
type
pageLayoutTabId
objectMetadataId
- gridPosition {
- row
- column
- rowSpan
- columnSpan
+ position {
+ ${WIDGET_POSITION_GQL_FIELDS}
}
configuration {
${WIDGET_CONFIGURATION_GQL_FIELDS}
diff --git a/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget-view-settings.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget-view-settings.integration-spec.ts
index 8cd9b726eae..15c179dbfba 100644
--- a/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget-view-settings.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget-view-settings.integration-spec.ts
@@ -14,6 +14,7 @@ import { destroyOneView } from 'test/integration/metadata/suites/view/utils/dest
import { upsertViewWidget } from 'test/integration/metadata/suites/view/utils/upsert-view-widget.util';
import {
FieldMetadataType,
+ PageLayoutTabLayoutMode,
ViewCalendarLayout,
ViewType,
WidgetType,
@@ -136,7 +137,13 @@ describe('upsertViewWidget view settings', () => {
type: WidgetType.RECORD_TABLE,
pageLayoutTabId,
objectMetadataId,
- gridPosition: { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
configuration: {
configurationType: WidgetConfigurationType.RECORD_TABLE,
viewId,
@@ -401,7 +408,13 @@ describe('upsertViewWidget view settings', () => {
type: WidgetType.FIELD,
pageLayoutTabId,
objectMetadataId,
- gridPosition: { row: 1, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 1,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
configuration: {
configurationType: WidgetConfigurationType.FIELD,
fieldMetadataId: selectFieldMetadataId,
diff --git a/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget.integration-spec.ts
index 87509de3d58..fb0bf07c9ce 100644
--- a/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/view/upsert-view-widget.integration-spec.ts
@@ -22,6 +22,7 @@ import { destroyOneView } from 'test/integration/metadata/suites/view/utils/dest
import { upsertViewWidget } from 'test/integration/metadata/suites/view/utils/upsert-view-widget.util';
import {
AggregateOperations,
+ PageLayoutTabLayoutMode,
ViewFilterGroupLogicalOperator,
ViewFilterOperand,
ViewSortDirection,
@@ -106,7 +107,13 @@ describe('upsertViewWidget', () => {
type: WidgetType.RECORD_TABLE,
pageLayoutTabId,
objectMetadataId: testFieldMetadataIds.objectMetadataId,
- gridPosition: { row: 0, column: 0, rowSpan: 1, columnSpan: 1 },
+ position: {
+ layoutMode: PageLayoutTabLayoutMode.GRID,
+ row: 0,
+ column: 0,
+ rowSpan: 1,
+ columnSpan: 1,
+ },
configuration: {
configurationType: WidgetConfigurationType.RECORD_TABLE,
viewId,
diff --git a/packages/twenty-shared/src/application/pageLayoutManifestType.ts b/packages/twenty-shared/src/application/pageLayoutManifestType.ts
index 101421c8253..1925e603de1 100644
--- a/packages/twenty-shared/src/application/pageLayoutManifestType.ts
+++ b/packages/twenty-shared/src/application/pageLayoutManifestType.ts
@@ -1,9 +1,9 @@
import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsType';
import {
- type GridPosition,
type PageLayoutTabLayoutMode,
type PageLayoutType,
type PageLayoutWidgetConditionalDisplay,
+ type PageLayoutWidgetPosition,
type PageLayoutWidgetUniversalConfiguration,
type WidgetType,
} from '@/types';
@@ -13,7 +13,7 @@ export type PageLayoutWidgetManifest = SyncableEntityOptions & {
type: `${WidgetType}`;
objectUniversalIdentifier?: string;
conditionalDisplay?: PageLayoutWidgetConditionalDisplay;
- gridPosition?: GridPosition;
+ position?: PageLayoutWidgetPosition;
configuration: PageLayoutWidgetUniversalConfiguration;
};