@openui5/sap.ui.fl 1.114.0 → 1.115.1

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 (209) hide show
  1. package/.reuse/dep5 +0 -5
  2. package/THIRDPARTY.txt +0 -6
  3. package/package.json +3 -3
  4. package/src/sap/ui/fl/.library +1 -1
  5. package/src/sap/ui/fl/Cache.js +39 -21
  6. package/src/sap/ui/fl/ChangePersistence.js +14 -21
  7. package/src/sap/ui/fl/ChangePersistenceFactory.js +3 -55
  8. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  9. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  10. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  11. package/src/sap/ui/fl/FlexController.js +5 -22
  12. package/src/sap/ui/fl/FlexControllerFactory.js +7 -159
  13. package/src/sap/ui/fl/LayerUtils.js +1 -1
  14. package/src/sap/ui/fl/Utils.js +2 -11
  15. package/src/sap/ui/fl/apply/_internal/ChangesController.js +0 -2
  16. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +8 -7
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.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 +4 -12
  41. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +3 -2
  48. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +8 -1
  49. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +25 -27
  51. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +104 -80
  52. package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +34 -15
  53. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  56. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  58. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  59. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -2
  60. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +300 -386
  61. package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +219 -0
  62. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  63. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  64. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +7 -9
  65. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  66. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/MoveControls.js +6 -1
  76. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  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/initial/_internal/Storage.js +3 -1
  87. package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +3 -22
  88. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  89. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +2 -3
  90. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  91. package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +1 -0
  92. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  93. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  94. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  95. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  96. package/src/sap/ui/fl/library.js +43 -43
  97. package/src/sap/ui/fl/messagebundle.properties +6 -0
  98. package/src/sap/ui/fl/messagebundle_ar.properties +4 -0
  99. package/src/sap/ui/fl/messagebundle_bg.properties +6 -2
  100. package/src/sap/ui/fl/messagebundle_ca.properties +4 -0
  101. package/src/sap/ui/fl/messagebundle_cs.properties +4 -0
  102. package/src/sap/ui/fl/messagebundle_cy.properties +4 -0
  103. package/src/sap/ui/fl/messagebundle_da.properties +4 -0
  104. package/src/sap/ui/fl/messagebundle_de.properties +6 -2
  105. package/src/sap/ui/fl/messagebundle_el.properties +4 -0
  106. package/src/sap/ui/fl/messagebundle_en.properties +4 -0
  107. package/src/sap/ui/fl/messagebundle_en_GB.properties +4 -0
  108. package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +4 -0
  109. package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +4 -0
  110. package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +4 -0
  111. package/src/sap/ui/fl/messagebundle_es.properties +4 -0
  112. package/src/sap/ui/fl/messagebundle_es_MX.properties +4 -0
  113. package/src/sap/ui/fl/messagebundle_et.properties +4 -0
  114. package/src/sap/ui/fl/messagebundle_fi.properties +4 -0
  115. package/src/sap/ui/fl/messagebundle_fr.properties +4 -0
  116. package/src/sap/ui/fl/messagebundle_fr_CA.properties +4 -0
  117. package/src/sap/ui/fl/messagebundle_hi.properties +4 -0
  118. package/src/sap/ui/fl/messagebundle_hr.properties +4 -0
  119. package/src/sap/ui/fl/messagebundle_hu.properties +4 -0
  120. package/src/sap/ui/fl/messagebundle_id.properties +4 -0
  121. package/src/sap/ui/fl/messagebundle_it.properties +4 -0
  122. package/src/sap/ui/fl/messagebundle_iw.properties +4 -0
  123. package/src/sap/ui/fl/messagebundle_ja.properties +12 -8
  124. package/src/sap/ui/fl/messagebundle_kk.properties +4 -0
  125. package/src/sap/ui/fl/messagebundle_ko.properties +4 -0
  126. package/src/sap/ui/fl/messagebundle_lt.properties +4 -0
  127. package/src/sap/ui/fl/messagebundle_lv.properties +4 -0
  128. package/src/sap/ui/fl/messagebundle_ms.properties +4 -0
  129. package/src/sap/ui/fl/messagebundle_nl.properties +4 -0
  130. package/src/sap/ui/fl/messagebundle_no.properties +4 -0
  131. package/src/sap/ui/fl/messagebundle_pl.properties +4 -0
  132. package/src/sap/ui/fl/messagebundle_pt.properties +4 -0
  133. package/src/sap/ui/fl/messagebundle_pt_PT.properties +4 -0
  134. package/src/sap/ui/fl/messagebundle_ro.properties +4 -0
  135. package/src/sap/ui/fl/messagebundle_ru.properties +4 -0
  136. package/src/sap/ui/fl/messagebundle_sh.properties +4 -0
  137. package/src/sap/ui/fl/messagebundle_sk.properties +4 -0
  138. package/src/sap/ui/fl/messagebundle_sl.properties +4 -0
  139. package/src/sap/ui/fl/messagebundle_sv.properties +4 -0
  140. package/src/sap/ui/fl/messagebundle_th.properties +5 -1
  141. package/src/sap/ui/fl/messagebundle_tr.properties +4 -0
  142. package/src/sap/ui/fl/messagebundle_uk.properties +4 -0
  143. package/src/sap/ui/fl/messagebundle_vi.properties +4 -0
  144. package/src/sap/ui/fl/messagebundle_zh_CN.properties +4 -0
  145. package/src/sap/ui/fl/messagebundle_zh_TW.properties +4 -0
  146. package/src/sap/ui/fl/registry/Settings.js +10 -0
  147. package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +1 -1
  148. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  149. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  150. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  151. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  152. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  153. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  154. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  155. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  156. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  157. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  158. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  159. package/src/sap/ui/fl/util/IFrame.js +1 -1
  160. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  161. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  162. package/src/sap/ui/fl/variants/VariantModel.js +124 -338
  163. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  164. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  165. package/src/sap/ui/fl/write/_internal/Versions.js +134 -111
  166. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  167. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  168. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  169. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  170. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +35 -8
  171. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +17 -2
  172. package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +8 -5
  173. package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +6 -0
  174. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  175. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +34 -4
  176. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  177. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  178. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  179. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  180. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  181. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  182. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  183. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  184. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  185. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  186. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  187. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  188. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  189. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  190. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  191. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  192. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  193. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  194. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  195. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  196. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +11 -7
  197. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +12 -11
  198. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  199. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  200. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +87 -27
  201. package/src/sap/ui/fl/write/api/ContextSharingAPI.js +7 -1
  202. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +1 -23
  203. package/src/sap/ui/fl/write/api/FeaturesAPI.js +5 -5
  204. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  205. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +4 -3
  206. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +10 -1
  207. package/src/sap/ui/fl/write/api/TranslationAPI.js +1 -1
  208. package/src/sap/ui/fl/write/api/VersionsAPI.js +70 -21
  209. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/prepareVariantsMap.js +0 -356
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  *
29
29
  * @namespace sap.ui.fl.write._internal.connectors.PersonalizationConnector
