@openui5/sap.ui.fl 1.115.1 → 1.117.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/.eslintrc.json +33 -2
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +30 -33
- package/src/sap/ui/fl/ChangePersistence.js +139 -84
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnector.js +7 -7
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +7 -7
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +5 -5
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
- package/src/sap/ui/fl/FlexController.js +82 -210
- package/src/sap/ui/fl/FlexControllerFactory.js +12 -1
- package/src/sap/ui/fl/Layer.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +11 -11
- package/src/sap/ui/fl/Utils.js +45 -88
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +41 -38
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +130 -94
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +10 -4
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +7 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +19 -19
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory.js +4 -5
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyUtil.js +1 -2
- 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 +18 -16
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +11 -9
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +4 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +9 -7
- 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 +4 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +4 -3
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +4 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +4 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +3 -5
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +7 -7
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +13 -11
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +4 -4
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +4 -3
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +5 -5
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageConnector.js +4 -5
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +29 -29
- package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +1 -2
- package/src/sap/ui/fl/apply/_internal/controlVariants/Utils.js +6 -4
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +44 -44
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +3 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +15 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.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 -14
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +3 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +16 -8
- package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +12 -4
- package/src/sap/ui/fl/apply/_internal/flexObjects/UpdatableChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +23 -5
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +206 -64
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +27 -17
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +16 -10
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +23 -7
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +4 -4
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +50 -50
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +27 -13
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +55 -37
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +20 -23
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +5 -5
- package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +6 -6
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +6 -6
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +15 -5
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +10 -4
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +6 -8
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +6 -6
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +3 -5
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +22 -22
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +43 -36
- package/src/sap/ui/fl/changeHandler/Base.js +7 -7
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +107 -107
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +45 -45
- package/src/sap/ui/fl/changeHandler/BaseRename.js +26 -26
- package/src/sap/ui/fl/changeHandler/BaseTreeModifier.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +15 -16
- package/src/sap/ui/fl/changeHandler/MoveControls.js +190 -191
- package/src/sap/ui/fl/changeHandler/MoveElements.js +36 -36
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +7 -7
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +7 -7
- package/src/sap/ui/fl/changeHandler/StashControl.js +35 -35
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +7 -7
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +21 -21
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +39 -39
- package/src/sap/ui/fl/changeHandler/common/ChangeCategories.js +1 -1
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +5 -5
- package/src/sap/ui/fl/changeHandler/common/getTargetAggregationIndex.js +5 -5
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +12 -12
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +7 -9
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/internal/Utils.js +12 -12
- package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +60 -60
- package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +2 -5
- package/src/sap/ui/fl/initial/_internal/Storage.js +20 -21
- package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +4 -4
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +20 -21
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +6 -6
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +2 -2
- package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +4 -4
- package/src/sap/ui/fl/initial/_internal/connectors/StaticFileConnector.js +3 -3
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +22 -18
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +4 -4
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +2 -2
- package/src/sap/ui/fl/interfaces/Delegate.js +7 -9
- package/src/sap/ui/fl/library.js +44 -45
- package/src/sap/ui/fl/library.support.js +59 -59
- package/src/sap/ui/fl/messagebundle.properties +4 -119
- package/src/sap/ui/fl/messagebundle_ar.properties +2 -79
- package/src/sap/ui/fl/messagebundle_bg.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ca.properties +2 -79
- package/src/sap/ui/fl/messagebundle_cs.properties +2 -79
- package/src/sap/ui/fl/messagebundle_cy.properties +2 -79
- package/src/sap/ui/fl/messagebundle_da.properties +2 -79
- package/src/sap/ui/fl/messagebundle_de.properties +2 -79
- package/src/sap/ui/fl/messagebundle_el.properties +2 -79
- package/src/sap/ui/fl/messagebundle_en.properties +2 -79
- package/src/sap/ui/fl/messagebundle_en_GB.properties +2 -79
- package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +2 -79
- package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +2 -79
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +2 -79
- package/src/sap/ui/fl/messagebundle_es.properties +2 -79
- package/src/sap/ui/fl/messagebundle_es_MX.properties +2 -79
- package/src/sap/ui/fl/messagebundle_et.properties +2 -79
- package/src/sap/ui/fl/messagebundle_fi.properties +2 -79
- package/src/sap/ui/fl/messagebundle_fr.properties +2 -79
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +2 -79
- package/src/sap/ui/fl/messagebundle_hi.properties +2 -79
- package/src/sap/ui/fl/messagebundle_hr.properties +2 -79
- package/src/sap/ui/fl/messagebundle_hu.properties +2 -79
- package/src/sap/ui/fl/messagebundle_id.properties +2 -79
- package/src/sap/ui/fl/messagebundle_it.properties +2 -79
- package/src/sap/ui/fl/messagebundle_iw.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ja.properties +2 -79
- package/src/sap/ui/fl/messagebundle_kk.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ko.properties +2 -79
- package/src/sap/ui/fl/messagebundle_lt.properties +2 -79
- package/src/sap/ui/fl/messagebundle_lv.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ms.properties +2 -79
- package/src/sap/ui/fl/messagebundle_nl.properties +2 -79
- package/src/sap/ui/fl/messagebundle_no.properties +2 -79
- package/src/sap/ui/fl/messagebundle_pl.properties +2 -79
- package/src/sap/ui/fl/messagebundle_pt.properties +2 -79
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ro.properties +2 -79
- package/src/sap/ui/fl/messagebundle_ru.properties +2 -79
- package/src/sap/ui/fl/messagebundle_sh.properties +2 -79
- package/src/sap/ui/fl/messagebundle_sk.properties +2 -79
- package/src/sap/ui/fl/messagebundle_sl.properties +2 -79
- package/src/sap/ui/fl/messagebundle_sv.properties +2 -79
- package/src/sap/ui/fl/messagebundle_th.properties +2 -79
- package/src/sap/ui/fl/messagebundle_tr.properties +2 -79
- package/src/sap/ui/fl/messagebundle_uk.properties +3 -80
- package/src/sap/ui/fl/messagebundle_vi.properties +2 -79
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +2 -79
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +2 -79
- package/src/sap/ui/fl/registry/Settings.js +41 -43
- package/src/sap/ui/fl/requireAsync.js +7 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +9 -9
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +22 -22
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +3 -3
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/Component.js +3 -5
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +27 -27
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +20 -20
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +17 -17
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +4 -4
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +34 -34
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +10 -10
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +5 -5
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/DescriptorChangeCheck.js +2 -2
- package/src/sap/ui/fl/util/IFrame.js +18 -18
- package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +7 -7
- package/src/sap/ui/fl/util/changePropertyValueByPath.js +2 -2
- package/src/sap/ui/fl/util/getContainerUserInfo.js +25 -25
- package/src/sap/ui/fl/util/resolveBinding.js +3 -3
- package/src/sap/ui/fl/variants/VariantManagement.js +8 -47
- package/src/sap/ui/fl/variants/VariantModel.js +236 -146
- package/src/sap/ui/fl/variants/context/Component.js +1 -2
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +2 -5
- package/src/sap/ui/fl/write/_internal/SaveAs.js +163 -161
- package/src/sap/ui/fl/write/_internal/Storage.js +51 -53
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +4 -4
- package/src/sap/ui/fl/write/_internal/Versions.js +105 -97
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +9 -9
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +7 -7
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +2 -2
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +3 -5
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +15 -10
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +10 -10
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +23 -24
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +60 -61
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +4 -4
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +6 -6
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +14 -14
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +3 -3
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +40 -10
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +2 -2
- 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 +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -3
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +3 -3
- 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 +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +3 -3
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +4 -4
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/validators/IsRequired.js +2 -2
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +33 -35
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +81 -59
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +12 -13
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +12 -12
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +7 -7
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +12 -15
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +222 -185
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +546 -110
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +122 -68
- package/src/sap/ui/fl/write/api/ExtensionPointRegistryAPI.js +19 -4
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +19 -20
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +32 -33
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +119 -73
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +8 -8
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +18 -21
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +14 -13
- package/src/sap/ui/fl/write/api/TranslationAPI.js +13 -17
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +5 -7
- package/src/sap/ui/fl/write/api/VersionsAPI.js +14 -14
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +1 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +7 -7
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +17 -17
- package/ui5.yaml +1 -2
- package/src/sap/ui/fl/apply/_internal/ChangesController.js +0 -49
|
@@ -69,18 +69,18 @@ sap.ui.define([
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
FakeLrepConnector.forTesting = {
|
|
72
|
-
getNumberOfChanges: function
|
|
72
|
+
getNumberOfChanges: function(oConnector, sReference) {
|
|
73
73
|
return oConnector.loadFlexData({reference: sReference})
|
|
74
|
-
.then(function
|
|
75
|
-
return aResponses.reduce(function
|
|
74
|
+
.then(function(aResponses) {
|
|
75
|
+
return aResponses.reduce(function(iNumberOfChanges, oResponse) {
|
|
76
76
|
return iNumberOfChanges + oResponse.changes.length;
|
|
77
77
|
}, 0);
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
|
-
spyMethod: function
|
|
80
|
+
spyMethod: function(sandbox, assert, oConnector, sMethod) {
|
|
81
81
|
var oSpy = sandbox.spy(oConnector, sMethod);
|
|
82
82
|
|
|
83
|
-
return function
|
|
83
|
+
return function(iNumberOfExpectedObjects, iCallIndex) {
|
|
84
84
|
iCallIndex = iCallIndex || 0;
|
|
85
85
|
var iNumberOfObjects = oSpy.getCall(iCallIndex).args[0].flexObjects.length;
|
|
86
86
|
assert.equal(iNumberOfObjects, iNumberOfExpectedObjects, sMethod + " was called " + iNumberOfExpectedObjects + " times");
|
|
@@ -94,7 +94,7 @@ sap.ui.define([
|
|
|
94
94
|
oConnector.storage = oNewStorage;
|
|
95
95
|
},
|
|
96
96
|
synchronous: {
|
|
97
|
-
clearAll: function
|
|
97
|
+
clearAll: function(oStorage) {
|
|
98
98
|
var fnRemoveItem = function(sKey) {
|
|
99
99
|
var bIsFlexObject = sKey.includes(FL_PREFIX);
|
|
100
100
|
|
|
@@ -107,7 +107,7 @@ sap.ui.define([
|
|
|
107
107
|
|
|
108
108
|
Object.keys(oStorage).map(fnRemoveItem);
|
|
109
109
|
},
|
|
110
|
-
store: function
|
|
110
|
+
store: function(oStorage, sKey, oItem) {
|
|
111
111
|
var sFlexKey = ObjectStorageUtils.createFlexKey(sKey);
|
|
112
112
|
var sItem = JSON.stringify(oItem);
|
|
113
113
|
oStorage.setItem(sFlexKey, sItem);
|
|
@@ -20,7 +20,7 @@ function(
|
|
|
20
20
|
* @namespace
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.117.0
|
|
24
24
|
*
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.48
|
|
@@ -34,25 +34,25 @@ function(
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
|
-
enableFakeConnector: function
|
|
37
|
+
enableFakeConnector: function(mPropertyBag) {
|
|
38
38
|
var sJsonPath = mPropertyBag ? mPropertyBag.sInitialComponentJsonPath : undefined;
|
|
39
39
|
FakeLrepConnector.setFlexibilityServicesAndClearCache("LocalStorageConnector", sJsonPath);
|
|
40
40
|
},
|
|
41
|
-
disableFakeConnector: function
|
|
41
|
+
disableFakeConnector: function() {
|
|
42
42
|
FakeLrepConnector.disableFakeConnector();
|
|
43
43
|
},
|
|
44
44
|
forTesting: {
|
|
45
|
-
spyWrite: function
|
|
45
|
+
spyWrite: function(sandbox, assert) {
|
|
46
46
|
return FakeLrepConnector.forTesting.spyMethod(sandbox, assert, LocalStorageConnector, "write");
|
|
47
47
|
},
|
|
48
|
-
getNumberOfChanges: function
|
|
48
|
+
getNumberOfChanges: function(sReference) {
|
|
49
49
|
return FakeLrepConnector.forTesting.getNumberOfChanges(LocalStorageConnector, sReference);
|
|
50
50
|
},
|
|
51
51
|
synchronous: {
|
|
52
|
-
clearAll: function
|
|
52
|
+
clearAll: function() {
|
|
53
53
|
FakeLrepConnector.forTesting.synchronous.clearAll(window.localStorage);
|
|
54
54
|
},
|
|
55
|
-
store: function
|
|
55
|
+
store: function(sKey, oItem) {
|
|
56
56
|
FakeLrepConnector.forTesting.synchronous.store(window.localStorage, sKey, oItem);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -20,7 +20,7 @@ function(
|
|
|
20
20
|
* @namespace
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.117.0
|
|
24
24
|
*
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.58
|
|
@@ -34,7 +34,7 @@ function(
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
|
-
enableFakeConnector: function
|
|
37
|
+
enableFakeConnector: function(mPropertyBag) {
|
|
38
38
|
var sJsonPath = mPropertyBag ? mPropertyBag.sInitialComponentJsonPath : undefined;
|
|
39
39
|
FakeLrepConnector.setFlexibilityServicesAndClearCache("SessionStorageConnector", sJsonPath);
|
|
40
40
|
},
|
|
@@ -42,10 +42,10 @@ function(
|
|
|
42
42
|
FakeLrepConnector.disableFakeConnector();
|
|
43
43
|
},
|
|
44
44
|
forTesting: {
|
|
45
|
-
spyWrite: function
|
|
45
|
+
spyWrite: function(sandbox, assert) {
|
|
46
46
|
return FakeLrepConnector.forTesting.spyMethod(sandbox, assert, SessionStorageConnector, "write");
|
|
47
47
|
},
|
|
48
|
-
getNumberOfChanges: function
|
|
48
|
+
getNumberOfChanges: function(sReference) {
|
|
49
49
|
return FakeLrepConnector.forTesting.getNumberOfChanges(SessionStorageConnector, sReference);
|
|
50
50
|
},
|
|
51
51
|
clear: function(mPropertyBag) {
|
|
@@ -55,7 +55,7 @@ function(
|
|
|
55
55
|
FakeLrepConnector.forTesting.setStorage(SessionStorageConnector, oNewStorage);
|
|
56
56
|
},
|
|
57
57
|
synchronous: {
|
|
58
|
-
clearAll: function
|
|
58
|
+
clearAll: function() {
|
|
59
59
|
FakeLrepConnector.forTesting.synchronous.clearAll(window.sessionStorage);
|
|
60
60
|
},
|
|
61
61
|
getNumberOfChanges: function(sReference) {
|
|
@@ -41,35 +41,36 @@ sap.ui.define([
|
|
|
41
41
|
|
|
42
42
|
function revertChangesAndUpdateVariantModel(oComponent, bSkipUrlUpdate, aChanges) {
|
|
43
43
|
return Promise.resolve()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
44
|
+
.then(function() {
|
|
45
|
+
if (aChanges.length !== 0) {
|
|
46
|
+
// Always revert changes in reverse order
|
|
47
|
+
aChanges.reverse();
|
|
48
|
+
return Reverter.revertMultipleChanges(aChanges, {
|
|
49
|
+
appComponent: oComponent,
|
|
50
|
+
modifier: JsControlTreeModifier,
|
|
51
|
+
flexController: this
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}.bind(this))
|
|
56
|
+
.then(function() {
|
|
57
|
+
if (oComponent) {
|
|
58
|
+
var oModel = oComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
59
|
+
if (oModel) {
|
|
60
|
+
// Temporary fix, parameters generally should not be removed
|
|
61
|
+
if (!bSkipUrlUpdate) {
|
|
62
|
+
URLHandler.update({
|
|
63
|
+
parameters: [],
|
|
64
|
+
updateURL: true,
|
|
65
|
+
updateHashEntry: true,
|
|
66
|
+
model: oModel
|
|
67
|
+
});
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
return aChanges;
|
|
73
|
+
});
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/**
|
|
@@ -81,7 +82,7 @@ sap.ui.define([
|
|
|
81
82
|
* @alias sap.ui.fl.FlexController
|
|
82
83
|
* @experimental Since 1.27.0
|
|
83
84
|
* @author SAP SE
|
|
84
|
-
* @version 1.
|
|
85
|
+
* @version 1.117.0
|
|
85
86
|
*/
|
|
86
87
|
var FlexController = function(sComponentName) {
|
|
87
88
|
this._oChangePersistence = undefined;
|
|
@@ -122,157 +123,6 @@ sap.ui.define([
|
|
|
122
123
|
return this._oVariantSwitchPromise;
|
|
123
124
|
};
|
|
124
125
|
|
|
125
|
-
/**
|
|
126
|
-
* Base function for creation of a change
|
|
127
|
-
*
|
|
128
|
-
* @param {object} oChangeSpecificData - Property bag holding the change information
|
|
129
|
-
* The property "oPropertyBag.packageName" is set to $TMP and internally since flex changes are always local when they are created.
|
|
130
|
-
* @param {sap.ui.core.Component} oAppComponent - Application Component of the control at runtime in case a map has been used
|
|
131
|
-
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} the created change
|
|
132
|
-
* @public
|
|
133
|
-
*/
|
|
134
|
-
FlexController.prototype.createBaseChange = function(oChangeSpecificData, oAppComponent) {
|
|
135
|
-
if (!oAppComponent) {
|
|
136
|
-
throw new Error("No application component found. To offer flexibility a valid relation to its owning component must be present.");
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
oChangeSpecificData.reference = this.getComponentName(); //in this case the component name can also be the value of sap-app-id
|
|
140
|
-
oChangeSpecificData.packageName = "$TMP"; // first a flex change is always local, until all changes of a component are made transportable
|
|
141
|
-
|
|
142
|
-
var oChange = FlexObjectFactory.createUIChange(oChangeSpecificData);
|
|
143
|
-
|
|
144
|
-
if (oChangeSpecificData.variantReference) {
|
|
145
|
-
oChange.setVariantReference(oChangeSpecificData.variantReference);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return oChange;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
FlexController.prototype._createChange = function(oChangeSpecificData, oAppComponent, oControl) {
|
|
152
|
-
// for getting the change handler the change type and potentially the control type are needed
|
|
153
|
-
var sControlType = oControl && (oControl.controlType || Utils.getControlType(oControl));
|
|
154
|
-
|
|
155
|
-
var oChange = this.createBaseChange(oChangeSpecificData, oAppComponent);
|
|
156
|
-
|
|
157
|
-
return ChangeHandlerStorage.getChangeHandler(oChange.getChangeType(), sControlType, oControl, JsControlTreeModifier, oChange.getLayer())
|
|
158
|
-
.then(function(oChangeHandler) {
|
|
159
|
-
if (oChangeHandler) {
|
|
160
|
-
return oChangeHandler.completeChangeContent(oChange, oChangeSpecificData, {
|
|
161
|
-
modifier: JsControlTreeModifier,
|
|
162
|
-
appComponent: oAppComponent,
|
|
163
|
-
view: Utils.getViewForControl(oControl)
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
throw new Error("Change handler could not be retrieved for change " + JSON.stringify(oChangeSpecificData) + ".");
|
|
167
|
-
})
|
|
168
|
-
.then(function () {
|
|
169
|
-
// completeChangeContent changes the content and might make it dirty
|
|
170
|
-
oChange.setState(States.LifecycleState.NEW);
|
|
171
|
-
return oChange;
|
|
172
|
-
})
|
|
173
|
-
.catch(function(oError) {
|
|
174
|
-
return Promise.reject(oError);
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Create a change with an ExtensionPoint as selector.
|
|
180
|
-
*
|
|
181
|
-
* @param {object} oChangeSpecificData - Property bag (nvp) holding the change information
|
|
182
|
-
* The property "oPropertyBag.packageName" is set to $TMP and internally since flex changes are always local when they are created.
|
|
183
|
-
* @param {object} mExtensionPointReference - Reference map for extension point
|
|
184
|
-
* @param {string} mExtensionPointReference.name - Name of the extension point
|
|
185
|
-
* @param {sap.ui.core.Component} mExtensionPointReference.view - View including the extension point
|
|
186
|
-
* @returns {Promise.<sap.ui.fl.apply._internal.flexObjects.FlexObject>} Created change wrapped in a promise
|
|
187
|
-
* @public
|
|
188
|
-
|
|
189
|
-
*/
|
|
190
|
-
FlexController.prototype.createChangeWithExtensionPointSelector = function(oChangeSpecificData, mExtensionPointReference) {
|
|
191
|
-
return Promise.resolve()
|
|
192
|
-
.then(function() {
|
|
193
|
-
if (!mExtensionPointReference) {
|
|
194
|
-
throw new Error("A flexibility change on extension point cannot be created without a valid extension point reference.");
|
|
195
|
-
}
|
|
196
|
-
var oView = mExtensionPointReference.view;
|
|
197
|
-
var oAppComponent = Utils.getAppComponentForControl(oView);
|
|
198
|
-
oChangeSpecificData.selector = {
|
|
199
|
-
name: mExtensionPointReference.name,
|
|
200
|
-
viewSelector: JsControlTreeModifier.getSelector(oView.getId(), oAppComponent)
|
|
201
|
-
};
|
|
202
|
-
return oAppComponent;
|
|
203
|
-
})
|
|
204
|
-
.then(function(oAppComponent) {
|
|
205
|
-
return this._createChange(oChangeSpecificData, oAppComponent);
|
|
206
|
-
}.bind(this));
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Create a change
|
|
211
|
-
*
|
|
212
|
-
* @param {object} oChangeSpecificData - Property bag (nvp) holding the change information
|
|
213
|
-
* The property "oPropertyBag.packageName" is set to $TMP and internally since flex changes are always local when they are created.
|
|
214
|
-
* @param {sap.ui.core.Control | map} oControl - Control for which the change will be added
|
|
215
|
-
* @param {string} oControl.id - ID of the control in case a map has been used to specify the control
|
|
216
|
-
* @param {sap.ui.core.Component} [oControl.appComponent] - Application component of the control at runtime in case a map has been used
|
|
217
|
-
* @param {string} oControl.controlType - Control type of the control in case a map has been used
|
|
218
|
-
* @returns {Promise.<sap.ui.fl.apply._internal.flexObjects.FlexObject>} Created change wrapped in a promise
|
|
219
|
-
* @public
|
|
220
|
-
*/
|
|
221
|
-
FlexController.prototype.createChangeWithControlSelector = function(oChangeSpecificData, oControl) {
|
|
222
|
-
var oAppComponent;
|
|
223
|
-
return new Utils.FakePromise()
|
|
224
|
-
.then(function() {
|
|
225
|
-
if (!oControl) {
|
|
226
|
-
throw new Error("A flexibility change cannot be created without a targeted control.");
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
var sControlId = oControl.id || oControl.getId();
|
|
230
|
-
|
|
231
|
-
if (!oChangeSpecificData.selector) {
|
|
232
|
-
oChangeSpecificData.selector = {};
|
|
233
|
-
}
|
|
234
|
-
oAppComponent = oControl.appComponent || Utils.getAppComponentForControl(oControl);
|
|
235
|
-
if (!oAppComponent) {
|
|
236
|
-
throw new Error("No application component found. To offer flexibility, the control with the ID '"
|
|
237
|
-
+ sControlId + "' has to have a valid relation to its owning application component.");
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// differentiate between controls containing the component id as a prefix and others
|
|
241
|
-
// get local Id for control at root component and use it as selector id
|
|
242
|
-
Object.assign(oChangeSpecificData.selector, JsControlTreeModifier.getSelector(sControlId, oAppComponent));
|
|
243
|
-
return oAppComponent;
|
|
244
|
-
})
|
|
245
|
-
.then(function(oAppComponent) {
|
|
246
|
-
return this._createChange(oChangeSpecificData, oAppComponent, oControl);
|
|
247
|
-
}.bind(this));
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Adds a change to the flex persistence (not yet saved). Will be saved with #saveAll.
|
|
252
|
-
*
|
|
253
|
-
* @param {object} oChangeSpecificData property bag (nvp) holding the change information
|
|
254
|
-
* The property "oPropertyBag.packageName" is set to $TMP internally since flex changes are always local when they are created.
|
|
255
|
-
* @param {sap.ui.core.Control} oControl control for which the change will be added
|
|
256
|
-
* @returns {Promise.<sap.ui.fl.apply._internal.flexObjects.FlexObject>} the created change
|
|
257
|
-
* @public
|
|
258
|
-
*/
|
|
259
|
-
FlexController.prototype.addChange = function(oChangeSpecificData, oControl) {
|
|
260
|
-
return this.createChangeWithControlSelector(oChangeSpecificData, oControl)
|
|
261
|
-
.then(function(oChange) {
|
|
262
|
-
var oAppComponent = Utils.getAppComponentForControl(oControl);
|
|
263
|
-
// adding a change to the persistence will trigger the propagation listener which would try to apply the change
|
|
264
|
-
// but in this scenario the change is applied in .createAndApplyChange and no dependencies are added,
|
|
265
|
-
// so the propagation listener should ignore this change once
|
|
266
|
-
oChange._ignoreOnce = true;
|
|
267
|
-
this.addPreparedChange(oChange, oAppComponent);
|
|
268
|
-
|
|
269
|
-
// TODO this should go into an API that applied multiple changes, that does not yet exist
|
|
270
|
-
// all changes should be queued to apply before the first change gets applied
|
|
271
|
-
oChange.setQueuedForApply();
|
|
272
|
-
return oChange;
|
|
273
|
-
}.bind(this));
|
|
274
|
-
};
|
|
275
|
-
|
|
276
126
|
/**
|
|
277
127
|
* Adds an already prepared change to the flex persistence (not yet saved). This method will not call
|
|
278
128
|
* createChange again, but expects a fully computed and appliable change.
|
|
@@ -300,7 +150,6 @@ sap.ui.define([
|
|
|
300
150
|
* Otherwise it will be marked for deletion.
|
|
301
151
|
*
|
|
302
152
|
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - the change to be deleted
|
|
303
|
-
* @param {sap.ui.core.Component} oAppComponent - Application component instance
|
|
304
153
|
*/
|
|
305
154
|
FlexController.prototype.deleteChange = function(oChange) {
|
|
306
155
|
this._oChangePersistence.deleteChange(oChange);
|
|
@@ -375,10 +224,10 @@ sap.ui.define([
|
|
|
375
224
|
return this._waitForChangesToBeApplied(mSelector);
|
|
376
225
|
}.bind(this));
|
|
377
226
|
return Promise.all(aPromises)
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
227
|
+
.then(function() {
|
|
228
|
+
// the return value is not important in this function, only that it resolves
|
|
229
|
+
return undefined;
|
|
230
|
+
});
|
|
382
231
|
};
|
|
383
232
|
|
|
384
233
|
/**
|
|
@@ -450,7 +299,14 @@ sap.ui.define([
|
|
|
450
299
|
* @returns {Promise} resolving with an array of responses or rejecting with the first error
|
|
451
300
|
* @public
|
|
452
301
|
*/
|
|
453
|
-
FlexController.prototype.saveAll = function(
|
|
302
|
+
FlexController.prototype.saveAll = function(
|
|
303
|
+
oAppComponent,
|
|
304
|
+
bSkipUpdateCache,
|
|
305
|
+
bDraft,
|
|
306
|
+
sLayer,
|
|
307
|
+
bRemoveOtherLayerChanges,
|
|
308
|
+
bCondenseAnyLayer
|
|
309
|
+
) {
|
|
454
310
|
var sParentVersion;
|
|
455
311
|
var aDraftFilenames;
|
|
456
312
|
if (bDraft) {
|
|
@@ -462,26 +318,35 @@ sap.ui.define([
|
|
|
462
318
|
aDraftFilenames = oVersionModel.getProperty("/draftFilenames");
|
|
463
319
|
}
|
|
464
320
|
return this._removeOtherLayerChanges(oAppComponent, sLayer, bRemoveOtherLayerChanges)
|
|
465
|
-
|
|
466
|
-
.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
321
|
+
.then(this._oChangePersistence.saveDirtyChanges.bind(
|
|
322
|
+
this._oChangePersistence,
|
|
323
|
+
oAppComponent,
|
|
324
|
+
bSkipUpdateCache,
|
|
325
|
+
undefined,
|
|
326
|
+
sParentVersion,
|
|
327
|
+
aDraftFilenames,
|
|
328
|
+
bCondenseAnyLayer,
|
|
329
|
+
sLayer
|
|
330
|
+
))
|
|
331
|
+
.then(function(oResult) {
|
|
332
|
+
if (bDraft && oResult && oResult.response) {
|
|
333
|
+
var vChangeDefinition = oResult.response;
|
|
334
|
+
var aDraftFilenames = [];
|
|
335
|
+
if (Array.isArray(vChangeDefinition)) {
|
|
336
|
+
vChangeDefinition.forEach(function(change) {
|
|
337
|
+
aDraftFilenames.push(change.fileName);
|
|
481
338
|
});
|
|
339
|
+
// the reference and layer of all items are the same
|
|
340
|
+
vChangeDefinition = vChangeDefinition[0];
|
|
482
341
|
}
|
|
483
|
-
|
|
484
|
-
|
|
342
|
+
Versions.onAllChangesSaved({
|
|
343
|
+
reference: vChangeDefinition.reference,
|
|
344
|
+
layer: vChangeDefinition.layer,
|
|
345
|
+
draftFilenames: aDraftFilenames
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
return oResult;
|
|
349
|
+
});
|
|
485
350
|
};
|
|
486
351
|
|
|
487
352
|
/**
|
|
@@ -503,8 +368,8 @@ sap.ui.define([
|
|
|
503
368
|
mPropertyBag.view = oView;
|
|
504
369
|
|
|
505
370
|
return this._oChangePersistence.getChangesForView(mPropertyBag)
|
|
506
|
-
|
|
507
|
-
|
|
371
|
+
.then(Applier.applyAllChangesForXMLView.bind(Applier, mPropertyBag))
|
|
372
|
+
.catch(handleXMLApplyError.bind(this, mPropertyBag.view));
|
|
508
373
|
};
|
|
509
374
|
|
|
510
375
|
function handleXMLApplyError(oView, oError) {
|
|
@@ -517,7 +382,7 @@ sap.ui.define([
|
|
|
517
382
|
*
|
|
518
383
|
* also used by OVP!
|
|
519
384
|
*
|
|
520
|
-
* @param {
|
|
385
|
+
* @param {object} mPropertyBag - (optional) contains additional data that are needed for reading of changes
|
|
521
386
|
* @param {object} [mPropertyBag.appDescriptor] Manifest that belongs to the current running component
|
|
522
387
|
* @param {string} [mPropertyBag.siteId] ID of the site belonging to the current running component
|
|
523
388
|
* @param {boolean} bInvalidateCache - (optional) should the cache be invalidated
|
|
@@ -554,7 +419,7 @@ sap.ui.define([
|
|
|
554
419
|
*/
|
|
555
420
|
FlexController.prototype.resetChanges = function(sLayer, sGenerator, oComponent, aSelectorIds, aChangeTypes) {
|
|
556
421
|
return this._oChangePersistence.resetChanges(sLayer, sGenerator, aSelectorIds, aChangeTypes)
|
|
557
|
-
|
|
422
|
+
.then(revertChangesAndUpdateVariantModel.bind(this, oComponent, undefined));
|
|
558
423
|
};
|
|
559
424
|
|
|
560
425
|
/**
|
|
@@ -596,21 +461,28 @@ sap.ui.define([
|
|
|
596
461
|
return Applier.applyChangeOnControl(oChange, oControl, mPropertyBag);
|
|
597
462
|
}
|
|
598
463
|
Log.error("A flexibility change tries to change a nonexistent control.");
|
|
464
|
+
return undefined;
|
|
599
465
|
}.bind(this));
|
|
600
|
-
}.bind(this), new Utils.FakePromise());
|
|
466
|
+
}.bind(this), (Utils.FakePromise ? new Utils.FakePromise() : Promise.resolve()));
|
|
601
467
|
};
|
|
602
468
|
|
|
603
469
|
/**
|
|
604
470
|
* Saves changes sequentially on the associated change persistence instance;
|
|
605
|
-
* This API must be only used in
|
|
471
|
+
* This API must be only used in scenarios without draft (like personalization).
|
|
606
472
|
*
|
|
607
473
|
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aDirtyChanges Array of dirty changes to be saved
|
|
608
474
|
* @param {sap.ui.core.UIComponent} [oAppComponent] - AppComponent instance
|
|
609
|
-
* @returns {Promise} A Promise which resolves when all changes have been saved
|
|
475
|
+
* @returns {Promise} A Promise which resolves when all changes have been saved with the backend response
|
|
610
476
|
* @public
|
|
611
477
|
*/
|
|
612
478
|
FlexController.prototype.saveSequenceOfDirtyChanges = function(aDirtyChanges, oAppComponent) {
|
|
613
|
-
return this._oChangePersistence.saveDirtyChanges(oAppComponent, false, aDirtyChanges)
|
|
479
|
+
return this._oChangePersistence.saveDirtyChanges(oAppComponent, false, aDirtyChanges)
|
|
480
|
+
.then(function(oResponse) {
|
|
481
|
+
aDirtyChanges.forEach(function(oDirtyChange) {
|
|
482
|
+
oDirtyChange.setState(States.LifecycleState.PERSISTED);
|
|
483
|
+
});
|
|
484
|
+
return oResponse;
|
|
485
|
+
});
|
|
614
486
|
};
|
|
615
487
|
|
|
616
488
|
return FlexController;
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
* @alias sap.ui.fl.FlexControllerFactory
|
|
23
23
|
* @experimental Since 1.27.0
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.117.0
|
|
26
26
|
*
|
|
27
27
|
* @private
|
|
28
28
|
* @ui5-restricted sap.ui.fl
|
|
@@ -67,5 +67,16 @@ sap.ui.define([
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Creates or returns an instance of the FlexController for the specified selector.
|
|
72
|
+
*
|
|
73
|
+
* @param {sap.ui.fl.Selector} oSelector - Selector object
|
|
74
|
+
* @returns {sap.ui.fl.FlexController} instance
|
|
75
|
+
*/
|
|
76
|
+
FlexControllerFactory.createForSelector = function(oSelector) {
|
|
77
|
+
var sComponentName = ManifestUtils.getFlexReferenceForSelector(oSelector);
|
|
78
|
+
return FlexControllerFactory.create(sComponentName);
|
|
79
|
+
};
|
|
80
|
+
|
|
70
81
|
return FlexControllerFactory;
|
|
71
82
|
}, true);
|
package/src/sap/ui/fl/Layer.js
CHANGED
|
@@ -15,7 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
) {
|
|
16
16
|
"use strict";
|
|
17
17
|
|
|
18
|
-
//Stack of layers in the layered repository
|
|
18
|
+
// Stack of layers in the layered repository
|
|
19
19
|
var aLayers = [
|
|
20
20
|
Layer.BASE,
|
|
21
21
|
Layer.VENDOR,
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
Layer.USER
|
|
27
27
|
];
|
|
28
28
|
|
|
29
|
-
//Precalculates index of layers
|
|
29
|
+
// Precalculates index of layers
|
|
30
30
|
var mLayersIndex = {};
|
|
31
31
|
aLayers.forEach(function(sLayer, iIndex) {
|
|
32
32
|
mLayersIndex[sLayer] = iIndex;
|
|
@@ -41,7 +41,7 @@ sap.ui.define([
|
|
|
41
41
|
*
|
|
42
42
|
* @namespace sap.ui.fl.LayerUtils
|
|
43
43
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
44
|
+
* @version 1.117.0
|
|
45
45
|
*/
|
|
46
46
|
var LayerUtils = {
|
|
47
47
|
_mLayersIndex: mLayersIndex,
|
|
@@ -55,8 +55,8 @@ sap.ui.define([
|
|
|
55
55
|
* @returns {boolean} <code>true</code> if the layer is valid
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
isValidLayer: function
|
|
59
|
-
return Object.keys(Layer).some(function
|
|
58
|
+
isValidLayer: function(sLayer) {
|
|
59
|
+
return Object.keys(Layer).some(function(sExistingLayer) {
|
|
60
60
|
return sExistingLayer === sLayer;
|
|
61
61
|
});
|
|
62
62
|
},
|
|
@@ -67,7 +67,7 @@ sap.ui.define([
|
|
|
67
67
|
* @returns {boolean} true if it's an application variant
|
|
68
68
|
* @public
|
|
69
69
|
*/
|
|
70
|
-
isVendorLayer: function
|
|
70
|
+
isVendorLayer: function() {
|
|
71
71
|
return this.getCurrentLayer() === Layer.VENDOR;
|
|
72
72
|
},
|
|
73
73
|
|
|
@@ -101,7 +101,7 @@ sap.ui.define([
|
|
|
101
101
|
* @returns {boolean} Indicates whether a new variant needs an ABAP package
|
|
102
102
|
* @public
|
|
103
103
|
*/
|
|
104
|
-
doesCurrentLayerRequirePackage: function
|
|
104
|
+
doesCurrentLayerRequirePackage: function() {
|
|
105
105
|
var sCurrentLayer = this.getCurrentLayer();
|
|
106
106
|
return (sCurrentLayer === Layer.VENDOR) || (sCurrentLayer === Layer.PARTNER) || (sCurrentLayer === Layer.CUSTOMER_BASE);
|
|
107
107
|
},
|
|
@@ -113,7 +113,7 @@ sap.ui.define([
|
|
|
113
113
|
* @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
|
|
114
114
|
* @return {string} maxLayer
|
|
115
115
|
*/
|
|
116
|
-
getMaxLayer: function
|
|
116
|
+
getMaxLayer: function(oURLParsingService) {
|
|
117
117
|
var sParseMaxLayer = LayerUtils.getMaxLayerTechnicalParameter(hasher.getHash(), oURLParsingService);
|
|
118
118
|
return sParseMaxLayer || getUrlParameter(this.FL_MAX_LAYER_PARAM) || LayerUtils._sTopLayer;
|
|
119
119
|
},
|
|
@@ -148,7 +148,7 @@ sap.ui.define([
|
|
|
148
148
|
* @returns {boolean} <code>true</code> if the first input layer is higher than the second input layer, otherwise <code>false</code>
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
|
-
isOverLayer: function
|
|
151
|
+
isOverLayer: function(sObjectsLayer, sComparedLayer) {
|
|
152
152
|
return this.getLayerIndex(sObjectsLayer) > this.getLayerIndex(sComparedLayer);
|
|
153
153
|
},
|
|
154
154
|
|
|
@@ -189,7 +189,7 @@ sap.ui.define([
|
|
|
189
189
|
* @returns {boolean} <code>true</code> if the top layer is also the max layer, otherwise <code>false</code>
|
|
190
190
|
* @public
|
|
191
191
|
*/
|
|
192
|
-
isSapUiLayerParameterProvided: function
|
|
192
|
+
isSapUiLayerParameterProvided: function() {
|
|
193
193
|
return !!getUrlParameter("sap-ui-layer");
|
|
194
194
|
},
|
|
195
195
|
|
|
@@ -199,7 +199,7 @@ sap.ui.define([
|
|
|
199
199
|
* @returns {string} the current layer
|
|
200
200
|
* @public
|
|
201
201
|
*/
|
|
202
|
-
getCurrentLayer: function
|
|
202
|
+
getCurrentLayer: function() {
|
|
203
203
|
var sLayer = getUrlParameter("sap-ui-layer") || "";
|
|
204
204
|
return sLayer.toUpperCase() || Layer.CUSTOMER;
|
|
205
205
|
},
|