@openui5/sap.ui.fl 1.96.5 → 1.99.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.
Files changed (174) hide show
  1. package/.reuse/dep5 +26 -31
  2. package/THIRDPARTY.txt +15 -21
  3. package/package.json +3 -3
  4. package/src/sap/ui/fl/.library +1 -1
  5. package/src/sap/ui/fl/Cache.js +1 -1
  6. package/src/sap/ui/fl/Change.js +11 -225
  7. package/src/sap/ui/fl/ChangePersistence.js +27 -25
  8. package/src/sap/ui/fl/ChangePersistenceFactory.js +5 -3
  9. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  10. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  11. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  12. package/src/sap/ui/fl/FlexController.js +19 -9
  13. package/src/sap/ui/fl/FlexControllerFactory.js +14 -8
  14. package/src/sap/ui/fl/LayerUtils.js +1 -1
  15. package/src/sap/ui/fl/Utils.js +46 -320
  16. package/src/sap/ui/fl/Variant.js +5 -119
  17. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
  18. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +266 -264
  41. package/src/sap/ui/fl/apply/_internal/controlVariants/Utils.js +39 -9
  42. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +15 -10
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +4 -4
  47. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +13 -18
  48. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +21 -22
  49. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  54. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +2 -2
  55. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +2 -7
  56. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +22 -28
  57. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/prepareVariantsMap.js +7 -1
  58. package/src/sap/ui/fl/{PreprocessorImpl.js → apply/_internal/preprocessors/ControllerExtension.js} +43 -50
  59. package/src/sap/ui/fl/{EventHistory.js → apply/_internal/preprocessors/EventHistory.js} +7 -7
  60. package/src/sap/ui/fl/{RegistrationDelegator.js → apply/_internal/preprocessors/RegistrationDelegator.js} +40 -42
  61. package/src/sap/ui/fl/{XmlPreprocessorImpl.js → apply/_internal/preprocessors/XmlPreprocessor.js} +18 -17
  62. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +86 -6
  63. package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +1 -1
  64. package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +71 -9
  65. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +14 -16
  66. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  82. package/src/sap/ui/fl/codeExt/CodeExtManager.js +16 -10
  83. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  84. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  85. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  86. package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +9 -2
  87. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  88. package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +1 -1
  89. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  90. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +9 -9
  91. package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +1 -1
  92. package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +16 -6
  93. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +4 -5
  94. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  95. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  96. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  97. package/src/sap/ui/fl/library.js +12 -12
  98. package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +19 -2
  99. package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +2 -35
  100. package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +19 -2
  101. package/src/sap/ui/fl/messagebundle_ro.properties +1 -1
  102. package/src/sap/ui/fl/registry/Settings.js +67 -19
  103. package/src/sap/ui/fl/support/Flexibility.js +83 -72
  104. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +59 -0
  105. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +34 -0
  106. package/src/sap/ui/fl/support/api/SupportAPI.js +31 -0
  107. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +13 -13
  108. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +8 -8
  109. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +9 -9
  110. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +3 -3
  111. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +51 -52
  112. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +129 -125
  113. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +4 -4
  114. package/src/sap/ui/fl/support/apps/uiFlexibilityDiagnostics/controller/Root.controller.js +0 -2
  115. package/src/sap/ui/fl/support/apps/uiFlexibilityDiagnostics/helper/Extractor.js +3 -14
  116. package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
  117. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  118. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +3 -5
  119. package/src/sap/ui/fl/util/IFrame.js +1 -1
  120. package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
  121. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  122. package/src/sap/ui/fl/util/changePropertyValueByPath.js +1 -1
  123. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  124. package/src/sap/ui/fl/variants/VariantManagement.js +7 -1
  125. package/src/sap/ui/fl/variants/VariantModel.js +27 -71
  126. package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +18 -4
  127. package/src/sap/ui/fl/write/_internal/Storage.js +47 -1
  128. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/Versions.js +17 -18
  130. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +24 -1
  134. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +3 -2
  135. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +4 -4
  137. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +79 -25
  138. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +59 -5
  139. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  141. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  143. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +4 -4
  146. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  148. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  149. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  152. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +5 -5
  153. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  154. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +2 -2
  155. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  156. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  157. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  158. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +3 -3
  159. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +5 -4
  160. package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +5 -7
  161. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +6 -5
  162. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -2
  163. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +220 -16
  164. package/src/sap/ui/fl/write/api/FeaturesAPI.js +9 -2
  165. package/src/sap/ui/fl/write/api/FieldExtensibility.js +7 -3
  166. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +41 -3
  167. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +4 -4
  168. package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +2 -0
  169. package/src/sap/ui/fl/write/api/TranslationAPI.js +123 -0
  170. package/src/sap/ui/fl/write/api/VersionsAPI.js +1 -1
  171. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
  172. package/src/sap/ui/fl/write/connectors/BaseConnector.js +43 -0
  173. package/ui5.yaml +132 -1
  174. package/src/sap/ui/fl/ControlPersonalizationAPI.js +0 -479
