Skip to content

The open alternative to Salesforce, designed for AI.

Fix empty record page on system objects for non-English workspace members (#20235)

Weiko0bb345b75f92
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
index 3a851d3133f..ae18ac45062 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
@@ -3,6 +3,7 @@ import { type FlatObjectMetadataItem } from '@/metadata-store/types/FlatObjectMe
import { PageLayoutLeftPanel } from '@/page-layout/components/PageLayoutLeftPanel';
import { PageLayoutTabList } from '@/page-layout/components/PageLayoutTabList';
import { PageLayoutTabListEffect } from '@/page-layout/components/PageLayoutTabListEffect';
+import { DEFAULT_RECORD_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultRecordPageLayoutId';
import { PAGE_LAYOUT_LEFT_PANEL_CONTAINER_WIDTH } from '@/page-layout/constants/PageLayoutLeftPanelContainerWidth';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
@@ -25,7 +26,6 @@ import { styled } from '@linaria/react';
import { isDefined } from 'twenty-shared/utils';
import { useIsMobile } from 'twenty-ui/utilities';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
-
const StyledContainer = styled.div<{ hasPinnedTab: boolean }>`
display: grid;
grid-template-columns: ${({ hasPinnedTab }) =>
@@ -104,11 +104,15 @@ export const PageLayoutTabsRenderer = () => {
const SYSTEM_OBJECT_TABS = ['Home', 'Timeline', 'Overview', 'Flow'];
- const tabsForCurrentObject = isSystemObject
- ? tabsWithVisibleWidgets.filter((tab) =>
- SYSTEM_OBJECT_TABS.includes(tab.title),
- )
- : tabsWithVisibleWidgets;
+ const isUsingDefaultRecordPageLayout =
+ currentPageLayout.id === DEFAULT_RECORD_PAGE_LAYOUT_ID;
+
+ const tabsForCurrentObject =
+ isSystemObject && isUsingDefaultRecordPageLayout
+ ? tabsWithVisibleWidgets.filter((tab) =>
+ SYSTEM_OBJECT_TABS.includes(tab.title),
+ )
+ : tabsWithVisibleWidgets;
const { tabsToRenderInTabList, pinnedLeftTab } = getTabsByDisplayMode({
tabs: tabsForCurrentObject,