@openui5/sap.ui.fl 1.138.0 → 1.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/REUSE.toml +8 -1
- package/THIRDPARTY.txt +72 -66
- package/package.json +4 -4
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +6 -6
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +25 -24
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +2 -2
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +13 -10
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantManagementChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +3 -3
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +12 -26
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +58 -114
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +3 -3
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/communication/FLPAboutInfo.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +290 -10
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/applyChangesOnVariant.js +61 -0
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +22 -9
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +5 -4
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +3 -3
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +2 -2
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +4 -4
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +43 -44
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/ChangeAnnotation.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChange.js +3 -3
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +3 -3
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/{apply/_internal/flexState → initial/_internal}/Loader.js +12 -10
- package/src/sap/ui/fl/{apply/_internal/flexState → initial/_internal}/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Settings.js +13 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +3 -2
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +9 -7
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/initial/api/InitialFlexAPI.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- package/src/sap/ui/fl/messagebundle_vi.properties +1 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +6 -2
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +2 -2
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +2 -2
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +2 -2
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +15 -5
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +39 -2
- package/src/sap/ui/fl/variants/VariantManager.js +9 -9
- package/src/sap/ui/fl/variants/VariantModel.js +59 -44
- package/src/sap/ui/fl/write/_internal/SaveAs.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +14 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +10 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +6 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +4 -2
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +27 -2
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +4 -1
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils.js +2 -2
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +15 -54
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/{CompVariantState.js → CompVariantManager.js} +186 -302
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +2 -2
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +92 -6
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +39 -17
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +17 -20
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +1 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +25 -23
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +5 -5
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +6 -6
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +25 -22
- package/src/sap/ui/fl/write/api/TranslationAPI.js +1 -1
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +2 -2
- package/src/sap/ui/fl/write/api/VersionsAPI.js +2 -2
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +1 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +13 -0
- package/ui5.yaml +0 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +0 -233
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +0 -118
- package/src/sap/ui/fl/util/resolveBinding.js +0 -79
|
@@ -5,13 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/Log",
|
|
8
9
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
|
|
9
11
|
"sap/ui/fl/apply/_internal/flexState/DataSelector",
|
|
10
|
-
"sap/ui/fl/apply/_internal/
|
|
12
|
+
"sap/ui/fl/apply/_internal/flexState/compVariants/applyChangesOnVariant",
|
|
13
|
+
"sap/ui/fl/apply/_internal/flexObjects/CompVariant",
|
|
14
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
15
|
+
"sap/ui/fl/apply/_internal/flexObjects/States"
|
|
11
16
|
], function(
|
|
17
|
+
Log,
|
|
12
18
|
FlexState,
|
|
19
|
+
UIChangesState,
|
|
13
20
|
DataSelector,
|
|
14
|
-
|
|
21
|
+
applyChangesOnVariant,
|
|
22
|
+
CompVariant,
|
|
23
|
+
FlexObjectFactory,
|
|
24
|
+
States
|
|
15
25
|
) {
|
|
16
26
|
"use strict";
|
|
17
27
|
|
|
@@ -20,7 +30,7 @@ sap.ui.define([
|
|
|
20
30
|
*
|
|
21
31
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantManagementState
|
|
22
32
|
* @since 1.129
|
|
23
|
-
* @version 1.
|
|
33
|
+
* @version 1.140.0
|
|
24
34
|
* @private
|
|
25
35
|
* @ui5-restricted
|
|
26
36
|
*/
|
|
@@ -28,6 +38,14 @@ sap.ui.define([
|
|
|
28
38
|
|
|
29
39
|
const sUpdatableChangeNameSpace = "sap.ui.fl.apply._internal.flexObjects.UpdatableChange";
|
|
30
40
|
|
|
41
|
+
const aCompVariantChangeTypes = [
|
|
42
|
+
"addFavorite",
|
|
43
|
+
"defaultVariant",
|
|
44
|
+
"removeFavorite",
|
|
45
|
+
"standardVariant",
|
|
46
|
+
"updateVariant"
|
|
47
|
+
];
|
|
48
|
+
|
|
31
49
|
const isSetDefaultChange = (oFlexObject) => {
|
|
32
50
|
return oFlexObject?.isA(sUpdatableChangeNameSpace)
|
|
33
51
|
&& oFlexObject.getFileType() === "change"
|
|
@@ -40,16 +58,167 @@ sap.ui.define([
|
|
|
40
58
|
parentDataSelector: FlexState.getFlexObjectsDataSelector(),
|
|
41
59
|
executeFunction(aFlexObjects, mPropertyBag) {
|
|
42
60
|
return aFlexObjects.filter((oFlexObject) =>
|
|
43
|
-
|
|
44
|
-
&&
|
|
61
|
+
(oFlexObject.getState() !== States.LifecycleState.DELETED || mPropertyBag.includeDeleted)
|
|
62
|
+
&& isSetDefaultChange(oFlexObject)
|
|
63
|
+
&& oFlexObject.getSelector().persistencyKey === mPropertyBag.persistencyKey
|
|
45
64
|
);
|
|
46
65
|
},
|
|
47
66
|
checkInvalidation(mParameters, oUpdateInfo) {
|
|
67
|
+
const oFlexObject = oUpdateInfo.updatedObject;
|
|
68
|
+
const bRelevantPersistencyKey = oFlexObject?.getSelector?.().persistencyKey === mParameters.persistencyKey;
|
|
48
69
|
const bRelevantType = ["addFlexObject", "removeFlexObject"].includes(oUpdateInfo.type);
|
|
49
|
-
return bRelevantType && isSetDefaultChange(oUpdateInfo.updatedObject);
|
|
70
|
+
return bRelevantPersistencyKey && bRelevantType && isSetDefaultChange(oUpdateInfo.updatedObject);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const oCompEntitiesDataSelector = new DataSelector({
|
|
75
|
+
id: "compEntitiesData",
|
|
76
|
+
parentDataSelector: FlexState.getFlexObjectsDataSelector(),
|
|
77
|
+
executeFunction(aFlexObjects) {
|
|
78
|
+
return aFlexObjects.filter((oFlexObject) => oFlexObject.getFileType() === "variant" ||
|
|
79
|
+
(
|
|
80
|
+
oFlexObject.getFileType() === "change"
|
|
81
|
+
&& aCompVariantChangeTypes.includes(oFlexObject.getChangeType())
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
checkInvalidation(mParameters, oUpdateInfo) {
|
|
86
|
+
const oFlexObject = oUpdateInfo.updatedObject;
|
|
87
|
+
const aRelevantUpdateTypes = ["addFlexObject", "updateFlexObject", "removeFlexObject"];
|
|
88
|
+
const bIsRelevantUpdateType = aRelevantUpdateTypes.includes(oUpdateInfo.type);
|
|
89
|
+
const bIsChangeWithRelevantChangeType = oFlexObject.getFileType() === "change" &&
|
|
90
|
+
aCompVariantChangeTypes.includes(oFlexObject.getChangeType());
|
|
91
|
+
const bIsVariantFileType = oUpdateInfo.updatedObject?.getFileType?.() === "variant";
|
|
92
|
+
return bIsRelevantUpdateType && (bIsVariantFileType || bIsChangeWithRelevantChangeType);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const oVariantsDataSelector = new DataSelector({
|
|
97
|
+
id: "compVariantData",
|
|
98
|
+
parameterKey: "persistencyKey",
|
|
99
|
+
parentDataSelector: oCompEntitiesDataSelector,
|
|
100
|
+
executeFunction(aFlexObjects, mPropertyBag) {
|
|
101
|
+
const aVariants = aFlexObjects.filter((oFlexObject) =>
|
|
102
|
+
oFlexObject.getFileType() === "variant"
|
|
103
|
+
&& oFlexObject.getPersistencyKey() === mPropertyBag.persistencyKey
|
|
104
|
+
&& (oFlexObject.getState() !== States.LifecycleState.DELETED || mPropertyBag.includeDeleted)
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
return CompVariantManagementState.applyChangesOnVariants(mPropertyBag.reference, mPropertyBag.persistencyKey, aVariants);
|
|
108
|
+
},
|
|
109
|
+
checkInvalidation(mParameters, oUpdateInfo) {
|
|
110
|
+
const oFlexObject = oUpdateInfo.updatedObject;
|
|
111
|
+
const aRelevantUpdateTypes = ["addFlexObject", "updateFlexObject", "removeFlexObject"];
|
|
112
|
+
const bIsRelevantUpdateType = aRelevantUpdateTypes.includes(oUpdateInfo.type);
|
|
113
|
+
const bIsChangeWithRelevantChangeType = oFlexObject.getFileType() === "change" &&
|
|
114
|
+
aCompVariantChangeTypes.includes(oFlexObject.getChangeType());
|
|
115
|
+
const bIsVariantFileType = oUpdateInfo.updatedObject?.getFileType?.() === "variant";
|
|
116
|
+
return bIsRelevantUpdateType && (bIsVariantFileType || bIsChangeWithRelevantChangeType);
|
|
50
117
|
}
|
|
51
118
|
});
|
|
52
119
|
|
|
120
|
+
// comp entities may hold the persistency key within the persistencyKey property (variant) or within the selector (changes)
|
|
121
|
+
const oCompEntitiesByPersistencyKeyDataSelector = new DataSelector({
|
|
122
|
+
id: "compEntitiesByPersistencyKey",
|
|
123
|
+
parameterKey: "persistencyKey",
|
|
124
|
+
parentDataSelector: oCompEntitiesDataSelector,
|
|
125
|
+
executeFunction(aFlexObjects, mPropertyBag) {
|
|
126
|
+
return aFlexObjects.filter((oFlexObject) =>
|
|
127
|
+
(oFlexObject.getPersistencyKey?.() || oFlexObject.getSelector?.().persistencyKey) === mPropertyBag.persistencyKey
|
|
128
|
+
);
|
|
129
|
+
},
|
|
130
|
+
checkInvalidation(mParameters, oUpdateInfo) {
|
|
131
|
+
const oFlexObject = oUpdateInfo.updatedObject;
|
|
132
|
+
return (oFlexObject?.getPersistencyKey?.() || oFlexObject.getSelector?.().persistencyKey) === mParameters.persistencyKey;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const oChangesByVariantIdsDataSelector = new DataSelector({
|
|
137
|
+
id: "getChangesByVariantIds",
|
|
138
|
+
parentDataSelector: oCompEntitiesByPersistencyKeyDataSelector,
|
|
139
|
+
executeFunction(aFlexObjects) {
|
|
140
|
+
const mChanges = {};
|
|
141
|
+
const aVariantIds = aFlexObjects
|
|
142
|
+
.filter((oFlexObject) => oFlexObject.getFileType() === "variant")
|
|
143
|
+
.map((oVariant) => oVariant.getVariantId());
|
|
144
|
+
|
|
145
|
+
aFlexObjects.filter((oFlexObject) => oFlexObject.getFileType() === "change" && oFlexObject.getChangeType() !== "defaultVariant")
|
|
146
|
+
.forEach(function(oChange) {
|
|
147
|
+
const sVariantId = escapeSpecialIdCharacters(oChange.getSelector().variantId || oChange.getContent().key);
|
|
148
|
+
if (aVariantIds.includes(sVariantId)) {
|
|
149
|
+
mChanges[sVariantId] ||= [];
|
|
150
|
+
mChanges[sVariantId].push(oChange);
|
|
151
|
+
} else if (oChange.getChangeType() === "standardVariant") {
|
|
152
|
+
mChanges[CompVariant.STANDARD_VARIANT_ID] ||= [];
|
|
153
|
+
mChanges[CompVariant.STANDARD_VARIANT_ID].push(oChange);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
return mChanges;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
function createVariant(mPropertyBag) {
|
|
162
|
+
const oVariantInput = mPropertyBag.variantInput || {};
|
|
163
|
+
const mAuthors = mPropertyBag.authors || {};
|
|
164
|
+
const oVariantData = {
|
|
165
|
+
fileName: oVariantInput.fileName,
|
|
166
|
+
fileType: "variant",
|
|
167
|
+
variantId: oVariantInput.id || CompVariant.STANDARD_VARIANT_ID,
|
|
168
|
+
persisted: oVariantInput.persisted,
|
|
169
|
+
reference: mPropertyBag.reference,
|
|
170
|
+
favorite: oVariantInput.favorite,
|
|
171
|
+
executeOnSelection: oVariantInput.executeOnSelection,
|
|
172
|
+
adaptationId: oVariantInput.adaptationId,
|
|
173
|
+
content: oVariantInput.content || {},
|
|
174
|
+
texts: {
|
|
175
|
+
variantName: {
|
|
176
|
+
value: oVariantInput.name || ""
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
selector: {
|
|
180
|
+
persistencyKey: mPropertyBag.persistencyKey
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
return FlexObjectFactory.createCompVariant(oVariantData, mAuthors);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function escapeSpecialIdCharacters(sId) {
|
|
188
|
+
return sId?.replace("#", "_HASHTAG_");
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
CompVariantManagementState.applyChangesOnVariants = function(sReference, sPersistencyKey, aVariants) {
|
|
192
|
+
const mChangesByVariantId = oChangesByVariantIdsDataSelector.get({
|
|
193
|
+
reference: sReference,
|
|
194
|
+
persistencyKey: sPersistencyKey
|
|
195
|
+
});
|
|
196
|
+
aVariants.forEach((oVariant) => {
|
|
197
|
+
const aChangesOnVariant = mChangesByVariantId[oVariant.getVariantId()] || [];
|
|
198
|
+
if (aChangesOnVariant.length > 0) {
|
|
199
|
+
applyChangesOnVariant(oVariant, aChangesOnVariant);
|
|
200
|
+
oCompEntitiesDataSelector.checkUpdate(
|
|
201
|
+
{ reference: sReference },
|
|
202
|
+
[{ type: "updateFlexObject", updatedObject: oVariant }]
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return aVariants;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Access to the variant management comp entities selector.
|
|
212
|
+
*
|
|
213
|
+
* @returns {object} The data selector for the variants and their changes
|
|
214
|
+
*
|
|
215
|
+
* @private
|
|
216
|
+
* @ui5-restricted sap.ui.fl.qunit
|
|
217
|
+
*/
|
|
218
|
+
CompVariantManagementState.getCompEntitiesDataSelector = function() {
|
|
219
|
+
return oCompEntitiesDataSelector;
|
|
220
|
+
};
|
|
221
|
+
|
|
53
222
|
/**
|
|
54
223
|
* Access to the variant management set default selector.
|
|
55
224
|
*
|
|
@@ -67,7 +236,7 @@ sap.ui.define([
|
|
|
67
236
|
*
|
|
68
237
|
* @param {object} mPropertyBag Object with the necessary properties
|
|
69
238
|
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
70
|
-
* @param {string} mPropertyBag.reference -
|
|
239
|
+
* @param {string} mPropertyBag.reference - Flexibility reference of the app
|
|
71
240
|
* @param {sap.ui.fl.apply._internal.flexObjects.CompVariant[]} mPropertyBag.variants - Array of variants which exist for the given variant management
|
|
72
241
|
*
|
|
73
242
|
* @returns {string | undefined} ID of the default variant
|
|
@@ -82,17 +251,95 @@ sap.ui.define([
|
|
|
82
251
|
|
|
83
252
|
mPropertyBag.persistencyKey = String(mPropertyBag.persistencyKey);
|
|
84
253
|
const aDefaultChanges = [...oSetDefaultDataSelector.get(mPropertyBag)].reverse();
|
|
85
|
-
const aDefaultVariantIds = aDefaultChanges
|
|
254
|
+
const aDefaultVariantIds = aDefaultChanges
|
|
255
|
+
.map((oChange) => oChange.getContent().defaultVariantName)
|
|
256
|
+
.map((sId) => escapeSpecialIdCharacters(sId));
|
|
86
257
|
|
|
87
258
|
return aDefaultVariantIds.find((sDefaultVariantId) => aVariantIds.includes(sDefaultVariantId)) || "";
|
|
88
259
|
};
|
|
89
260
|
|
|
90
261
|
/**
|
|
91
|
-
* Returns
|
|
262
|
+
* Returns all variants saved in the FlexState.
|
|
263
|
+
*
|
|
264
|
+
* @param {object} mPropertyBag - Object with the necessary properties
|
|
265
|
+
* @param {string} mPropertyBag.reference - Flex reference of the current app
|
|
266
|
+
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
267
|
+
* @param {object} mPropertyBag.standardVariant - The standard variant passed by the control
|
|
268
|
+
* @param {string} mPropertyBag.componentId - The ID of the application component
|
|
269
|
+
* @param {boolean} [mPropertyBag.includeDeleted=false] - Flag if also deleted variants should be returned
|
|
270
|
+
*
|
|
271
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant[]} Array of variants
|
|
272
|
+
*/
|
|
273
|
+
CompVariantManagementState.assembleVariantList = function(mPropertyBag) {
|
|
274
|
+
let oStandardVariant = oVariantsDataSelector.get(mPropertyBag).findLast((oVariant) => oVariant.getStandardVariant());
|
|
275
|
+
|
|
276
|
+
if (!oStandardVariant) {
|
|
277
|
+
oStandardVariant = createVariant({
|
|
278
|
+
reference: mPropertyBag.reference,
|
|
279
|
+
persistencyKey: mPropertyBag.persistencyKey,
|
|
280
|
+
variantInput: mPropertyBag.standardVariant,
|
|
281
|
+
standardVariant: true
|
|
282
|
+
});
|
|
283
|
+
FlexState.addRuntimeSteadyObject(mPropertyBag.reference, mPropertyBag.componentId, oStandardVariant);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return oVariantsDataSelector.get(mPropertyBag).filter((oVariant) => oVariant.getVisible());
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Returns a variant saved in the flex state.
|
|
92
291
|
*
|
|
93
292
|
* @param {object} mPropertyBag Object with the necessary properties
|
|
293
|
+
* @param {string} mPropertyBag.reference - Flex reference of the current app
|
|
94
294
|
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
95
|
-
* @param {string} mPropertyBag.
|
|
295
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
296
|
+
* @param {string} mPropertyBag.componentId - The ID of the application component
|
|
297
|
+
*
|
|
298
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant | undefined} Variant or undefined if the variant cannot be found
|
|
299
|
+
*/
|
|
300
|
+
CompVariantManagementState.getVariant = function(mPropertyBag) {
|
|
301
|
+
return oVariantsDataSelector.get(mPropertyBag).find((oVariant) => oVariant.getVariantId() === mPropertyBag.id);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Returns all changes for a given variant saved in the FlexState.
|
|
306
|
+
*
|
|
307
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.CompVariant} oVariant - Variant for which the changes should be retrieved
|
|
308
|
+
*
|
|
309
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.UIChange[]} List of changes for the variant
|
|
310
|
+
*/
|
|
311
|
+
CompVariantManagementState.getVariantChanges = function(oVariant) {
|
|
312
|
+
const sReference = oVariant.getFlexObjectMetadata().reference;
|
|
313
|
+
const sVariantId = oVariant.getVariantId();
|
|
314
|
+
const sPersistencyKey = oVariant.getPersistencyKey();
|
|
315
|
+
return oChangesByVariantIdsDataSelector.get({
|
|
316
|
+
reference: sReference,
|
|
317
|
+
persistencyKey: sPersistencyKey
|
|
318
|
+
})?.[sVariantId] || [];
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
CompVariantManagementState.addExternalVariants = function(mPropertyBag) {
|
|
322
|
+
try {
|
|
323
|
+
mPropertyBag.variants?.map((oVariant) => {
|
|
324
|
+
oVariant.reference = mPropertyBag.reference;
|
|
325
|
+
oVariant.fileName = escapeSpecialIdCharacters(oVariant.id); // external oData Variants may have an invalid ID for ManagedObjects
|
|
326
|
+
oVariant.selector = {persistencyKey: mPropertyBag.persistencyKey};
|
|
327
|
+
oVariant.texts = {variantName: {value: oVariant.name}};
|
|
328
|
+
return oVariant;
|
|
329
|
+
})
|
|
330
|
+
.map((oVariant) => FlexObjectFactory.createFromFileContent(oVariant, CompVariant, true))
|
|
331
|
+
.forEach((oFlexObject) => FlexState.addRuntimeSteadyObject(mPropertyBag.reference, mPropertyBag.componentId, oFlexObject));
|
|
332
|
+
} catch (oError) {
|
|
333
|
+
Log.error(`External comp variant could not be added: ${oError.message}`);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Returns the 'defaultVariant' changes for a given variant management
|
|
339
|
+
*
|
|
340
|
+
* @param {object} mPropertyBag - Object with the necessary properties
|
|
341
|
+
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
342
|
+
* @param {string} mPropertyBag.reference - Flexibility reference of the app
|
|
96
343
|
*
|
|
97
344
|
* @returns {sap.ui.fl.apply._internal.flexObjects.UpdatableChange[]} 'defaultVariant' changes of the variant management
|
|
98
345
|
*
|
|
@@ -104,5 +351,38 @@ sap.ui.define([
|
|
|
104
351
|
return oSetDefaultDataSelector.get(mPropertyBag);
|
|
105
352
|
};
|
|
106
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Returns the all sap.ui.comp related entities for a given reference
|
|
356
|
+
*
|
|
357
|
+
* @param {object} mPropertyBag Object with the necessary properties
|
|
358
|
+
* @param {string} mPropertyBag.reference - Flexibility reference of the app
|
|
359
|
+
*
|
|
360
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} - All comp variants for a given reference
|
|
361
|
+
*
|
|
362
|
+
* @since 1.140
|
|
363
|
+
* @private
|
|
364
|
+
* @ui5-restricted sap.ui.fl
|
|
365
|
+
*/
|
|
366
|
+
CompVariantManagementState.getCompEntities = (mPropertyBag) => {
|
|
367
|
+
return oCompEntitiesDataSelector.get(mPropertyBag);
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Returns the all sap.ui.comp related entities for a given reference and persistency key
|
|
372
|
+
*
|
|
373
|
+
* @param {object} mPropertyBag Object with the necessary properties
|
|
374
|
+
* @param {string} mPropertyBag.reference - Flexibility reference of the app
|
|
375
|
+
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
376
|
+
*
|
|
377
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} - all sap.ui.comp related entities for a given reference
|
|
378
|
+
*
|
|
379
|
+
* @since 1.140
|
|
380
|
+
* @private
|
|
381
|
+
* @ui5-restricted sap.ui.fl
|
|
382
|
+
*/
|
|
383
|
+
CompVariantManagementState.getCompEntitiesByPersistencyKey = (mPropertyBag) => {
|
|
384
|
+
return oCompEntitiesByPersistencyKeyDataSelector.get(mPropertyBag);
|
|
385
|
+
};
|
|
386
|
+
|
|
107
387
|
return CompVariantManagementState;
|
|
108
388
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/base/Log"
|
|
9
|
+
], function(
|
|
10
|
+
Log
|
|
11
|
+
) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var mChangeHandlers = {
|
|
15
|
+
addFavorite(oVariant) {
|
|
16
|
+
oVariant.setFavorite(true);
|
|
17
|
+
},
|
|
18
|
+
removeFavorite(oVariant) {
|
|
19
|
+
oVariant.setFavorite(false);
|
|
20
|
+
},
|
|
21
|
+
updateVariant(oVariant, oChange) {
|
|
22
|
+
var oChangeContent = oChange.getContent();
|
|
23
|
+
if (oChangeContent.executeOnSelection !== undefined) {
|
|
24
|
+
oVariant.setExecuteOnSelection(oChangeContent.executeOnSelection);
|
|
25
|
+
}
|
|
26
|
+
if (oChangeContent.favorite !== undefined) {
|
|
27
|
+
oVariant.setFavorite(oChangeContent.favorite);
|
|
28
|
+
}
|
|
29
|
+
if (oChangeContent.contexts) {
|
|
30
|
+
oVariant.setContexts(oChangeContent.contexts);
|
|
31
|
+
}
|
|
32
|
+
if (oChangeContent.visible !== undefined) {
|
|
33
|
+
oVariant.setVisible(oChangeContent.visible);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (oChangeContent.variantContent) {
|
|
37
|
+
oVariant.setContent(oChangeContent.variantContent, /* bSkipStateChange = */ true);
|
|
38
|
+
}
|
|
39
|
+
var sVariantName = oChange.getText("variantName");
|
|
40
|
+
if (sVariantName) {
|
|
41
|
+
oVariant.setName(sVariantName, /* bSkipStateChange = */ true);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
standardVariant(oVariant, oChange) {
|
|
45
|
+
// legacy change on standard variants
|
|
46
|
+
oVariant.setExecuteOnSelection(oChange.getContent().executeOnSelect);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function logNoChangeHandler(oVariant, oChange) {
|
|
51
|
+
Log.error(`No change handler for change with the ID '${oChange.getId()}' and type '${oChange.getChangeType()}' defined.
|
|
52
|
+
The variant '${oVariant.getId()}'was not modified'`);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (oVariant, aChanges = []) => {
|
|
56
|
+
aChanges.forEach(function(oChange) {
|
|
57
|
+
var oChangeHandler = mChangeHandlers[oChange.getChangeType()] || logNoChangeHandler;
|
|
58
|
+
oChangeHandler(oVariant, oChange);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
});
|
|
@@ -55,7 +55,7 @@ sap.ui.define([
|
|
|
55
55
|
*
|
|
56
56
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
|
|
57
57
|
* @since 1.74
|
|
58
|
-
* @version 1.
|
|
58
|
+
* @version 1.140.0
|
|
59
59
|
* @private
|
|
60
60
|
* @ui5-restricted
|
|
61
61
|
*/
|
|
@@ -235,9 +235,9 @@ sap.ui.define([
|
|
|
235
235
|
return oGroupedFlexObjects;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
function createVariantsMap(aFlexObjects) {
|
|
238
|
+
function createVariantsMap(aFlexObjects, mPropertyBag) {
|
|
239
239
|
const oGroupedFlexObjects = groupFlexObjects(aFlexObjects);
|
|
240
|
-
const sReference =
|
|
240
|
+
const sReference = mPropertyBag.reference;
|
|
241
241
|
|
|
242
242
|
const oVariantManagementsMap = {};
|
|
243
243
|
oGroupedFlexObjects.variants.forEach((oVariantInstance) => {
|
|
@@ -791,23 +791,36 @@ sap.ui.define([
|
|
|
791
791
|
};
|
|
792
792
|
|
|
793
793
|
/**
|
|
794
|
-
* Sets the promise for the variant switch for the given reference.
|
|
794
|
+
* Sets the promise for the variant switch for the given flex reference and VM reference.
|
|
795
795
|
*
|
|
796
796
|
* @param {string} sReference - Flex reference of the app
|
|
797
|
+
* @param {string} sVMReference - Variant Management reference
|
|
797
798
|
* @param {Promise<undefined>} oPromise - Variant Switch Promise
|
|
798
799
|
*/
|
|
799
|
-
VariantManagementState.setVariantSwitchPromise = function(sReference, oPromise) {
|
|
800
|
-
mVariantSwitchPromises[sReference]
|
|
800
|
+
VariantManagementState.setVariantSwitchPromise = function(sReference, sVMReference, oPromise) {
|
|
801
|
+
mVariantSwitchPromises[sReference] ||= {};
|
|
802
|
+
mVariantSwitchPromises[sReference][sVMReference] = oPromise;
|
|
801
803
|
};
|
|
802
804
|
|
|
803
805
|
/**
|
|
804
|
-
*
|
|
806
|
+
* Waits for the variant switch of a given VM.
|
|
805
807
|
*
|
|
806
808
|
* @param {string} sReference - Flex reference of the app
|
|
809
|
+
* @param {string} sVMReference - Variant Management reference
|
|
807
810
|
* @returns {Promise<undefined>} Variant Switch Promise
|
|
808
811
|
*/
|
|
809
|
-
VariantManagementState.
|
|
810
|
-
return mVariantSwitchPromises[sReference];
|
|
812
|
+
VariantManagementState.waitForVariantSwitch = function(sReference, sVMReference) {
|
|
813
|
+
return mVariantSwitchPromises[sReference]?.[sVMReference] || Promise.resolve();
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Waits for all variant switches for the given flex reference.
|
|
818
|
+
*
|
|
819
|
+
* @param {string} sReference - Flex reference of the app
|
|
820
|
+
* @returns {Promise<undefined>} Variant Switches Promise
|
|
821
|
+
*/
|
|
822
|
+
VariantManagementState.waitForAllVariantSwitches = function(sReference) {
|
|
823
|
+
return Promise.all(Object.values(mVariantSwitchPromises[sReference] || {}));
|
|
811
824
|
};
|
|
812
825
|
|
|
813
826
|
return VariantManagementState;
|
|
@@ -12,9 +12,9 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/fl/apply/_internal/changes/descriptor/InlineApplier",
|
|
13
13
|
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
15
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
16
15
|
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
17
16
|
"sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration",
|
|
17
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
18
18
|
"sap/ui/fl/variants/VariantModel",
|
|
19
19
|
"sap/ui/fl/Layer",
|
|
20
20
|
"sap/ui/fl/Utils",
|
|
@@ -29,9 +29,9 @@ sap.ui.define([
|
|
|
29
29
|
InlineApplier,
|
|
30
30
|
ChangesApplier,
|
|
31
31
|
FlexState,
|
|
32
|
-
ManifestUtils,
|
|
33
32
|
ControlVariantApplyAPI,
|
|
34
33
|
ChangeHandlerRegistration,
|
|
34
|
+
ManifestUtils,
|
|
35
35
|
VariantModel,
|
|
36
36
|
Layer,
|
|
37
37
|
Utils,
|
|
@@ -41,6 +41,7 @@ sap.ui.define([
|
|
|
41
41
|
) {
|
|
42
42
|
"use strict";
|
|
43
43
|
|
|
44
|
+
// TODO: Move to initial and make dependencies to apply lazy
|
|
44
45
|
/**
|
|
45
46
|
* @namespace sap.ui.fl.apply._internal.preprocessors.ComponentLifecycleHooks
|
|
46
47
|
* @since 1.114
|
|
@@ -250,13 +251,13 @@ sap.ui.define([
|
|
|
250
251
|
componentData: oComponentData
|
|
251
252
|
});
|
|
252
253
|
try {
|
|
253
|
-
//
|
|
254
|
+
// skipLoadBundle has to be true as there is no guarantee that the flex bundle is already available at this point
|
|
254
255
|
await FlexState.initialize({
|
|
255
256
|
componentData: oComponentData,
|
|
256
257
|
asyncHints: oPropertyBag.owner?.config.asyncHints || oPropertyBag.factoryConfig.asyncHints,
|
|
257
258
|
componentId: sAppComponentId,
|
|
258
259
|
reference: sReference,
|
|
259
|
-
|
|
260
|
+
skipLoadBundle: true
|
|
260
261
|
});
|
|
261
262
|
const sServiceUrl = ODataUtils.removeOriginSegmentParameters(oPropertyBag.model.getServiceUrl());
|
|
262
263
|
const aRelevantAnnotationChanges = FlexState.getAnnotationChanges(sReference)
|
|
@@ -8,7 +8,7 @@ sap.ui.define([
|
|
|
8
8
|
"sap/base/Log",
|
|
9
9
|
"sap/ui/core/Component",
|
|
10
10
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
11
|
-
"sap/ui/fl/
|
|
11
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
12
12
|
"sap/ui/fl/Utils"
|
|
13
13
|
], function(
|
|
14
14
|
Log,
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @class
|
|
27
27
|
* @constructor
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.140.0
|
|
30
30
|
* @since 1.27.0
|
|
31
31
|
* @private
|
|
32
32
|
* @ui5-restricted sap.ui.fl, sap.ui.core
|
|
@@ -12,11 +12,11 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/core/ExtensionPoint",
|
|
13
13
|
"sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/communication/FLPAboutInfo",
|
|
15
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
16
15
|
"sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks",
|
|
17
16
|
"sap/ui/fl/apply/api/DelegateMediatorAPI",
|
|
18
17
|
"sap/ui/fl/changeHandler/ChangeAnnotation",
|
|
19
18
|
"sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration",
|
|
19
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
20
20
|
"sap/ui/base/DesignTime",
|
|
21
21
|
// the lower 2 are set as a callback in the "register...Processors" which are not detected as dependencies from the preload-building
|
|
22
22
|
"sap/ui/fl/apply/_internal/preprocessors/ControllerExtension",
|
|
@@ -28,11 +28,11 @@ sap.ui.define([
|
|
|
28
28
|
ExtensionPoint,
|
|
29
29
|
Preprocessor,
|
|
30
30
|
FLPAboutInfo,
|
|
31
|
-
ManifestUtils,
|
|
32
31
|
ComponentLifecycleHooks,
|
|
33
32
|
DelegateMediatorAPI,
|
|
34
33
|
ChangeAnnotation,
|
|
35
34
|
ChangeHandlerRegistration,
|
|
35
|
+
ManifestUtils,
|
|
36
36
|
DesignTime
|
|
37
37
|
) {
|
|
38
38
|
"use strict";
|
|
@@ -44,7 +44,7 @@ sap.ui.define([
|
|
|
44
44
|
* @class
|
|
45
45
|
* @constructor
|
|
46
46
|
* @author SAP SE
|
|
47
|
-
* @version 1.
|
|
47
|
+
* @version 1.140.0
|
|
48
48
|
* @since 1.43.0
|
|
49
49
|
* @private
|
|
50
50
|
*/
|
|
@@ -13,7 +13,7 @@ sap.ui.define([
|
|
|
13
13
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
16
|
-
"sap/ui/fl/
|
|
16
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
17
17
|
"sap/ui/fl/Utils",
|
|
18
18
|
"sap/base/Log"
|
|
19
19
|
], function(
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @class
|
|
39
39
|
* @constructor
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.140.0
|
|
42
42
|
* @since 1.27.0
|
|
43
43
|
* @private
|
|
44
44
|
*/
|
|
@@ -243,7 +243,7 @@ sap.ui.define([
|
|
|
243
243
|
var oControl = mPropertyBag.selector.id && Element.getElementById(mPropertyBag.selector.id) || mPropertyBag.selector;
|
|
244
244
|
var oAppComponent = Utils.getAppComponentForControl(oControl);
|
|
245
245
|
waitForVariantModel(oAppComponent).then(function(oVariantModel) {
|
|
246
|
-
oVariantModel.detachVariantApplied(mPropertyBag.vmControlId, oControl
|
|
246
|
+
oVariantModel.detachVariantApplied(mPropertyBag.vmControlId, oControl);
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
};
|
|
@@ -10,11 +10,11 @@ sap.ui.define([
|
|
|
10
10
|
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
11
11
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
12
12
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
13
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
14
13
|
"sap/ui/fl/initial/_internal/FlexConfiguration",
|
|
15
14
|
"sap/ui/fl/initial/_internal/FlexInfoSession",
|
|
16
|
-
"sap/ui/fl/initial/
|
|
15
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
17
16
|
"sap/ui/fl/initial/_internal/Settings",
|
|
17
|
+
"sap/ui/fl/initial/api/InitialFlexAPI",
|
|
18
18
|
"sap/ui/fl/Layer",
|
|
19
19
|
"sap/ui/fl/Utils",
|
|
20
20
|
"sap/ui/VersionInfo"
|
|
@@ -24,11 +24,11 @@ sap.ui.define([
|
|
|
24
24
|
VariantUtils,
|
|
25
25
|
FlexObjectState,
|
|
26
26
|
FlexState,
|
|
27
|
-
ManifestUtils,
|
|
28
27
|
FlexConfiguration,
|
|
29
28
|
FlexInfoSession,
|
|
30
|
-
|
|
29
|
+
ManifestUtils,
|
|
31
30
|
Settings,
|
|
31
|
+
InitialFlexAPI,
|
|
32
32
|
Layer,
|
|
33
33
|
Utils,
|
|
34
34
|
VersionInfo
|