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:
committed by
GitHub
parent
d90d2e3151
commit
be89ef30cd
+4
-8
@@ -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,
|
||||
|
||||
+18
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user