@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
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/Log",
|
|
9
|
+
"sap/base/strings/formatMessage",
|
|
9
10
|
"sap/ui/core/Element",
|
|
10
11
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
11
12
|
"sap/ui/fl/apply/_internal/changes/FlexCustomData",
|
|
@@ -14,6 +15,7 @@ sap.ui.define([
|
|
|
14
15
|
"sap/ui/fl/Utils"
|
|
15
16
|
], function(
|
|
16
17
|
Log,
|
|
18
|
+
formatMessage,
|
|
17
19
|
Element,
|
|
18
20
|
JsControlTreeModifier,
|
|
19
21
|
FlexCustomData,
|
|
@@ -23,7 +25,21 @@ sap.ui.define([
|
|
|
23
25
|
) {
|
|
24
26
|
"use strict";
|
|
25
27
|
|
|
26
|
-
var oLastPromise = new FlUtils.FakePromise();
|
|
28
|
+
var oLastPromise = (FlUtils.FakePromise ? new FlUtils.FakePromise() : Promise.resolve());
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Formats the log message by replacing placeholders with values and logging the message.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} sLogType - Logging type to be used. Possible values: info | warning | debug | error
|
|
34
|
+
* @param {array.<string>} aMessageComponents - Individual parts of the message text
|
|
35
|
+
* @param {array.<any>} aValuesToInsert - The values to be used instead of the placeholders in the message
|
|
36
|
+
* @param {string} [sCallStack] - Passes the callstack to the logging function
|
|
37
|
+
*/
|
|
38
|
+
function formatAndLogMessage(sLogType, aMessageComponents, aValuesToInsert, sCallStack) {
|
|
39
|
+
var sLogMessage = aMessageComponents.join(" ");
|
|
40
|
+
sLogMessage = formatMessage(sLogMessage, aValuesToInsert);
|
|
41
|
+
Log[sLogType](sLogMessage, sCallStack || "");
|
|
42
|
+
}
|
|
27
43
|
|
|
28
44
|
function checkControlAndDependentSelectorControls(oChange, mPropertyBag) {
|
|
29
45
|
var oSelector = oChange.getSelector && oChange.getSelector();
|
|
@@ -38,22 +54,26 @@ sap.ui.define([
|
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
return mPropertyBag.modifier.bySelectorTypeIndependent(oSelector, mPropertyBag.appComponent, mPropertyBag.view)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
.then(function(oControl) {
|
|
58
|
+
if (!oControl) {
|
|
59
|
+
throw Error("A flexibility change tries to change a nonexistent control.");
|
|
60
|
+
}
|
|
61
|
+
checkFailedSelectors(oSelector);
|
|
62
|
+
|
|
63
|
+
var aDependentControlSelectorList = oChange.getDependentControlSelectorList();
|
|
64
|
+
aDependentControlSelectorList.forEach(function(oDependentControlSelector) {
|
|
65
|
+
var oDependentControl = mPropertyBag.modifier.bySelector(
|
|
66
|
+
oDependentControlSelector,
|
|
67
|
+
mPropertyBag.appComponent,
|
|
68
|
+
mPropertyBag.view
|
|
69
|
+
);
|
|
70
|
+
if (!oDependentControl) {
|
|
71
|
+
throw new Error("A dependent selector control of the flexibility change is not available.");
|
|
44
72
|
}
|
|
45
|
-
checkFailedSelectors(
|
|
46
|
-
|
|
47
|
-
var aDependentControlSelectorList = oChange.getDependentControlSelectorList();
|
|
48
|
-
aDependentControlSelectorList.forEach(function(oDependentControlSelector) {
|
|
49
|
-
var oDependentControl = mPropertyBag.modifier.bySelector(oDependentControlSelector, mPropertyBag.appComponent, mPropertyBag.view);
|
|
50
|
-
if (!oDependentControl) {
|
|
51
|
-
throw new Error("A dependent selector control of the flexibility change is not available.");
|
|
52
|
-
}
|
|
53
|
-
checkFailedSelectors(oDependentControlSelector);
|
|
54
|
-
});
|
|
55
|
-
return oControl;
|
|
73
|
+
checkFailedSelectors(oDependentControlSelector);
|
|
56
74
|
});
|
|
75
|
+
return oControl;
|
|
76
|
+
});
|
|
57
77
|
}
|
|
58
78
|
|
|
59
79
|
function isXmlModifier(mPropertyBag) {
|
|
@@ -107,28 +127,28 @@ sap.ui.define([
|
|
|
107
127
|
|
|
108
128
|
function handleAfterApply(oChange, mControl, oInitializedControl, mPropertyBag) {
|
|
109
129
|
return Promise.resolve()
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
.then(function() {
|
|
131
|
+
// changeHandler can return a different control, e.g. case where a visible UI control replaces the stashed control placeholder
|
|
132
|
+
if (oInitializedControl instanceof Element) {
|
|
133
|
+
// the newly rendered control could have custom data set from the XML modifier
|
|
134
|
+
mControl.control = oInitializedControl;
|
|
135
|
+
}
|
|
136
|
+
if (mControl.control) {
|
|
137
|
+
return mPropertyBag.modifier.updateAggregation(mControl.originalControl, oChange.getContent().boundAggregation);
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
})
|
|
141
|
+
.then(function() {
|
|
142
|
+
// only save the revert data in the custom data when the change is being processed in XML,
|
|
143
|
+
// as it's only relevant for viewCache at the moment
|
|
144
|
+
return FlexCustomData.addAppliedCustomData(mControl.control, oChange, mPropertyBag, isXmlModifier(mPropertyBag));
|
|
145
|
+
})
|
|
146
|
+
.then(function() {
|
|
147
|
+
// if a change was reverted previously remove the flag as it is not reverted anymore
|
|
148
|
+
var oResult = {success: true};
|
|
149
|
+
oChange.markSuccessful(oResult);
|
|
150
|
+
return oResult;
|
|
151
|
+
});
|
|
132
152
|
}
|
|
133
153
|
|
|
134
154
|
function handleAfterApplyError(oError, oChange, mControl, mPropertyBag) {
|
|
@@ -141,27 +161,42 @@ sap.ui.define([
|
|
|
141
161
|
var sCustomDataIdentifier = FlexCustomData.getCustomDataIdentifier(false, bErrorOccurred, bXmlModifier);
|
|
142
162
|
switch (sCustomDataIdentifier) {
|
|
143
163
|
case FlexCustomData.notApplicableChangesCustomDataKey:
|
|
144
|
-
|
|
164
|
+
formatAndLogMessage(
|
|
165
|
+
"info",
|
|
166
|
+
[sLogMessage, oError.message],
|
|
167
|
+
[sChangeId]
|
|
168
|
+
);
|
|
145
169
|
break;
|
|
146
170
|
case FlexCustomData.failedChangesCustomDataKeyXml:
|
|
147
|
-
|
|
171
|
+
formatAndLogMessage(
|
|
172
|
+
"warning",
|
|
173
|
+
[sLogMessage, "Merge error detected while processing the XML tree."],
|
|
174
|
+
[sChangeId],
|
|
175
|
+
oError.stack
|
|
176
|
+
);
|
|
148
177
|
break;
|
|
149
178
|
case FlexCustomData.failedChangesCustomDataKeyJs:
|
|
150
|
-
|
|
179
|
+
formatAndLogMessage(
|
|
180
|
+
"error",
|
|
181
|
+
[sLogMessage, "Merge error detected while processing the JS control tree."],
|
|
182
|
+
[sChangeId],
|
|
183
|
+
oError.stack
|
|
184
|
+
);
|
|
151
185
|
break;
|
|
152
|
-
|
|
186
|
+
default:
|
|
187
|
+
// no default
|
|
153
188
|
}
|
|
154
189
|
return FlexCustomData.addFailedCustomData(mControl.control, oChange, mPropertyBag, sCustomDataIdentifier)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
190
|
+
.then(function() {
|
|
191
|
+
// if the change failed during XML processing, the status has to be reset
|
|
192
|
+
// the change will be applied again in JS
|
|
193
|
+
if (bXmlModifier) {
|
|
194
|
+
oChange.setInitialApplyState();
|
|
195
|
+
} else {
|
|
196
|
+
oChange.markFailed(oResult);
|
|
197
|
+
}
|
|
198
|
+
return oResult;
|
|
199
|
+
});
|
|
165
200
|
}
|
|
166
201
|
|
|
167
202
|
function logApplyChangeError(oError, oChange) {
|
|
@@ -210,7 +245,7 @@ sap.ui.define([
|
|
|
210
245
|
}
|
|
211
246
|
|
|
212
247
|
function registerOnAfterXMLChangeProcessingHandler(aOnAfterXMLChangeProcessingHandlers, oChangeHandler, oControl) {
|
|
213
|
-
var iChangeHandlerIndex = aOnAfterXMLChangeProcessingHandlers.findIndex(function
|
|
248
|
+
var iChangeHandlerIndex = aOnAfterXMLChangeProcessingHandlers.findIndex(function(mHandler) {
|
|
214
249
|
return mHandler.handler === oChangeHandler;
|
|
215
250
|
});
|
|
216
251
|
if (iChangeHandlerIndex < 0) {
|
|
@@ -232,7 +267,7 @@ sap.ui.define([
|
|
|
232
267
|
* @param {Promise} oPromise - Promise which is resolved when precondition fulfilled
|
|
233
268
|
*/
|
|
234
269
|
addPreConditionForInitialChangeApplying: function(oPromise) {
|
|
235
|
-
oLastPromise = oLastPromise.then(function
|
|
270
|
+
oLastPromise = oLastPromise.then(function() {
|
|
236
271
|
return oPromise;
|
|
237
272
|
});
|
|
238
273
|
},
|
|
@@ -268,7 +303,7 @@ sap.ui.define([
|
|
|
268
303
|
return oResult;
|
|
269
304
|
});
|
|
270
305
|
} else if (!oChange.isApplyProcessFinished()) {
|
|
271
|
-
return new FlUtils.FakePromise().then(function() {
|
|
306
|
+
return (FlUtils.FakePromise ? new FlUtils.FakePromise() : Promise.resolve()).then(function() {
|
|
272
307
|
oChange.startApplying();
|
|
273
308
|
return oChangeHandler.applyChange(oChange, mControl.control, mPropertyBag);
|
|
274
309
|
})
|
|
@@ -315,7 +350,7 @@ sap.ui.define([
|
|
|
315
350
|
view: FlUtils.getViewForControl(oControl)
|
|
316
351
|
};
|
|
317
352
|
|
|
318
|
-
aChangesForControl.forEach(function
|
|
353
|
+
aChangesForControl.forEach(function(oChange) {
|
|
319
354
|
checkAndAdjustChangeStatus(oControl, oChange, mChangesMap, oFlexController, mPropertyBag);
|
|
320
355
|
if (!oChange.isApplyProcessFinished() && !oChange._ignoreOnce) {
|
|
321
356
|
oChange.setQueuedForApply();
|
|
@@ -334,8 +369,9 @@ sap.ui.define([
|
|
|
334
369
|
bControlWithDependencies = true;
|
|
335
370
|
}
|
|
336
371
|
|
|
337
|
-
aChangesForControl.forEach(function
|
|
338
|
-
// in the ExtensionPoint scenario changes can get cloned,
|
|
372
|
+
aChangesForControl.forEach(function(oChange) {
|
|
373
|
+
// in the ExtensionPoint scenario changes can get cloned,
|
|
374
|
+
// in case of a template change the original selector has to be adjusted
|
|
339
375
|
if (oChange.originalSelectorToBeAdjusted) {
|
|
340
376
|
adjustOriginalSelector(oChange, oControl, oAppComponent);
|
|
341
377
|
delete oChange.originalSelectorToBeAdjusted;
|
|
@@ -357,7 +393,7 @@ sap.ui.define([
|
|
|
357
393
|
});
|
|
358
394
|
|
|
359
395
|
if (aChangesForControl.length || bControlWithDependencies) {
|
|
360
|
-
return FlUtils.execPromiseQueueSequentially(aPromiseStack).then(function
|
|
396
|
+
return FlUtils.execPromiseQueueSequentially(aPromiseStack).then(function() {
|
|
361
397
|
return DependencyHandler.processDependentQueue(mChangesMap, oAppComponent, sControlId);
|
|
362
398
|
});
|
|
363
399
|
}
|
|
@@ -391,50 +427,50 @@ sap.ui.define([
|
|
|
391
427
|
return aChanges.reduce(function(oPreviousPromise, oChange) {
|
|
392
428
|
var oControl;
|
|
393
429
|
return oPreviousPromise
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
return Applier.applyChangeOnControl(oChange, oControl, mPropertyBag);
|
|
430
|
+
.then(checkControlAndDependentSelectorControls.bind(null, oChange, mPropertyBag))
|
|
431
|
+
.then(function(oReturnedControl) {
|
|
432
|
+
oControl = oReturnedControl;
|
|
433
|
+
var mControl = Utils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
|
|
434
|
+
return Utils.getChangeHandler(oChange, mControl, mPropertyBag);
|
|
435
|
+
})
|
|
436
|
+
.then(function(oChangeHandler) {
|
|
437
|
+
mPropertyBag.changeHandler = oChangeHandler;
|
|
438
|
+
oChange.setQueuedForApply();
|
|
439
|
+
checkAndAdjustChangeStatus(oControl, oChange, undefined, undefined, mPropertyBag);
|
|
440
|
+
|
|
441
|
+
if (!oChange.isApplyProcessFinished()) {
|
|
442
|
+
if (typeof mPropertyBag.changeHandler.onAfterXMLChangeProcessing === "function") {
|
|
443
|
+
registerOnAfterXMLChangeProcessingHandler(
|
|
444
|
+
aOnAfterXMLChangeProcessingHandlers,
|
|
445
|
+
mPropertyBag.changeHandler,
|
|
446
|
+
oControl
|
|
447
|
+
);
|
|
414
448
|
}
|
|
415
|
-
return
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
449
|
+
return Applier.applyChangeOnControl(oChange, oControl, mPropertyBag);
|
|
450
|
+
}
|
|
451
|
+
return {success: true};
|
|
452
|
+
})
|
|
453
|
+
.then(function(oReturn) {
|
|
454
|
+
if (!oReturn.success) {
|
|
455
|
+
throw Error(oReturn.error);
|
|
456
|
+
}
|
|
457
|
+
})
|
|
458
|
+
.catch(function(oError) {
|
|
459
|
+
oChange.getDependentSelectorList().forEach(function(oDependentControlSelector) {
|
|
460
|
+
if (FlUtils.indexOfObject(mPropertyBag.failedSelectors, oDependentControlSelector) === -1) {
|
|
461
|
+
mPropertyBag.failedSelectors.push(oDependentControlSelector);
|
|
420
462
|
}
|
|
421
|
-
})
|
|
422
|
-
.catch(function(oError) {
|
|
423
|
-
oChange.getDependentSelectorList().forEach(function(oDependentControlSelector) {
|
|
424
|
-
if (FlUtils.indexOfObject(mPropertyBag.failedSelectors, oDependentControlSelector) === -1) {
|
|
425
|
-
mPropertyBag.failedSelectors.push(oDependentControlSelector);
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
logApplyChangeError(oError, oChange);
|
|
429
463
|
});
|
|
430
|
-
|
|
464
|
+
logApplyChangeError(oError, oChange);
|
|
465
|
+
});
|
|
466
|
+
}, (FlUtils.FakePromise ? new FlUtils.FakePromise() : Promise.resolve()))
|
|
431
467
|
.then(function() {
|
|
432
468
|
delete mPropertyBag.failedSelectors;
|
|
433
469
|
|
|
434
470
|
// Once all changes for a control are processed, call the
|
|
435
471
|
// onAfterXMLChangeProcessing hooks of all involved change handlers
|
|
436
|
-
aOnAfterXMLChangeProcessingHandlers.forEach(function
|
|
437
|
-
mHandler.controls.forEach(function
|
|
472
|
+
aOnAfterXMLChangeProcessingHandlers.forEach(function(mHandler) {
|
|
473
|
+
mHandler.controls.forEach(function(oControl) {
|
|
438
474
|
try {
|
|
439
475
|
mHandler.handler.onAfterXMLChangeProcessing(oControl, mPropertyBag);
|
|
440
476
|
} catch (oError) {
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/Log",
|
|
9
|
+
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
9
10
|
"sap/ui/fl/apply/_internal/changes/FlexCustomData",
|
|
10
11
|
"sap/ui/fl/apply/_internal/changes/Utils",
|
|
11
12
|
"sap/ui/fl/Utils"
|
|
12
13
|
], function(
|
|
13
14
|
Log,
|
|
15
|
+
Applier,
|
|
14
16
|
FlexCustomData,
|
|
15
17
|
Utils,
|
|
16
18
|
FlUtils
|
|
@@ -77,7 +79,7 @@ sap.ui.define([
|
|
|
77
79
|
}
|
|
78
80
|
return undefined;
|
|
79
81
|
})
|
|
80
|
-
.then(function
|
|
82
|
+
.then(function() {
|
|
81
83
|
oChange.markRevertFinished();
|
|
82
84
|
return mControl.control;
|
|
83
85
|
})
|
|
@@ -109,7 +111,7 @@ sap.ui.define([
|
|
|
109
111
|
var oControl = mPropertyBag.modifier.bySelector(oSelector, mPropertyBag.appComponent);
|
|
110
112
|
if (!oControl) {
|
|
111
113
|
Log.warning("A flexibility change tries to revert changes on a nonexistent control with id " + oSelector.id);
|
|
112
|
-
return new FlUtils.FakePromise();
|
|
114
|
+
return (FlUtils.FakePromise ? new FlUtils.FakePromise() : Promise.resolve());
|
|
113
115
|
}
|
|
114
116
|
var mRevertProperties = {
|
|
115
117
|
modifier: mPropertyBag.modifier,
|
|
@@ -119,8 +121,12 @@ sap.ui.define([
|
|
|
119
121
|
return revertAndDeleteChangeOnControl(oChange, oControl, mRevertProperties, mPropertyBag);
|
|
120
122
|
});
|
|
121
123
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
const pReturn = FlUtils.execPromiseQueueSequentially(aPromiseStack);
|
|
125
|
+
// reverting a change might trigger the propagation listener and the applyAllChangesForControl functionality
|
|
126
|
+
// this needs to wait for the whole revert to be done so that the persistence is cleaned up and
|
|
127
|
+
// a reverted change is not applied again
|
|
128
|
+
Applier.addPreConditionForInitialChangeApplying(pReturn);
|
|
129
|
+
return pReturn;
|
|
124
130
|
};
|
|
125
131
|
|
|
126
132
|
return Reverter;
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @namespace sap.ui.fl.apply._internal.changes.Utils
|
|
24
24
|
* @since 1.70
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.117.0
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl.apply._internal, sap.ui.fl.write._internal
|
|
28
28
|
*/
|
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
* @returns {object} Contains the information about the control
|
|
50
50
|
* @private
|
|
51
51
|
*/
|
|
52
|
-
getControlIfTemplateAffected: function
|
|
52
|
+
getControlIfTemplateAffected: function(oChange, oControl, mPropertyBag) {
|
|
53
53
|
var oModifier = mPropertyBag.modifier;
|
|
54
54
|
var mControl = {
|
|
55
55
|
originalControl: oControl
|
|
@@ -105,6 +105,11 @@ sap.ui.define([
|
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
var oControl = oModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
108
|
+
// if the control is currently not available,
|
|
109
|
+
// the change is also not applied anymore and the dependency is still valid
|
|
110
|
+
if (!oControl) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
108
113
|
var bHasChangeApplyFinishedCustomData = FlexCustomData.hasChangeApplyFinishedCustomData(oControl, oChange, oModifier);
|
|
109
114
|
return isDependencyStillValid(oChange, bHasChangeApplyFinishedCustomData);
|
|
110
115
|
},
|
|
@@ -40,28 +40,28 @@ sap.ui.define([
|
|
|
40
40
|
* @param {function} mStrategy.processTexts - Text postprocessing strategy
|
|
41
41
|
* @returns {Promise<object>} - Processed manifest with descriptor changes
|
|
42
42
|
*/
|
|
43
|
-
applyChanges: function
|
|
43
|
+
applyChanges: function(oUpdatedManifest, aAppDescriptorChanges, mStrategy) {
|
|
44
44
|
return mStrategy.registry()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
} catch (oError) {
|
|
60
|
-
mStrategy.handleError(oError);
|
|
45
|
+
.then(function(Registry) {
|
|
46
|
+
var aChangeHandlerPromises = aAppDescriptorChanges.map(function(oChange) {
|
|
47
|
+
return Registry[oChange.getChangeType()] && Registry[oChange.getChangeType()]();
|
|
48
|
+
});
|
|
49
|
+
return Promise.all(aChangeHandlerPromises);
|
|
50
|
+
})
|
|
51
|
+
.then(function(aChangeHandlers) {
|
|
52
|
+
aChangeHandlers.forEach(function(oChangeHandler, iIndex) {
|
|
53
|
+
try {
|
|
54
|
+
var oChange = aAppDescriptorChanges[iIndex];
|
|
55
|
+
oUpdatedManifest = oChangeHandler.applyChange(oUpdatedManifest, oChange);
|
|
56
|
+
if (!oChangeHandler.skipPostprocessing && !isEmptyObject(oChange.getTexts())) {
|
|
57
|
+
oUpdatedManifest = mStrategy.processTexts(oUpdatedManifest, oChange.getTexts());
|
|
61
58
|
}
|
|
62
|
-
})
|
|
63
|
-
|
|
59
|
+
} catch (oError) {
|
|
60
|
+
mStrategy.handleError(oError);
|
|
61
|
+
}
|
|
64
62
|
});
|
|
63
|
+
return oUpdatedManifest;
|
|
64
|
+
});
|
|
65
65
|
},
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/ui/fl/requireAsync",
|
|
10
10
|
"sap/base/Log"
|
|
11
|
-
], function
|
|
11
|
+
], function(
|
|
12
12
|
requireAsync,
|
|
13
13
|
Log
|
|
14
14
|
) {
|
|
@@ -18,11 +18,11 @@ sap.ui.define([
|
|
|
18
18
|
registry: function() {
|
|
19
19
|
return requireAsync("sap/ui/fl/apply/_internal/changes/descriptor/Registration");
|
|
20
20
|
},
|
|
21
|
-
handleError: function
|
|
21
|
+
handleError: function(oError) {
|
|
22
22
|
Log.error(oError);
|
|
23
23
|
},
|
|
24
|
-
processTexts: function
|
|
25
|
-
//TODO: optimize performance by creating map not using JSON.stringify/parse
|
|
24
|
+
processTexts: function(oManifest, oChangeTexts) {
|
|
25
|
+
// TODO: optimize performance by creating map not using JSON.stringify/parse
|
|
26
26
|
var sManifest = JSON.stringify(oManifest);
|
|
27
27
|
Object.keys(oChangeTexts).forEach(function(sTextKey) {
|
|
28
28
|
if (oChangeTexts[sTextKey].value[""]) {
|
|
@@ -35,7 +35,6 @@ sap.ui.define([
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
39
38
|
var ApplyStrategyFactory = {
|
|
40
39
|
/**
|
|
41
40
|
* Strategy to apply descriptor changes during runtime.
|
|
@@ -12,7 +12,6 @@ sap.ui.define([
|
|
|
12
12
|
) {
|
|
13
13
|
"use strict";
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
var ApplyUtil = {
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -24,7 +23,7 @@ sap.ui.define([
|
|
|
24
23
|
* @private
|
|
25
24
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
26
25
|
*/
|
|
27
|
-
formatBundleName: function
|
|
26
|
+
formatBundleName: function(sId, sBundleUrl) {
|
|
28
27
|
if (sBundleUrl.startsWith("/")) {
|
|
29
28
|
throw Error("Absolute paths are not supported");
|
|
30
29
|
}
|
|
@@ -34,7 +34,7 @@ sap.ui.define([
|
|
|
34
34
|
return aChangeAnnotations.indexOf(sAnnotation) >= 0;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function checkingDataSourceId
|
|
37
|
+
function checkingDataSourceId(oManifestDataSources, sChangeDataSourceId) {
|
|
38
38
|
if (sChangeDataSourceId) {
|
|
39
39
|
if (Object.keys(oManifestDataSources).length > 0) {
|
|
40
40
|
if (!isDataSourceIdExistingInManifest(oManifestDataSources, sChangeDataSourceId)) {
|
|
@@ -52,7 +52,7 @@ sap.ui.define([
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function checkingAnnotationArray
|
|
55
|
+
function checkingAnnotationArray(aChangeAnnotations) {
|
|
56
56
|
if (aChangeAnnotations) {
|
|
57
57
|
if (aChangeAnnotations.length === 0) {
|
|
58
58
|
throw new Error("Invalid change format: The 'annotations' array property is empty");
|
|
@@ -62,7 +62,7 @@ sap.ui.define([
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function checkingAnnotationsInsertPosition
|
|
65
|
+
function checkingAnnotationsInsertPosition(sChangeAnnotationsInsertPosition) {
|
|
66
66
|
if (!(SUPPORTED_INSERT_POSITION.indexOf(sChangeAnnotationsInsertPosition) >= 0) && !(sChangeAnnotationsInsertPosition === undefined)) { // default is 'BEGINNING'
|
|
67
67
|
throw new Error("The defined insert position '" + sChangeAnnotationsInsertPosition + "' is not supported. The supported insert positions are: " + SUPPORTED_INSERT_POSITION.join("|"));
|
|
68
68
|
}
|
|
@@ -96,24 +96,24 @@ sap.ui.define([
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function mergeAnnotationArray(oManifestDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition) {
|
|
99
|
-
if (!oManifestDataSourceId
|
|
100
|
-
oManifestDataSourceId
|
|
99
|
+
if (!oManifestDataSourceId.settings) {
|
|
100
|
+
oManifestDataSourceId.settings = {};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
if (!oManifestDataSourceId
|
|
104
|
-
oManifestDataSourceId
|
|
103
|
+
if (!oManifestDataSourceId.settings.annotations) {
|
|
104
|
+
oManifestDataSourceId.settings.annotations = [];
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
var aNotExistingAnnotationsInChange = oManifestDataSourceId
|
|
107
|
+
var aNotExistingAnnotationsInChange = oManifestDataSourceId.settings.annotations.filter(function(annotation) {
|
|
108
108
|
return (aChangeAnnotations.indexOf(annotation) < 0);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
oManifestDataSourceId
|
|
111
|
+
oManifestDataSourceId.settings.annotations = aNotExistingAnnotationsInChange;
|
|
112
112
|
|
|
113
113
|
if (sChangeAnnotationsInsertPosition === "END") {
|
|
114
|
-
oManifestDataSourceId
|
|
114
|
+
oManifestDataSourceId.settings.annotations = oManifestDataSourceId.settings.annotations.concat(aChangeAnnotations);
|
|
115
115
|
} else {
|
|
116
|
-
oManifestDataSourceId
|
|
116
|
+
oManifestDataSourceId.settings.annotations = aChangeAnnotations.concat(oManifestDataSourceId.settings.annotations);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -121,7 +121,7 @@ sap.ui.define([
|
|
|
121
121
|
Object.assign(oManifestDataSources, oChangeDataSource);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function postChecks
|
|
124
|
+
function postChecks(oManifestDataSources, oChangeDataSource, aChangeAnnotations) {
|
|
125
125
|
// Further checks after main checks
|
|
126
126
|
aChangeAnnotations.forEach(function(sAnnotation) {
|
|
127
127
|
if (!isAnnotationExisting(oManifestDataSources, oChangeDataSource, sAnnotation)) {
|
|
@@ -136,9 +136,10 @@ sap.ui.define([
|
|
|
136
136
|
*
|
|
137
137
|
* Available only for build {@link sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild}.
|
|
138
138
|
*
|
|
139
|
-
* @namespace
|
|
139
|
+
* @namespace
|
|
140
|
+
* @alias sap.ui.fl.apply._internal.changes.descriptor.app.AddAnnotationsToOData
|
|
140
141
|
* @since 1.87
|
|
141
|
-
* @version 1.
|
|
142
|
+
* @version 1.117.0
|
|
142
143
|
* @private
|
|
143
144
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
144
145
|
*/
|
|
@@ -149,6 +150,7 @@ sap.ui.define([
|
|
|
149
150
|
*
|
|
150
151
|
* @param {object} oManifest - Original manifest
|
|
151
152
|
* @param {sap.ui.fl.apply._internal.flexObjects.AppDescriptorChange} oChange - Change with type <code>appdescr_app_addAnnotationsToOData</code>
|
|
153
|
+
* @param {object} oChange.content - Details of the change
|
|
152
154
|
* @param {string} oChange.content.dataSourceId - ID of <code>sap.app/dataSource</code> that is being changed
|
|
153
155
|
* @param {Array<string>} oChange.content.annotations - Array of annotations in OData dataSource <code>sap.app/dataSource/settings/annotations</code> that is being changed
|
|
154
156
|
* @param {string} oChange.content.annotationsInsertPosition - Insert position operation that is performed under annotations. Allowed values: <code>BEGINNING</code> and <code>END</code> default: (<code>BEGINNING</code)
|
|
@@ -168,9 +170,9 @@ sap.ui.define([
|
|
|
168
170
|
checkingAnnotationArray(aChangeAnnotations);
|
|
169
171
|
checkingAnnotationsInsertPosition(sChangeAnnotationsInsertPosition);
|
|
170
172
|
checkingAnnotationDataSource(oChangeDataSource, aChangeAnnotations, oChange);
|
|
171
|
-
postChecks(oManifest["sap.app"]
|
|
173
|
+
postChecks(oManifest["sap.app"].dataSources, oChangeDataSource, aChangeAnnotations);
|
|
172
174
|
|
|
173
|
-
merge(oManifest["sap.app"]
|
|
175
|
+
merge(oManifest["sap.app"].dataSources, sChangeDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition, oChangeDataSource);
|
|
174
176
|
|
|
175
177
|
return oManifest;
|
|
176
178
|
}
|