Ensure command backfills all relations as Field widget (#18858)

\+ add missing Field widget for workflow relations

Copies the logic of the injectRelationWidgetsIntoLayout front-end
function
This commit is contained in:
Baptiste Devessier
2026-03-23 17:49:05 +01:00
committed by GitHub
parent 1cfdd2e8ed
commit 07a4cf2d26
5 changed files with 392 additions and 70 deletions
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard page layout metadata related entity ids 1`] = `
{
@@ -340,21 +340,24 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"workflowRunRecordPage": {
"id": "00000000-0000-0000-0000-000000000093",
"id": "00000000-0000-0000-0000-000000000094",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000096",
"id": "00000000-0000-0000-0000-000000000098",
"widgets": {
"workflowRun": {
"id": "00000000-0000-0000-0000-000000000097",
"id": "00000000-0000-0000-0000-000000000099",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000094",
"id": "00000000-0000-0000-0000-000000000095",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000095",
"id": "00000000-0000-0000-0000-000000000096",
},
"workflow": {
"id": "00000000-0000-0000-0000-000000000097",
},
},
},
@@ -364,10 +367,10 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
"id": "00000000-0000-0000-0000-000000000088",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000091",
"id": "00000000-0000-0000-0000-000000000092",
"widgets": {
"workflowVersion": {
"id": "00000000-0000-0000-0000-000000000092",
"id": "00000000-0000-0000-0000-000000000093",
},
},
},
@@ -377,6 +380,9 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
"fields": {
"id": "00000000-0000-0000-0000-000000000090",
},
"workflow": {
"id": "00000000-0000-0000-0000-000000000091",
},
},
},
},
@@ -1,8 +1,11 @@
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
import {
GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
import {
@@ -19,6 +22,15 @@ const WORKFLOW_RUN_PAGE_TABS = {
universalIdentifier: '20202020-ac08-4008-8008-a0bcf10a8811',
...WIDGET_PROPS.fields,
},
workflow: {
universalIdentifier: '20202020-ac08-4008-8008-a0bcf10a8813',
title: 'Workflow',
type: WidgetType.FIELD,
gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
fieldUniversalIdentifier:
STANDARD_OBJECTS.workflowRun.fields.workflow.universalIdentifier,
},
},
},
flow: {
@@ -1,8 +1,11 @@
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
import {
GRID_POSITIONS,
TAB_PROPS,
VERTICAL_LIST_LAYOUT_POSITIONS,
WIDGET_PROPS,
} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
import {
@@ -19,6 +22,15 @@ const WORKFLOW_VERSION_PAGE_TABS = {
universalIdentifier: '20202020-ac07-4007-8007-a0bcf10a7711',
...WIDGET_PROPS.fields,
},
workflow: {
universalIdentifier: '20202020-ac07-4007-8007-a0bcf10a7712',
title: 'Workflow',
type: WidgetType.FIELD,
gridPosition: GRID_POSITIONS.FULL_WIDTH,
position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
fieldUniversalIdentifier:
STANDARD_OBJECTS.workflowVersion.fields.workflow.universalIdentifier,
},
},
},
flow: {