@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.
Files changed (263) hide show
  1. package/.eslintrc.json +33 -2
  2. package/.reuse/dep5 +0 -5
  3. package/THIRDPARTY.txt +1 -7
  4. package/package.json +3 -3
  5. package/src/sap/ui/fl/.library +1 -1
  6. package/src/sap/ui/fl/Cache.js +30 -33
  7. package/src/sap/ui/fl/ChangePersistence.js +139 -84
  8. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  9. package/src/sap/ui/fl/FakeLrepConnector.js +7 -7
  10. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +7 -7
  11. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +5 -5
  12. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  13. package/src/sap/ui/fl/FlexController.js +82 -210
  14. package/src/sap/ui/fl/FlexControllerFactory.js +12 -1
  15. package/src/sap/ui/fl/Layer.js +1 -1
  16. package/src/sap/ui/fl/LayerUtils.js +11 -11
  17. package/src/sap/ui/fl/Utils.js +45 -88
  18. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +41 -38
  19. package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +130 -94
  21. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +10 -4
  23. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +7 -2
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +19 -19
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory.js +4 -5
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyUtil.js +1 -2
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +18 -16
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +11 -9
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +2 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +4 -2
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +9 -7
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +4 -2
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +4 -3
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +4 -2
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +4 -2
  40. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +2 -1
  41. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +3 -5
  42. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +7 -7
  43. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +13 -11
  44. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +4 -4
  45. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +4 -3
  46. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +5 -5
  47. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageConnector.js +4 -5
  48. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +29 -29
  49. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +1 -2
  50. package/src/sap/ui/fl/apply/_internal/controlVariants/Utils.js +6 -4
  51. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +44 -44
  52. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +3 -3
  53. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +15 -1
  54. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  56. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -14
  57. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +3 -1
  58. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +16 -8
  59. package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
  60. package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +1 -1
  61. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +12 -4
  62. package/src/sap/ui/fl/apply/_internal/flexObjects/UpdatableChange.js +1 -1
  63. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +23 -5
  64. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +206 -64
  65. package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +27 -17
  66. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +16 -10
  67. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +23 -7
  68. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +2 -2
  69. package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +1 -1
  70. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +4 -4
  71. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +50 -50
  72. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +27 -13
  73. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +5 -5
  74. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +5 -5
  75. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +55 -37
  76. package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +20 -23
  77. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +5 -5
  78. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +6 -6
  79. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -2
  80. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +6 -6
  81. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +15 -5
  82. package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +10 -4
  83. package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +6 -8
  84. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +6 -6
  85. package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +3 -5
  86. package/src/sap/ui/fl/changeHandler/AddIFrame.js +22 -22
  87. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  88. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +43 -36
  89. package/src/sap/ui/fl/changeHandler/Base.js +7 -7
  90. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +107 -107
  91. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +45 -45
  92. package/src/sap/ui/fl/changeHandler/BaseRename.js +26 -26
  93. package/src/sap/ui/fl/changeHandler/BaseTreeModifier.js +1 -1
  94. package/src/sap/ui/fl/changeHandler/HideControl.js +15 -16
  95. package/src/sap/ui/fl/changeHandler/MoveControls.js +190 -191
  96. package/src/sap/ui/fl/changeHandler/MoveElements.js +36 -36
  97. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +7 -7
  98. package/src/sap/ui/fl/changeHandler/PropertyChange.js +7 -7
  99. package/src/sap/ui/fl/changeHandler/StashControl.js +35 -35
  100. package/src/sap/ui/fl/changeHandler/UnhideControl.js +7 -7
  101. package/src/sap/ui/fl/changeHandler/UnstashControl.js +21 -21
  102. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +39 -39
  103. package/src/sap/ui/fl/changeHandler/common/ChangeCategories.js +1 -1
  104. package/src/sap/ui/fl/changeHandler/common/createIFrame.js +5 -5
  105. package/src/sap/ui/fl/changeHandler/common/getTargetAggregationIndex.js +5 -5
  106. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +12 -12
  107. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +7 -9
  108. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  109. package/src/sap/ui/fl/descriptorRelated/internal/Utils.js +12 -12
  110. package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +60 -60
  111. package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +2 -5
  112. package/src/sap/ui/fl/initial/_internal/Storage.js +20 -21
  113. package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +4 -4
  114. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +20 -21
  115. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +6 -6
  116. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  117. package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +2 -2
  118. package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.js +1 -1
  119. package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +4 -4
  120. package/src/sap/ui/fl/initial/_internal/connectors/StaticFileConnector.js +3 -3
  121. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +22 -18
  122. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +4 -4
  123. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +2 -2
  124. package/src/sap/ui/fl/interfaces/Delegate.js +7 -9
  125. package/src/sap/ui/fl/library.js +44 -45
  126. package/src/sap/ui/fl/library.support.js +59 -59
  127. package/src/sap/ui/fl/messagebundle.properties +4 -119
  128. package/src/sap/ui/fl/messagebundle_ar.properties +2 -79
  129. package/src/sap/ui/fl/messagebundle_bg.properties +2 -79
  130. package/src/sap/ui/fl/messagebundle_ca.properties +2 -79
  131. package/src/sap/ui/fl/messagebundle_cs.properties +2 -79
  132. package/src/sap/ui/fl/messagebundle_cy.properties +2 -79
  133. package/src/sap/ui/fl/messagebundle_da.properties +2 -79
  134. package/src/sap/ui/fl/messagebundle_de.properties +2 -79
  135. package/src/sap/ui/fl/messagebundle_el.properties +2 -79
  136. package/src/sap/ui/fl/messagebundle_en.properties +2 -79
  137. package/src/sap/ui/fl/messagebundle_en_GB.properties +2 -79
  138. package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +2 -79
  139. package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +2 -79
  140. package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +2 -79
  141. package/src/sap/ui/fl/messagebundle_es.properties +2 -79
  142. package/src/sap/ui/fl/messagebundle_es_MX.properties +2 -79
  143. package/src/sap/ui/fl/messagebundle_et.properties +2 -79
  144. package/src/sap/ui/fl/messagebundle_fi.properties +2 -79
  145. package/src/sap/ui/fl/messagebundle_fr.properties +2 -79
  146. package/src/sap/ui/fl/messagebundle_fr_CA.properties +2 -79
  147. package/src/sap/ui/fl/messagebundle_hi.properties +2 -79
  148. package/src/sap/ui/fl/messagebundle_hr.properties +2 -79
  149. package/src/sap/ui/fl/messagebundle_hu.properties +2 -79
  150. package/src/sap/ui/fl/messagebundle_id.properties +2 -79
  151. package/src/sap/ui/fl/messagebundle_it.properties +2 -79
  152. package/src/sap/ui/fl/messagebundle_iw.properties +2 -79
  153. package/src/sap/ui/fl/messagebundle_ja.properties +2 -79
  154. package/src/sap/ui/fl/messagebundle_kk.properties +2 -79
  155. package/src/sap/ui/fl/messagebundle_ko.properties +2 -79
  156. package/src/sap/ui/fl/messagebundle_lt.properties +2 -79
  157. package/src/sap/ui/fl/messagebundle_lv.properties +2 -79
  158. package/src/sap/ui/fl/messagebundle_ms.properties +2 -79
  159. package/src/sap/ui/fl/messagebundle_nl.properties +2 -79
  160. package/src/sap/ui/fl/messagebundle_no.properties +2 -79
  161. package/src/sap/ui/fl/messagebundle_pl.properties +2 -79
  162. package/src/sap/ui/fl/messagebundle_pt.properties +2 -79
  163. package/src/sap/ui/fl/messagebundle_pt_PT.properties +2 -79
  164. package/src/sap/ui/fl/messagebundle_ro.properties +2 -79
  165. package/src/sap/ui/fl/messagebundle_ru.properties +2 -79
  166. package/src/sap/ui/fl/messagebundle_sh.properties +2 -79
  167. package/src/sap/ui/fl/messagebundle_sk.properties +2 -79
  168. package/src/sap/ui/fl/messagebundle_sl.properties +2 -79
  169. package/src/sap/ui/fl/messagebundle_sv.properties +2 -79
  170. package/src/sap/ui/fl/messagebundle_th.properties +2 -79
  171. package/src/sap/ui/fl/messagebundle_tr.properties +2 -79
  172. package/src/sap/ui/fl/messagebundle_uk.properties +3 -80
  173. package/src/sap/ui/fl/messagebundle_vi.properties +2 -79
  174. package/src/sap/ui/fl/messagebundle_zh_CN.properties +2 -79
  175. package/src/sap/ui/fl/messagebundle_zh_TW.properties +2 -79
  176. package/src/sap/ui/fl/registry/Settings.js +41 -43
  177. package/src/sap/ui/fl/requireAsync.js +7 -1
  178. package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +9 -9
  179. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +22 -22
  180. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +3 -3
  181. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  182. package/src/sap/ui/fl/support/apps/contentbrowser/Component.js +3 -5
  183. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +27 -27
  184. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +20 -20
  185. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +17 -17
  186. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +4 -4
  187. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +34 -34
  188. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +10 -10
  189. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +5 -5
  190. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  191. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +2 -2
  192. package/src/sap/ui/fl/util/IFrame.js +18 -18
  193. package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
  194. package/src/sap/ui/fl/util/ManagedObjectModel.js +7 -7
  195. package/src/sap/ui/fl/util/changePropertyValueByPath.js +2 -2
  196. package/src/sap/ui/fl/util/getContainerUserInfo.js +25 -25
  197. package/src/sap/ui/fl/util/resolveBinding.js +3 -3
  198. package/src/sap/ui/fl/variants/VariantManagement.js +8 -47
  199. package/src/sap/ui/fl/variants/VariantModel.js +236 -146
  200. package/src/sap/ui/fl/variants/context/Component.js +1 -2
  201. package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +2 -5
  202. package/src/sap/ui/fl/write/_internal/SaveAs.js +163 -161
  203. package/src/sap/ui/fl/write/_internal/Storage.js +51 -53
  204. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +4 -4
  205. package/src/sap/ui/fl/write/_internal/Versions.js +105 -97
  206. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +9 -9
  207. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +7 -7
  208. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +2 -2
  209. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +3 -5
  210. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +15 -10
  211. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  212. package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +1 -1
  213. package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +1 -1
  214. package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +1 -1
  215. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +10 -10
  216. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +23 -24
  217. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +60 -61
  218. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +4 -4
  219. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +6 -6
  220. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +2 -2
  221. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +14 -14
  222. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +3 -3
  223. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +40 -10
  224. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +2 -2
  225. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  226. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  227. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +2 -2
  228. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -3
  229. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +2 -2
  230. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  231. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +3 -3
  232. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  233. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +2 -2
  234. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +2 -2
  235. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +2 -2
  236. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +3 -3
  237. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +4 -4
  238. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/validators/IsRequired.js +2 -2
  239. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +33 -35
  240. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +81 -59
  241. package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +12 -13
  242. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +12 -12
  243. package/src/sap/ui/fl/write/_internal/transport/Transports.js +7 -7
  244. package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +12 -15
  245. package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +222 -185
  246. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +546 -110
  247. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +122 -68
  248. package/src/sap/ui/fl/write/api/ExtensionPointRegistryAPI.js +19 -4
  249. package/src/sap/ui/fl/write/api/FeaturesAPI.js +19 -20
  250. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  251. package/src/sap/ui/fl/write/api/LocalResetAPI.js +32 -33
  252. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +119 -73
  253. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +8 -8
  254. package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +18 -21
  255. package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +14 -13
  256. package/src/sap/ui/fl/write/api/TranslationAPI.js +13 -17
  257. package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +5 -7
  258. package/src/sap/ui/fl/write/api/VersionsAPI.js +14 -14
  259. package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +1 -1
  260. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +7 -7
  261. package/src/sap/ui/fl/write/connectors/BaseConnector.js +17 -17
  262. package/ui5.yaml +1 -2
  263. package/src/sap/ui/fl/apply/_internal/ChangesController.js +0 -49