30
30
  * @since 1.70
31
- * @version 1.114.0
31
+ * @version 1.115.1
32
32
  * @private
33
33
  * @ui5-restricted sap.ui.fl.write._internal.Storage
34
34
  */
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  *
17
17
  * @namespace sap.ui.fl.write._internal.connectors.Utils
18
18
  * @since 1.70
19
- * @version 1.114.0
19
+ * @version 1.115.1
20
20
  * @private
21
21
  * @ui5-restricted sap.ui.fl.write._internal.connectors, sap.ui.fl.write._internal.transport
22
22
  */
@@ -28,7 +28,7 @@ function(
28
28
  * @class
29
29
  * @constructor
30
30
  * @author SAP SE
31
- * @version 1.114.0
31
+ * @version 1.115.1
32
32
  */
33
33
  var Processor = {
34
34
  applyExtensionPoint: function(oExtensionPoint) {
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @alias sap.ui.fl.write._internal.extensionPoint.Registry
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.114.0
23
+ * @version 1.115.1
24
24
  *
25
25
  * @private
26
26
  * @ui5-restricted sap.ui.fl
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPAccess
41
41
  * @experimental Since 1.87.0
42
42
  * @author SAP SE
43
- * @version 1.114.0
43
+ * @version 1.115.1
44
44
  */
45
45
  var ABAPAccess = {};
46
46
 
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @class
18
18
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariant
19
19
  * @since 1.87
20
- * @version 1.114.0
20
+ * @version 1.115.1
21
21
  * @public
22
22
  * @param {sap.ui.base.ManagedObject} oControl - Control to add extensions
23
23
  */
@@ -117,7 +117,7 @@ sap.ui.define([
117
117
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariantFactory
118
118
  * @experimental Since 1.87.0
119
119
  * @author SAP SE
120
- * @version 1.114.0
120
+ * @version 1.115.1
121
121
  */
122
122
  var ABAPExtensibilityVariantFactory = {};
123
123
 
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.MultiTenantABAPExtensibilityVariant
26
26
  * @since 1.87
27
- * @version 1.114.0
27
+ * @version 1.115.1
28
28
  * @public
29
29
  */
30
30
 
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.ServiceValidation
20
20
  * @experimental Since 1.87.0
21
21
  * @author SAP SE
22
- * @version 1.114.0
22
+ * @version 1.115.1
23
23
  */
24
24
  var ServiceValidation = {};
25
25
 
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  *
44
44
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.SingleTenantABAPExtensibilityVariant
45
45
  * @since 1.87
46
- * @version 1.114.0
46
+ * @version 1.115.1
47
47
  * @public
48
48
  */
49
49
 
@@ -134,7 +134,7 @@ sap.ui.define([
134
134
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.UriParser
135
135
  * @experimental Since 1.87.0
136
136
  * @author SAP SE
137
- * @version 1.114.0
137
+ * @version 1.115.1
138
138
  */
139
139
  var UriParser = {};
140
140
 
@@ -249,7 +249,7 @@ sap.ui.define([
249
249
  * @namespace sap.ui.fl.write._internal.fieldExtensibility.Utils
250
250
  * @experimental Since 1.87.0
251
251
  * @author SAP SE
252
- * @version 1.114.0
252
+ * @version 1.115.1
253
253
  */
254
254
  var Utils = {};
255
255
 
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @experimental Since 1.93
23
23
  * @private
24
24
  * @author SAP SE
25
- * @version 1.114.0
25
+ * @version 1.115.1
26
26
  */
27
27
  var CAPAccess = {};
28
28
 
@@ -80,7 +80,7 @@ sap.ui.define([
80
80
  * @extends sap.ui.base.ManagedObject
81
81
  * @alias sap.ui.fl.write._internal.fieldExtensibility.cap.dialog.CustomFieldCAPDialog
82
82
  * @author SAP SE
83
- * @version 1.114.0
83
+ * @version 1.115.1
84
84
  * @since 1.93
85
85
  * @experimental Since 1.93
86
86
  * @private
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * @alias sap.ui.fl.write._internal.fieldExtensibility.cap.editor.propertyEditor.booleanEditor.BooleanEditor
19
19
  * @author SAP SE
20
20
  * @since 1.93
21
- * @version 1.114.0
21
+ * @version 1.115.1
22
22
  *
23
23
  * @private
24
24
  * @experimental 1.93
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @alias sap.ui.fl.write._internal.fieldExtensibility.cap.editor.propertyEditor.rangeEditor.RangeEditor
21
21
  * @author SAP SE
22
22
  * @since 1.93
23
- * @version 1.114.0
23
+ * @version 1.115.1
24
24
  *
25
25
  * @private
26
26
  * @experimental 1.93
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @alias sap.ui.fl.write._internal.fieldExtensibility.cap.editor.propertyEditor.timeEditor.TimeEditor
23
23
  * @author SAP SE
24
24
  * @since 1.93
25
- * @version 1.114.0
25
+ * @version 1.115.1
26
26
  *
27
27
  * @private
28
28
  * @experimental 1.93
@@ -14,6 +14,7 @@ sap.ui.define([
14
14
  "sap/ui/fl/apply/_internal/ChangesController",
15
15
  "sap/ui/fl/apply/api/ControlVariantApplyAPI",
16
16
  "sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState",
17
+ "sap/ui/fl/write/_internal/Versions",
17
18
  "sap/ui/fl/ChangePersistenceFactory",
18
19
  "sap/ui/fl/LayerUtils",
19
20
  "sap/ui/fl/Utils"
@@ -27,6 +28,7 @@ sap.ui.define([
27
28
  ChangesController,
28
29
  ControlVariantApplyAPI,
29
30
  CompVariantState,
31
+ Versions,
30
32
  ChangePersistenceFactory,
31
33
  LayerUtils,
32
34
  Utils
@@ -37,7 +39,7 @@ sap.ui.define([
37
39
  * @namespace
38
40
  * @alias sap.ui.fl.write._internal.flexState.FlexObjectState
39
41
  * @since 1.83
40
- * @version 1.114.0
42
+ * @version 1.115.1
41
43
  * @private
42
44
  * @ui5-restricted sap.ui.fl
43
45
  */
@@ -45,7 +47,6 @@ sap.ui.define([
45
47
 
46
48
  function initFlexStateAndSetReference(mPropertyBag) {
47
49
  mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.selector);
48
-
49
50
  return FlexState.initialize({
50
51
  componentId: mPropertyBag.componentId || Utils.getAppComponentForControl(mPropertyBag.selector).getId(),
51
52
  reference: mPropertyBag.reference,
@@ -221,14 +222,11 @@ sap.ui.define([
221
222
  if (ChangePersistenceFactory.getChangePersistenceForComponent(sReference).getDirtyChanges().length > 0) {
222
223
  return true;
223
224
  }
224
- if (ChangePersistenceFactory.getChangePersistenceForComponent(Utils.normalizeReference(sReference)).getDirtyChanges().length > 0) {
225
- return true;
226
- }
227
225
  return CompVariantState.hasDirtyChanges(sReference);
228
226
  };
229
227
 
230
228
  /**
231
- *
229
+ * Save Flex objects and reload Flex State
232
230
  * @param {object} mPropertyBag - Object with parameters as properties
233
231
  * @param {sap.ui.fl.Selector} mPropertyBag.selector - Selector to retrieve the associated flex persistence
234
232
  * @param {object} [mPropertyBag.appDescriptor] - Manifest that belongs to the current running component
@@ -239,14 +237,20 @@ sap.ui.define([
239
237
  * @param {string} [mPropertyBag.cacheKey] - Key to validate the cache entry stored on client side
240
238
  * @param {boolean} [mPropertyBag.invalidateCache] - Indicates whether the cache is to be invalidated
241
239
  * @param {boolean} [mPropertyBag.removeOtherLayerChanges=false] - Whether to remove changes on other layers before saving
242
- * @param {boolean} [mPropertyBag.version] - Version for which the objects are saved
240
+ * @param {string} [mPropertyBag.version] - Version to load into Flex State after saving (e.g. undefined when exiting RTA)
241
+ * @param {string} [mPropertyBag.adaptationId] - Adaptation to load into Flex State after saving (e.g. undefined when exiting RTA)
243
242
  * @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
244
243
  */
245
244
  FlexObjectState.saveFlexObjects = function(mPropertyBag) {
246
245
  var oAppComponent = ChangesController.getAppComponentForSelector(mPropertyBag.selector);
246
+ mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.selector);
247
247
  return saveCompEntities(mPropertyBag)
248
248
  .then(saveChangePersistenceEntities.bind(this, mPropertyBag, oAppComponent))
249
249
  .then(function() {
250
+ if (mPropertyBag.version !== undefined && Versions.hasVersionsModel(mPropertyBag)) {
251
+ var oModel = Versions.getVersionsModel(mPropertyBag);
252
+ mPropertyBag.version = oModel.getProperty("/displayedVersion");
253
+ }
250
254
  if (mPropertyBag.layer) {
251
255
  //TODO: sync the layer parameter name with new persistence and remove this line
252
256
  mPropertyBag.currentLayer = mPropertyBag.layer;
@@ -56,7 +56,7 @@ sap.ui.define([
56
56
 
57
57
  function getPropertyFromVersionsModel(sPropertyName, mPropertyBag) {
58
58
  var mPropertyBag = {
59
- reference: Utils.normalizeReference(mPropertyBag.reference),
59
+ reference: mPropertyBag.reference,
60
60
  layer: mPropertyBag.layer
61
61
  };
62
62
  if (Versions.hasVersionsModel(mPropertyBag)) {
@@ -105,7 +105,7 @@ sap.ui.define([
105
105
 
106
106
  function updateObjectAndStorage(oFlexObject, oStoredResponse, sParentVersion) {
107
107
  return Storage.update({
108
- flexObject: oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition(),
108
+ flexObject: oFlexObject.convertToFileContent(),
109
109
  layer: oFlexObject.getLayer(),
110
110
  transport: oFlexObject.getRequest(),
111
111
  parentVersion: sParentVersion
@@ -126,7 +126,7 @@ sap.ui.define([
126
126
  }).then(function () {
127
127
  // update StorageResponse
128
128
  var aObjectArray = getSubSection(oStoredResponse.changes.comp, oFlexObject);
129
- var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
129
+ var oFileContent = oFlexObject.convertToFileContent();
130
130
  updateArrayByName(aObjectArray, oFileContent);
131
131
  return oFileContent;
132
132
  });
@@ -155,7 +155,7 @@ sap.ui.define([
155
155
  }
156
156
 
157
157
  function deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion) {
158
- var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
158
+ var oFileContent = oFlexObject.convertToFileContent();
159
159
  return Storage.remove({
160
160
  flexObject: oFileContent,
161
161
  layer: oFlexObject.getLayer(),
@@ -164,7 +164,10 @@ sap.ui.define([
164
164
  }).then(function () {
165
165
  // update CompVariantsMap
166
166
  removeFromCompVariantsMap(oFlexObject, mCompVariantsMapByPersistencyKey);
167
- }).then(function () {
167
+ }).then(Versions.updateModelFromBackend.bind(this, {
168
+ reference: oFileContent.reference,
169
+ layer: oFileContent.layer
170
+ })).then(function() {
168
171
  // update StorageResponse
169
172
  removeFromArrayById(
170
173
  getSubSection(oStoredResponse.changes.comp, oFlexObject),
@@ -272,7 +275,7 @@ sap.ui.define([
272
275
  *
273
276
  * @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
274
277
  * @since 1.83
275
- * @version 1.114.0
278
+ * @version 1.115.1
276
279
  * @private
277
280
  * @ui5-restricted sap.ui.fl
278
281
  */
@@ -805,7 +808,7 @@ sap.ui.define([
805
808
  }
806
809
  // TODO: remove this line as soon as layering and a condensing is in place
807
810
  return Storage.write({
808
- flexObjects: [oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition()],
811
+ flexObjects: [oFlexObject.convertToFileContent()],
809
812
  layer: oFlexObject.getLayer(),
810
813
  transport: oFlexObject.getRequest(),
811
814
  isLegacyVariant: oFlexObject.isVariant && oFlexObject.isVariant(),
@@ -826,7 +829,7 @@ sap.ui.define([
826
829
  }
827
830
  }).then(function () {
828
831
  // update StorageResponse
829
- var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
832
+ var oFileContent = oFlexObject.convertToFileContent();
830
833
  getSubSection(oStoredResponse.changes.comp, oFlexObject).push(oFileContent);
831
834
  return oFileContent;
832
835
  });
@@ -860,9 +863,7 @@ sap.ui.define([
860
863
  if (index === 0) {
861
864
  var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
862
865
  layer: oFlexObject.getLayer(),
863
- reference: oFlexObject.getFlexObjectMetadata ?
864
- oFlexObject.getFlexObjectMetadata().reference :
865
- oFlexObject.getDefinition().reference
866
+ reference: oFlexObject.getFlexObjectMetadata().reference
866
867
  });
867
868
  // TODO: use condensing route to reduce backend requests
868
869
  // need to save first entry to generate draft version in backend
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @private
27
27
  * @alias sap.ui.fl.write._internal.transport.TransportSelection
28
28
  * @author SAP SE
29
- * @version 1.114.0
29
+ * @version 1.115.1
30
30
  * @since 1.74.0
31
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
32
32
  * of the SmartVariant control.
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * Entity that handles ABAP transport related information.
28
28
  * @alias sap.ui.fl.write._internal.transport.Transports
29
29
  * @author SAP SE
30
- * @version 1.114.0
30
+ * @version 1.115.1
31
31
  * @since 1.74.0
32
32
  * @private
33
33
  * @ui5-restricted sap.ui.fl.write._internal.transport
@@ -5,26 +5,28 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/fl/registry/Settings",
9
8
  "sap/ui/fl/write/api/Adaptations",
9
+ "sap/ui/fl/write/api/FeaturesAPI",
10
10
  "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
11
11
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
12
12
  "sap/ui/fl/write/_internal/flexState/FlexObjectState",
13
13
  "sap/ui/fl/Layer",
14
14
  "sap/ui/fl/LayerUtils",
15
15
  "sap/ui/fl/Utils",
16
+ "sap/ui/fl/write/_internal/FlexInfoSession",
16
17
  "sap/ui/fl/write/_internal/Storage",
17
18
  "sap/ui/fl/write/_internal/Versions",
18
19
  "sap/ui/model/json/JSONModel"
19
20
  ], function(
20
- Settings,
21
21
  Adaptations,
22
+ FeaturesAPI,
22
23
  FlexObjectFactory,
23
24
  ManifestUtils,
24
25
  FlexObjectState,
25
26
  Layer,
26
27
  LayerUtils,
27
28
  FlexUtils,
29
+ FlexInfoSession,
28
30
  Storage,
29
31
  Versions,
30
32
  JSONModel
@@ -49,28 +51,36 @@ sap.ui.define([
49
51
  if (!sReference) {
50
52
  throw Error("The application ID could not be determined");
51
53
  }
52
- return FlexUtils.normalizeReference(sReference);
54
+ return sReference;
53
55
  }
54
56
 
55
57
  /**
56
- * Processing the response to activate the draft if the expected status is contained in the response object
58
+ * Processing the response to create/read/update/delete adaptations if the expected status is contained in the response object
59
+ * In case of a deletion the version list is reloaded because the draft might have been deleted on the backend
57
60
  * @param {object} oResponse - Object with response data
58
61
  * @param {number} oResponse.status - HTTP response code
59
62
  * @param {number} nExpectedStatus - Expected HTTP response code
60
63
  * @param {object} mPropertyBag - Object with parameters as properties
61
64
  * @param {string} mPropertyBag.appId - Reference of the application
62
65
  * @param {string} mPropertyBag.layer - Layer
63
- * @returns {object} Object with response data
66
+ * @param {boolean} [bDelete=false] - Indicator whether the response was from a delete
67
+ * @returns {Promise<object>} Object with response data
64
68
  */
65
- function handleResponseForVersioning(oResponse, nExpectedStatus, mPropertyBag) {
66
- if (oResponse.status === nExpectedStatus) {
67
- Versions.onAllChangesSaved({
69
+ function handleResponseForVersioning(oResponse, nExpectedStatus, mPropertyBag, bDelete) {
70
+ if (bDelete) {
71
+ return Versions.updateModelFromBackend({
68
72
  reference: mPropertyBag.appId,
69
- layer: mPropertyBag.layer,
70
- contextBasedAdaptation: true
73
+ layer: mPropertyBag.layer
74
+ }).then(function() {
75
+ return oResponse;
71
76
  });
72
77
  }
73
- return oResponse;
78
+ Versions.onAllChangesSaved({
79
+ reference: mPropertyBag.appId,
80
+ layer: mPropertyBag.layer,
81
+ contextBasedAdaptation: true
82
+ });
83
+ return Promise.resolve(oResponse);
74
84
  }
75
85
 
76
86
  /**
@@ -93,13 +103,26 @@ sap.ui.define([
93
103
  if (_mInstances && _mInstances[sReference] && _mInstances[sReference][sLayer]) {
94
104
  return Promise.resolve(_mInstances[sReference][sLayer]);
95
105
  }
96
- return Settings.getInstance()
97
- .then(function(oSettings) {
98
- var bContextBasedAdaptationsEnabled = oSettings.isContextBasedAdaptationEnabled();
106
+ var bContextBasedAdaptationsEnabled;
107
+ return FeaturesAPI.isContextBasedAdaptationAvailable(sLayer)
108
+ .then(function(bContextBasedAdaptationsEnabledResponse) {
109
+ bContextBasedAdaptationsEnabled = bContextBasedAdaptationsEnabledResponse;
99
110
  var oAdaptationsPromise = bContextBasedAdaptationsEnabled ? ContextBasedAdaptationsAPI.load(mPropertyBag) : Promise.resolve({adaptations: []});
100
111
  return oAdaptationsPromise;
101
- }).then(function(oAdaptations) {
102
- return ContextBasedAdaptationsAPI.createModel(oAdaptations.adaptations);
112
+ })
113
+ .then(function(oAdaptations) {
114
+ // Determine displayed adaptation
115
+ // Flex Info Session returns currently shown one based on Flex Data response
116
+ // If no longer available switch to highest ranked one
117
+ var oFlexInfoSession = FlexInfoSession.get(mPropertyBag.control) || {};
118
+ var oDisplayedAdaptation = oAdaptations.adaptations[0];
119
+ if (oFlexInfoSession.adaptationId) {
120
+ oDisplayedAdaptation = oAdaptations.adaptations.find(function(oAdaptation) {
121
+ return oAdaptation.id === oFlexInfoSession.adaptationId;
122
+ }) || oDisplayedAdaptation;
123
+ }
124
+
125
+ return ContextBasedAdaptationsAPI.createModel(oAdaptations.adaptations, oDisplayedAdaptation, bContextBasedAdaptationsEnabled);
103
126
  })
104
127
  .then(function(oModel) {
105
128
  _mInstances[sReference] = _mInstances[sReference] || {};
@@ -111,19 +134,29 @@ sap.ui.define([
111
134
 
112
135
  /**
113
136
  * Initializes and creates an new adaptation Model
114
- * @param {string[]} aAdaptations - List of adaptations from backend
137
+ * @param {object[]} aAdaptations - List of adaptations from backend
138
+ * @param {object} oDisplayedAdaptation - Adaptation to be set as displayedAdaptation
139
+ * @param {boolean} bContextBasedAdaptationsEnabled - Whether the feature is enabled
115
140
  * @returns {sap.ui.model.json.JSONModel} - Model of adaptations enhanced with additional properties
116
141
  */
117
- ContextBasedAdaptationsAPI.createModel = function(aAdaptations) {
142
+ ContextBasedAdaptationsAPI.createModel = function(aAdaptations, oDisplayedAdaptation, bContextBasedAdaptationsEnabled) {
118
143
  if (!Array.isArray(aAdaptations)) {
119
144
  throw Error("Adaptations model can only be initialized with an array of adaptations");
120
145
  }
146
+ if (bContextBasedAdaptationsEnabled && !oDisplayedAdaptation) {
147
+ throw Error("Invalid call, must pass displayed adaptation");
148
+ }
149
+ if (!bContextBasedAdaptationsEnabled && aAdaptations.length) {
150
+ throw Error("Invalid call, must not pass adaptations if feature is disabled");
151
+ }
121
152
 
153
+ // TODO Extract class
122
154
  var oModel = new JSONModel({
123
155
  allAdaptations: [],
124
156
  adaptations: [],
125
157
  count: 0,
126
- displayedAdaptation: {}
158
+ displayedAdaptation: {},
159
+ contextBasedAdaptationsEnabled: bContextBasedAdaptationsEnabled
127
160
  });
128
161
  oModel.updateAdaptations = function(aAdaptations) {
129
162
  var aContextBasedAdaptations = aAdaptations.filter(function(oAdapation, iIndex) {
@@ -181,7 +214,7 @@ sap.ui.define([
181
214
  };
182
215
  if (aAdaptations.length > 0) {
183
216
  oModel.updateAdaptations(aAdaptations);
184
- oModel.setProperty("/displayedAdaptation", aAdaptations[0]);
217
+ oModel.setProperty("/displayedAdaptation", oDisplayedAdaptation);
185
218
  }
186
219
  return oModel;
187
220
  };
@@ -234,10 +267,38 @@ sap.ui.define([
234
267
  return _mInstances[sReference] && _mInstances[sReference][sLayer];
235
268
  };
236
269
 
270
+ /**
271
+ * Checks if an adaptation for a given reference and layer exists.
272
+ * @param {object} mPropertyBag - Object with parameters as properties
273
+ * @param {string} mPropertyBag.reference - ID of the application for which the versions are requested
274
+ * @param {string} mPropertyBag.layer - Layer
275
+ * @returns {boolean} checks if at least one adaptation exists for this reference and layer
276
+ */
277
+ ContextBasedAdaptationsAPI.adaptationExists = function(mPropertyBag) {
278
+ var sReference = mPropertyBag.reference;
279
+ var sLayer = mPropertyBag.layer;
280
+ return this.hasAdaptationsModel({reference: sReference, layer: sLayer}) && _mInstances[sReference][sLayer].getProperty("/count") > 0;
281
+ };
282
+
237
283
  ContextBasedAdaptationsAPI.clearInstances = function() {
238
284
  _mInstances = {};
239
285
  };
240
286
 
287
+ /**
288
+ * Discards the model, initializes it again and returns the displayed adaptation.
289
+ * @param {object} mPropertyBag - Object with parameters as properties
290
+ * @param {sap.ui.core.Control} mPropertyBag.control - Control for which the request is done
291
+ * @param {string} mPropertyBag.layer - Layer
292
+ * @returns {string} Displayed adaptation id of the refreshed model
293
+ */
294
+ ContextBasedAdaptationsAPI.refreshAdaptationModel = function(mPropertyBag) {
295
+ this.clearInstances();
296
+ return this.initialize(mPropertyBag)
297
+ .then(function(oModel) {
298
+ return oModel.getProperty("/displayedAdaptation/id");
299
+ });
300
+ };
301
+
241
302
  function getNewVariantId(mFileNames, sOldVariantId) {
242
303
  return mFileNames.get(sOldVariantId) || sOldVariantId;
243
304
  }
@@ -250,10 +311,9 @@ sap.ui.define([
250
311
  */
251
312
  function copyVariants(aVariants, aCopiedFlexObjects, mFileNames, sContextBasedAdaptationId) {
252
313
  aVariants.forEach(function(oChange) {
253
- var oCopiedVariant;
254
- var sFileName = FlexUtils.createDefaultFileName(oChange.getId().split("_").pop());
255
314
  // copy of CompVariant and FLVariant variants
256
- oCopiedVariant = FlexObjectFactory.createFromFileContent(oChange.cloneFileContentWithNewId(sFileName));
315
+ var oCopiedVariant = FlexObjectFactory.createFromFileContent(oChange.cloneFileContentWithNewId());
316
+ var sFileName = oCopiedVariant.getId();
257
317
  oCopiedVariant.setAdaptationId(sContextBasedAdaptationId);
258
318
  aCopiedFlexObjects.push(oCopiedVariant);
259
319
  mFileNames.set(oChange.getId(), sFileName);
@@ -361,9 +421,10 @@ sap.ui.define([
361
421
  }).then(function(oResponse) {
362
422
  var oModel = this.getAdaptationsModel(mPropertyBag);
363
423
  oModel.insertAdaptation(mPropertyBag.contextBasedAdaptation);
364
- handleResponseForVersioning(oResponse, 201, mPropertyBag);
424
+ return handleResponseForVersioning(oResponse, 201, mPropertyBag);
425
+ }.bind(this)).then(function() {
365
426
  return FlexObjectState.getFlexObjects({ selector: mPropertyBag.control, invalidateCache: false, includeCtrlVariants: true, includeDirtyChanges: true, currentLayer: Layer.CUSTOMER });
366
- }.bind(this)).then(function(aFlexObjects) {
427
+ }).then(function(aFlexObjects) {
367
428
  //currently getFlexObjects contains also VENDOR layer ctrl variant changes which need to be removed before copy
368
429
  //TODO refactor when FlexObjectState.getFlexObjects will be refactored
369
430
  var aCustomerFlexObjects = LayerUtils.filterChangeOrChangeDefinitionsByCurrentLayer(aFlexObjects, Layer.CUSTOMER);
@@ -461,7 +522,6 @@ sap.ui.define([
461
522
  mPropertyBag.appId = getFlexReferenceForControl(mPropertyBag.control);
462
523
  return Storage.contextBasedAdaptation.load({
463
524
  layer: mPropertyBag.layer,
464
- flexObject: mPropertyBag.parameters,
465
525
  appId: mPropertyBag.appId,
466
526
  version: getParentVersion(mPropertyBag)
467
527
  }).then(function(oAdaptations) {
@@ -497,7 +557,7 @@ sap.ui.define([
497
557
  adaptationId: mPropertyBag.adaptationId,
498
558
  parentVersion: getParentVersion(mPropertyBag)
499
559
  }).then(function(oResponse) {
500
- return handleResponseForVersioning(oResponse, 204, mPropertyBag);
560
+ return handleResponseForVersioning(oResponse, 204, mPropertyBag, true);
501
561
  });
502
562
  };
503
563
 
@@ -5,12 +5,16 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
+ "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
8
9
  "sap/ui/fl/variants/context/Component",
10
+ "sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
9
11
  "sap/ui/core/ComponentContainer",
10
12
  "sap/ui/fl/Layer",
11
13
  "sap/ui/fl/registry/Settings"
12
14
  ], function(
15
+ ManifestUtils,
13
16
  ContextSharingComponent,
17
+ ContextBasedAdaptationsAPI,
14
18
  ComponentContainer,
15
19
  Layer,
16
20
  Settings
@@ -37,6 +41,7 @@ sap.ui.define([
37
41
  *
38
42
  * @param {object} mPropertyBag - Object with parameters as properties
39
43
  * @param {string} [mPropertyBag.layer] - Layer
44
+ * @param {sap.ui.core.Control} [mPropertyBag.variantManagementControl] - Comp or control variant management control
40
45
  * @returns {Promise<sap.ui.core.ComponentContainer>} Promise resolving with the ComponentContainer or nothing depending on the availability of the feature in the used back end
41
46
  * @private
42
47
  * @ui5-restricted sap.ui.comp, sap.ui.fl
@@ -45,8 +50,9 @@ sap.ui.define([
45
50
  if (mPropertyBag.layer !== Layer.CUSTOMER) {
46
51
  return Promise.resolve();
47
52
  }
53
+ var sReference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.variantManagementControl);
48
54
  return Settings.getInstance().then(function(oSettings) {
49
- return oSettings.isContextSharingEnabled();
55
+ return oSettings.isContextSharingEnabled() && !ContextBasedAdaptationsAPI.adaptationExists({reference: sReference, layer: Layer.CUSTOMER});
50
56
  }).then(function(bIsEnabled) {
51
57
  if (bIsEnabled) {
52
58
  if (!oComponentContainer || oComponentContainer.bIsDestroyed) {