Add a Table display mode to relation field widgets (#20929)
## Context Adds a new Table layout to the FIELD widget for to-many relation fields. On a record page, a relation can now be displayed as a full record table (the same component used for record indexes and dashboard table widgets) scoped to the records related to the current record. https://github.com/user-attachments/assets/320b24dc-f019-4d0e-bc71-3e64d032d75a https://github.com/user-attachments/assets/2f6d4f8e-de26-4fc1-ae12-c9b9c19654dc https://github.com/user-attachments/assets/3fb6d512-f83c-4818-823e-46ad2644fbc2
This commit is contained in:
+24
-3
@@ -334,15 +334,36 @@ export const fromUniversalConfigurationToFlatPageLayoutWidgetConfiguration = ({
|
||||
}
|
||||
|
||||
case WidgetConfigurationType.FIELD: {
|
||||
const { fieldMetadataId: fieldMetadataUniversalIdentifier, ...rest } =
|
||||
universalConfiguration;
|
||||
const {
|
||||
fieldMetadataId: fieldMetadataUniversalIdentifier,
|
||||
viewId: viewUniversalIdentifier,
|
||||
...rest
|
||||
} = universalConfiguration;
|
||||
|
||||
const fieldMetadataId = resolveFieldMetadataIdOrThrow({
|
||||
fieldMetadataUniversalIdentifier,
|
||||
flatFieldMetadataMaps,
|
||||
});
|
||||
|
||||
return { ...rest, fieldMetadataId };
|
||||
let viewId: string | undefined = undefined;
|
||||
|
||||
if (isDefined(viewUniversalIdentifier)) {
|
||||
const flatView = findFlatEntityByUniversalIdentifier({
|
||||
flatEntityMaps: flatViewMaps,
|
||||
universalIdentifier: viewUniversalIdentifier,
|
||||
});
|
||||
|
||||
if (!isDefined(flatView)) {
|
||||
throw new FlatEntityMapsException(
|
||||
`View not found for universal identifier: ${viewUniversalIdentifier}`,
|
||||
FlatEntityMapsExceptionCode.ENTITY_NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
viewId = flatView.id;
|
||||
}
|
||||
|
||||
return { ...rest, fieldMetadataId, viewId };
|
||||
}
|
||||
|
||||
case WidgetConfigurationType.VIEW:
|
||||
|
||||
Reference in New Issue
Block a user