963f2de864
> [!NOTE] > The improvement will only fully work once all tabs get translated. ## When using the front-end mocks https://github.com/user-attachments/assets/cf7dc0fb-9438-4e18-841e-47558ff71474 ## When loading page layout information from database https://github.com/user-attachments/assets/d2c9d98b-97e2-4629-aa6c-53f3f3713733 ## When editing dashboard https://github.com/user-attachments/assets/c6ae3a7a-f05f-48ea-8b33-8f689e3f71f7 Closes https://github.com/twentyhq/twenty/issues/17950#issuecomment-3902782952
104 lines
3.1 KiB
TypeScript
104 lines
3.1 KiB
TypeScript
import { DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultWorkflowVersionPageLayoutId';
|
|
import { type PageLayout } from '@/page-layout/types/PageLayout';
|
|
import {
|
|
PageLayoutTabLayoutMode,
|
|
PageLayoutType,
|
|
WidgetType,
|
|
} from '~/generated-metadata/graphql';
|
|
|
|
/**
|
|
* Default WorkflowVersion PageLayout.
|
|
* Specialized layout for workflow version visualization with Fields and Flow tabs.
|
|
*/
|
|
export const DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT: PageLayout = {
|
|
__typename: 'PageLayout',
|
|
id: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
|
|
name: 'Default Workflow Version Layout',
|
|
type: PageLayoutType.RECORD_PAGE,
|
|
objectMetadataId: null,
|
|
createdAt: new Date().toISOString(),
|
|
updatedAt: new Date().toISOString(),
|
|
deletedAt: null,
|
|
defaultTabToFocusOnMobileAndSidePanelId: 'workflow-version-tab-flow',
|
|
tabs: [
|
|
// Fields tab (position 100)
|
|
{
|
|
__typename: 'PageLayoutTab',
|
|
applicationId: '',
|
|
id: 'workflow-version-tab-fields',
|
|
title: 'Home',
|
|
icon: 'IconHome',
|
|
position: 100,
|
|
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
|
|
pageLayoutId: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
|
|
createdAt: new Date().toISOString(),
|
|
updatedAt: new Date().toISOString(),
|
|
deletedAt: null,
|
|
widgets: [
|
|
{
|
|
__typename: 'PageLayoutWidget',
|
|
id: 'workflow-version-widget-fields',
|
|
pageLayoutTabId: 'workflow-version-tab-fields',
|
|
title: 'Fields',
|
|
type: WidgetType.FIELDS,
|
|
objectMetadataId: null,
|
|
gridPosition: {
|
|
__typename: 'GridPosition',
|
|
row: 0,
|
|
column: 0,
|
|
rowSpan: 12,
|
|
columnSpan: 12,
|
|
},
|
|
configuration: {
|
|
__typename: 'FieldsConfiguration',
|
|
configurationType: 'FIELDS',
|
|
sections: [],
|
|
},
|
|
createdAt: new Date().toISOString(),
|
|
updatedAt: new Date().toISOString(),
|
|
deletedAt: null,
|
|
},
|
|
],
|
|
},
|
|
// Flow tab (position 200)
|
|
{
|
|
__typename: 'PageLayoutTab',
|
|
applicationId: '',
|
|
id: 'workflow-version-tab-flow',
|
|
title: 'Flow',
|
|
icon: 'IconSettings',
|
|
position: 200,
|
|
layoutMode: PageLayoutTabLayoutMode.CANVAS,
|
|
pageLayoutId: DEFAULT_WORKFLOW_VERSION_PAGE_LAYOUT_ID,
|
|
createdAt: new Date().toISOString(),
|
|
updatedAt: new Date().toISOString(),
|
|
deletedAt: null,
|
|
widgets: [
|
|
{
|
|
__typename: 'PageLayoutWidget',
|
|
id: 'workflow-version-widget-flow',
|
|
pageLayoutTabId: 'workflow-version-tab-flow',
|
|
title: 'Flow',
|
|
type: WidgetType.WORKFLOW_VERSION,
|
|
objectMetadataId: null,
|
|
gridPosition: {
|
|
__typename: 'GridPosition',
|
|
row: 0,
|
|
column: 0,
|
|
rowSpan: 12,
|
|
columnSpan: 12,
|
|
},
|
|
configuration: {
|
|
__typename: 'FieldsConfiguration',
|
|
configurationType: 'FIELDS',
|
|
sections: [],
|
|
},
|
|
createdAt: new Date().toISOString(),
|
|
updatedAt: new Date().toISOString(),
|
|
deletedAt: null,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|