@@ -25,13 +25,11 @@ sap.ui.define([
25
25
  /**
26
26
  * @private
27
27
  * @alias sap.ui.fl.write._internal.transport.TransportSelection
28
- * @constructor
29
28
  * @author SAP SE
30
- * @version 1.96.5
29
+ * @version 1.99.0
31
30
  * @since 1.74.0
32
31
  * Helper object to select an ABAP transport for an LREP object. This is not a generic utility to select a transport request, but part
33
32
  * of the SmartVariant control.
34
- * @returns {sap.ui.fl.write._internal.transport.TransportSelection} New instance of <code>sap.ui.fl.write._internal.transport.TransportSelection</code>
35
33
  */
36
34
  var TransportSelection = function() {};
37
35
 
@@ -51,6 +49,7 @@ sap.ui.define([
51
49
  * @param {function} fError - Callback to be invoked when an error occurred during selection of a transport request
52
50
  * @param {boolean} bCompactMode - Flag indicating whether the transport dialog should be opened in compact mode
53
51
  * @param {object} oControl - Control instance
52
+ * @param {string} sStyleClass - CSS style class that should be added to any dialogs
54
53
  * @public
55
54
  */
56
55
  TransportSelection.prototype.selectTransport = function(oObjectInfo, fOkay, fError, bCompactMode, oControl, sStyleClass) {
@@ -157,6 +156,7 @@ sap.ui.define([
157
156
  * @param {function} fOkay - Callback to be invoked when a transport request has successfully been selected
158
157
  * @param {function} fError - Callback to be invoked when an error occurred during selection of a transport request
159
158
  * @param {boolean} bCompactMode - Flag indicating whether the transport dialog should be opened in compact mode
159
+ * @param {string} sStyleClass - CSS style class that should be added to any dialogs
160
160
  * @returns {sap.ui.fl.write._internal.transport.TransportDialog} Dialog
161
161
  * @private
162
162
  */
@@ -202,7 +202,7 @@ sap.ui.define([
202
202
  /**
203
203
  * Returns whether the dialog to select a transport should be started.
204
204
  *
205
- * @param {object} oTransports- Available transports
205
+ * @param {object} oTransports - Available transports
206
206
  * @param {boolean} bATOActive - Indicates whether the system is using ATO_NOTIFICATION or not
207
207
  * @returns {boolean} <code>true</code> if the LREP object is already locked in one of the transports, <code>false</code> otherwise
208
208
  * @private
@@ -303,7 +303,8 @@ sap.ui.define([
303
303
  * Opens the transport selection dialog
304
304
  *
305
305
  * @param {sap.ui.fl.Change} [oChange] - Change for which the transport information should be retrieved
306
- * @param {object} oControl- Object of the root control for the transport dialog
306
+ * @param {object} oControl - Object of the root control for the transport dialog
307
+ * @param {string} sStyleClass - CSS style class that should be added to any dialogs
307
308
  * @returns {Promise} Promise that resolves
308
309
  * @public
309
310
  */
@@ -3,7 +3,6 @@
3
3
  * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
- /*global Promise */
7
6
 
8
7
  sap.ui.define([
9
8
  "sap/ui/fl/initial/_internal/connectors/LrepConnector",
@@ -28,7 +27,7 @@ sap.ui.define([
28
27
  * Entity that handles ABAP transport related information.
29
28
  * @alias sap.ui.fl.write._internal.transport.Transports
30
29
  * @author SAP SE
31
- * @version 1.96.5
30
+ * @version 1.99.0
32
31
  * @since 1.74.0
33
32
  * @private
34
33
  * @ui5-restricted sap.ui.fl.write._internal.transport
@@ -5,16 +5,28 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/fl/ControlPersonalizationAPI",
8
+ "sap/base/Log",
9
+ "sap/ui/core/util/reflection/JsControlTreeModifier",
10
+ "sap/ui/core/Core",
11
+ "sap/ui/core/Element",
12
+ "sap/ui/fl/apply/_internal/controlVariants/Utils",
13
+ "sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
14
+ "sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage",
15
+ "sap/ui/fl/registry/Settings",
9
16
  "sap/ui/fl/FlexControllerFactory",
10
17
  "sap/ui/fl/Layer",
11
- "sap/ui/fl/registry/Settings",
12
18
  "sap/ui/fl/Utils"
13
19
  ], function(
14
- OldControlPersonalizationAPI,
20
+ Log,
21
+ JsControlTreeModifier,
22
+ Core,
23
+ Element,
24
+ VariantUtils,
25
+ FlexRuntimeInfoAPI,
26
+ ChangeHandlerStorage,
27
+ Settings,
15
28
  FlexControllerFactory,
16
29
  Layer,
17
- Settings,
18
30
  Utils
19
31
  ) {
20
32
  "use strict";
@@ -29,6 +41,52 @@ sap.ui.define([
29
41
  * @ui5-restricted UI5 controls that allow personalization
30
42
  */
31
43
 
44
+ var mChangeCreationListeners = {};
45
+
46
+ function checkChangeSpecificData(oChange, sLayer) {
47
+ if (!oChange.changeSpecificData) {
48
+ return Promise.reject(new Error("No changeSpecificData available"));
49
+ }
50
+ if (!oChange.changeSpecificData.changeType) {
51
+ return Promise.reject(new Error("No valid changeType"));
52
+ }
53
+
54
+ if (!(oChange.selectorControl instanceof Element)) {
55
+ return Promise.reject(new Error("No valid selectorControl"));
56
+ }
57
+
58
+ var sControlType = oChange.selectorControl.getMetadata().getName();
59
+ return ChangeHandlerStorage.getChangeHandler(
60
+ oChange.changeSpecificData.changeType,
61
+ sControlType,
62
+ oChange.selectorControl,
63
+ JsControlTreeModifier,
64
+ sLayer
65
+ );
66
+ }
67
+
68
+ function getRelevantVariantManagementReference(oAppComponent, oControl, bUseStaticArea) {
69
+ var sVMControlId = VariantUtils.getRelevantVariantManagementControlId(oControl, [], bUseStaticArea);
70
+ return JsControlTreeModifier.getSelector(sVMControlId, oAppComponent).id;
71
+ }
72
+
73
+ function getAllVariantManagementReferences(oAppComponent) {
74
+ var aVMControlIds = VariantUtils.getAllVariantManagementControlIds(oAppComponent);
75
+ return aVMControlIds.reduce(function(aValidIds, sVMControlId) {
76
+ var oForControls = Core.byId(sVMControlId).getFor();
77
+ // without any referenced controls the VM control is not active and should be ignored
78
+ if (oForControls.length) {
79
+ aValidIds.push(JsControlTreeModifier.getSelector(sVMControlId, oAppComponent).id);
80
+ }
81
+ return aValidIds;
82
+ }, []);
83
+ }
84
+
85
+ function logAndReject(sMessage) {
86
+ Log.error(sMessage);
87
+ return Promise.reject(sMessage);
88
+ }
89
+
32
90
  /**
33
91
  * Object containing attributes of a change, along with the control to which this change should be applied.
34
92
  *
@@ -43,7 +101,6 @@ sap.ui.define([
43
101
  */
44
102
 
45
103
  var ControlPersonalizationWriteAPI = /** @lends sap.ui.fl.write.api.ControlPersonalizationWriteAPI */{
46
-
47
104
  /**
48
105
  * Creates personalization changes, adds them to the flex persistence (not yet saved) and applies them to the control.
49
106
  *
@@ -57,12 +114,88 @@ sap.ui.define([
57
114
  * @ui5-restricted
58
115
  */
59
116
  add: function(mPropertyBag) {
60
- mPropertyBag.changes.forEach(function(oPersonalizationChange) {
61
- oPersonalizationChange.selectorControl = oPersonalizationChange.selectorElement;
62
- });
63
- // old API is still using the old name
64
- mPropertyBag.controlChanges = mPropertyBag.changes;
65
- return OldControlPersonalizationAPI.addPersonalizationChanges(mPropertyBag);
117
+ if (!mPropertyBag.changes.length) {
118
+ return Promise.resolve([]);
119
+ }
120
+ var oReferenceControl = (
121
+ mPropertyBag.changes[0].selectorElement
122
+ || mPropertyBag.changes[0].selectorControl
123
+ );
124
+ var oAppComponent = Utils.getAppComponentForControl(oReferenceControl);
125
+ var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oReferenceControl});
126
+ var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
127
+ var oVariantModel = oAppComponent.getModel(Utils.VARIANT_MODEL_NAME);
128
+ var sLayer = Layer.USER;
129
+ var aSuccessfulChanges = [];
130
+
131
+ function createChanges() {
132
+ var aAddedChanges = [];
133
+ return mPropertyBag.changes.reduce(function(pPromise, oPersonalizationChange) {
134
+ return pPromise
135
+ .then(function() {
136
+ oPersonalizationChange.selectorControl = oPersonalizationChange.selectorElement;
137
+ return checkChangeSpecificData(oPersonalizationChange, sLayer);
138
+ })
139
+ .then(function() {
140
+ if (!mPropertyBag.ignoreVariantManagement) {
141
+ // check for preset variantReference
142
+ if (!oPersonalizationChange.changeSpecificData.variantReference) {
143
+ var sVariantManagementReference = getRelevantVariantManagementReference(oAppComponent, oPersonalizationChange.selectorControl, mPropertyBag.useStaticArea);
144
+ if (sVariantManagementReference) {
145
+ var sCurrentVariantReference = oVariantModel.oData[sVariantManagementReference].currentVariant;
146
+ oPersonalizationChange.changeSpecificData.variantReference = sCurrentVariantReference;
147
+ }
148
+ }
149
+ } else {
150
+ // delete preset variantReference
151
+ delete oPersonalizationChange.changeSpecificData.variantReference;
152
+ }
153
+
154
+ oPersonalizationChange.changeSpecificData = Object.assign(oPersonalizationChange.changeSpecificData, {developerMode: false, layer: sLayer});
155
+ return oFlexController.addChange(oPersonalizationChange.changeSpecificData, oPersonalizationChange.selectorControl);
156
+ })
157
+ .then(function(oAddedChange) {
158
+ aAddedChanges.push({
159
+ changeInstance: oAddedChange,
160
+ selectorControl: oPersonalizationChange.selectorControl
161
+ });
162
+ })
163
+ .catch(function(oError) {
164
+ Log.error("A Change was not added successfully. Reason:", oError.message);
165
+ });
166
+ }, Promise.resolve())
167
+ .then(function() {
168
+ return aAddedChanges;
169
+ });
170
+ }
171
+
172
+ function applyChanges(aAddedChanges) {
173
+ return aAddedChanges.reduce(function(pPromise, oAddedChange) {
174
+ return pPromise
175
+ .then(function() {
176
+ return oFlexController.applyChange(oAddedChange.changeInstance, oAddedChange.selectorControl);
177
+ })
178
+ .then(function(oAppliedChange) {
179
+ aSuccessfulChanges.push(oAppliedChange);
180
+ })
181
+ .catch(function(oError) {
182
+ Log.error("A Change was not applied successfully. Reason:", oError.message);
183
+ });
184
+ }, Promise.resolve());
185
+ }
186
+
187
+ // Make sure to first create and add all changes so that change handlers
188
+ // that rely on change batching in the applier can wait for them, e.g.
189
+ // when adding multiple columns at once to a MDC table
190
+ return createChanges()
191
+ .then(applyChanges)
192
+ .then(function() {
193
+ (mChangeCreationListeners[sFlexReference] || [])
194
+ .forEach(function(fnCallback) {
195
+ fnCallback(aSuccessfulChanges);
196
+ });
197
+ return aSuccessfulChanges;
198
+ });
66
199
  },
67
200
 
68
201
  /**
@@ -70,7 +203,7 @@ sap.ui.define([
70
203
  *
71
204
  * @param {object} mPropertyBag - Object with parameters as properties
72
205
  * @param {sap.ui.fl.Selector[]} mPropertyBag.selectors - Array of selectors, at least one selector is necessary
73
- * @param {String[]} [mPropertyBag.changeTypes] - Types of changes to be deleted
206
+ * @param {string[]} [mPropertyBag.changeTypes] - Types of changes to be deleted
74
207
  *
75
208
  * @returns {Promise} Promise that resolves after the deletion took place and changes are reverted
76
209
  *
@@ -78,8 +211,22 @@ sap.ui.define([
78
211
  * @ui5-restricted
79
212
  */
80
213
  reset: function(mPropertyBag) {
81
- mPropertyBag.selectors = mPropertyBag.selectors || [];
82
- return OldControlPersonalizationAPI.resetChanges(mPropertyBag.selectors, mPropertyBag.changeTypes);
214
+ if (!mPropertyBag.selectors || mPropertyBag.selectors.length === 0) {
215
+ return logAndReject("At least one control ID has to be provided as a parameter");
216
+ }
217
+
218
+ var oAppComponent = mPropertyBag.selectors[0].appComponent || Utils.getAppComponentForControl(mPropertyBag.selectors[0]);
219
+ if (!oAppComponent) {
220
+ return logAndReject("App Component could not be determined");
221
+ }
222
+
223
+ var aSelectorIds = mPropertyBag.selectors.map(function (vControl) {
224
+ var sControlId = vControl.id || vControl.getId();
225
+ var sLocalId = oAppComponent.getLocalId(sControlId);
226
+ return sLocalId || sControlId;
227
+ });
228
+ var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
229
+ return oFlexController.resetChanges(Layer.USER, undefined, oAppComponent, aSelectorIds, mPropertyBag.changeTypes);
83
230
  },
84
231
 
85
232
  /**
@@ -117,7 +264,7 @@ sap.ui.define([
117
264
  *
118
265
  * @param {object} mPropertyBag - Object with parameters as properties
119
266
  * @param {sap.ui.fl.Selector} mPropertyBag.selector - Selector
120
- * @param {String[]} [mPropertyBag.changes] - Array of changes to be saved; if not provided, all unsaved changes will be saved
267
+ * @param {string[]} [mPropertyBag.changes] - Array of changes to be saved; if not provided, all unsaved changes will be saved
121
268
  *
122
269
  * @returns {Promise} Promise that is resolved when the changes have been saved
123
270
  *
@@ -126,7 +273,17 @@ sap.ui.define([
126
273
  */
127
274
  save: function(mPropertyBag) {
128
275
  var oAppComponent = mPropertyBag.selector.appComponent || Utils.getAppComponentForControl(mPropertyBag.selector);
129
- return OldControlPersonalizationAPI.saveChanges(mPropertyBag.changes, oAppComponent);
276
+ if (!oAppComponent) {
277
+ return logAndReject("App Component could not be determined");
278
+ }
279
+ var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
280
+ var oVariantModel = oAppComponent.getModel(Utils.VARIANT_MODEL_NAME);
281
+ var aVariantManagementReferences = getAllVariantManagementReferences(oAppComponent);
282
+ return oFlexController.saveSequenceOfDirtyChanges(mPropertyBag.changes, oAppComponent)
283
+ .then(function(oResponse) {
284
+ oVariantModel.checkDirtyStateForControlModels(aVariantManagementReferences);
285
+ return oResponse;
286
+ });
130
287
  },
131
288
 
132
289
  /**
@@ -167,6 +324,53 @@ sap.ui.define([
167
324
  .then(function (oSettings) {
168
325
  return oSettings.isCondensingEnabled(Layer.USER);
169
326
  });
327
+ },
328
+
329
+ /**
330
+ * Registers the provided callback function to be called when personalization changes are
331
+ * added for the flex reference that the given control belongs to.
332
+ *
333
+ * @param {sap.ui.core.Control} oControl - Reference control to get the flex reference
334
+ * @param {function} fnCallback - Function to be called on change creation
335
+ * @private
336
+ * @sapui5-restricted sap.ui.rta
337
+ */
338
+ attachChangeCreation: function(oControl, fnCallback) {
339
+ var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oControl});
340
+ mChangeCreationListeners[sFlexReference] = (mChangeCreationListeners[sFlexReference] || []).concat(fnCallback);
341
+ },
342
+
343
+ /**
344
+ * Removes a previously registered callback function by reference.
345
+ *
346
+ * @param {sap.ui.core.Control} oControl - Reference control to get the flex reference
347
+ * @param {function} fnCallback - Function reference to be removed
348
+ * @private
349
+ * @sapui5-restricted sap.ui.rta
350
+ */
351
+ detachChangeCreation: function(oControl, fnCallback) {
352
+ var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oControl});
353
+ if (Array.isArray(mChangeCreationListeners[sFlexReference])) {
354
+ mChangeCreationListeners[sFlexReference] = mChangeCreationListeners[sFlexReference].filter(function(fnRegisteredCallback) {
355
+ return fnRegisteredCallback !== fnCallback;
356
+ });
357
+ }
358
+ },
359
+
360
+ /**
361
+ * Removes all registered change creation listeners.
362
+ *
363
+ * @param {sap.ui.core.Control} [oControl] - When provided, listeners are only removed for the flex reference of the given control
364
+ * @private
365
+ * @sapui5-restricted sap.ui.rta
366
+ */
367
+ detachAllChangeCreationListeners: function(oControl) {
368
+ if (oControl) {
369
+ var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oControl});
370
+ delete mChangeCreationListeners[sFlexReference];
371
+ } else {
372
+ mChangeCreationListeners = {};
373
+ }
170
374
  }
171
375
  };
172
376
 
@@ -37,7 +37,10 @@ sap.ui.define([
37
37
  */
38
38
  isPublishAvailable: function () {
39
39
  return Settings.getInstance().then(function (oSettings) {
40
- return !oSettings.isProductiveSystem();
40
+ return (
41
+ !oSettings.isProductiveSystem()
42
+ && oSettings.isSystemWithTransports()
43
+ );
41
44
  });
42
45
  },
43
46
 
@@ -101,6 +104,7 @@ sap.ui.define([
101
104
  /**
102
105
  * Checks if key user has also the admin role to enable the translation button
103
106
  *
107
+ * @param {sap.ui.fl.Layer} sLayer - Current layer
104
108
  * @returns {Promise<boolean>} Resolves to a boolean indicating if they keyuser is also admin
105
109
  * @public
106
110
  */
@@ -115,13 +119,16 @@ sap.ui.define([
115
119
  },
116
120
 
117
121
  /**
118
- * Checks if context sharing is enbaled.
122
+ * Checks if context sharing is enabled.
119
123
  *
120
124
  * @param {string} sLayer - Layer to get correct connector
121
125
  * @returns {Promise<boolean>} Resolves to a boolean indicating if context sharing is enabled
122
126
  * @public
123
127
  */
124
128
  isContextSharingEnabled: function (sLayer) {
129
+ if (sLayer !== Layer.CUSTOMER) {
130
+ return Promise.resolve(false);
131
+ }
125
132
  return Storage.isContextSharingEnabled({layer: sLayer});
126
133
  }
127
134
  };
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @namespace sap.ui.fl.write.api.FieldExtensibility
26
26
  * @since 1.87
27
- * @version 1.96.5
27
+ * @version 1.99.0
28
28
  * @private
29
29
  * @ui5-restricted sap.ui.fl, sap.ui.rta
30
30
  */
@@ -68,6 +68,7 @@ sap.ui.define([
68
68
  * Until this function is called again the control does not change and information can be cached.
69
69
  *
70
70
  * @param {sap.ui.base.ManagedObject} oControl - Control instance that was selected
71
+ * @returns {Promise} Resolves with the return value of the function in the implementation
71
72
  */
72
73
  FieldExtensibility.onControlSelected = function(oControl) {
73
74
  return callFunctionInImplementation("onControlSelected", oControl);
@@ -97,6 +98,7 @@ sap.ui.define([
97
98
  * Removes the flag that identifies the service as outdated.
98
99
  *
99
100
  * @param {string|map} vServiceInfo - service uri or service info map containing <code>serviceName</code>, <code>serviceVersion</code> and <code>serviceType</code>
101
+ * @returns {Promise} Resolves with the return value of the function in the implementation
100
102
  */
101
103
  FieldExtensibility.setServiceValid = function(vServiceInfo) {
102
104
  return callFunctionInImplementation("setServiceValid", vServiceInfo);
@@ -105,7 +107,7 @@ sap.ui.define([
105
107
  /**
106
108
  * Retrieves the necessary texts.
107
109
  *
108
- * @returns {object} - Object with <code>tooltip</code> and <code>headerText</code>
110
+ * @returns {Promise<object>} - Object with <code>tooltip</code> and <code>headerText</code>
109
111
  */
110
112
  FieldExtensibility.getTexts = function() {
111
113
  return callFunctionInImplementation("getTexts");
@@ -114,7 +116,7 @@ sap.ui.define([
114
116
  /**
115
117
  * Retrieves the extension data.
116
118
  *
117
- * @returns {Object} All necessary information about the extension data. This will be passed to <code>FieldExtensibility.onTriggerCreateExtensionData</code>
119
+ * @returns {Promise<object>} All necessary information about the extension data. This will be passed to <code>FieldExtensibility.onTriggerCreateExtensionData</code>
118
120
  */
119
121
  FieldExtensibility.getExtensionData = function() {
120
122
  // TODO: currently the return value must be an object that includes .BusinessContexts in order to be shown in the Dialog.
@@ -126,6 +128,8 @@ sap.ui.define([
126
128
  * Handler for the button to trigger extension data creation.
127
129
  *
128
130
  * @param {object} oExtensibilityInfo - Information about the extension data. Should be the return value of <code>FieldExtensibility.getExtensionData</code>
131
+ * @param {string} sRtaStyleClassName - CSS style class that should be added to any dialogs
132
+ * @returns {Promise} Resolves with the return value of the function in the implementation
129
133
  */
130
134
  FieldExtensibility.onTriggerCreateExtensionData = function(oExtensibilityInfo, sRtaStyleClassName) {
131
135
  return callFunctionInImplementation("onTriggerCreateExtensionData", oExtensibilityInfo, sRtaStyleClassName);
@@ -17,7 +17,8 @@ sap.ui.define([
17
17
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
18
18
  "sap/ui/fl/write/api/FeaturesAPI",
19
19
  "sap/ui/fl/Layer",
20
- "sap/ui/fl/LayerUtils"
20
+ "sap/ui/fl/LayerUtils",
21
+ "sap/ui/fl/registry/Settings"
21
22
  ], function(
22
23
  includes,
23
24
  _omit,
@@ -31,7 +32,8 @@ sap.ui.define([
31
32
  ManifestUtils,
32
33
  FeaturesAPI,
33
34
  Layer,
34
- LayerUtils
35
+ LayerUtils,
36
+ Settings
35
37
  ) {
36
38
  "use strict";
37
39
 
@@ -235,6 +237,7 @@ sap.ui.define([
235
237
  * @param {object} mPropertyBag - Object with parameters as properties
236
238
  * @param {sap.ui.fl.Change} mPropertyBag.change - Change instance
237
239
  * @param {sap.ui.fl.Selector} mPropertyBag.selector - To retrieve the associated flex persistence
240
+ * @returns {sap.ui.fl.Change} The change instance
238
241
  *
239
242
  * @private
240
243
  * @ui5-restricted
@@ -287,6 +290,41 @@ sap.ui.define([
287
290
  });
288
291
  };
289
292
 
293
+ /**
294
+ * Decides which warning should be shown if changes were made
295
+ * in a different system or in a P system with no changes at all.
296
+ *
297
+ * @param {object} mPropertyBag - Object with parameters as properties
298
+ * @param {sap.ui.fl.Selector} mPropertyBag.selector - Retrieves the associated flex persistence
299
+ * @param {string} [mPropertyBag.layer] - Layer for which changes are to be deleted
300
+ * @param {string} [mPropertyBag.generator] - Generator of changes
301
+ * @param {string[]} [mPropertyBag.selectorIds] - Selector IDs in local format
302
+ * @param {string[]} [mPropertyBag.changeTypes] - Types of changes
303
+ * @returns {Promise} Resolves with object that decides if warning should be shown
304
+ *
305
+ */
306
+ PersistenceWriteAPI.getChangesWarning = function (mPropertyBag) {
307
+ return this._getUIChanges(mPropertyBag).then(function (aChanges) {
308
+ var bHasChangesFromOtherSystem = aChanges.some(function (oChange) {
309
+ return oChange.isChangeFromOtherSystem();
310
+ });
311
+
312
+ var oSettingsInstance = Settings.getInstanceOrUndef();
313
+ var isProductiveSystemWithTransports = oSettingsInstance && oSettingsInstance.isProductiveSystemWithTransports();
314
+ var bHasNoChanges = aChanges.length === 0;
315
+ var oChangesWarning = {showWarning: false};
316
+
317
+ if (bHasChangesFromOtherSystem) {
318
+ oChangesWarning = {showWarning: true, warningType: "mixedChangesWarning"};
319
+ }
320
+
321
+ if (isProductiveSystemWithTransports && bHasNoChanges) {
322
+ oChangesWarning = {showWarning: true, warningType: "noChangesAndPSystemWarning"};
323
+ }
324
+ return oChangesWarning;
325
+ });
326
+ };
327
+
290
328
  /**
291
329
  * Calls the Condenser with all the passed changes.
292
330
  * ATTENTION: Only to be used by sap.ui.rta.test
@@ -323,7 +361,7 @@ sap.ui.define([
323
361
  * @param {string} [mPropertyBag.siteId] - ID of the site belonging to the current running component
324
362
  * @param {string} [mPropertyBag.layer] - Specifies a single layer for loading change; if this parameter is set, the max layer filtering is not applied
325
363
  * @param {boolean} [mPropertyBag.ignoreMaxLayerParameter] - Indicates that changes are to be loaded without layer filtering
326
- * @param {boolean} [mPropertyBag.includeVariants] - Indicates that smart variants are to be included
364
+ * @param {boolean} [mPropertyBag.includeCtrlVariants] - Flag if control variant changes should be included
327
365
  * @param {boolean} [mPropertyBag.includeDirtyChanges] - Flag if dirty UI changes should be included
328
366
  * @param {string} [mPropertyBag.cacheKey] - Key to validate the cache entry stored on client side
329
367
  * @param {boolean} [mPropertyBag.invalidateCache] - Indicates whether the cache is to be invalidated
@@ -232,7 +232,7 @@ sap.ui.define([
232
232
  */
233
233
  initialDraftGotActivated: function(oReloadInfo) {
234
234
  if (oReloadInfo.versioningEnabled) {
235
- var bUrlHasVersionParameter = this.hasVersionParameterWithValue({value: sap.ui.fl.Versions.Draft.toString()}, oReloadInfo.URLParsingService);
235
+ var bUrlHasVersionParameter = this.hasVersionParameterWithValue({value: sap.ui.fl.Versions.Draft}, oReloadInfo.URLParsingService);
236
236
  return !VersionsAPI.isDraftAvailable(oReloadInfo) && bUrlHasVersionParameter;
237
237
  }
238
238
  return false;
@@ -262,10 +262,10 @@ sap.ui.define([
262
262
 
263
263
  // TODO fix app descriptor handling and reload behavior
264
264
  // TODO move changesNeedReload near flexState; set flag when saving change that needs a reload
265
- oReloadInfo.isDraftAvailable = oReloadInfo.isDraftAvailable || ReloadInfoAPI.hasVersionParameterWithValue({value: sap.ui.fl.Versions.Draft.toString()}, oReloadInfo.URLParsingService);
265
+ oReloadInfo.isDraftAvailable = oReloadInfo.isDraftAvailable || ReloadInfoAPI.hasVersionParameterWithValue({value: sap.ui.fl.Versions.Draft}, oReloadInfo.URLParsingService);
266
266
 
267
- if (oReloadInfo.activeVersion > sap.ui.fl.Versions.Original) {
268
- oReloadInfo.activeVersionNotSelected = oReloadInfo.activeVersion && !ReloadInfoAPI.hasVersionParameterWithValue({value: oReloadInfo.activeVersion.toString()}, oReloadInfo.URLParsingService);
267
+ if (oReloadInfo.activeVersion !== sap.ui.fl.Versions.Original) {
268
+ oReloadInfo.activeVersionNotSelected = oReloadInfo.activeVersion && !ReloadInfoAPI.hasVersionParameterWithValue({value: oReloadInfo.activeVersion}, oReloadInfo.URLParsingService);
269
269
  }
270
270
  oReloadInfo.hasHigherLayerChanges = ReloadInfoAPI.hasMaxLayerParameterWithValue({value: oReloadInfo.layer}, oReloadInfo.URLParsingService);
271
271
  oReloadInfo.initialDraftGotActivated = ReloadInfoAPI.initialDraftGotActivated(oReloadInfo);
@@ -92,6 +92,7 @@ sap.ui.define([
92
92
  * @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the variant removal takes place
93
93
  * @param {boolean} [mPropertyBag.changeSpecificData.isUserDependent] - Flag if the variant is personalization only
94
94
  * this either updates the variant from the layer or writes a change to that layer.
95
+ * @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant
95
96
  * @private
96
97
  * @ui5-restricted sap.ui.rta.command, sap.ui.comp.smartvariants.SmartVariantManagement
97
98
  */
@@ -112,6 +113,7 @@ sap.ui.define([
112
113
  * @param {string} mPropertyBag.id - ID of the variant
113
114
  * @param {sap.ui.fl.Layer} mPropertyBag.layer - Layer in which the variant removal takes place;
114
115
  * this either removes the variant from the layer or writes a change to that layer.
116
+ * @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The removed variant
115
117
  * @private
116
118
  * @ui5-restricted sap.ui.rta.command
117
119
  */