@@ -11,10 +11,10 @@ sap.ui.define([
11
11
  "sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
12
12
  "sap/ui/fl/apply/_internal/flexState/FlexState",
13
13
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
14
- "sap/ui/fl/apply/_internal/ChangesController",
15
14
  "sap/ui/fl/apply/api/ControlVariantApplyAPI",
16
15
  "sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState",
17
16
  "sap/ui/fl/write/_internal/Versions",
17
+ "sap/ui/fl/FlexControllerFactory",
18
18
  "sap/ui/fl/ChangePersistenceFactory",
19
19
  "sap/ui/fl/LayerUtils",
20
20
  "sap/ui/fl/Utils"
@@ -25,10 +25,10 @@ sap.ui.define([
25
25
  VariantManagementState,
26
26
  FlexState,
27
27
  ManifestUtils,
28
- ChangesController,
29
28
  ControlVariantApplyAPI,
30
29
  CompVariantState,
31
30
  Versions,
31
+ FlexControllerFactory,
32
32
  ChangePersistenceFactory,
33
33
  LayerUtils,
34
34
  Utils
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @namespace
40
40
  * @alias sap.ui.fl.write._internal.flexState.FlexObjectState
41
41
  * @since 1.83
42
- * @version 1.115.1
42
+ * @version 1.117.0
43
43
  * @private
44
44
  * @ui5-restricted sap.ui.fl
45
45
  */
@@ -58,7 +58,7 @@ sap.ui.define([
58
58
  function getCompVariantEntities(mPropertyBag) {
59
59
  var mCompEntities = FlexState.getCompVariantsMap(mPropertyBag.reference);
60
60
  var aEntities = [];
61
- //Enhance CompVariantsMap with external data and standard variant after FlexState has been cleared and reinitialized
61
+ // Enhance CompVariantsMap with external data and standard variant after FlexState has been cleared and reinitialized
62
62
  if (mPropertyBag.invalidateCache) {
63
63
  var oDataToRestore = FlexState.getInitialNonFlCompVariantData(mPropertyBag.reference);
64
64
  if (oDataToRestore) {
@@ -85,8 +85,7 @@ sap.ui.define([
85
85
 
86
86
  function getChangePersistence(mPropertyBag) {
87
87
  if (!mPropertyBag.reference) {
88
- var oAppComponent = ChangesController.getAppComponentForSelector(mPropertyBag.selector);
89
- mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
88
+ mPropertyBag.reference = ManifestUtils.getFlexReferenceForSelector(mPropertyBag.selector);
90
89
  }
91
90
  return ChangePersistenceFactory.getChangePersistenceForComponent(mPropertyBag.reference);
92
91
  }
@@ -134,26 +133,26 @@ sap.ui.define([
134
133
  var oChangePersistence = getChangePersistence(mPropertyBag);
135
134
 
136
135
  return oChangePersistence.getChangesForComponent(_omit(mPropertyBag, ["invalidateCache", "selector"]), mPropertyBag.invalidateCache)
137
- .then(function(aPersistedChanges) {
138
- var aDirtyChanges = [];
139
- if (mPropertyBag.includeDirtyChanges) {
140
- aDirtyChanges = oChangePersistence.getDirtyChanges();
141
- if (mPropertyBag.currentLayer) {
142
- aDirtyChanges = aDirtyChanges.filter(function(oChange) {
143
- return oChange.getLayer() === mPropertyBag.currentLayer;
144
- });
145
- }
136
+ .then(function(aPersistedChanges) {
137
+ var aDirtyChanges = [];
138
+ if (mPropertyBag.includeDirtyChanges) {
139
+ aDirtyChanges = oChangePersistence.getDirtyChanges();
140
+ if (mPropertyBag.currentLayer) {
141
+ aDirtyChanges = aDirtyChanges.filter(function(oChange) {
142
+ return oChange.getLayer() === mPropertyBag.currentLayer;
143
+ });
146
144
  }
147
- var aChanges = aPersistedChanges.concat(aDirtyChanges);
148
- if (mPropertyBag.onlyCurrentVariants) {
149
- return filterChangesByCurrentVariants(aChanges, mPropertyBag.selector);
150
- }
151
- return aChanges;
152
- });
145
+ }
146
+ var aChanges = aPersistedChanges.concat(aDirtyChanges);
147
+ if (mPropertyBag.onlyCurrentVariants) {
148
+ return filterChangesByCurrentVariants(aChanges, mPropertyBag.selector);
149
+ }
150
+ return aChanges;
151
+ });
153
152
  }
154
153
 
155
154
  function saveChangePersistenceEntities(mPropertyBag, oAppComponent) {
156
- var oFlexController = ChangesController.getFlexControllerInstance(mPropertyBag.selector);
155
+ var oFlexController = FlexControllerFactory.createForSelector(mPropertyBag.selector);
157
156
 
158
157
  return oFlexController.saveAll(
159
158
  oAppComponent,
@@ -172,20 +171,20 @@ sap.ui.define([
172
171
  * @param {object} mPropertyBag - Object with parameters as properties
173
172
  * @param {sap.ui.fl.Selector} mPropertyBag.selector - Retrieves the associated flex persistence
174
173
  * @param {string} [mPropertyBag.layer] - Specifies a single layer for loading change; if this parameter is set, the max layer filtering is not applied
175
- * @param {string} [mPropertyBar.currentLayer] - Specifies a single layer to filtering changes (without filtering ctrl variant changes)
174
+ * @param {string} [mPropertyBag.currentLayer] - Specifies a single layer to filtering changes (without filtering ctrl variant changes)
176
175
  * @param {boolean} [mPropertyBag.invalidateCache] - Flag if the cache should be invalidated
177
176
  * @param {boolean} [mPropertyBag.includeCtrlVariants] - Flag if control variant changes should be included
178
177
  * @param {boolean} [mPropertyBag.includeDirtyChanges] - Flag if dirty UI changes should be included
179
178
  * @param {boolean} [mPropertyBag.version] - The version for which the objects are retrieved
180
179
  * @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
181
180
  */
182
- FlexObjectState.getFlexObjects = function (mPropertyBag) {
181
+ FlexObjectState.getFlexObjects = function(mPropertyBag) {
183
182
  return initFlexStateAndSetReference(mPropertyBag)
184
- .then(function () {
185
- return getChangePersistenceEntities(mPropertyBag);
186
- }).then(function (aChangePersistenceEntities) {
187
- return getCompVariantEntities(mPropertyBag).concat(aChangePersistenceEntities);
188
- });
183
+ .then(function() {
184
+ return getChangePersistenceEntities(mPropertyBag);
185
+ }).then(function(aChangePersistenceEntities) {
186
+ return getCompVariantEntities(mPropertyBag).concat(aChangePersistenceEntities);
187
+ });
189
188
  };
190
189
 
191
190
  /**
@@ -198,7 +197,7 @@ sap.ui.define([
198
197
  * @param {boolean} mPropertyBag.includeCtrlVariants - Flag if control variant changes should be included
199
198
  * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
200
199
  */
201
- FlexObjectState.getDirtyFlexObjects = function (mPropertyBag) {
200
+ FlexObjectState.getDirtyFlexObjects = function(mPropertyBag) {
202
201
  mPropertyBag.includeDirtyChanges = true;
203
202
  var oChangePersistence = getChangePersistence(mPropertyBag);
204
203
  var aChangePersistenceEntities = oChangePersistence.getDirtyChanges();
@@ -216,9 +215,8 @@ sap.ui.define([
216
215
  * @param {sap.ui.fl.Selector} mPropertyBag.selector To retrieve the associated flex persistence
217
216
  * @returns {boolean} <code>true</code> if dirty flex objects exist
218
217
  */
219
- FlexObjectState.hasDirtyFlexObjects = function (mPropertyBag) {
220
- var oAppComponent = ChangesController.getAppComponentForSelector(mPropertyBag.selector);
221
- var sReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
218
+ FlexObjectState.hasDirtyFlexObjects = function(mPropertyBag) {
219
+ var sReference = ManifestUtils.getFlexReferenceForSelector(mPropertyBag.selector);
222
220
  if (ChangePersistenceFactory.getChangePersistenceForComponent(sReference).getDirtyChanges().length > 0) {
223
221
  return true;
224
222
  }
@@ -242,7 +240,7 @@ sap.ui.define([
242
240
  * @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
243
241
  */
244
242
  FlexObjectState.saveFlexObjects = function(mPropertyBag) {
245
- var oAppComponent = ChangesController.getAppComponentForSelector(mPropertyBag.selector);
243
+ var oAppComponent = Utils.getAppComponentForSelector(mPropertyBag.selector);
246
244
  mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.selector);
247
245
  return saveCompEntities(mPropertyBag)
248
246
  .then(saveChangePersistenceEntities.bind(this, mPropertyBag, oAppComponent))
@@ -252,7 +250,7 @@ sap.ui.define([
252
250
  mPropertyBag.version = oModel.getProperty("/displayedVersion");
253
251
  }
254
252
  if (mPropertyBag.layer) {
255
- //TODO: sync the layer parameter name with new persistence and remove this line
253
+ // TODO: sync the layer parameter name with new persistence and remove this line
256
254
  mPropertyBag.currentLayer = mPropertyBag.layer;
257
255
  }
258
256
  // with invalidation more parameters are required to make a new storage request
@@ -109,7 +109,7 @@ sap.ui.define([
109
109
  layer: oFlexObject.getLayer(),
110
110
  transport: oFlexObject.getRequest(),
111
111
  parentVersion: sParentVersion
112
- }).then(function (result) {
112
+ }).then(function(result) {
113
113
  // update FlexObject and versionModel
114
114
  if (result && result.response) {
115
115
  oFlexObject.setResponse(result.response);
@@ -123,7 +123,7 @@ sap.ui.define([
123
123
  } else {
124
124
  oFlexObject.setState(States.LifecycleState.PERSISTED);
125
125
  }
126
- }).then(function () {
126
+ }).then(function() {
127
127
  // update StorageResponse
128
128
  var aObjectArray = getSubSection(oStoredResponse.changes.comp, oFlexObject);
129
129
  var oFileContent = oFlexObject.convertToFileContent();
@@ -134,9 +134,9 @@ sap.ui.define([
134
134
 
135
135
  function removeFromArrayById(aObjectArray, sObjectId) {
136
136
  for (var i = aObjectArray.length - 1; i >= 0; i--) {
137
- //aObjectArray can come from either back end response or flex state
138
- //In the first case, the fileName is a direct property of object
139
- //In the second case, it can be obtained from getId() function
137
+ // aObjectArray can come from either back end response or flex state
138
+ // In the first case, the fileName is a direct property of object
139
+ // In the second case, it can be obtained from getId() function
140
140
  var sFileName = aObjectArray[i].fileName || (aObjectArray[i].getId() && aObjectArray[i].getId());
141
141
  if ((sFileName || aObjectArray[i].getId()) === sObjectId) {
142
142
  aObjectArray.splice(i, 1);
@@ -161,7 +161,7 @@ sap.ui.define([
161
161
  layer: oFlexObject.getLayer(),
162
162
  transport: oFlexObject.getRequest(),
163
163
  parentVersion: sParentVersion
164
- }).then(function () {
164
+ }).then(function() {
165
165
  // update CompVariantsMap
166
166
  removeFromCompVariantsMap(oFlexObject, mCompVariantsMapByPersistencyKey);
167
167
  }).then(Versions.updateModelFromBackend.bind(this, {
@@ -180,7 +180,7 @@ sap.ui.define([
180
180
  function getTexts(mPropertyBag) {
181
181
  var mInternalTexts = {};
182
182
  if (typeof (mPropertyBag.texts) === "object") {
183
- Object.keys(mPropertyBag.texts).forEach(function (key) {
183
+ Object.keys(mPropertyBag.texts).forEach(function(key) {
184
184
  mInternalTexts[key] = {
185
185
  value: mPropertyBag.texts[key],
186
186
  type: "XFLD"
@@ -197,9 +197,9 @@ sap.ui.define([
197
197
 
198
198
  function getAllCompVariantObjects(mCompVariantsMapByPersistencyKey) {
199
199
  return mCompVariantsMapByPersistencyKey.variants
200
- .concat(mCompVariantsMapByPersistencyKey.changes)
201
- .concat(mCompVariantsMapByPersistencyKey.defaultVariants)
202
- .concat(mCompVariantsMapByPersistencyKey.standardVariantChange);
200
+ .concat(mCompVariantsMapByPersistencyKey.changes)
201
+ .concat(mCompVariantsMapByPersistencyKey.defaultVariants)
202
+ .concat(mCompVariantsMapByPersistencyKey.standardVariantChange);
203
203
  }
204
204
 
205
205
  function determineLayer(mPropertyBag) {
@@ -275,7 +275,7 @@ sap.ui.define([
275
275
  *
276
276
  * @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
277
277
  * @since 1.83
278
- * @version 1.115.1
278
+ * @version 1.117.0
279
279
  * @private
280
280
  * @ui5-restricted sap.ui.fl
281
281
  */
@@ -301,7 +301,7 @@ sap.ui.define([
301
301
  * @param {sap.ui.fl.Layer} [mPropertyBag.layer = Layer.USER] - Enables setDefault for the given layer
302
302
  * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} Created or updated change object in charge for setting the default variant
303
303
  */
304
- CompVariantState.setDefault = function (mPropertyBag) {
304
+ CompVariantState.setDefault = function(mPropertyBag) {
305
305
  var oContent = {
306
306
  defaultVariantName: mPropertyBag.defaultVariantId
307
307
  };
@@ -327,6 +327,7 @@ sap.ui.define([
327
327
  },
328
328
  support: mPropertyBag.support || {}
329
329
  };
330
+ oChangeParameter.adaptationId = mPropertyBag.changeSpecificData?.adaptationId;
330
331
  oChangeParameter.support.generator = oChangeParameter.support.generator || "CompVariantState." + sChangeType;
331
332
  oChangeParameter.support.sapui5Version = Core.getConfiguration().getVersion().toString();
332
333
  oChange = FlexObjectFactory.createFromFileContent(oChangeParameter, UpdatableChange);
@@ -355,7 +356,7 @@ sap.ui.define([
355
356
  * @param {string} mPropertyBag.reference - Flex reference of the application
356
357
  * @param {string} mPropertyBag.persistencyKey - ID of the variant management internal identifier
357
358
  */
358
- CompVariantState.revertSetDefaultVariantId = function (mPropertyBag) {
359
+ CompVariantState.revertSetDefaultVariantId = function(mPropertyBag) {
359
360
  var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference)._getOrCreate(mPropertyBag.persistencyKey);
360
361
  var aDefaultVariantChanges = mCompVariantsMap.defaultVariants;
361
362
  var oChange = aDefaultVariantChanges[aDefaultVariantChanges.length - 1];
@@ -427,27 +428,30 @@ sap.ui.define([
427
428
  * @param {object} [mPropertyBag.name] - Title of the variant
428
429
  * @param {object} [mPropertyBag.content] - Content of the new change
429
430
  * @param {object} [mPropertyBag.favorite] - Flag if the variant should be flagged as a favorite
431
+ * @param {boolean} [mPropertyBag.visible] - Flag if the variant should be set visible
430
432
  * @param {object} [mPropertyBag.executeOnSelection] - Flag if the variant should be executed on selection
431
433
  * @param {object} [mPropertyBag.contexts] - Map of contexts that restrict the visibility of the variant
432
434
  * @param {string[]} [mPropertyBag.contexts.role] - List of roles which are allowed to see the variant
433
435
  * @param {sap.ui.fl.Layer} mPropertyBag.layer - Layer in which the variant removal takes place;
436
+ * @param {string} mPropertyBag.adaptationId - ID of the context-based adaptation
437
+ * @param {boolean} [mPropertyBag.forceCreate] - Parameter that forces a new change to be created
434
438
  * this either updates the variant from the layer or writes a change to that layer.
435
439
  * @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant
436
440
  */
437
- CompVariantState.updateVariant = function (mPropertyBag) {
441
+ CompVariantState.updateVariant = function(mPropertyBag) {
438
442
  function variantCanBeUpdated(oVariant, sLayer) {
439
443
  var bSameLayer = oVariant.getLayer() === sLayer;
440
444
  var sPackageName = oVariant.getFlexObjectMetadata().packageName;
441
445
  var bNotTransported = !sPackageName || sPackageName === "$TMP";
442
446
  // in case changes were already done within the layer, no update of the variant can be done to safeguard the execution order
443
- var bIsChangedOnLayer = oVariant.getChanges().some(function (oChange) {
447
+ var bIsChangedOnLayer = oVariant.getChanges().some(function(oChange) {
444
448
  return oChange.getLayer() === sLayer;
445
449
  });
446
450
  return oVariant.getPersisted() && bSameLayer && bNotTransported && !bIsChangedOnLayer && isVersionIndependentOrInDraft(oVariant, mPropertyBag);
447
451
  }
448
452
 
449
453
  function getLatestUpdatableChange(oVariant) {
450
- return oVariant.getChanges().reverse().find(function (oChange) {
454
+ return oVariant.getChanges().reverse().find(function(oChange) {
451
455
  return oChange.getChangeType() === "updateVariant" && isChangeUpdatable(oChange, mPropertyBag);
452
456
  });
453
457
  }
@@ -460,6 +464,7 @@ sap.ui.define([
460
464
  previousState: oVariant.getState(),
461
465
  previousContent: oVariant.getContent(),
462
466
  previousFavorite: oVariant.getFavorite(),
467
+ previousVisible: oVariant.getVisible(),
463
468
  previousExecuteOnSelection: oVariant.getExecuteOnSelection(),
464
469
  previousContexts: oVariant.getContexts(),
465
470
  previousName: oVariant.getName(),
@@ -475,9 +480,15 @@ sap.ui.define([
475
480
  if (mPropertyBag.executeOnSelection !== undefined) {
476
481
  oVariant.storeExecuteOnSelection(mPropertyBag.executeOnSelection);
477
482
  }
478
- if (mPropertyBag.favorite !== undefined) {
483
+ // public variant should not be visible for other users
484
+ if (mPropertyBag.layer === Layer.PUBLIC) {
485
+ oVariant.storeFavorite(false);
486
+ } else if (mPropertyBag.favorite !== undefined) {
479
487
  oVariant.storeFavorite(mPropertyBag.favorite);
480
488
  }
489
+ if (mPropertyBag.visible !== undefined) {
490
+ oVariant.storeVisible(mPropertyBag.visible);
491
+ }
481
492
  if (mPropertyBag.contexts) {
482
493
  oVariant.storeContexts(mPropertyBag.contexts);
483
494
  }
@@ -496,7 +507,7 @@ sap.ui.define([
496
507
  var oRevertData = {
497
508
  previousContent: Object.assign({}, oChangeContent),
498
509
  previousState: oChange.getState(),
499
- change: _pick(Object.assign({}, mPropertyBag), ["favorite", "executeOnSelection", "contexts", "content", "name"])
510
+ change: _pick(Object.assign({}, mPropertyBag), ["favorite", "visible", "executeOnSelection", "contexts", "content", "name"])
500
511
  };
501
512
  aRevertData.push(oRevertData);
502
513
  oChange.setRevertData(aRevertData);
@@ -506,12 +517,18 @@ sap.ui.define([
506
517
  if (mPropertyBag.favorite !== undefined) {
507
518
  oChangeContent.favorite = mPropertyBag.favorite;
508
519
  }
520
+ if (mPropertyBag.visible !== undefined) {
521
+ oChangeContent.visible = mPropertyBag.visible;
522
+ }
509
523
  if (mPropertyBag.contexts) {
510
524
  oChangeContent.contexts = mPropertyBag.contexts;
511
525
  }
512
526
  if (mPropertyBag.content) {
513
527
  oChangeContent.variantContent = mPropertyBag.content;
514
528
  }
529
+ if (mPropertyBag.adaptationId) {
530
+ oChange.setAdaptationId(mPropertyBag.adaptationId);
531
+ }
515
532
  if (mPropertyBag.name) {
516
533
  oChange.setText("variantName", mPropertyBag.name);
517
534
  }
@@ -532,7 +549,7 @@ sap.ui.define([
532
549
  }
533
550
 
534
551
  var oContent = {};
535
- ["favorite", "executeOnSelection", "contexts"].forEach(function (sPropertyName) {
552
+ ["favorite", "visible", "executeOnSelection", "contexts"].forEach(function(sPropertyName) {
536
553
  if (mPropertyBag[sPropertyName] !== undefined) {
537
554
  oContent[sPropertyName] = mPropertyBag[sPropertyName];
538
555
  }
@@ -554,7 +571,9 @@ sap.ui.define([
554
571
  }
555
572
  });
556
573
 
557
- if (mPropertyBag.changeSpecificData && mPropertyBag.changeSpecificData.adaptationId !== undefined) {
574
+ if (mPropertyBag.adaptationId !== undefined) {
575
+ oChange.setAdaptationId(mPropertyBag.adaptationId);
576
+ } else if (mPropertyBag.changeSpecificData && mPropertyBag.changeSpecificData.adaptationId !== undefined) {
558
577
  oChange.setAdaptationId(mPropertyBag.changeSpecificData.adaptationId);
559
578
  }
560
579
 
@@ -573,7 +592,9 @@ sap.ui.define([
573
592
  var oVariant = getVariantById(mPropertyBag);
574
593
  var sLayer = determineLayer(mPropertyBag);
575
594
 
576
- if (variantCanBeUpdated(oVariant, sLayer)) {
595
+ if (mPropertyBag.forceCreate) {
596
+ createChange(mPropertyBag, oVariant);
597
+ } else if (variantCanBeUpdated(oVariant, sLayer)) {
577
598
  updateVariant(mPropertyBag, oVariant);
578
599
  } else {
579
600
  var oUpdatableChange = getLatestUpdatableChange(oVariant);
@@ -603,8 +624,8 @@ sap.ui.define([
603
624
  var oVariant = getVariantById(mPropertyBag);
604
625
  var aVariantRevertData = oVariant.getRevertData();
605
626
  if (aVariantRevertData.length !== 0) {
606
- //Look at revert data backward, to find the content of last save action
607
- var bIsVariantSaved = aVariantRevertData.slice().reverse().some(function (oRevertData) {
627
+ // Look at revert data backward, to find the content of last save action
628
+ var bIsVariantSaved = aVariantRevertData.slice().reverse().some(function(oRevertData) {
608
629
  if (oRevertData.getContent().previousAction === CompVariantState.updateActionType.SAVE) {
609
630
  mPropertyBag.content = oRevertData.getContent().previousContent;
610
631
  mPropertyBag.action = CompVariantState.updateActionType.DISCARD;
@@ -616,7 +637,7 @@ sap.ui.define([
616
637
  mPropertyBag.content = aVariantRevertData[0].getContent().previousContent;
617
638
  mPropertyBag.action = CompVariantState.updateActionType.DISCARD;
618
639
  }
619
- //Update variant content to the last saved or original content
640
+ // Update variant content to the last saved or original content
620
641
  CompVariantState.updateVariant(mPropertyBag);
621
642
  }
622
643
  return oVariant;
@@ -661,7 +682,7 @@ sap.ui.define([
661
682
  * this either removes the variant from the layer or writes a change to that layer.
662
683
  * @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The removed variant
663
684
  */
664
- CompVariantState.removeVariant = function (mPropertyBag) {
685
+ CompVariantState.removeVariant = function(mPropertyBag) {
665
686
  var oVariant = getVariantById(mPropertyBag);
666
687
  var sCurrentState = oVariant.getState();
667
688
 
@@ -695,12 +716,12 @@ sap.ui.define([
695
716
  * @param {string} mPropertyBag.id - ID of the variant
696
717
  * @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The reverted variant
697
718
  */
698
- CompVariantState.revert = function (mPropertyBag) {
719
+ CompVariantState.revert = function(mPropertyBag) {
699
720
  function removeChange(oChange) {
700
721
  var sPersistencyKey = oChange.getSelector().persistencyKey;
701
722
  var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference);
702
723
  delete mCompVariantsMap[sPersistencyKey].byId[oChange.getId()];
703
- mCompVariantsMap[sPersistencyKey].changes = mCompVariantsMap[sPersistencyKey].changes.filter(function (oChangeInMap) {
724
+ mCompVariantsMap[sPersistencyKey].changes = mCompVariantsMap[sPersistencyKey].changes.filter(function(oChangeInMap) {
704
725
  return oChangeInMap !== oChange;
705
726
  });
706
727
  }
@@ -785,7 +806,7 @@ sap.ui.define([
785
806
  oStandardVariant.setExecuteOnSelection(!!mPropertyBag.executeOnSelection);
786
807
  var aChanges = oStandardVariant.getChanges();
787
808
  oStandardVariant.removeAllChanges();
788
- aChanges.forEach(function (oChange) {
809
+ aChanges.forEach(function(oChange) {
789
810
  CompVariantMerger.applyChangeOnVariant(oStandardVariant, oChange);
790
811
  });
791
812
  };
@@ -813,7 +834,7 @@ sap.ui.define([
813
834
  transport: oFlexObject.getRequest(),
814
835
  isLegacyVariant: oFlexObject.isVariant && oFlexObject.isVariant(),
815
836
  parentVersion: sParentVersion
816
- }).then(function (result) {
837
+ }).then(function(result) {
817
838
  // updateFlexObject and versionModel
818
839
  if (result && result.response && result.response[0]) {
819
840
  oFlexObject.setResponse(result.response[0]);
@@ -827,7 +848,7 @@ sap.ui.define([
827
848
  } else {
828
849
  oFlexObject.setState(States.LifecycleState.PERSISTED);
829
850
  }
830
- }).then(function () {
851
+ }).then(function() {
831
852
  // update StorageResponse
832
853
  var oFileContent = oFlexObject.convertToFileContent();
833
854
  getSubSection(oStoredResponse.changes.comp, oFlexObject).push(oFileContent);
@@ -857,31 +878,31 @@ sap.ui.define([
857
878
  var mCompVariantsMapByPersistencyKey = mCompVariantsMap._getOrCreate(sPersistencyKey);
858
879
 
859
880
  return FlexState.getStorageResponse(sReference)
860
- .then(function(oStoredResponse) {
861
- var aFlexObjects = getAllCompVariantObjects(mCompVariantsMapByPersistencyKey).filter(needsPersistencyCall);
862
- var aPromises = aFlexObjects.map(function(oFlexObject, index) {
863
- if (index === 0) {
864
- var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
865
- layer: oFlexObject.getLayer(),
866
- reference: oFlexObject.getFlexObjectMetadata().reference
867
- });
868
- // TODO: use condensing route to reduce backend requests
869
- // need to save first entry to generate draft version in backend
870
- return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion)
871
- .then(function() {
872
- var aPromises = aFlexObjects.map(function(oFlexObject, index) {
873
- if (index !== 0) {
874
- var sDraftVersion = sParentVersion ? Version.Number.Draft : undefined;
875
- return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sDraftVersion);
876
- }
877
- });
878
- return aPromises;
881
+ .then(function(oStoredResponse) {
882
+ var aFlexObjects = getAllCompVariantObjects(mCompVariantsMapByPersistencyKey).filter(needsPersistencyCall);
883
+ var aPromises = aFlexObjects.map(function(oFlexObject, index) {
884
+ if (index === 0) {
885
+ var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
886
+ layer: oFlexObject.getLayer(),
887
+ reference: oFlexObject.getFlexObjectMetadata().reference
888
+ });
889
+ // TODO: use condensing route to reduce backend requests
890
+ // need to save first entry to generate draft version in backend
891
+ return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion)
892
+ .then(function() {
893
+ var aPromises = aFlexObjects.map(function(oFlexObject, index) {
894
+ if (index !== 0) {
895
+ var sDraftVersion = sParentVersion ? Version.Number.Draft : undefined;
896
+ return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sDraftVersion);
897
+ }
879
898
  });
880
- }
881
- });
882
- // TODO Consider not rejecting with first error, but wait for all promises and collect the results
883
- return Promise.all(aPromises);
899
+ return Promise.all(aPromises);
900
+ });
901
+ }
884
902
  });
903
+ // TODO Consider not rejecting with first error, but wait for all promises and collect the results
904
+ return Promise.all(aPromises);
905
+ });
885
906
  };
886
907
 
887
908
  /**
@@ -893,13 +914,14 @@ sap.ui.define([
893
914
  */
894
915
  CompVariantState.persistAll = function(sReference) {
895
916
  var mCompEntities = _omit(FlexState.getCompVariantsMap(sReference), "_getOrCreate", "_initialize");
896
- var aPromises = Object.keys(mCompEntities).map(function(sPersistencyKey) {
897
- return CompVariantState.persist({
917
+ // Calls must be done sequentially because the backend can't do this in parallel
918
+ // and first call might create draft which requires other parameters for following calls
919
+ return Object.keys(mCompEntities).reduce(function(oPromise, sPersistencyKey) {
920
+ return oPromise.then(CompVariantState.persist.bind(undefined, {
898
921
  reference: sReference,
899
922
  persistencyKey: sPersistencyKey
900
- });
901
- });
902
- return Promise.all(aPromises);
923
+ }));
924
+ }, Promise.resolve());
903
925
  };
904
926
 
905
927
  /**
@@ -908,7 +930,7 @@ sap.ui.define([
908
930
  * @param {string} sReference - Flex reference of the app
909
931
  * @returns {boolean} <code>true</code> if dirty changes exist
910
932
  */
911
- CompVariantState.hasDirtyChanges = function (sReference) {
933
+ CompVariantState.hasDirtyChanges = function(sReference) {
912
934
  var mCompEntities = FlexState.getCompVariantsMap(sReference);
913
935
  var aEntities = [];
914
936
  for (var sPersistencyKey in mCompEntities) {
@@ -95,7 +95,6 @@ sap.ui.define([
95
95
  }
96
96
  });
97
97
 
98
-
99
98
  /**
100
99
  * Initializes the control.
101
100
  *
@@ -249,7 +248,7 @@ sap.ui.define([
249
248
  tooltip: this._oResources.getText("TRANSPORT_DIALOG_TRANSPORT_TT"),
250
249
  width: "100%",
251
250
  selectionChange: function() {
252
- //if package field is visible but has no value, the OK button is disable
251
+ // if package field is visible but has no value, the OK button is disable
253
252
  if (that._oPackageListItem.getVisible() && !that._oPackage.getValue()) {
254
253
  return;
255
254
  }
@@ -375,7 +374,7 @@ sap.ui.define([
375
374
  var oLock;
376
375
  var aTransports;
377
376
 
378
- //get the transports into an array.
377
+ // get the transports into an array.
379
378
  oLock = this._hasLock(oTransports.transports);
380
379
 
381
380
  if (oLock) {
@@ -384,16 +383,16 @@ sap.ui.define([
384
383
  aTransports = oTransports.transports;
385
384
  }
386
385
 
387
- //set the transports.
386
+ // set the transports.
388
387
  this.setTransports(aTransports);
389
388
 
390
- //pre-select one, if necessary.
389
+ // pre-select one, if necessary.
391
390
  if (aTransports && aTransports.length === 1) {
392
391
  this._oTransport.setValue(aTransports[0].description, true);
393
392
  this.getButtons()[1].setEnabled(true);
394
393
  }
395
394
 
396
- //clear the transport combo-box, if necessary.
395
+ // clear the transport combo-box, if necessary.
397
396
  if (!aTransports || aTransports.length === 0) {
398
397
  this._oTransport.setSelectedKey(null);
399
398
  this._oTransport.setValueState(ValueState.None);
@@ -434,7 +433,7 @@ sap.ui.define([
434
433
  return null;
435
434
  };
436
435
 
437
- TransportDialog.prototype.setLocalObjectVisible = function (bLocalObjectVisible) {
436
+ TransportDialog.prototype.setLocalObjectVisible = function(bLocalObjectVisible) {
438
437
  this._oLocalObjectButton.setVisible(bLocalObjectVisible);
439
438
  this.setProperty("localObjectVisible", bLocalObjectVisible);
440
439
  };
@@ -462,7 +461,7 @@ sap.ui.define([
462
461
  // correct the title.
463
462
  this.setTitle(this._oResources.getText("TRANSPORT_DIALOG_TITLE_SIMPLE"));
464
463
 
465
- //disable local object button, as package has been set from outside and therefore should not be changed.
464
+ // disable local object button, as package has been set from outside and therefore should not be changed.
466
465
  this.getButtons()[0].setVisible(false);
467
466
  }
468
467
 
@@ -533,18 +532,18 @@ sap.ui.define([
533
532
  * @public
534
533
  */
535
534
  TransportDialog.prototype.setHidePackage = function(bHide) {
536
- //set the property itself.
535
+ // set the property itself.
537
536
  this.setProperty("hidePackage", bHide);
538
537
 
539
- //toggle package visibility.
538
+ // toggle package visibility.
540
539
  this._oPackageListItem.setVisible(!bHide);
541
540
 
542
541
  if (bHide) {
543
- //set the local object button to enabled,
544
- //as the end-user might want to "just" save the object without selecting a transport.
542
+ // set the local object button to enabled,
543
+ // as the end-user might want to "just" save the object without selecting a transport.
545
544
  this.getButtons()[0].setEnabled(bHide);
546
545
 
547
- //correct the title.
546
+ // correct the title.
548
547
  this.setTitle(this._oResources.getText("TRANSPORT_DIALOG_TITLE_SIMPLE"));
549
548
  }
550
549