@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
|
@@ -5,27 +5,27 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/
|
|
8
|
+
"sap/base/util/restricted/_omit",
|
|
9
|
+
"sap/base/util/merge",
|
|
10
|
+
"sap/base/Log",
|
|
9
11
|
"sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes",
|
|
12
|
+
"sap/ui/fl/registry/Settings",
|
|
13
|
+
"sap/ui/fl/write/_internal/appVariant/AppVariantFactory",
|
|
10
14
|
"sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory",
|
|
11
|
-
"sap/ui/fl/
|
|
12
|
-
"sap/ui/fl/Utils",
|
|
13
|
-
"sap/base/Log",
|
|
15
|
+
"sap/ui/fl/FlexControllerFactory",
|
|
14
16
|
"sap/ui/fl/Layer",
|
|
15
|
-
"sap/
|
|
16
|
-
"sap/base/util/restricted/_omit",
|
|
17
|
-
"sap/ui/fl/registry/Settings"
|
|
17
|
+
"sap/ui/fl/Utils"
|
|
18
18
|
], function(
|
|
19
|
-
|
|
19
|
+
_omit,
|
|
20
|
+
merge,
|
|
21
|
+
Log,
|
|
20
22
|
DescriptorChangeTypes,
|
|
23
|
+
Settings,
|
|
24
|
+
AppVariantFactory,
|
|
21
25
|
AppVariantInlineChangeFactory,
|
|
22
|
-
|
|
23
|
-
Utils,
|
|
24
|
-
Log,
|
|
26
|
+
FlexControllerFactory,
|
|
25
27
|
Layer,
|
|
26
|
-
|
|
27
|
-
_omit,
|
|
28
|
-
Settings
|
|
28
|
+
Utils
|
|
29
29
|
) {
|
|
30
30
|
"use strict";
|
|
31
31
|
|
|
@@ -49,8 +49,8 @@ sap.ui.define([
|
|
|
49
49
|
if (
|
|
50
50
|
mPropertyBag.isForSmartBusiness
|
|
51
51
|
&& (
|
|
52
|
-
mPropertyBag.package !==
|
|
53
|
-
&& mPropertyBag.package !==
|
|
52
|
+
mPropertyBag.package !== "$TMP"
|
|
53
|
+
&& mPropertyBag.package !== ""
|
|
54
54
|
)
|
|
55
55
|
&& !mPropertyBag.transport
|
|
56
56
|
&& !oSettings.isAtoEnabled()
|
|
@@ -126,7 +126,7 @@ sap.ui.define([
|
|
|
126
126
|
function _inlineDescriptorChanges(aAllInlineChanges, oAppVariant) {
|
|
127
127
|
var aAllDescrChanges = [];
|
|
128
128
|
aAllInlineChanges.forEach(function(oInlineChange) {
|
|
129
|
-
//Replace the hosting key with the new reference
|
|
129
|
+
// Replace the hosting key with the new reference
|
|
130
130
|
oInlineChange.replaceHostingIdForTextKey(oAppVariant.getId(), oAppVariant.getReference(), oInlineChange.getContent(), oInlineChange.getTexts());
|
|
131
131
|
aAllDescrChanges.push(oAppVariant.addDescriptorInlineChange(oInlineChange));
|
|
132
132
|
});
|
|
@@ -135,7 +135,7 @@ sap.ui.define([
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function _getDirtyDescrChanges(vSelector) {
|
|
138
|
-
var oFlexControllerPersistence =
|
|
138
|
+
var oFlexControllerPersistence = FlexControllerFactory.createForSelector(vSelector)._oChangePersistence;
|
|
139
139
|
if (!oFlexControllerPersistence) {
|
|
140
140
|
return [];
|
|
141
141
|
}
|
|
@@ -145,7 +145,7 @@ sap.ui.define([
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
function _getDirtyChanges(vSelector) {
|
|
148
|
-
var oFlexControllerPersistence =
|
|
148
|
+
var oFlexControllerPersistence = FlexControllerFactory.createForSelector(vSelector)._oChangePersistence;
|
|
149
149
|
if (!oFlexControllerPersistence) {
|
|
150
150
|
return [];
|
|
151
151
|
}
|
|
@@ -155,13 +155,15 @@ sap.ui.define([
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
function _deleteDescrChangesFromPersistence(vSelector) {
|
|
158
|
+
var aChangesToBeDeleted = [];
|
|
158
159
|
// In case of app variant, both persistences hold descriptor changes and have to be removed from one of the persistences
|
|
159
160
|
_getDirtyDescrChanges(vSelector).forEach(function(oChange) {
|
|
160
161
|
if (DescriptorChangeTypes.getChangeTypes().includes(oChange.getChangeType())) {
|
|
161
|
-
//
|
|
162
|
-
|
|
162
|
+
// If there are UI changes, they are sent to the backend in the last resolved promise and removed from the persistence
|
|
163
|
+
aChangesToBeDeleted.push(oChange);
|
|
163
164
|
}
|
|
164
165
|
});
|
|
166
|
+
FlexControllerFactory.createForSelector(vSelector)._oChangePersistence.deleteChanges(aChangesToBeDeleted);
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
function _addPackageAndTransport(oAppVariant, mPropertyBag) {
|
|
@@ -173,11 +175,11 @@ sap.ui.define([
|
|
|
173
175
|
mPropertyBag.layer = oAppVariant.getDefinition().layer;
|
|
174
176
|
|
|
175
177
|
return _validatePackageAndPrepareTransportInfo(mPropertyBag)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
.then(function(oTransportInfo) {
|
|
179
|
+
return _setTransportAndPackageInfoForAppVariant(oAppVariant, oTransportInfo);
|
|
180
|
+
}).then(function() {
|
|
181
|
+
return oAppVariant;
|
|
182
|
+
});
|
|
181
183
|
}
|
|
182
184
|
|
|
183
185
|
var SaveAs = {
|
|
@@ -186,167 +188,167 @@ sap.ui.define([
|
|
|
186
188
|
var oAppVariantResultClosure;
|
|
187
189
|
|
|
188
190
|
return AppVariantFactory.prepareCreate(mPropertyBag)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
return _getInlineChangesFromDescrChanges(aDescrChanges);
|
|
207
|
-
})
|
|
208
|
-
.then(function(aAllInlineChanges) {
|
|
209
|
-
return _inlineDescriptorChanges(aAllInlineChanges, oAppVariantClosure);
|
|
210
|
-
})
|
|
211
|
-
.then(function() {
|
|
212
|
-
// Save the app variant to backend
|
|
213
|
-
return oAppVariantClosure.submit()
|
|
214
|
-
.catch(function(oError) {
|
|
215
|
-
oError.messageKey = "MSG_SAVE_APP_VARIANT_FAILED";
|
|
216
|
-
throw oError;
|
|
217
|
-
});
|
|
218
|
-
})
|
|
219
|
-
.then(function(oResult) {
|
|
220
|
-
oAppVariantResultClosure = merge({}, oResult);
|
|
221
|
-
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
222
|
-
|
|
223
|
-
var oFlexController = ChangesController.getFlexControllerInstance(mPropertyBag.selector);
|
|
224
|
-
|
|
225
|
-
var aUIChanges = _getDirtyChanges(mPropertyBag.selector); //after removing descr changes, all remaining dirty changes are UI changes
|
|
226
|
-
if (aUIChanges.length) {
|
|
227
|
-
// Save the dirty UI changes to backend => firing PersistenceWriteApi.save
|
|
228
|
-
return oFlexController.saveAll(ChangesController.getAppComponentForSelector(mPropertyBag.selector), true)
|
|
229
|
-
.catch(function(oError) {
|
|
230
|
-
// Delete the inconsistent app variant if the UI changes failed to save
|
|
231
|
-
return this.deleteAppVariant({
|
|
232
|
-
id: mPropertyBag.id
|
|
233
|
-
})
|
|
234
|
-
.then(function() {
|
|
235
|
-
oError.messageKey = "MSG_COPY_UNSAVED_CHANGES_FAILED";
|
|
236
|
-
throw oError;
|
|
237
|
-
});
|
|
238
|
-
}.bind(this));
|
|
191
|
+
.then(function(oAppVariant) {
|
|
192
|
+
oAppVariantClosure = merge({}, oAppVariant);
|
|
193
|
+
return _validatePackageAndPrepareTransportInfo(mPropertyBag);
|
|
194
|
+
})
|
|
195
|
+
.then(function(oTransportInfo) {
|
|
196
|
+
return _setTransportAndPackageInfoForAppVariant(oAppVariantClosure, oTransportInfo);
|
|
197
|
+
})
|
|
198
|
+
.then(function() {
|
|
199
|
+
var aDescrChanges = [];
|
|
200
|
+
_getDirtyChanges(mPropertyBag.selector).forEach(function(oChange) {
|
|
201
|
+
// UI and Descriptor changes need to be separated here so as to perform different operations on changes
|
|
202
|
+
if (DescriptorChangeTypes.getChangeTypes().includes(oChange.getChangeType())) {
|
|
203
|
+
aDescrChanges.push(oChange);
|
|
204
|
+
} else {
|
|
205
|
+
_moveChangesToNewFlexReference(oChange, oAppVariantClosure);
|
|
239
206
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
207
|
+
});
|
|
208
|
+
return _getInlineChangesFromDescrChanges(aDescrChanges);
|
|
209
|
+
})
|
|
210
|
+
.then(function(aAllInlineChanges) {
|
|
211
|
+
return _inlineDescriptorChanges(aAllInlineChanges, oAppVariantClosure);
|
|
212
|
+
})
|
|
213
|
+
.then(function() {
|
|
214
|
+
// Save the app variant to backend
|
|
215
|
+
return oAppVariantClosure.submit()
|
|
246
216
|
.catch(function(oError) {
|
|
247
|
-
|
|
248
|
-
if (
|
|
249
|
-
_getDirtyDescrChanges(mPropertyBag.selector).length
|
|
250
|
-
) {
|
|
251
|
-
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
Log.error("the app variant could not be created.", oError.message || oError);
|
|
217
|
+
oError.messageKey = "MSG_SAVE_APP_VARIANT_FAILED";
|
|
255
218
|
throw oError;
|
|
256
219
|
});
|
|
220
|
+
})
|
|
221
|
+
.then(function(oResult) {
|
|
222
|
+
oAppVariantResultClosure = merge({}, oResult);
|
|
223
|
+
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
224
|
+
|
|
225
|
+
var oFlexController = FlexControllerFactory.createForSelector(mPropertyBag.selector);
|
|
226
|
+
|
|
227
|
+
var aUIChanges = _getDirtyChanges(mPropertyBag.selector); // after removing descr changes, all remaining dirty changes are UI changes
|
|
228
|
+
if (aUIChanges.length) {
|
|
229
|
+
// Save the dirty UI changes to backend => firing PersistenceWriteApi.save
|
|
230
|
+
return oFlexController.saveAll(Utils.getAppComponentForSelector(mPropertyBag.selector), true)
|
|
231
|
+
.catch(function(oError) {
|
|
232
|
+
// Delete the inconsistent app variant if the UI changes failed to save
|
|
233
|
+
return this.deleteAppVariant({
|
|
234
|
+
id: mPropertyBag.id
|
|
235
|
+
})
|
|
236
|
+
.then(function() {
|
|
237
|
+
oError.messageKey = "MSG_COPY_UNSAVED_CHANGES_FAILED";
|
|
238
|
+
throw oError;
|
|
239
|
+
});
|
|
240
|
+
}.bind(this));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return Promise.resolve();
|
|
244
|
+
}.bind(this))
|
|
245
|
+
.then(function() {
|
|
246
|
+
return oAppVariantResultClosure;
|
|
247
|
+
})
|
|
248
|
+
.catch(function(oError) {
|
|
249
|
+
// If promise gets rejected before making a submit call, then app descriptor changes have to be removed from persistence
|
|
250
|
+
if (
|
|
251
|
+
_getDirtyDescrChanges(mPropertyBag.selector).length
|
|
252
|
+
) {
|
|
253
|
+
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
Log.error("the app variant could not be created.", oError.message || oError);
|
|
257
|
+
throw oError;
|
|
258
|
+
});
|
|
257
259
|
},
|
|
258
260
|
updateAppVariant: function(mPropertyBag) {
|
|
259
261
|
var oAppVariantClosure;
|
|
260
262
|
var oAppVariantResultClosure;
|
|
261
263
|
|
|
262
264
|
return AppVariantFactory.prepareUpdate(_omit(mPropertyBag, "selector"))
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
.catch(function(oError) {
|
|
266
|
+
oError.messageKey = "MSG_LOAD_APP_VARIANT_FAILED";
|
|
267
|
+
throw oError;
|
|
268
|
+
})
|
|
269
|
+
.then(function(oAppVariant) {
|
|
270
|
+
if (!oAppVariant) {
|
|
271
|
+
throw new Error("App variant with ID: " + mPropertyBag.id + "does not exist");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
oAppVariantClosure = merge({}, oAppVariant);
|
|
275
|
+
mPropertyBag.package = oAppVariantClosure.getPackage();
|
|
276
|
+
mPropertyBag.layer = oAppVariantClosure.getDefinition().layer;
|
|
277
|
+
|
|
278
|
+
return _validatePackageAndPrepareTransportInfo(mPropertyBag);
|
|
279
|
+
})
|
|
280
|
+
.then(function(oTransportInfo) {
|
|
281
|
+
return _setTransportAndPackageInfoForAppVariant(oAppVariantClosure, oTransportInfo);
|
|
282
|
+
})
|
|
283
|
+
.then(function() {
|
|
284
|
+
var aDescrChanges = [];
|
|
285
|
+
_getDirtyDescrChanges(mPropertyBag.selector).forEach(function(oChange) {
|
|
286
|
+
if (DescriptorChangeTypes.getChangeTypes().includes(oChange.getChangeType())) {
|
|
287
|
+
aDescrChanges.push(oChange);
|
|
270
288
|
}
|
|
289
|
+
});
|
|
271
290
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
})
|
|
281
|
-
.then(function() {
|
|
282
|
-
var aDescrChanges = [];
|
|
283
|
-
_getDirtyDescrChanges(mPropertyBag.selector).forEach(function(oChange) {
|
|
284
|
-
if (DescriptorChangeTypes.getChangeTypes().includes(oChange.getChangeType())) {
|
|
285
|
-
aDescrChanges.push(oChange);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
return _getInlineChangesFromDescrChanges(aDescrChanges);
|
|
290
|
-
})
|
|
291
|
-
.then(function(aAllInlineChanges) {
|
|
292
|
-
return _inlineDescriptorChanges(aAllInlineChanges, oAppVariantClosure);
|
|
293
|
-
})
|
|
294
|
-
.then(function() {
|
|
295
|
-
// Updates the app variant saved in backend
|
|
296
|
-
return oAppVariantClosure.submit()
|
|
297
|
-
.catch(function(oError) {
|
|
298
|
-
if (mPropertyBag.isForSmartBusiness) {
|
|
299
|
-
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
300
|
-
throw oError;
|
|
301
|
-
}
|
|
302
|
-
oError.messageKey = "MSG_UPDATE_APP_VARIANT_FAILED";
|
|
303
|
-
throw oError;
|
|
304
|
-
});
|
|
305
|
-
}).then(function(oResult) {
|
|
306
|
-
oAppVariantResultClosure = merge({}, oResult);
|
|
307
|
-
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
308
|
-
return oAppVariantResultClosure;
|
|
309
|
-
})
|
|
291
|
+
return _getInlineChangesFromDescrChanges(aDescrChanges);
|
|
292
|
+
})
|
|
293
|
+
.then(function(aAllInlineChanges) {
|
|
294
|
+
return _inlineDescriptorChanges(aAllInlineChanges, oAppVariantClosure);
|
|
295
|
+
})
|
|
296
|
+
.then(function() {
|
|
297
|
+
// Updates the app variant saved in backend
|
|
298
|
+
return oAppVariantClosure.submit()
|
|
310
299
|
.catch(function(oError) {
|
|
311
|
-
|
|
312
|
-
if (
|
|
313
|
-
_getDirtyDescrChanges(mPropertyBag.selector).length
|
|
314
|
-
) {
|
|
300
|
+
if (mPropertyBag.isForSmartBusiness) {
|
|
315
301
|
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
302
|
+
throw oError;
|
|
316
303
|
}
|
|
317
|
-
|
|
318
|
-
Log.error("the app variant could not be updated.", oError.message || oError);
|
|
304
|
+
oError.messageKey = "MSG_UPDATE_APP_VARIANT_FAILED";
|
|
319
305
|
throw oError;
|
|
320
306
|
});
|
|
307
|
+
}).then(function(oResult) {
|
|
308
|
+
oAppVariantResultClosure = merge({}, oResult);
|
|
309
|
+
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
310
|
+
return oAppVariantResultClosure;
|
|
311
|
+
})
|
|
312
|
+
.catch(function(oError) {
|
|
313
|
+
// If promise gets rejected before making a submit call, then also app descriptor changes have to be removed from persistence
|
|
314
|
+
if (
|
|
315
|
+
_getDirtyDescrChanges(mPropertyBag.selector).length
|
|
316
|
+
) {
|
|
317
|
+
_deleteDescrChangesFromPersistence(mPropertyBag.selector);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
Log.error("the app variant could not be updated.", oError.message || oError);
|
|
321
|
+
throw oError;
|
|
322
|
+
});
|
|
321
323
|
},
|
|
322
324
|
deleteAppVariant: function(mPropertyBag) {
|
|
323
325
|
return AppVariantFactory.prepareDelete(_omit(mPropertyBag, "selector"))
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
.catch(function(oError) {
|
|
336
|
-
if (oError === "cancel") {
|
|
337
|
-
return Promise.reject("cancel");
|
|
338
|
-
}
|
|
339
|
-
oError.messageKey = "MSG_DELETE_APP_VARIANT_FAILED";
|
|
340
|
-
throw oError;
|
|
341
|
-
});
|
|
342
|
-
})
|
|
326
|
+
.catch(function(oError) {
|
|
327
|
+
oError.messageKey = "MSG_LOAD_APP_VARIANT_FAILED";
|
|
328
|
+
throw oError;
|
|
329
|
+
})
|
|
330
|
+
.then(function(oAppVariant) {
|
|
331
|
+
return ((mPropertyBag.isForSmartBusiness)
|
|
332
|
+
? Promise.resolve(oAppVariant)
|
|
333
|
+
: _addPackageAndTransport(oAppVariant, mPropertyBag));
|
|
334
|
+
})
|
|
335
|
+
.then(function(oAppVariant) {
|
|
336
|
+
return oAppVariant.submit()
|
|
343
337
|
.catch(function(oError) {
|
|
344
338
|
if (oError === "cancel") {
|
|
345
339
|
return Promise.reject("cancel");
|
|
346
340
|
}
|
|
347
|
-
|
|
341
|
+
oError.messageKey = "MSG_DELETE_APP_VARIANT_FAILED";
|
|
348
342
|
throw oError;
|
|
349
343
|
});
|
|
344
|
+
})
|
|
345
|
+
.catch(function(oError) {
|
|
346
|
+
if (oError === "cancel") {
|
|
347
|
+
return Promise.reject("cancel");
|
|
348
|
+
}
|
|
349
|
+
Log.error("the app variant could not be deleted.", oError.message || oError);
|
|
350
|
+
throw oError;
|
|
351
|
+
});
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
354
|
return SaveAs;
|
|
@@ -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.117.0
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl
|
|
28
28
|
*/
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function findConnectorConfigForLayer(sLayer, aConnectors) {
|
|
42
|
-
var aFilteredConnectors = aConnectors.filter(function
|
|
42
|
+
var aFilteredConnectors = aConnectors.filter(function(oConnector) {
|
|
43
43
|
return oConnector.layers.indexOf("ALL") !== -1 || oConnector.layers.indexOf(sLayer) !== -1;
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -57,18 +57,18 @@ sap.ui.define([
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function _sendLoadFeaturesToConnector(aConnectors) {
|
|
60
|
-
var aConnectorPromises = aConnectors.map(function
|
|
60
|
+
var aConnectorPromises = aConnectors.map(function(oConnectorConfig) {
|
|
61
61
|
return oConnectorConfig.writeConnectorModule.loadFeatures({url: oConnectorConfig.url})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
layers: oConnectorConfig.layers
|
|
66
|
-
};
|
|
67
|
-
})
|
|
68
|
-
.catch(StorageUtils.logAndResolveDefault.bind(null, {
|
|
69
|
-
features: {},
|
|
62
|
+
.then(function(oFeatures) {
|
|
63
|
+
return {
|
|
64
|
+
features: oFeatures,
|
|
70
65
|
layers: oConnectorConfig.layers
|
|
71
|
-
}
|
|
66
|
+
};
|
|
67
|
+
})
|
|
68
|
+
.catch(StorageUtils.logAndResolveDefault.bind(null, {
|
|
69
|
+
features: {},
|
|
70
|
+
layers: oConnectorConfig.layers
|
|
71
|
+
}, oConnectorConfig, "loadFeatures"));
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
return Promise.all(aConnectorPromises);
|
|
@@ -85,22 +85,22 @@ sap.ui.define([
|
|
|
85
85
|
return Promise.reject("No layer was provided");
|
|
86
86
|
}
|
|
87
87
|
return _getWriteConnectors()
|
|
88
|
-
|
|
88
|
+
.then(findConnectorConfigForLayer.bind(this, sLayer));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function _validateDraftScenario(mPropertyBag) {
|
|
92
92
|
if (mPropertyBag.draft) {
|
|
93
|
-
return new Promise(function
|
|
93
|
+
return new Promise(function(resolve, reject) {
|
|
94
94
|
// no loop of classes included since loadFeatures is not using executeActionsByName
|
|
95
|
-
sap.ui.require(["sap/ui/fl/write/api/FeaturesAPI"], function
|
|
95
|
+
sap.ui.require(["sap/ui/fl/write/api/FeaturesAPI"], function(FeaturesAPI) {
|
|
96
96
|
FeaturesAPI.isVersioningEnabled(mPropertyBag.layer)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
.then(function(bDraftEnabled) {
|
|
98
|
+
if (bDraftEnabled) {
|
|
99
|
+
resolve();
|
|
100
|
+
} else {
|
|
101
|
+
reject("Draft is not supported for the given layer: " + mPropertyBag.layer);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -137,9 +137,6 @@ sap.ui.define([
|
|
|
137
137
|
var bAlreadyReordered = false;
|
|
138
138
|
mPropertyBag.allChanges.forEach(function(oChange, index) {
|
|
139
139
|
var sFileType = oChange.getFileType();
|
|
140
|
-
if (sFileType === "ctrl_variant") {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
140
|
var iChangeCreateIndex = findChangeCreateIndex(oChange, mPropertyBag.condensedChanges);
|
|
144
141
|
if (oChange.condenserState) {
|
|
145
142
|
var bDifferentOrder = false;
|
|
@@ -215,12 +212,12 @@ sap.ui.define([
|
|
|
215
212
|
|
|
216
213
|
function _executeActionByName(sActionName, mPropertyBag) {
|
|
217
214
|
return _validateDraftScenario(mPropertyBag)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
215
|
+
.then(_getConnectorConfigByLayer.bind(undefined, mPropertyBag.layer))
|
|
216
|
+
.then(function(oConnectorConfig) {
|
|
217
|
+
mPropertyBag.url = oConnectorConfig.url;
|
|
218
|
+
var oConnector = ObjectPath.get(sActionName, oConnectorConfig.writeConnectorModule);
|
|
219
|
+
return oConnector.call(oConnectorConfig.writeConnectorModule, mPropertyBag);
|
|
220
|
+
});
|
|
224
221
|
}
|
|
225
222
|
|
|
226
223
|
var Storage = {};
|
|
@@ -262,7 +259,11 @@ sap.ui.define([
|
|
|
262
259
|
if (
|
|
263
260
|
mCondense.create || mCondense.reorder || mCondense.update || mCondense.delete
|
|
264
261
|
) {
|
|
265
|
-
var oCreatedChanges =
|
|
262
|
+
var oCreatedChanges = [];
|
|
263
|
+
if (mCondense.create) {
|
|
264
|
+
oCreatedChanges = (mCondense.create.change ? mCondense.create.change : [])
|
|
265
|
+
.concat(mCondense.create.ctrl_variant ? mCondense.create.ctrl_variant : []);
|
|
266
|
+
}
|
|
266
267
|
mPropertyBag.flexObjects = mCondense;
|
|
267
268
|
return _executeActionByName("condense", mPropertyBag)
|
|
268
269
|
.then(function(oResult) {
|
|
@@ -392,8 +393,8 @@ sap.ui.define([
|
|
|
392
393
|
*/
|
|
393
394
|
Storage.loadFeatures = function() {
|
|
394
395
|
return _getWriteConnectors()
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
.then(_sendLoadFeaturesToConnector)
|
|
397
|
+
.then(StorageFeaturesMerger.mergeResults);
|
|
397
398
|
};
|
|
398
399
|
|
|
399
400
|
/**
|
|
@@ -420,26 +421,23 @@ sap.ui.define([
|
|
|
420
421
|
Storage.contextBasedAdaptation = {
|
|
421
422
|
create: function(mPropertyBag) {
|
|
422
423
|
return _getWriteConnectors()
|
|
423
|
-
|
|
424
|
+
.then(_executeActionByName.bind(undefined, "contextBasedAdaptation.create", mPropertyBag));
|
|
424
425
|
},
|
|
425
426
|
reorder: function(mPropertyBag) {
|
|
426
427
|
return _getWriteConnectors()
|
|
427
|
-
|
|
428
|
+
.then(_executeActionByName.bind(undefined, "contextBasedAdaptation.reorder", mPropertyBag));
|
|
428
429
|
},
|
|
429
430
|
update: function(mPropertyBag) {
|
|
430
431
|
return _getWriteConnectors()
|
|
431
|
-
|
|
432
|
+
.then(_executeActionByName.bind(undefined, "contextBasedAdaptation.update", mPropertyBag));
|
|
432
433
|
},
|
|
433
434
|
load: function(mPropertyBag) {
|
|
434
435
|
return _getWriteConnectors()
|
|
435
|
-
|
|
436
|
-
},
|
|
437
|
-
writeChange: function(mPropertyBag) {
|
|
438
|
-
return Storage.write(mPropertyBag);
|
|
436
|
+
.then(_executeActionByName.bind(undefined, "contextBasedAdaptation.load", mPropertyBag));
|
|
439
437
|
},
|
|
440
438
|
remove: function(mPropertyBag) {
|
|
441
439
|
return _getWriteConnectors()
|
|
442
|
-
|
|
440
|
+
.then(_executeActionByName.bind(undefined, "contextBasedAdaptation.remove", mPropertyBag));
|
|
443
441
|
}
|
|
444
442
|
};
|
|
445
443
|
|
|
@@ -454,9 +452,9 @@ sap.ui.define([
|
|
|
454
452
|
* @returns {Promise<sap.ui.fl.Version[]>} Promise resolving with a list of versions if available;
|
|
455
453
|
* rejects if an error occurs or the layer does not support draft handling
|
|
456
454
|
*/
|
|
457
|
-
load: function
|
|
455
|
+
load: function(mPropertyBag) {
|
|
458
456
|
return _getWriteConnectors()
|
|
459
|
-
|
|
457
|
+
.then(_executeActionByName.bind(undefined, "versions.load", mPropertyBag));
|
|
460
458
|
},
|
|
461
459
|
|
|
462
460
|
/**
|
|
@@ -469,9 +467,9 @@ sap.ui.define([
|
|
|
469
467
|
* @returns {Promise<sap.ui.fl.Version>} Promise resolving with the activated version;
|
|
470
468
|
* rejects if an error occurs or the layer does not support draft handling
|
|
471
469
|
*/
|
|
472
|
-
activate: function
|
|
470
|
+
activate: function(mPropertyBag) {
|
|
473
471
|
return _getWriteConnectors()
|
|
474
|
-
|
|
472
|
+
.then(_executeActionByName.bind(undefined, "versions.activate", mPropertyBag));
|
|
475
473
|
},
|
|
476
474
|
|
|
477
475
|
/**
|
|
@@ -483,12 +481,12 @@ sap.ui.define([
|
|
|
483
481
|
* @returns {Promise} Promise resolving after the draft is discarded;
|
|
484
482
|
* rejects if an error occurs or the layer does not support draft handling
|
|
485
483
|
*/
|
|
486
|
-
discardDraft: function
|
|
484
|
+
discardDraft: function(mPropertyBag) {
|
|
487
485
|
return _getWriteConnectors()
|
|
488
|
-
|
|
486
|
+
.then(_executeActionByName.bind(undefined, "versions.discardDraft", mPropertyBag));
|
|
489
487
|
},
|
|
490
488
|
|
|
491
|
-
publish: function
|
|
489
|
+
publish: function(mPropertyBag) {
|
|
492
490
|
return _getWriteConnectors()
|
|
493
491
|
.then(_executeActionByName.bind(undefined, "versions.publish", mPropertyBag));
|
|
494
492
|
}
|
|
@@ -504,10 +502,10 @@ sap.ui.define([
|
|
|
504
502
|
* @returns {Promise} Resolving after the languages are retrieved;
|
|
505
503
|
* rejects if an error occurs
|
|
506
504
|
*/
|
|
507
|
-
getSourceLanguages: function
|
|
505
|
+
getSourceLanguages: function(mPropertyBag) {
|
|
508
506
|
// TODO: cache the request & invalidate it in case of a writing operation
|
|
509
507
|
return _getWriteConnectors()
|
|
510
|
-
|
|
508
|
+
.then(_executeActionByName.bind(undefined, "translation.getSourceLanguages", mPropertyBag));
|
|
511
509
|
},
|
|
512
510
|
|
|
513
511
|
/**
|
|
@@ -521,7 +519,7 @@ sap.ui.define([
|
|
|
521
519
|
* @returns {Promise} Resolving after the languages are retrieved;
|
|
522
520
|
* rejects if an error occurs
|
|
523
521
|
*/
|
|
524
|
-
getTexts: function
|
|
522
|
+
getTexts: function(mPropertyBag) {
|
|
525
523
|
return _getWriteConnectors()
|
|
526
524
|
.then(_executeActionByName.bind(undefined, "translation.getTexts", mPropertyBag));
|
|
527
525
|
},
|
|
@@ -535,7 +533,7 @@ sap.ui.define([
|
|
|
535
533
|
* @returns {Promise} Resolves after the file was uploaded;
|
|
536
534
|
* rejects if an error occurs or the parameter is missing
|
|
537
535
|
*/
|
|
538
|
-
postTranslationTexts: function
|
|
536
|
+
postTranslationTexts: function(mPropertyBag) {
|
|
539
537
|
return _getWriteConnectors()
|
|
540
538
|
.then(_executeActionByName.bind(undefined, "translation.postTranslationTexts", mPropertyBag));
|
|
541
539
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/merge"
|
|
9
|
-
], function
|
|
9
|
+
], function(
|
|
10
10
|
merge
|
|
11
11
|
) {
|
|
12
12
|
"use strict";
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
*
|
|
17
17
|
* @namespace sap.ui.fl.write._internal.StorageFeaturesMerger
|
|
18
18
|
* @since 1.70
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.117.0
|
|
20
20
|
* @private
|
|
21
21
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
22
22
|
*/
|
|
@@ -63,8 +63,8 @@ sap.ui.define([
|
|
|
63
63
|
mergeResults: function(aResponses) {
|
|
64
64
|
var oResult = DEFAULT_FEATURES;
|
|
65
65
|
|
|
66
|
-
aResponses.forEach(function
|
|
67
|
-
Object.keys(oResponse.features).forEach(function
|
|
66
|
+
aResponses.forEach(function(oResponse) {
|
|
67
|
+
Object.keys(oResponse.features).forEach(function(sKey) {
|
|
68
68
|
if (sKey !== "isVersioningEnabled") {
|
|
69
69
|
oResult[sKey] = oResponse.features[sKey];
|
|
70
70
|
}
|