Migrate field widgets to backend (#18808)

- Renamed FieldConfiguration's layout field to fieldDisplayMode as it
caused issues with the layout field of BarChartConfiguration
- Create relation Field widgets for standard objects

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Baptiste Devessier
2026-03-23 01:26:00 +01:00
committed by GitHub
parent d90d2e3151
commit be89ef30cd
38 changed files with 1388 additions and 790 deletions
@@ -51,10 +51,8 @@ export class FlatPageLayoutWidgetTypeValidatorService {
msg`Widget type VIEW is not supported yet.`,
),
IFRAME: validateIframeFlatPageLayoutWidgetForCreation,
FIELD: rejectWidgetType(
WidgetType.FIELD,
'Widget type FIELD is not supported yet.',
msg`Widget type FIELD is not supported yet.`,
FIELD: validateSimpleRecordPageWidgetForCreation(
WidgetConfigurationType.FIELD,
),
FIELDS: validateFieldsFlatPageLayoutWidgetForCreation,
GRAPH: validateGraphFlatPageLayoutWidgetForCreation,
@@ -101,10 +99,8 @@ export class FlatPageLayoutWidgetTypeValidatorService {
msg`Widget type VIEW is not supported yet.`,
),
IFRAME: validateIframeFlatPageLayoutWidgetForUpdate,
FIELD: rejectWidgetType(
WidgetType.FIELD,
'Widget type FIELD is not supported yet.',
msg`Widget type FIELD is not supported yet.`,
FIELD: validateSimpleRecordPageWidgetForUpdate(
WidgetConfigurationType.FIELD,
),
FIELDS: () => [],
GRAPH: validateGraphFlatPageLayoutWidgetForUpdate,
@@ -321,8 +321,25 @@ export const fromPageLayoutWidgetConfigurationToUniversalConfiguration = ({
};
}
case WidgetConfigurationType.FIELD: {
const { fieldMetadataId, fieldDisplayMode, configurationType } =
configuration;
const fieldMetadataUniversalIdentifier =
getFieldMetadataUniversalIdentifier({
fieldMetadataId,
fieldMetadataUniversalIdentifierById,
shouldThrowOnMissingIdentifier,
});
return {
configurationType,
fieldMetadataId: fieldMetadataUniversalIdentifier ?? fieldMetadataId,
fieldDisplayMode,
};
}
case WidgetConfigurationType.VIEW:
case WidgetConfigurationType.FIELD:
case WidgetConfigurationType.TIMELINE:
case WidgetConfigurationType.TASKS:
case WidgetConfigurationType.NOTES: