Replace newFieldDefaultConfiguration with newFieldDefaultVisibility (#18539)
https://github.com/user-attachments/assets/365092cb-0fe1-44f7-9ae6-c6fc5edb98b2 --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
committed by
GitHub
parent
e4e7137660
commit
ab5fb1f658
+2
-32
@@ -273,7 +273,7 @@ export const fromPageLayoutWidgetConfigurationToUniversalConfiguration = ({
|
||||
}
|
||||
|
||||
case WidgetConfigurationType.FIELDS: {
|
||||
const { viewId, newFieldDefaultConfiguration, ...rest } = configuration;
|
||||
const { viewId, newFieldDefaultVisibility, ...rest } = configuration;
|
||||
|
||||
let viewUniversalIdentifier: string | null = null;
|
||||
|
||||
@@ -291,40 +291,10 @@ export const fromPageLayoutWidgetConfigurationToUniversalConfiguration = ({
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDefined(newFieldDefaultConfiguration)) {
|
||||
return {
|
||||
...rest,
|
||||
newFieldDefaultConfiguration,
|
||||
viewId: viewUniversalIdentifier,
|
||||
};
|
||||
}
|
||||
|
||||
let viewFieldGroupUniversalIdentifier: string | null = null;
|
||||
|
||||
if (isDefined(newFieldDefaultConfiguration.viewFieldGroupId)) {
|
||||
viewFieldGroupUniversalIdentifier =
|
||||
viewFieldGroupUniversalIdentifierById[
|
||||
newFieldDefaultConfiguration.viewFieldGroupId
|
||||
] ?? null;
|
||||
|
||||
if (
|
||||
!isDefined(viewFieldGroupUniversalIdentifier) &&
|
||||
shouldThrowOnMissingIdentifier
|
||||
) {
|
||||
throw new FlatEntityMapsException(
|
||||
`View field group universal identifier not found for id: ${newFieldDefaultConfiguration.viewFieldGroupId}`,
|
||||
FlatEntityMapsExceptionCode.RELATION_UNIVERSAL_IDENTIFIER_NOT_FOUND,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...rest,
|
||||
newFieldDefaultVisibility,
|
||||
viewId: viewUniversalIdentifier,
|
||||
newFieldDefaultConfiguration: {
|
||||
isVisible: newFieldDefaultConfiguration.isVisible,
|
||||
viewFieldGroupId: viewFieldGroupUniversalIdentifier,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user