@openui5/sap.ui.fl 1.140.0 → 1.141.1
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/.eslint-rules/import-check.js +71 -0
- package/THIRDPARTY.txt +2 -2
- package/package.json +3 -3
- 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 +13 -3
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +4 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +2 -8
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +2 -2
- 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 +6 -3
- package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +53 -161
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +0 -8
- 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 +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +2 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +22 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +54 -12
- package/src/sap/ui/fl/apply/_internal/init.js +47 -0
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +14 -5
- package/src/sap/ui/fl/apply/api/AnnotationChangeHandlerAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +190 -53
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +17 -1
- package/src/sap/ui/fl/apply/api/ExtensionPointRegistryAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +2 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +2 -2
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +4 -4
- package/src/sap/ui/fl/changeHandler/Base.js +3 -2
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +21 -9
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/ChangeAnnotation.js +7 -2
- 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/changeHandler/common/createIFrame.js +1 -4
- 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/designtime/variants/VariantManagement.designtime.js +14 -12
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Loader.js +243 -79
- package/src/sap/ui/fl/initial/_internal/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Settings.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +67 -9
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +12 -5
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/ControllerExtension.js +15 -4
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/RegistrationDelegator.js +7 -38
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/XmlPreprocessor.js +28 -20
- 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 +44 -44
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +1 -1
- 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 +3 -2
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +49 -36
- package/src/sap/ui/fl/variants/VariantManager.js +75 -15
- package/src/sap/ui/fl/variants/VariantModel.js +7 -165
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +9 -5
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -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 +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -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/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 +30 -21
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +3 -3
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantManager.js +2 -19
- package/src/sap/ui/fl/write/_internal/init.js +27 -0
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/Adaptations.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +9 -8
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +2 -3
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +2 -1
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +3 -2
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +2 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +10 -3
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +5 -2
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +2 -1
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/TranslationAPI.js +2 -1
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/VersionsAPI.js +2 -1
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +2 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* @namespace
|
|
24
24
|
* @name sap.ui.fl.descriptorRelated
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.141.1
|
|
27
27
|
* @private
|
|
28
28
|
* @ui5-restricted sap.ui.rta, smart business
|
|
29
29
|
*/
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @namespace
|
|
34
34
|
* @name sap.ui.fl.descriptorRelated.api
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.141.1
|
|
37
37
|
* @private
|
|
38
38
|
* @ui5-restricted sap.ui.rta, smart business
|
|
39
39
|
*/
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
* @constructor
|
|
48
48
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChange
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.141.1
|
|
51
51
|
* @private
|
|
52
52
|
* @ui5-restricted sap.ui.rta, smart business
|
|
53
53
|
*/
|
|
@@ -15,7 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
* @namespace
|
|
16
16
|
* @name sap.ui.fl.descriptorRelated
|
|
17
17
|
* @author SAP SE
|
|
18
|
-
* @version 1.
|
|
18
|
+
* @version 1.141.1
|
|
19
19
|
* @private
|
|
20
20
|
* @ui5-restricted sap.ui.rta, smart business
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @namespace
|
|
26
26
|
* @name sap.ui.fl.descriptorRelated.api
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.141.1
|
|
29
29
|
* @private
|
|
30
30
|
* @ui5-restricted sap.ui.rta, smart business
|
|
31
31
|
*/
|
|
@@ -37,7 +37,7 @@ sap.ui.define([
|
|
|
37
37
|
* @constructor
|
|
38
38
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChangeFactory
|
|
39
39
|
* @author SAP SE
|
|
40
|
-
* @version 1.
|
|
40
|
+
* @version 1.141.1
|
|
41
41
|
* @private
|
|
42
42
|
* @ui5-restricted sap.ui.rta, smart business
|
|
43
43
|
*/
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @namespace
|
|
39
39
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorInlineChangeFactory
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.141.1
|
|
42
42
|
* @private
|
|
43
43
|
* @deprecated Since version 1.76
|
|
44
44
|
* @ui5-restricted sap.ui.rta, smart business
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @namespace
|
|
17
17
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorVariantFactory
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.141.1
|
|
20
20
|
* @private
|
|
21
21
|
* @deprecated Since version 1.73
|
|
22
22
|
* @ui5-restricted sap.ui.rta, smart business
|
|
@@ -15,7 +15,8 @@ sap.ui.define([
|
|
|
15
15
|
flUtils
|
|
16
16
|
) {
|
|
17
17
|
"use strict";
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
async function fnSetControlAttributes(oVariantManagement, bDesignTimeMode) {
|
|
19
20
|
var oAppComponent = flUtils.getAppComponentForControl(oVariantManagement);
|
|
20
21
|
var sControlId = oVariantManagement.getId();
|
|
21
22
|
var oModel = oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
@@ -26,15 +27,15 @@ sap.ui.define([
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
if (bDesignTimeMode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
30
|
+
await oVariantManagement.waitForInit();
|
|
31
|
+
oModel.setModelPropertiesForControl(sVariantManagementReference, bDesignTimeMode, oVariantManagement);
|
|
32
|
+
oModel.checkUpdate(true);
|
|
33
33
|
} else {
|
|
34
34
|
oModel.setModelPropertiesForControl(sVariantManagementReference, bDesignTimeMode, oVariantManagement);
|
|
35
35
|
oModel.checkUpdate(true);
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
|
+
|
|
38
39
|
return {
|
|
39
40
|
annotations: {},
|
|
40
41
|
properties: {
|
|
@@ -85,17 +86,18 @@ sap.ui.define([
|
|
|
85
86
|
},
|
|
86
87
|
actions: {
|
|
87
88
|
controlVariant(oVariantManagement) {
|
|
88
|
-
var oAppComponent = flUtils.getAppComponentForControl(oVariantManagement);
|
|
89
|
-
var sControlId = oVariantManagement.getId();
|
|
90
|
-
var oModel = oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
91
|
-
var sVariantManagementReference = oAppComponent.getLocalId(sControlId) || sControlId;
|
|
92
89
|
return {
|
|
93
90
|
validators: [
|
|
94
91
|
"noEmptyText",
|
|
95
92
|
{
|
|
96
93
|
validatorFunction(sNewText) {
|
|
97
|
-
|
|
98
|
-
return
|
|
94
|
+
// Avoid duplicate titles
|
|
95
|
+
return !oVariantManagement.getVariants().some(function(oVariant) {
|
|
96
|
+
if (oVariant.getKey() === oVariantManagement.getCurrentVariantKey()) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return sNewText.toLowerCase() === oVariant.getTitle().toLowerCase() && oVariant.getVisible();
|
|
100
|
+
});
|
|
99
101
|
},
|
|
100
102
|
errorMessage: Lib.getResourceBundleFor("sap.m").getText("VARIANT_MANAGEMENT_ERROR_DUPLICATE")
|
|
101
103
|
}
|
|
@@ -5,15 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/util/Deferred",
|
|
9
|
+
"sap/base/util/merge",
|
|
8
10
|
"sap/base/util/ObjectPath",
|
|
11
|
+
"sap/base/Log",
|
|
9
12
|
"sap/ui/base/ManagedObject",
|
|
13
|
+
"sap/ui/fl/initial/_internal/FlexInfoSession",
|
|
10
14
|
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
11
15
|
"sap/ui/fl/initial/_internal/Settings",
|
|
12
16
|
"sap/ui/fl/initial/_internal/Storage",
|
|
13
17
|
"sap/ui/fl/initial/_internal/StorageUtils"
|
|
14
18
|
], function(
|
|
19
|
+
Deferred,
|
|
20
|
+
merge,
|
|
15
21
|
ObjectPath,
|
|
22
|
+
Log,
|
|
16
23
|
ManagedObject,
|
|
24
|
+
FlexInfoSession,
|
|
17
25
|
ManifestUtils,
|
|
18
26
|
Settings,
|
|
19
27
|
Storage,
|
|
@@ -21,6 +29,20 @@ sap.ui.define([
|
|
|
21
29
|
) {
|
|
22
30
|
"use strict";
|
|
23
31
|
|
|
32
|
+
const _mCachedFlexData = {};
|
|
33
|
+
const _mInitPromises = {};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Class for loading Flex Data from the backend via the Connectors.
|
|
37
|
+
*
|
|
38
|
+
* @namespace sap.ui.fl.apply._internal.flexState.Loader
|
|
39
|
+
* @since 1.74
|
|
40
|
+
* @version 1.141.1
|
|
41
|
+
* @private
|
|
42
|
+
* @ui5-restricted sap.ui.fl.apply._internal.flexState
|
|
43
|
+
*/
|
|
44
|
+
const Loader = {};
|
|
45
|
+
|
|
24
46
|
function getIdIsLocalTrueObject(vSelector) {
|
|
25
47
|
if (typeof vSelector === "string") {
|
|
26
48
|
vSelector = {id: vSelector};
|
|
@@ -30,8 +52,8 @@ sap.ui.define([
|
|
|
30
52
|
return vSelector;
|
|
31
53
|
}
|
|
32
54
|
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
55
|
+
function migrateOVPSelectorFlags(oManifest, mFlexData) {
|
|
56
|
+
if (ManifestUtils.getOvpEntry(oManifest)) {
|
|
35
57
|
[
|
|
36
58
|
mFlexData.changes,
|
|
37
59
|
mFlexData.variantChanges,
|
|
@@ -81,18 +103,6 @@ sap.ui.define([
|
|
|
81
103
|
return mFlexData;
|
|
82
104
|
}
|
|
83
105
|
|
|
84
|
-
function isMigrationNeeded(oManifest) {
|
|
85
|
-
return oManifest && !!ManifestUtils.getOvpEntry(oManifest);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function formatFlexData(mFlexData) {
|
|
89
|
-
// TODO: rename "changes" everywhere to avoid oResponse.changes.changes calls
|
|
90
|
-
return {
|
|
91
|
-
changes: mFlexData,
|
|
92
|
-
cacheKey: mFlexData.cacheKey
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
106
|
function getSideId(oComponentData) {
|
|
97
107
|
if (oComponentData?.startupParameters && Array.isArray(oComponentData.startupParameters.hcpApplicationId)) {
|
|
98
108
|
return oComponentData.startupParameters.hcpApplicationId[0];
|
|
@@ -131,78 +141,232 @@ sap.ui.define([
|
|
|
131
141
|
}
|
|
132
142
|
|
|
133
143
|
/**
|
|
134
|
-
*
|
|
144
|
+
* Provides the flex data for a given application based on the configured connectors.
|
|
145
|
+
* This function needs a manifest object, async hints and either an ID to an instantiated component or component data as parameter.
|
|
146
|
+
* The fetched data is cached statically in the Loader class. Together with the data, all parameters that have been used
|
|
147
|
+
* for the request are cached as well. If the function is called again with the same parameters,
|
|
148
|
+
* the cached data is returned instead of a new request to the backend.
|
|
135
149
|
*
|
|
136
|
-
* @
|
|
137
|
-
* @
|
|
138
|
-
* @
|
|
139
|
-
* @
|
|
140
|
-
* @
|
|
150
|
+
* @param {object} mPropertyBag - Contains additional data needed for loading changes
|
|
151
|
+
* @param {object} mPropertyBag.manifest - ManifestObject that belongs to current component
|
|
152
|
+
* @param {string} mPropertyBag.reference - Flex Reference
|
|
153
|
+
* @param {object} mPropertyBag.componentData - Component data of the current component
|
|
154
|
+
* @param {boolean} [mPropertyBag.reInitialize] - Flag if the application is reinitialized even if it was loaded before
|
|
155
|
+
* @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
|
|
156
|
+
* @param {boolean} [mPropertyBag.skipLoadBundle=false] - If true only the partial flex data is loaded, without the bundle
|
|
157
|
+
* @returns {Promise<object>} Resolves with the change file for the given component from the Storage
|
|
141
158
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
* @param {object} mPropertyBag.manifest - ManifestObject that belongs to current component
|
|
152
|
-
* @param {object} mPropertyBag.reference - Flex Reference
|
|
153
|
-
* @param {string} mPropertyBag.componentData - Component data of the current component
|
|
154
|
-
* @param {object} [mPropertyBag.reInitialize] - Flag if the application is reinitialized even if it was loaded before
|
|
155
|
-
* @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
|
|
156
|
-
* @param {number} [mPropertyBag.version] - Number of the version in which the state should be initialized
|
|
157
|
-
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be initialized
|
|
158
|
-
* @param {boolean} [mPropertyBag.skipLoadBundle=false] - If true only the partial flex data is loaded, without the bundle
|
|
159
|
-
* @param {boolean} [mPropertyBag.allContexts] - Includes also restricted context
|
|
160
|
-
* @param {object} [mPropertyBag.partialFlexData] - Already loaded data if only the bundle has to be loaded
|
|
161
|
-
* @returns {Promise<object>} resolves with the change file for the given component from the Storage
|
|
162
|
-
*/
|
|
163
|
-
loadFlexData(mPropertyBag) {
|
|
164
|
-
var sComponentName = ManifestUtils.getBaseComponentNameFromManifest(mPropertyBag.manifest);
|
|
165
|
-
|
|
166
|
-
if (mPropertyBag.partialFlexData) {
|
|
167
|
-
return Storage.completeFlexData({
|
|
168
|
-
reference: mPropertyBag.reference,
|
|
169
|
-
componentName: sComponentName,
|
|
170
|
-
partialFlexData: mPropertyBag.partialFlexData
|
|
171
|
-
}).then(formatFlexData);
|
|
172
|
-
}
|
|
159
|
+
Loader.getFlexData = async function(mPropertyBag) {
|
|
160
|
+
// the FlexInfoSession is used to adjust the parameters of the request
|
|
161
|
+
let oFlexInfoSession = FlexInfoSession.getByReference(mPropertyBag.reference);
|
|
162
|
+
const mPropertyBagCopy = merge({}, mPropertyBag, {
|
|
163
|
+
version: oFlexInfoSession.version,
|
|
164
|
+
adaptationId: oFlexInfoSession.displayedAdaptationId,
|
|
165
|
+
allContextsProvided: oFlexInfoSession.allContextsProvided
|
|
166
|
+
});
|
|
167
|
+
const sReference = mPropertyBagCopy.reference;
|
|
173
168
|
|
|
169
|
+
const oOldInitPromise = _mInitPromises[sReference];
|
|
170
|
+
const oNewInitPromise = new Deferred();
|
|
171
|
+
_mInitPromises[sReference] = oNewInitPromise;
|
|
172
|
+
|
|
173
|
+
if (oOldInitPromise) {
|
|
174
|
+
await oOldInitPromise.promise;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const bRequiresNewLoadRequest =
|
|
178
|
+
mPropertyBag.reInitialize
|
|
179
|
+
|| !_mCachedFlexData[mPropertyBag.reference]
|
|
180
|
+
|| _mCachedFlexData[sReference].parameters.emptyState
|
|
181
|
+
|| _mCachedFlexData[sReference].parameters.version !== mPropertyBagCopy.version
|
|
182
|
+
|| _mCachedFlexData[sReference].parameters.allContextsProvided !== mPropertyBagCopy.allContextsProvided
|
|
183
|
+
|| _mCachedFlexData[sReference].parameters.adaptationId !== mPropertyBagCopy.adaptationId;
|
|
184
|
+
|
|
185
|
+
const bRequiresOnlyCompletion =
|
|
186
|
+
_mCachedFlexData[sReference]
|
|
187
|
+
&& !_mCachedFlexData[sReference].parameters.emptyState
|
|
188
|
+
&& _mCachedFlexData[sReference].parameters.bundleNotLoaded
|
|
189
|
+
&& !mPropertyBagCopy.skipLoadBundle;
|
|
190
|
+
|
|
191
|
+
if (!bRequiresNewLoadRequest && !bRequiresOnlyCompletion) {
|
|
192
|
+
oNewInitPromise.resolve();
|
|
193
|
+
return {
|
|
194
|
+
data: _mCachedFlexData[sReference].data,
|
|
195
|
+
cacheInvalidated: false
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let oFlexData;
|
|
200
|
+
let oAuthors;
|
|
201
|
+
const sComponentName = ManifestUtils.getBaseComponentNameFromManifest(mPropertyBagCopy.manifest);
|
|
202
|
+
if (bRequiresNewLoadRequest) {
|
|
174
203
|
// the cache key cannot be used in case of a reinitialization
|
|
175
|
-
|
|
204
|
+
const sCacheKey = mPropertyBagCopy.reInitialize
|
|
205
|
+
? undefined
|
|
206
|
+
: ManifestUtils.getCacheKeyFromAsyncHints(sReference, mPropertyBagCopy.asyncHints);
|
|
176
207
|
|
|
177
|
-
|
|
178
|
-
preview: ManifestUtils.getPreviewSectionFromAsyncHints(
|
|
179
|
-
reference:
|
|
208
|
+
oFlexData = await Storage.loadFlexData({
|
|
209
|
+
preview: ManifestUtils.getPreviewSectionFromAsyncHints(mPropertyBagCopy.asyncHints),
|
|
210
|
+
reference: sReference,
|
|
180
211
|
componentName: sComponentName,
|
|
181
212
|
cacheKey: sCacheKey,
|
|
182
|
-
siteId: getSideId(
|
|
183
|
-
appDescriptor:
|
|
184
|
-
version:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.
|
|
190
|
-
|
|
191
|
-
.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
213
|
+
siteId: getSideId(mPropertyBagCopy.componentData),
|
|
214
|
+
appDescriptor: mPropertyBagCopy.manifest.getRawJson ? mPropertyBagCopy.manifest.getRawJson() : mPropertyBagCopy.manifest,
|
|
215
|
+
version: mPropertyBagCopy.version,
|
|
216
|
+
adaptationId: mPropertyBagCopy.adaptationId,
|
|
217
|
+
skipLoadBundle: mPropertyBagCopy.skipLoadBundle
|
|
218
|
+
});
|
|
219
|
+
const oSettings = await Settings.getInstance();
|
|
220
|
+
oAuthors = oSettings.getIsVariantAuthorNameAvailable() ? await Storage.loadVariantsAuthors(sReference) : {};
|
|
221
|
+
} else {
|
|
222
|
+
oFlexData = await Storage.completeFlexData({
|
|
223
|
+
reference: sReference,
|
|
224
|
+
componentName: sComponentName,
|
|
225
|
+
partialFlexData: _mCachedFlexData[sReference].data.changes
|
|
226
|
+
});
|
|
227
|
+
oAuthors = _mCachedFlexData[sReference].data.authors;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const oFlexDataCopy = Object.assign({}, oFlexData);
|
|
231
|
+
applyDeactivateChanges(oFlexDataCopy);
|
|
232
|
+
filterInvalidFileNames(oFlexDataCopy);
|
|
233
|
+
migrateOVPSelectorFlags(mPropertyBagCopy.manifest, oFlexDataCopy);
|
|
234
|
+
|
|
235
|
+
const oFormattedFlexData = {
|
|
236
|
+
changes: oFlexDataCopy,
|
|
237
|
+
cacheKey: oFlexDataCopy.cacheKey,
|
|
238
|
+
authors: oAuthors
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
_mCachedFlexData[sReference] = {
|
|
242
|
+
data: oFormattedFlexData,
|
|
243
|
+
parameters: {
|
|
244
|
+
bundleNotLoaded: !!mPropertyBagCopy.skipLoadBundle,
|
|
245
|
+
version: mPropertyBagCopy.version,
|
|
246
|
+
allContextsProvided: mPropertyBagCopy.allContextsProvided,
|
|
247
|
+
adaptationId: mPropertyBagCopy.adaptationId
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
if (oFormattedFlexData.changes.info !== undefined) {
|
|
252
|
+
oFlexInfoSession = { ...oFlexInfoSession, ...oFormattedFlexData.changes.info };
|
|
206
253
|
}
|
|
254
|
+
FlexInfoSession.setByReference(oFlexInfoSession, sReference);
|
|
255
|
+
oNewInitPromise.resolve();
|
|
256
|
+
return {
|
|
257
|
+
data: oFormattedFlexData,
|
|
258
|
+
cacheInvalidated: true
|
|
259
|
+
};
|
|
207
260
|
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Initializes an empty cache for a specific reference.
|
|
264
|
+
*
|
|
265
|
+
* @param {string} sReference - The flex reference for which to initialize the cache.
|
|
266
|
+
* @returns {object} The empty Flex Data object
|
|
267
|
+
*/
|
|
268
|
+
Loader.initializeEmptyCache = function(sReference) {
|
|
269
|
+
const oInitialFlexData = { changes: StorageUtils.getEmptyFlexDataResponse() };
|
|
270
|
+
_mCachedFlexData[sReference] = {
|
|
271
|
+
data: oInitialFlexData,
|
|
272
|
+
parameters: {
|
|
273
|
+
bundleNotLoaded: true,
|
|
274
|
+
emptyState: true
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
return oInitialFlexData;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Clears the cache for a specific reference or for all references if no reference is provided.
|
|
282
|
+
* Should only be used in tests.
|
|
283
|
+
*
|
|
284
|
+
* @param {string} [sReference] - The flex reference for which to clear the cache.
|
|
285
|
+
*/
|
|
286
|
+
Loader.clearCache = function(sReference) {
|
|
287
|
+
if (sReference) {
|
|
288
|
+
delete _mCachedFlexData[sReference];
|
|
289
|
+
delete _mInitPromises[sReference];
|
|
290
|
+
} else {
|
|
291
|
+
Object.keys(_mCachedFlexData).forEach((sReference) => {
|
|
292
|
+
delete _mCachedFlexData[sReference];
|
|
293
|
+
delete _mInitPromises[sReference];
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Loads a FlVariant and updates the cached flex data.
|
|
300
|
+
*
|
|
301
|
+
* @param {object} mPropertyBag - The property bag containing the variant reference and other parameters.
|
|
302
|
+
* @param {string} mPropertyBag.variantReference - The reference of the variant to load.
|
|
303
|
+
* @param {string} mPropertyBag.reference - The flex reference of the application.
|
|
304
|
+
* @returns {Promise<object>} Resolves with the loaded variant data.
|
|
305
|
+
*/
|
|
306
|
+
Loader.loadFlVariant = async function(mPropertyBag) {
|
|
307
|
+
const oNewData = await Storage.loadFlVariant({
|
|
308
|
+
variantReference: mPropertyBag.variantReference,
|
|
309
|
+
reference: mPropertyBag.reference
|
|
310
|
+
});
|
|
311
|
+
Object.entries(oNewData).forEach(([sKey, vValue]) => {
|
|
312
|
+
_mCachedFlexData[mPropertyBag.reference].data.changes[sKey].push(...vValue);
|
|
313
|
+
});
|
|
314
|
+
return {
|
|
315
|
+
newData: oNewData,
|
|
316
|
+
completeData: _mCachedFlexData[mPropertyBag.reference].data
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Updates the storage response for a specific reference.
|
|
322
|
+
*
|
|
323
|
+
* @param {string} sReference - The flex reference for which to update the storage response.
|
|
324
|
+
* @param {object[]} aUpdates - The updates to apply to the storage response.
|
|
325
|
+
*/
|
|
326
|
+
Loader.updateCachedResponse = function(sReference, aUpdates) {
|
|
327
|
+
StorageUtils.updateStorageResponse(_mCachedFlexData[sReference].data, aUpdates);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Retrieves the cached flexibility data for a specific reference.
|
|
332
|
+
*
|
|
333
|
+
* @param {string} sReference - The flex reference for which to retrieve the cached data.
|
|
334
|
+
* @returns {Promise<object>} A promise that resolves with the cached flexibility data or an empty object if not found.
|
|
335
|
+
*/
|
|
336
|
+
Loader.getCachedFlexData = function(sReference) {
|
|
337
|
+
// TODO return copy of the data once the CompVariantManager does not mutate it anymore
|
|
338
|
+
return _mCachedFlexData[sReference]?.data || {};
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Waits for the Loader to initialize the cached backend response.
|
|
343
|
+
* If the getFlexData was not called before an error is logged and the promise resolves immediately.
|
|
344
|
+
*
|
|
345
|
+
* @param {string} sReference - The flex reference for which to wait for initialization.
|
|
346
|
+
* @return {Promise<undefined>} Resolves with undefined when the initialization is complete
|
|
347
|
+
*/
|
|
348
|
+
Loader.waitForInitialization = function(sReference) {
|
|
349
|
+
const oInitPromise = _mInitPromises[sReference]?.promise;
|
|
350
|
+
if (!oInitPromise) {
|
|
351
|
+
Log.error("Loader.waitForInitialization was called before FlexState.initialize");
|
|
352
|
+
return Promise.resolve();
|
|
353
|
+
}
|
|
354
|
+
return oInitPromise;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* This function is temporary and will be removed once the allContextsProvided property is part of the flex/data requests in ABAP
|
|
359
|
+
* The allContextsProvided property is not part of the initial flex/data request and needs to be set later to prevent
|
|
360
|
+
* FlexState from being reinitialized
|
|
361
|
+
*
|
|
362
|
+
* @param {string} sReference - Flexibility reference of the app
|
|
363
|
+
* @param {boolean} bAllContextsProvided - Flag to indicate if all contexts are provided
|
|
364
|
+
*/
|
|
365
|
+
Loader.setAllContextsProvided = function(sReference, bAllContextsProvided) {
|
|
366
|
+
if (_mCachedFlexData[sReference] && _mCachedFlexData[sReference].parameters.allContextsProvided === undefined) {
|
|
367
|
+
_mCachedFlexData[sReference].parameters.allContextsProvided = bAllContextsProvided;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
return Loader;
|
|
208
372
|
});
|