Skip to content

The open alternative to Salesforce, designed for AI.

Enable records layouts for all records except workflows (#15378)

Baptiste Devessier24349cb72978
diff --git a/packages/twenty-front/src/modules/object-record/record-show/components/PageLayoutDispatcher.tsx b/packages/twenty-front/src/modules/object-record/record-show/components/PageLayoutDispatcher.tsx
index 60ea78e1583..d54e4ff579a 100644
--- a/packages/twenty-front/src/modules/object-record/record-show/components/PageLayoutDispatcher.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-show/components/PageLayoutDispatcher.tsx
@@ -18,23 +18,15 @@ export const PageLayoutDispatcher = ({
FeatureFlagKey.IS_RECORD_PAGE_LAYOUT_ENABLED,
);
- const isStandardObjectWithDefaultLayout =
+ const isStandardObjectUnsupportingRecordPageLayouts =
targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Company ||
+ CoreObjectNameSingular.Workflow ||
targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Person ||
+ CoreObjectNameSingular.WorkflowRun ||
targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Opportunity ||
- targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Note ||
- targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Task;
+ CoreObjectNameSingular.WorkflowVersion;
- if (
- targetRecordIdentifier.targetObjectNameSingular ===
- CoreObjectNameSingular.Dashboard ||
- (isRecordPageEnabled && isStandardObjectWithDefaultLayout)
- ) {
+ if (isRecordPageEnabled && !isStandardObjectUnsupportingRecordPageLayouts) {
return (
<PageLayoutRecordPageRenderer
targetRecordIdentifier={targetRecordIdentifier}
diff --git a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts b/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts
index b546475a277..97b1e7cee35 100644
--- a/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts
+++ b/packages/twenty-front/src/modules/page-layout/constants/DefaultRecordPageLayout.ts
@@ -173,69 +173,5 @@ export const DEFAULT_RECORD_PAGE_LAYOUT: PageLayout = {
},
],
},
- {
- __typename: 'PageLayoutTab',
- id: 'default-tab-emails',
- title: 'Emails',
- position: 600,
- layoutMode: 'vertical-list',
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- id: 'default-widget-emails',
- pageLayoutTabId: 'default-tab-emails',
- title: 'Emails',
- type: WidgetType.EMAILS,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- configuration: null,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
- {
- __typename: 'PageLayoutTab',
- id: 'default-tab-calendar',
- title: 'Calendar',
- position: 700,
- layoutMode: 'vertical-list',
- pageLayoutId: DEFAULT_RECORD_PAGE_LAYOUT_ID,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- widgets: [
- {
- __typename: 'PageLayoutWidget',
- id: 'default-widget-calendar',
- pageLayoutTabId: 'default-tab-calendar',
- title: 'Calendar',
- type: WidgetType.CALENDAR,
- objectMetadataId: null,
- gridPosition: {
- __typename: 'GridPosition',
- row: 0,
- column: 0,
- rowSpan: 6,
- columnSpan: 12,
- },
- configuration: null,
- createdAt: new Date().toISOString(),
- updatedAt: new Date().toISOString(),
- deletedAt: null,
- },
- ],
- },
],
};