@openui5/sap.ui.fl 1.139.0 → 1.141.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/.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 +2 -2
- 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 +14 -12
- 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 +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 +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +12 -26
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +68 -229
- 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 +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 +287 -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 +22 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +72 -19
- package/src/sap/ui/fl/apply/_internal/init.js +47 -0
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +17 -7
- 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 +6 -5
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +45 -45
- 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 +372 -0
- package/src/sap/ui/fl/{apply/_internal/flexState → 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 +16 -5
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/RegistrationDelegator.js +9 -40
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/XmlPreprocessor.js +29 -21
- 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/messagebundle_vi.properties +1 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +2 -2
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- 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 +5 -4
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +88 -36
- package/src/sap/ui/fl/variants/VariantManager.js +81 -21
- package/src/sap/ui/fl/variants/VariantModel.js +38 -189
- 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 +9 -5
- 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 +1 -1
- 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/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 +40 -71
- 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/{CompVariantState.js → CompVariantManager.js} +176 -309
- package/src/sap/ui/fl/write/_internal/init.js +27 -0
- 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/Adaptations.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +4 -2
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +60 -26
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +19 -23
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +3 -2
- 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 +3 -2
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +23 -20
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +10 -7
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +8 -7
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +3 -2
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +26 -22
- package/src/sap/ui/fl/write/api/TranslationAPI.js +3 -2
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/VersionsAPI.js +4 -3
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +3 -2
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +4 -2
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +13 -0
- package/ui5.yaml +0 -1
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +0 -208
- 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
|
@@ -8,13 +8,10 @@ sap.ui.define([
|
|
|
8
8
|
"sap/base/util/restricted/_difference",
|
|
9
9
|
"sap/base/util/restricted/_isEqual",
|
|
10
10
|
"sap/base/util/restricted/_omit",
|
|
11
|
-
"sap/base/util/each",
|
|
12
11
|
"sap/base/util/isEmptyObject",
|
|
13
12
|
"sap/base/util/merge",
|
|
14
|
-
"sap/base/Log",
|
|
15
13
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
16
14
|
"sap/ui/core/BusyIndicator",
|
|
17
|
-
"sap/ui/core/Element",
|
|
18
15
|
"sap/ui/core/Lib",
|
|
19
16
|
"sap/ui/fl/apply/_internal/controlVariants/URLHandler",
|
|
20
17
|
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
@@ -23,7 +20,8 @@ sap.ui.define([
|
|
|
23
20
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher",
|
|
24
21
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
25
22
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
26
|
-
"sap/ui/fl/apply/
|
|
23
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
24
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
27
25
|
"sap/ui/fl/initial/_internal/Settings",
|
|
28
26
|
"sap/ui/fl/Layer",
|
|
29
27
|
"sap/ui/fl/LayerUtils",
|
|
@@ -35,13 +33,10 @@ sap.ui.define([
|
|
|
35
33
|
_difference,
|
|
36
34
|
_isEqual,
|
|
37
35
|
_omit,
|
|
38
|
-
each,
|
|
39
36
|
isEmptyObject,
|
|
40
37
|
merge,
|
|
41
|
-
Log,
|
|
42
38
|
JsControlTreeModifier,
|
|
43
39
|
BusyIndicator,
|
|
44
|
-
Element,
|
|
45
40
|
Lib,
|
|
46
41
|
URLHandler,
|
|
47
42
|
VariantUtil,
|
|
@@ -50,6 +45,7 @@ sap.ui.define([
|
|
|
50
45
|
Switcher,
|
|
51
46
|
VariantManagementState,
|
|
52
47
|
FlexObjectState,
|
|
48
|
+
ControlVariantApplyAPI,
|
|
53
49
|
ManifestUtils,
|
|
54
50
|
Settings,
|
|
55
51
|
Layer,
|
|
@@ -63,22 +59,23 @@ sap.ui.define([
|
|
|
63
59
|
|
|
64
60
|
var _mUShellServices = {};
|
|
65
61
|
const { SharingMode } = mobileLibrary;
|
|
62
|
+
|
|
66
63
|
/**
|
|
67
64
|
* Adds the passed function to the variant switch promise and returns the whole promise chain.
|
|
68
65
|
*
|
|
69
66
|
* @param {function():Promise} fnCallback - Callback function returning a promise
|
|
70
|
-
* @param {
|
|
67
|
+
* @param {string} sFlexReference - Flex reference of the app
|
|
71
68
|
* @param {string} sVMReference - Variant Management reference
|
|
72
69
|
* @returns {Promise} Resolves when the variant model is not busy anymore
|
|
73
70
|
* @private
|
|
74
71
|
*/
|
|
75
|
-
function executeAfterSwitch(fnCallback,
|
|
72
|
+
function executeAfterSwitch(fnCallback, sFlexReference, sVMReference) {
|
|
76
73
|
// if there are multiple switches triggered very quickly this makes sure that they are being executed one after another
|
|
77
|
-
|
|
74
|
+
const oNewPromise = VariantManagementState.waitForVariantSwitch(sFlexReference, sVMReference)
|
|
78
75
|
.catch(function() {})
|
|
79
76
|
.then(fnCallback);
|
|
80
|
-
VariantManagementState.setVariantSwitchPromise(
|
|
81
|
-
return
|
|
77
|
+
VariantManagementState.setVariantSwitchPromise(sFlexReference, sVMReference, oNewPromise);
|
|
78
|
+
return oNewPromise;
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
/**
|
|
@@ -121,7 +118,9 @@ sap.ui.define([
|
|
|
121
118
|
var oSettings = Settings.getInstanceOrUndef();
|
|
122
119
|
var bUserIsAuthorized = oSettings &&
|
|
123
120
|
(oSettings.getIsKeyUser() || !oSettings.getUserId() ||
|
|
124
|
-
(oSettings.getIsPublicFlVariantEnabled() &&
|
|
121
|
+
(oSettings.getIsPublicFlVariantEnabled() &&
|
|
122
|
+
oSettings.getUserId().toUpperCase() === oVariant.instance.getSupportInformation().user.toUpperCase()
|
|
123
|
+
));
|
|
125
124
|
oVariant.remove = bUserIsAuthorized;
|
|
126
125
|
oVariant.rename = bUserIsAuthorized;
|
|
127
126
|
oVariant.change = bUserIsAuthorized;
|
|
@@ -135,20 +134,6 @@ sap.ui.define([
|
|
|
135
134
|
return false;
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
function waitForControlToBeRendered(oControl) {
|
|
139
|
-
return new Promise(function(resolve) {
|
|
140
|
-
if (oControl.getDomRef()) {
|
|
141
|
-
resolve();
|
|
142
|
-
} else {
|
|
143
|
-
oControl.addEventDelegate({
|
|
144
|
-
onAfterRendering() {
|
|
145
|
-
resolve();
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
137
|
function initUshellServices() {
|
|
153
138
|
var oUShellContainer = Utils.getUshellContainer();
|
|
154
139
|
if (oUShellContainer) {
|
|
@@ -199,7 +184,7 @@ sap.ui.define([
|
|
|
199
184
|
* @class Variant model implementation for JSON format.
|
|
200
185
|
* @extends sap.ui.model.json.JSONModel
|
|
201
186
|
* @author SAP SE
|
|
202
|
-
* @version 1.
|
|
187
|
+
* @version 1.141.0
|
|
203
188
|
* @param {object} oData - Either the URL where to load the JSON from or a JS object
|
|
204
189
|
* @param {object} mPropertyBag - Map of properties required for the constructor
|
|
205
190
|
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Application component instance that is currently loading
|
|
@@ -224,8 +209,6 @@ sap.ui.define([
|
|
|
224
209
|
this.sFlexReference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.appComponent);
|
|
225
210
|
this.oAppComponent = mPropertyBag.appComponent;
|
|
226
211
|
this._oResourceBundle = Lib.getResourceBundleFor("sap.ui.fl");
|
|
227
|
-
this._oVariantSwitchPromises = {};
|
|
228
|
-
this._oVariantAppliedListeners = {};
|
|
229
212
|
|
|
230
213
|
// set variant model data
|
|
231
214
|
this.fnUpdateListener = this.updateData.bind(this);
|
|
@@ -288,10 +271,6 @@ sap.ui.define([
|
|
|
288
271
|
}.bind(this));
|
|
289
272
|
};
|
|
290
273
|
|
|
291
|
-
VariantModel.prototype.waitForAllVMSwitchPromises = function() {
|
|
292
|
-
return Promise.all(Object.values(this._oVariantSwitchPromises));
|
|
293
|
-
};
|
|
294
|
-
|
|
295
274
|
/**
|
|
296
275
|
* Updates the storage of the current variant for a given variant management control.
|
|
297
276
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
@@ -319,7 +298,7 @@ sap.ui.define([
|
|
|
319
298
|
}
|
|
320
299
|
return executeAfterSwitch(
|
|
321
300
|
switchVariantAndUpdateModel.bind(this, mProperties, mPropertyBag.scenario),
|
|
322
|
-
this,
|
|
301
|
+
this.sFlexReference,
|
|
323
302
|
mPropertyBag.variantManagementReference
|
|
324
303
|
);
|
|
325
304
|
};
|
|
@@ -345,6 +324,7 @@ sap.ui.define([
|
|
|
345
324
|
iIndex = index;
|
|
346
325
|
return true;
|
|
347
326
|
}
|
|
327
|
+
return false;
|
|
348
328
|
});
|
|
349
329
|
}.bind(this));
|
|
350
330
|
return {
|
|
@@ -372,115 +352,20 @@ sap.ui.define([
|
|
|
372
352
|
return getVariant(this.oData[sVMReference].variants, sVariantReference).title;
|
|
373
353
|
};
|
|
374
354
|
|
|
375
|
-
function handleInitialLoadScenario(sVMReference, oVariantManagementControl) {
|
|
376
|
-
var aVariantChangesForVariant = VariantManagementState.getVariantChangesForVariant({
|
|
377
|
-
vmReference: sVMReference,
|
|
378
|
-
reference: this.sFlexReference
|
|
379
|
-
});
|
|
380
|
-
var sDefaultVariantReference = this.oData[sVMReference].defaultVariant;
|
|
381
|
-
if (
|
|
382
|
-
oVariantManagementControl.getExecuteOnSelectionForStandardDefault()
|
|
383
|
-
&& sDefaultVariantReference === sVMReference
|
|
384
|
-
&& !aVariantChangesForVariant.some((oVariantChange) => oVariantChange.getChangeType() === "setExecuteOnSelect")
|
|
385
|
-
) {
|
|
386
|
-
var oStandardVariant = getVariant(this.oData[sVMReference].variants, sVMReference);
|
|
387
|
-
// set executeOnSelect in model and State without creating a change
|
|
388
|
-
oStandardVariant.instance.setExecuteOnSelection(true);
|
|
389
|
-
this.oData[sVMReference].variants[0].executeOnSelect = true;
|
|
390
|
-
return true;
|
|
391
|
-
}
|
|
392
|
-
return false;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Saves a function that will be called after a variant has been applied with the new variant as parameter.
|
|
397
|
-
* The function also performs a sanity check after the control has been rendered.
|
|
398
|
-
* If the passed variant control ID does not match the responsible variant management control, the callback will not be saved.
|
|
399
|
-
* Optionally this function is also called after the initial variant is applied without a sanity check.
|
|
400
|
-
*
|
|
401
|
-
* @param {object} mPropertyBag - Object with parameters as properties
|
|
402
|
-
* @param {string} mPropertyBag.control - Instance of the control
|
|
403
|
-
* @param {string} mPropertyBag.vmControlId - ID of the variant management control
|
|
404
|
-
* @param {function} mPropertyBag.callback - Callback that will be called after a variant has been applied
|
|
405
|
-
* @param {boolean} mPropertyBag.callAfterInitialVariant - The callback will also be called after the initial variant is applied
|
|
406
|
-
* @returns {Promise} Promise that resolves after the sanity check
|
|
407
|
-
*/
|
|
408
|
-
VariantModel.prototype.attachVariantApplied = function(mPropertyBag) {
|
|
409
|
-
var oVariantManagementControl = Element.getElementById(mPropertyBag.vmControlId);
|
|
410
|
-
var sVMReference = this.getVariantManagementReferenceForControl(oVariantManagementControl);
|
|
411
|
-
|
|
412
|
-
return this.waitForVMControlInit(sVMReference).then(function(sVMReference, mPropertyBag) {
|
|
413
|
-
this._oVariantAppliedListeners[sVMReference] ||= {};
|
|
414
|
-
|
|
415
|
-
var bInitialLoad = handleInitialLoadScenario.call(this, sVMReference, oVariantManagementControl);
|
|
416
|
-
|
|
417
|
-
// if the parameter callAfterInitialVariant or initialLoad is true call the function without check
|
|
418
|
-
if (mPropertyBag.callAfterInitialVariant || bInitialLoad) {
|
|
419
|
-
var mParameters = {
|
|
420
|
-
appComponent: this.oAppComponent,
|
|
421
|
-
reference: this.sFlexReference,
|
|
422
|
-
vmReference: sVMReference
|
|
423
|
-
};
|
|
424
|
-
waitForInitialVariantChanges(mParameters).then(function() {
|
|
425
|
-
var sCurrentVariantReference = this.oData[sVMReference].currentVariant;
|
|
426
|
-
this.callVariantSwitchListeners(sVMReference, sCurrentVariantReference, mPropertyBag.callback);
|
|
427
|
-
}.bind(this));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// first check if the passed vmControlId is correct, then save the callback
|
|
431
|
-
// for this check the control has to be in the control tree already
|
|
432
|
-
return waitForControlToBeRendered(mPropertyBag.control).then(function() {
|
|
433
|
-
if (
|
|
434
|
-
VariantUtil.getRelevantVariantManagementControlId(
|
|
435
|
-
mPropertyBag.control,
|
|
436
|
-
this.getVariantManagementControlIds()
|
|
437
|
-
) === mPropertyBag.vmControlId
|
|
438
|
-
) {
|
|
439
|
-
this.oData[sVMReference].showExecuteOnSelection = true;
|
|
440
|
-
this.checkUpdate(true);
|
|
441
|
-
this._oVariantAppliedListeners[sVMReference][mPropertyBag.control.getId()] = mPropertyBag.callback;
|
|
442
|
-
} else {
|
|
443
|
-
Log.error("Error in attachVariantApplied: The passed VariantManagement ID does not match the "
|
|
444
|
-
+ "responsible VariantManagement control");
|
|
445
|
-
}
|
|
446
|
-
}.bind(this));
|
|
447
|
-
}.bind(this, sVMReference, mPropertyBag));
|
|
448
|
-
};
|
|
449
|
-
|
|
450
355
|
VariantModel.prototype.callVariantSwitchListeners = function(sVMReference, sNewVariantReference, fnCallback, sScenario) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
if (fnCallback) {
|
|
458
|
-
fnCallback(oVariant);
|
|
459
|
-
} else {
|
|
460
|
-
each(this._oVariantAppliedListeners[sVMReference], function(sControlId, fnCallback) {
|
|
461
|
-
fnCallback(oVariant);
|
|
462
|
-
});
|
|
463
|
-
}
|
|
356
|
+
const oVMControl = ControlVariantApplyAPI.getVariantManagementControlByVMReference(sVMReference, this.oAppComponent);
|
|
357
|
+
const oVariant = getVariant(this.oData[sVMReference].variants, sNewVariantReference);
|
|
358
|
+
if (sScenario) {
|
|
359
|
+
oVariant.createScenario = sScenario;
|
|
464
360
|
}
|
|
465
|
-
};
|
|
466
361
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
362
|
+
if (fnCallback) {
|
|
363
|
+
fnCallback(oVariant);
|
|
364
|
+
} else {
|
|
365
|
+
oVMControl._executeAllVariantAppliedListeners(oVariant);
|
|
471
366
|
}
|
|
472
367
|
};
|
|
473
368
|
|
|
474
|
-
VariantModel.prototype._getVariantTitleCount = function(sNewText, sVariantManagementReference) {
|
|
475
|
-
var oData = this.getData();
|
|
476
|
-
return oData[sVariantManagementReference].variants.reduce(function(iCount, oVariant) {
|
|
477
|
-
if (sNewText.toLowerCase() === oVariant.title.toLowerCase() && oVariant.visible) {
|
|
478
|
-
iCount++;
|
|
479
|
-
}
|
|
480
|
-
return iCount;
|
|
481
|
-
}, 0);
|
|
482
|
-
};
|
|
483
|
-
|
|
484
369
|
function createNewVariant(oSourceVariant, mPropertyBag) {
|
|
485
370
|
var mProperties = {
|
|
486
371
|
id: mPropertyBag.newVariantReference,
|
|
@@ -527,7 +412,10 @@ sap.ui.define([
|
|
|
527
412
|
return oVariantChange.convertToFileContent();
|
|
528
413
|
});
|
|
529
414
|
|
|
530
|
-
mPropertyBag.currentVariantComparison = LayerUtils.compareAgainstCurrentLayer(
|
|
415
|
+
mPropertyBag.currentVariantComparison = LayerUtils.compareAgainstCurrentLayer(
|
|
416
|
+
oSourceVariant.instance.getLayer(),
|
|
417
|
+
mPropertyBag.layer
|
|
418
|
+
);
|
|
531
419
|
if (mPropertyBag.currentVariantComparison === 1) {
|
|
532
420
|
mPropertyBag.sourceVariantSource = this.getVariant(oSourceVariant.instance.getVariantReference());
|
|
533
421
|
}
|
|
@@ -701,7 +589,8 @@ sap.ui.define([
|
|
|
701
589
|
break;
|
|
702
590
|
case "setVisible":
|
|
703
591
|
mAdditionalChangeContent.visible = mPropertyBag.visible;
|
|
704
|
-
|
|
592
|
+
// 'createdByReset' is used by the backend to distinguish between setVisible change created via reset and delete
|
|
593
|
+
mAdditionalChangeContent.createdByReset = false;
|
|
705
594
|
oVariantInstance.setVisible(mPropertyBag.visible);
|
|
706
595
|
break;
|
|
707
596
|
case "setContexts":
|
|
@@ -717,7 +606,7 @@ sap.ui.define([
|
|
|
717
606
|
oData[sVariantManagementReference].defaultVariant !== oData[sVariantManagementReference].currentVariant
|
|
718
607
|
&& aHashParameters.indexOf(oData[sVariantManagementReference].currentVariant) === -1
|
|
719
608
|
) {
|
|
720
|
-
// if default variant is changed from the current variant,
|
|
609
|
+
// if default variant is changed from the current variant, add the current variant id as a variant URI parameter
|
|
721
610
|
URLHandler.update({
|
|
722
611
|
parameters: aHashParameters.concat(oData[sVariantManagementReference].currentVariant),
|
|
723
612
|
updateURL: !this._bDesignTimeMode,
|
|
@@ -750,8 +639,7 @@ sap.ui.define([
|
|
|
750
639
|
VariantModel.prototype._ensureStandardVariantExists = function(sVariantManagementReference) {
|
|
751
640
|
var oData = this.getData();
|
|
752
641
|
var oVMDataSection = oData[sVariantManagementReference] || {};
|
|
753
|
-
|
|
754
|
-
if (!oData[sVariantManagementReference] || isEmptyObject(oVMDataSectionWithoutInit)) { // Ensure standard variant exists
|
|
642
|
+
if (!oData[sVariantManagementReference] || isEmptyObject(oVMDataSection)) { // Ensure standard variant exists
|
|
755
643
|
// Standard Variant should always contain the value: "SAP" in "author" / "Created by" field
|
|
756
644
|
var oStandardVariantInstance = FlexObjectFactory.createFlVariant({
|
|
757
645
|
id: sVariantManagementReference,
|
|
@@ -878,12 +766,6 @@ sap.ui.define([
|
|
|
878
766
|
return JsControlTreeModifier.getSelector(sId, oAppComponent).id;
|
|
879
767
|
};
|
|
880
768
|
|
|
881
|
-
VariantModel.prototype.getVariantManagementReferenceForControl = function(oVariantManagementControl) {
|
|
882
|
-
var sControlId = oVariantManagementControl.getId();
|
|
883
|
-
var oAppComponent = Utils.getAppComponentForControl(oVariantManagementControl);
|
|
884
|
-
return (oAppComponent && oAppComponent.getLocalId(sControlId)) || sControlId;
|
|
885
|
-
};
|
|
886
|
-
|
|
887
769
|
VariantModel.prototype.switchToDefaultForVariantManagement = function(sVariantManagementReference) {
|
|
888
770
|
if (this.oData[sVariantManagementReference].currentVariant !== this.oData[sVariantManagementReference].defaultVariant) {
|
|
889
771
|
BusyIndicator.show(200);
|
|
@@ -939,7 +821,7 @@ sap.ui.define([
|
|
|
939
821
|
}
|
|
940
822
|
|
|
941
823
|
VariantModel.prototype.registerToModel = function(oVariantManagementControl) {
|
|
942
|
-
const sVariantManagementReference =
|
|
824
|
+
const sVariantManagementReference = oVariantManagementControl.getVariantManagementReference();
|
|
943
825
|
|
|
944
826
|
// ensure standard variants are mocked, if no variants are present in the changes.variantSection response from the backend
|
|
945
827
|
this._ensureStandardVariantExists(sVariantManagementReference);
|
|
@@ -948,7 +830,7 @@ sap.ui.define([
|
|
|
948
830
|
this.oData[sVariantManagementReference]._isEditable = oVariantManagementControl.getEditable();
|
|
949
831
|
|
|
950
832
|
// only attachVariantApplied will set this to true
|
|
951
|
-
|
|
833
|
+
oVariantManagementControl.setShowExecuteOnSelection(false);
|
|
952
834
|
|
|
953
835
|
// replace bindings in titles with the resolved texts
|
|
954
836
|
resolveTitleBindingsAndCreateVariantChanges.call(this, oVariantManagementControl, sVariantManagementReference);
|
|
@@ -989,44 +871,11 @@ sap.ui.define([
|
|
|
989
871
|
reference: this.sFlexReference,
|
|
990
872
|
vmReference: sVariantManagementReference
|
|
991
873
|
};
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
this.oData[sVariantManagementReference].init = true;
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
VariantModel.prototype.waitForVMControlInit = function(sVMReference) {
|
|
1003
|
-
if (!this.oData[sVMReference]) {
|
|
1004
|
-
this.oData[sVMReference] = {};
|
|
1005
|
-
} else if (this.oData[sVMReference].init) {
|
|
1006
|
-
return Promise.resolve();
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
this.oData[sVMReference].initPromise = {};
|
|
1010
|
-
this.oData[sVMReference].initPromise.promise = new Promise(function(resolve) {
|
|
1011
|
-
this.oData[sVMReference].initPromise.resolveFunction = resolve;
|
|
1012
|
-
}.bind(this));
|
|
1013
|
-
return this.oData[sVMReference].initPromise.promise;
|
|
1014
|
-
};
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Checks if the passed changes exist as dirty changes.
|
|
1018
|
-
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aControlChanges - Array of changes to be checked
|
|
1019
|
-
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Array of filtered changes
|
|
1020
|
-
* @private
|
|
1021
|
-
*/
|
|
1022
|
-
VariantModel.prototype._getDirtyChangesFromVariantChanges = function(aControlChanges) {
|
|
1023
|
-
var aChangeFileNames = aControlChanges.map(function(oChange) {
|
|
1024
|
-
return oChange.getId();
|
|
1025
|
-
});
|
|
1026
|
-
|
|
1027
|
-
return FlexObjectState.getDirtyFlexObjects(this.sFlexReference).filter(function(oChange) {
|
|
1028
|
-
return aChangeFileNames.includes(oChange.getId()) && !oChange.getSavedToVariant();
|
|
1029
|
-
});
|
|
874
|
+
VariantManagementState.setVariantSwitchPromise(
|
|
875
|
+
this.sFlexReference,
|
|
876
|
+
sVariantManagementReference,
|
|
877
|
+
waitForInitialVariantChanges(mParameters)
|
|
878
|
+
);
|
|
1030
879
|
};
|
|
1031
880
|
|
|
1032
881
|
/**
|
|
@@ -10,7 +10,7 @@ sap.ui.define([
|
|
|
10
10
|
"sap/base/Log",
|
|
11
11
|
"sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes",
|
|
12
12
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
13
|
-
"sap/ui/fl/
|
|
13
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
14
14
|
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
15
15
|
"sap/ui/fl/initial/_internal/Settings",
|
|
16
16
|
"sap/ui/fl/write/_internal/appVariant/AppVariantFactory",
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @namespace sap.ui.fl.write._internal.Storage
|
|
24
24
|
* @since 1.67
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.141.0
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl
|
|
28
28
|
*/
|
|
@@ -340,6 +340,19 @@ sap.ui.define([
|
|
|
340
340
|
return _executeActionByName("setSeenFeatureIds", mPropertyBag);
|
|
341
341
|
};
|
|
342
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Deletes all user variants for the given variant management references.
|
|
345
|
+
*
|
|
346
|
+
* @param {object} mPropertyBag - Property bag
|
|
347
|
+
* @param {string} mPropertyBag.flexReference - Flex reference of the app the VM controls belong to
|
|
348
|
+
* @param {string[]} mPropertyBag.variantManagementReferences - Array of variant management references
|
|
349
|
+
* @param {sap.ui.fl.Layer} mPropertyBag.layer - Layer
|
|
350
|
+
* @returns {Promise<undefined>} Promise that resolves as soon as the deletion was completed
|
|
351
|
+
*/
|
|
352
|
+
Storage.deleteUserVariantsForVM = function(mPropertyBag) {
|
|
353
|
+
return _executeActionByName("deleteUserVariantsForVM", mPropertyBag);
|
|
354
|
+
};
|
|
355
|
+
|
|
343
356
|
/**
|
|
344
357
|
* Gets the variant management context information.
|
|
345
358
|
* The context information is a JSON object that has boolean property 'lastHitReached'
|
|
@@ -159,7 +159,7 @@ sap.ui.define([
|
|
|
159
159
|
*
|
|
160
160
|
* @namespace sap.ui.fl.write._internal.Versions
|
|
161
161
|
* @since 1.74
|
|
162
|
-
* @version 1.
|
|
162
|
+
* @version 1.141.0
|
|
163
163
|
* @private
|
|
164
164
|
* @ui5-restricted sap.ui.fl
|
|
165
165
|
*/
|
|
@@ -275,10 +275,10 @@ sap.ui.define([
|
|
|
275
275
|
* @param {array} [mPropertyBag.draftFilenames] - Array with filesnames which was saved as draft
|
|
276
276
|
*/
|
|
277
277
|
Versions.onAllChangesSaved = function(mPropertyBag) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
const oModel = Versions.getVersionsModel(mPropertyBag);
|
|
279
|
+
const bVersioningEnabled = oModel.getProperty("/versioningEnabled");
|
|
280
|
+
const bDirtyChanges = oModel.getProperty("/dirtyChanges");
|
|
281
|
+
const aDraftFilenames = oModel.getProperty("/draftFilenames");
|
|
282
282
|
oModel.setProperty("/draftFilenames", aDraftFilenames.concat(mPropertyBag.draftFilenames));
|
|
283
283
|
oModel.setProperty("/dirtyChanges", true);
|
|
284
284
|
oModel.setProperty("/backendDraft", bVersioningEnabled && bDirtyChanges || !!mPropertyBag.contextBasedAdaptation);
|
|
@@ -286,6 +286,10 @@ sap.ui.define([
|
|
|
286
286
|
// Save can happen without a reload and the model must be kept up-to-date
|
|
287
287
|
oModel.setProperty("/persistedVersion", Version.Number.Draft);
|
|
288
288
|
oModel.updateBindings(true);
|
|
289
|
+
// Set the Flex InfoSession version to draft "0"
|
|
290
|
+
const oFlexInfo = FlexInfoSession.getByReference(mPropertyBag.reference);
|
|
291
|
+
oFlexInfo.version = Version.Number.Draft;
|
|
292
|
+
FlexInfoSession.setByReference(oFlexInfo, mPropertyBag.reference);
|
|
289
293
|
};
|
|
290
294
|
|
|
291
295
|
/**
|
|
@@ -26,6 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
*
|
|
27
27
|
* @param {object} mPropertyBag Parameters
|
|
28
28
|
* @param {string} mPropertyBag.id ID of the app variant to be provided for a new app variant and for deleting an app variant
|
|
29
|
+
* @param {object} [mPropertyBag.oParsedHash] - Parsed Hash containing semantic object, action and parameters for inbound
|
|
29
30
|
* @param {string} [mPropertyBag.reference] Proposed referenced descriptor or app variant ID (might be overwritten by the back end) to be provided when creating a new app variant
|
|
30
31
|
* @param {string} [mPropertyBag.transport] Transport with which the app variant should be transported
|
|
31
32
|
* @param {string} [mPropertyBag.package] Package of the app variant
|
|
@@ -35,7 +36,7 @@ sap.ui.define([
|
|
|
35
36
|
* @constructor
|
|
36
37
|
* @alias sap.ui.fl.write._internal.appVariant.AppVariant
|
|
37
38
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
39
|
+
* @version 1.141.0
|
|
39
40
|
* @private
|
|
40
41
|
* @ui5-restricted sap.ui.rta, smart business
|
|
41
42
|
*/
|
|
@@ -164,6 +165,10 @@ sap.ui.define([
|
|
|
164
165
|
return this._oDefinition.id;
|
|
165
166
|
};
|
|
166
167
|
|
|
168
|
+
AppVariant.prototype.getParsedHash = function() {
|
|
169
|
+
return this._oDefinition.parsedHash;
|
|
170
|
+
};
|
|
171
|
+
|
|
167
172
|
AppVariant.prototype.getNamespace = function() {
|
|
168
173
|
return this._oDefinition.namespace || Utils.getNameAndNameSpace(this._oDefinition.id, this._oDefinition.reference).namespace;
|
|
169
174
|
};
|
|
@@ -306,6 +311,10 @@ sap.ui.define([
|
|
|
306
311
|
mPropertyBag.parentVersion = this._oDefinition.parentVersion;
|
|
307
312
|
}
|
|
308
313
|
|
|
314
|
+
if (this._oDefinition.parsedHash) {
|
|
315
|
+
mPropertyBag.parsedHash = this._oDefinition.parsedHash;
|
|
316
|
+
}
|
|
317
|
+
|
|
309
318
|
if (mMap.layer) {
|
|
310
319
|
mPropertyBag.layer = mMap.layer;
|
|
311
320
|
}
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @namespace
|
|
33
33
|
* @alias sap.ui.fl.write._internal.appVariant.AppVariantFactory
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.141.0
|
|
36
36
|
* @private
|
|
37
37
|
* @ui5-restricted sap.ui.rta, smart business
|
|
38
38
|
*/
|
|
@@ -80,6 +80,7 @@ sap.ui.define([
|
|
|
80
80
|
* @param {object} mPropertyBag Parameters
|
|
81
81
|
* @param {string} mPropertyBag.id Id of the app variant
|
|
82
82
|
* @param {string} mPropertyBag.reference Proposed referenced descriptor or app variant ID (might be overwritten by the back end)
|
|
83
|
+
* @param {object} [mPropertyBag.oParsedHash] - Parsed Hash containing semantic object, action and parameters for inbound
|
|
83
84
|
* @param {string} [mPropertyBag.transport] Transport with which the app variant should be transported
|
|
84
85
|
* @param {string} [mPropertyBag.package] Package of the app variant
|
|
85
86
|
* @param {string} [mPropertyBag.version] Version of the app variant
|
|
@@ -96,6 +97,10 @@ sap.ui.define([
|
|
|
96
97
|
Utils.checkParameterAndType(mPropertyBag, "reference", "string");
|
|
97
98
|
Utils.checkParameterAndType(mPropertyBag, "id", "string");
|
|
98
99
|
|
|
100
|
+
if (mPropertyBag.parsedHash) {
|
|
101
|
+
Utils.checkParameterAndType(mPropertyBag, "parsedHash", "object");
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
if (mPropertyBag.version) {
|
|
100
105
|
Utils.checkParameterAndType(mPropertyBag, "version", "string");
|
|
101
106
|
}
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* Connector for saving and deleting data from SAPUI5 Flexibility KeyUser service - including personalization.
|
|
26
26
|
*
|
|
27
27
|
* @namespace sap.ui.fl.write._internal.connectors.BtpServiceConnector
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.141.0
|
|
29
29
|
* @private
|
|
30
30
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
31
31
|
*/
|
|
@@ -52,7 +52,8 @@ sap.ui.define([
|
|
|
52
52
|
GET_SOURCELANGUAGE: `${InitialConnector.ROOT}/translation/sourcelanguages`
|
|
53
53
|
},
|
|
54
54
|
CONTEXTS: `${InitialConnector.ROOT}/contexts`,
|
|
55
|
-
SEEN_FEATURES: `${InitialConnector.ROOT}/seenFeatures
|
|
55
|
+
SEEN_FEATURES: `${InitialConnector.ROOT}/seenFeatures`,
|
|
56
|
+
DELETE_USER_VARIANTS: `${InitialConnector.ROOT}/variantdata/delete`
|
|
56
57
|
},
|
|
57
58
|
|
|
58
59
|
async getSeenFeatureIds(mPropertyBag) {
|
|
@@ -103,6 +104,30 @@ sap.ui.define([
|
|
|
103
104
|
);
|
|
104
105
|
|
|
105
106
|
return WriteUtils.sendRequest(sUrl, "POST", oRequestOption);
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Deletes all user variants for the given variant management references.
|
|
111
|
+
*
|
|
112
|
+
* @param {object} mPropertyBag - Property bag
|
|
113
|
+
* @param {string} mPropertyBag.flexReference - Flex reference of the app the variant management controls belong to
|
|
114
|
+
* @param {string[]} mPropertyBag.variantManagementReferences - Array of variant management references
|
|
115
|
+
* @param {string} mPropertyBag.url - Configured url for the connector
|
|
116
|
+
* @returns {Promise<undefined>} Promise that resolves as soon as the deletion was completed
|
|
117
|
+
*/
|
|
118
|
+
deleteUserVariantsForVM(mPropertyBag) {
|
|
119
|
+
const mPayload = {
|
|
120
|
+
flexReference: mPropertyBag.flexReference,
|
|
121
|
+
variantManagementReferences: mPropertyBag.variantManagementReferences
|
|
122
|
+
};
|
|
123
|
+
const sUrl = InitialUtils.getUrl(this.ROUTES.DELETE_USER_VARIANTS, mPropertyBag);
|
|
124
|
+
return WriteUtils.sendRequest(sUrl, "POST", {
|
|
125
|
+
tokenUrl: this.ROUTES.TOKEN,
|
|
126
|
+
initialConnector: InitialConnector,
|
|
127
|
+
payload: JSON.stringify(mPayload),
|
|
128
|
+
dataType: "json",
|
|
129
|
+
contentType: "application/json; charset=utf-8"
|
|
130
|
+
});
|
|
106
131
|
}
|
|
107
132
|
});
|
|
108
133
|
|
|
@@ -104,6 +104,9 @@ sap.ui.define([
|
|
|
104
104
|
if (mPropertyBag.parentVersion) {
|
|
105
105
|
mParameters.parentVersion = mPropertyBag.parentVersion;
|
|
106
106
|
}
|
|
107
|
+
if (mPropertyBag.parsedHash) {
|
|
108
|
+
mParameters.parsedHash = JSON.stringify(mPropertyBag.parsedHash);
|
|
109
|
+
}
|
|
107
110
|
InitialUtils.addSAPLogonLanguageInfo(mParameters);
|
|
108
111
|
InitialConnector._addClientInfo(mParameters);
|
|
109
112
|
// single update --> fileName needs to be in the url
|
|
@@ -168,7 +171,7 @@ sap.ui.define([
|
|
|
168
171
|
*
|
|
169
172
|
* @namespace sap.ui.fl.write._internal.connectors.LrepConnector
|
|
170
173
|
* @since 1.67
|
|
171
|
-
* @version 1.
|
|
174
|
+
* @version 1.141.0
|
|
172
175
|
* @private
|
|
173
176
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
174
177
|
*/
|