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
+4
-26
@@ -128,18 +128,12 @@ const buildFieldsWidgetConfiguration = ({
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.FIELDS,
|
||||
viewId: null,
|
||||
newFieldDefaultConfiguration: {
|
||||
isVisible: true,
|
||||
viewFieldGroupId: null,
|
||||
},
|
||||
newFieldDefaultVisibility: true,
|
||||
},
|
||||
universalConfiguration: {
|
||||
configurationType: WidgetConfigurationType.FIELDS,
|
||||
viewId: null,
|
||||
newFieldDefaultConfiguration: {
|
||||
isVisible: true,
|
||||
viewFieldGroupId: null,
|
||||
},
|
||||
newFieldDefaultVisibility: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -167,32 +161,16 @@ const buildFieldsWidgetConfiguration = ({
|
||||
|
||||
const viewUniversalIdentifier = viewDefinition?.universalIdentifier ?? null;
|
||||
|
||||
const otherViewFieldGroupId =
|
||||
views[recordPageFieldsViewName]?.viewFieldGroups?.other?.id ?? null;
|
||||
|
||||
const otherViewFieldGroupUniversalIdentifier =
|
||||
viewDefinition?.viewFieldGroups?.other?.universalIdentifier ?? null;
|
||||
|
||||
const newFieldDefaultConfiguration = {
|
||||
isVisible: true,
|
||||
viewFieldGroupId: otherViewFieldGroupId,
|
||||
};
|
||||
|
||||
const universalNewFieldDefaultConfiguration = {
|
||||
isVisible: true,
|
||||
viewFieldGroupId: otherViewFieldGroupUniversalIdentifier,
|
||||
};
|
||||
|
||||
return {
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.FIELDS,
|
||||
viewId,
|
||||
newFieldDefaultConfiguration,
|
||||
newFieldDefaultVisibility: true,
|
||||
},
|
||||
universalConfiguration: {
|
||||
configurationType: WidgetConfigurationType.FIELDS,
|
||||
viewId: viewUniversalIdentifier,
|
||||
newFieldDefaultConfiguration: universalNewFieldDefaultConfiguration,
|
||||
newFieldDefaultVisibility: true,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
+2
-32
@@ -257,7 +257,7 @@ export const fromUniversalConfigurationToFlatPageLayoutWidgetConfiguration = ({
|
||||
case WidgetConfigurationType.FIELDS: {
|
||||
const {
|
||||
viewId: viewUniversalIdentifier,
|
||||
newFieldDefaultConfiguration: universalNewFieldDefaultConfiguration,
|
||||
newFieldDefaultVisibility,
|
||||
...rest
|
||||
} = universalConfiguration;
|
||||
|
||||
@@ -279,37 +279,7 @@ export const fromUniversalConfigurationToFlatPageLayoutWidgetConfiguration = ({
|
||||
viewId = flatView.id;
|
||||
}
|
||||
|
||||
let newFieldDefaultConfiguration:
|
||||
| { isVisible: boolean; viewFieldGroupId: string | null }
|
||||
| null
|
||||
| undefined = universalNewFieldDefaultConfiguration;
|
||||
|
||||
if (
|
||||
isDefined(universalNewFieldDefaultConfiguration) &&
|
||||
isDefined(universalNewFieldDefaultConfiguration.viewFieldGroupId)
|
||||
) {
|
||||
const viewFieldGroupUniversalIdentifier =
|
||||
universalNewFieldDefaultConfiguration.viewFieldGroupId;
|
||||
|
||||
const flatViewFieldGroup = findFlatEntityByUniversalIdentifier({
|
||||
flatEntityMaps: flatViewFieldGroupMaps,
|
||||
universalIdentifier: viewFieldGroupUniversalIdentifier,
|
||||
});
|
||||
|
||||
if (!isDefined(flatViewFieldGroup)) {
|
||||
throw new FlatEntityMapsException(
|
||||
`View field group not found for universal identifier: ${viewFieldGroupUniversalIdentifier}`,
|
||||
FlatEntityMapsExceptionCode.ENTITY_NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
newFieldDefaultConfiguration = {
|
||||
isVisible: universalNewFieldDefaultConfiguration.isVisible,
|
||||
viewFieldGroupId: flatViewFieldGroup.id,
|
||||
};
|
||||
}
|
||||
|
||||
return { ...rest, viewId, newFieldDefaultConfiguration };
|
||||
return { ...rest, viewId, newFieldDefaultVisibility };
|
||||
}
|
||||
|
||||
case WidgetConfigurationType.FRONT_COMPONENT: {
|
||||
|
||||
Reference in New Issue
Block a user