@openui5/sap.ui.rta 1.108.2 → 1.110.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 (253) hide show
  1. package/.reuse/dep5 +16 -16
  2. package/THIRDPARTY.txt +2 -2
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +2 -2
  5. package/src/sap/ui/rta/Client.js +2 -2
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +240 -191
  7. package/src/sap/ui/rta/Utils.js +40 -19
  8. package/src/sap/ui/rta/api/startAdaptation.js +1 -1
  9. package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
  10. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
  11. package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
  12. package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
  13. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
  14. package/src/sap/ui/rta/appVariant/Feature.js +2 -8
  15. package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
  16. package/src/sap/ui/rta/appVariant/Utils.js +1 -1
  17. package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
  18. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
  19. package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
  20. package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
  21. package/src/sap/ui/rta/command/AddIFrame.js +2 -2
  22. package/src/sap/ui/rta/command/AddProperty.js +2 -2
  23. package/src/sap/ui/rta/command/AddXML.js +3 -3
  24. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
  25. package/src/sap/ui/rta/command/AppDescriptorCommand.js +3 -3
  26. package/src/sap/ui/rta/command/BaseCommand.js +2 -2
  27. package/src/sap/ui/rta/command/BindProperty.js +2 -2
  28. package/src/sap/ui/rta/command/Combine.js +2 -2
  29. package/src/sap/ui/rta/command/CommandFactory.js +2 -2
  30. package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
  31. package/src/sap/ui/rta/command/ControlVariantConfigure.js +5 -3
  32. package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
  33. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +15 -15
  34. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +11 -4
  35. package/src/sap/ui/rta/command/ControlVariantSwitch.js +42 -10
  36. package/src/sap/ui/rta/command/CreateContainer.js +2 -2
  37. package/src/sap/ui/rta/command/CustomAdd.js +2 -2
  38. package/src/sap/ui/rta/command/FlexCommand.js +18 -16
  39. package/src/sap/ui/rta/command/LREPSerializer.js +27 -17
  40. package/src/sap/ui/rta/command/LocalReset.js +2 -2
  41. package/src/sap/ui/rta/command/Move.js +2 -2
  42. package/src/sap/ui/rta/command/Property.js +2 -2
  43. package/src/sap/ui/rta/command/Remove.js +2 -2
  44. package/src/sap/ui/rta/command/Rename.js +2 -2
  45. package/src/sap/ui/rta/command/Resize.js +2 -2
  46. package/src/sap/ui/rta/command/Reveal.js +2 -2
  47. package/src/sap/ui/rta/command/Settings.js +2 -2
  48. package/src/sap/ui/rta/command/Split.js +2 -2
  49. package/src/sap/ui/rta/command/Stack.js +11 -3
  50. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
  51. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -3
  52. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
  53. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +28 -6
  54. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +2 -2
  55. package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
  56. package/src/sap/ui/rta/enablement/elementActionTest.js +28 -19
  57. package/src/sap/ui/rta/library.js +3 -3
  58. package/src/sap/ui/rta/messagebundle.properties +65 -17
  59. package/src/sap/ui/rta/messagebundle_ar.properties +32 -8
  60. package/src/sap/ui/rta/messagebundle_bg.properties +32 -8
  61. package/src/sap/ui/rta/messagebundle_ca.properties +32 -8
  62. package/src/sap/ui/rta/messagebundle_cs.properties +32 -8
  63. package/src/sap/ui/rta/messagebundle_cy.properties +31 -7
  64. package/src/sap/ui/rta/messagebundle_da.properties +31 -7
  65. package/src/sap/ui/rta/messagebundle_de.properties +31 -7
  66. package/src/sap/ui/rta/messagebundle_el.properties +31 -7
  67. package/src/sap/ui/rta/messagebundle_en.properties +31 -7
  68. package/src/sap/ui/rta/messagebundle_en_GB.properties +32 -8
  69. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +31 -7
  70. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +31 -7
  71. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +31 -7
  72. package/src/sap/ui/rta/messagebundle_es.properties +31 -7
  73. package/src/sap/ui/rta/messagebundle_es_MX.properties +31 -7
  74. package/src/sap/ui/rta/messagebundle_et.properties +31 -7
  75. package/src/sap/ui/rta/messagebundle_fi.properties +31 -7
  76. package/src/sap/ui/rta/messagebundle_fr.properties +31 -7
  77. package/src/sap/ui/rta/messagebundle_fr_CA.properties +32 -8
  78. package/src/sap/ui/rta/messagebundle_hi.properties +32 -8
  79. package/src/sap/ui/rta/messagebundle_hr.properties +32 -8
  80. package/src/sap/ui/rta/messagebundle_hu.properties +31 -7
  81. package/src/sap/ui/rta/messagebundle_id.properties +32 -8
  82. package/src/sap/ui/rta/messagebundle_it.properties +32 -8
  83. package/src/sap/ui/rta/messagebundle_iw.properties +31 -7
  84. package/src/sap/ui/rta/messagebundle_ja.properties +32 -8
  85. package/src/sap/ui/rta/messagebundle_kk.properties +31 -7
  86. package/src/sap/ui/rta/messagebundle_ko.properties +31 -7
  87. package/src/sap/ui/rta/messagebundle_lt.properties +31 -7
  88. package/src/sap/ui/rta/messagebundle_lv.properties +32 -8
  89. package/src/sap/ui/rta/messagebundle_ms.properties +32 -8
  90. package/src/sap/ui/rta/messagebundle_nl.properties +31 -7
  91. package/src/sap/ui/rta/messagebundle_no.properties +32 -8
  92. package/src/sap/ui/rta/messagebundle_pl.properties +32 -8
  93. package/src/sap/ui/rta/messagebundle_pt.properties +32 -8
  94. package/src/sap/ui/rta/messagebundle_pt_PT.properties +31 -7
  95. package/src/sap/ui/rta/messagebundle_ro.properties +32 -8
  96. package/src/sap/ui/rta/messagebundle_ru.properties +32 -8
  97. package/src/sap/ui/rta/messagebundle_sh.properties +31 -7
  98. package/src/sap/ui/rta/messagebundle_sk.properties +31 -7
  99. package/src/sap/ui/rta/messagebundle_sl.properties +31 -7
  100. package/src/sap/ui/rta/messagebundle_sv.properties +32 -8
  101. package/src/sap/ui/rta/messagebundle_th.properties +33 -9
  102. package/src/sap/ui/rta/messagebundle_tr.properties +31 -7
  103. package/src/sap/ui/rta/messagebundle_uk.properties +31 -7
  104. package/src/sap/ui/rta/messagebundle_vi.properties +32 -8
  105. package/src/sap/ui/rta/messagebundle_zh_CN.properties +32 -8
  106. package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -8
  107. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
  108. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  109. package/src/sap/ui/rta/plugin/Combine.js +2 -2
  110. package/src/sap/ui/rta/plugin/CompVariant.js +107 -29
  111. package/src/sap/ui/rta/plugin/ControlVariant.js +118 -50
  112. package/src/sap/ui/rta/plugin/CreateContainer.js +2 -2
  113. package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
  114. package/src/sap/ui/rta/plugin/DragDrop.js +4 -4
  115. package/src/sap/ui/rta/plugin/EasyAdd.js +30 -21
  116. package/src/sap/ui/rta/plugin/EasyRemove.js +13 -11
  117. package/src/sap/ui/rta/plugin/LocalReset.js +6 -4
  118. package/src/sap/ui/rta/plugin/Plugin.js +50 -13
  119. package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
  120. package/src/sap/ui/rta/plugin/Remove.js +2 -2
  121. package/src/sap/ui/rta/plugin/Rename.js +2 -2
  122. package/src/sap/ui/rta/plugin/RenameHandler.js +29 -19
  123. package/src/sap/ui/rta/plugin/Resize.js +2 -2
  124. package/src/sap/ui/rta/plugin/Selection.js +7 -14
  125. package/src/sap/ui/rta/plugin/Settings.js +2 -2
  126. package/src/sap/ui/rta/plugin/Split.js +2 -2
  127. package/src/sap/ui/rta/plugin/Stretch.js +17 -16
  128. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +28 -7
  129. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +1 -0
  130. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +2 -2
  131. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +1 -1
  132. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +5 -5
  133. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
  134. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  135. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
  136. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +7 -2
  137. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
  138. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +4 -4
  139. package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
  140. package/src/sap/ui/rta/service/Action.js +2 -2
  141. package/src/sap/ui/rta/service/ControllerExtension.js +3 -3
  142. package/src/sap/ui/rta/service/Outline.js +2 -2
  143. package/src/sap/ui/rta/service/Property.js +2 -2
  144. package/src/sap/ui/rta/service/Receiver.js +1 -1
  145. package/src/sap/ui/rta/service/Selection.js +2 -2
  146. package/src/sap/ui/rta/service/SupportTools.js +2 -2
  147. package/src/sap/ui/rta/service/index.js +1 -1
  148. package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +26 -9
  149. package/src/sap/ui/rta/themes/base/library.source.less +1 -1
  150. package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
  151. package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +82 -0
  152. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +35 -90
  153. package/src/sap/ui/rta/toolbar/Adaptation.js +83 -27
  154. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
  155. package/src/sap/ui/rta/toolbar/Base.js +4 -4
  156. package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
  157. package/src/sap/ui/rta/toolbar/Fiori.js +11 -10
  158. package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
  159. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
  160. package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
  161. package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
  162. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +263 -0
  163. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +149 -0
  164. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +185 -0
  165. package/src/sap/ui/rta/toolbar/contextBased/{SaveAsContextBasedAdaptationDialog.fragment.xml → SaveAsAdaptationDialog.fragment.xml} +19 -15
  166. package/src/sap/ui/rta/toolbar/translation/Translation.js +2 -2
  167. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +4 -4
  168. package/src/sap/ui/rta/util/Animation.js +5 -9
  169. package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
  170. package/src/sap/ui/rta/util/PluginManager.js +2 -2
  171. package/src/sap/ui/rta/util/PopupManager.js +2 -2
  172. package/src/sap/ui/rta/util/ReloadManager.js +2 -2
  173. package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
  174. package/src/sap/ui/rta/util/StylesLoader.js +1 -1
  175. package/src/sap/ui/rta/util/UrlParser.js +1 -1
  176. package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
  177. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
  178. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +4 -3
  179. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +11 -10
  180. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -0
  181. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +28 -4
  182. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -2
  183. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +110 -72
  184. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
  185. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
  186. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
  187. package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
  188. package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
  189. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
  190. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
  191. package/src/sap/ui/rta/util/hasStableId.js +1 -1
  192. package/src/sap/ui/rta/util/showMessageBox.js +1 -1
  193. package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
  194. package/src/sap/ui/rta/util/validateStableIds.js +1 -1
  195. package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +0 -76
  196. package/src/sap/ui/rta/appContexts/Component.js +0 -31
  197. package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +0 -323
  198. package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +0 -22
  199. package/src/sap/ui/rta/appContexts/i18n/i18n.properties +0 -47
  200. package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +0 -23
  201. package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +0 -23
  202. package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +0 -23
  203. package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +0 -23
  204. package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +0 -23
  205. package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +0 -23
  206. package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +0 -23
  207. package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +0 -23
  208. package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +0 -23
  209. package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +0 -23
  210. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +0 -23
  211. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +0 -23
  212. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +0 -23
  213. package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +0 -23
  214. package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +0 -23
  215. package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +0 -23
  216. package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +0 -23
  217. package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +0 -23
  218. package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +0 -23
  219. package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +0 -23
  220. package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +0 -23
  221. package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +0 -23
  222. package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +0 -23
  223. package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +0 -23
  224. package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +0 -23
  225. package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +0 -23
  226. package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +0 -23
  227. package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +0 -23
  228. package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +0 -23
  229. package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +0 -23
  230. package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +0 -23
  231. package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +0 -23
  232. package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +0 -23
  233. package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +0 -23
  234. package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +0 -23
  235. package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +0 -23
  236. package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +0 -23
  237. package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +0 -23
  238. package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +0 -23
  239. package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +0 -23
  240. package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +0 -23
  241. package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +0 -23
  242. package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +0 -23
  243. package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +0 -23
  244. package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +0 -23
  245. package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +0 -23
  246. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +0 -23
  247. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +0 -23
  248. package/src/sap/ui/rta/appContexts/index.html +0 -25
  249. package/src/sap/ui/rta/appContexts/manifest.json +0 -52
  250. package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +0 -76
  251. package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +0 -103
  252. package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +0 -76
  253. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +0 -124
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * OpenUI5
3
- * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
3
+ * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
@@ -23,7 +23,6 @@ sap.ui.define([
23
23
  "sap/ui/dt/Util",
24
24
  "sap/ui/events/KeyCodes",
25
25
  "sap/ui/fl/write/api/Version",
26
- "sap/ui/fl/apply/api/SmartVariantManagementApplyAPI",
27
26
  "sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
28
27
  "sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
29
28
  "sap/ui/fl/write/api/FeaturesAPI",
@@ -71,7 +70,6 @@ sap.ui.define([
71
70
  DtUtil,
72
71
  KeyCodes,
73
72
  Version,
74
- SmartVariantManagementApplyAPI,
75
73
  ContextBasedAdaptationsAPI,
76
74
  ControlPersonalizationWriteAPI,
77
75
  FeaturesAPI,
@@ -118,7 +116,7 @@ sap.ui.define([
118
116
  * @class The runtime authoring allows to adapt the fields of a running application.
119
117
  * @extends sap.ui.base.ManagedObject
120
118
  * @author SAP SE
121
- * @version 1.108.2
119
+ * @version 1.110.0
122
120
  * @constructor
123
121
  * @private
124
122
  * @since 1.30
@@ -299,6 +297,19 @@ sap.ui.define([
299
297
  ReloadManager.disableAutomaticStart(sLayer);
300
298
  };
301
299
 
300
+ /**
301
+ * Check if RTA is about to start or starting after a reload
302
+ * e.g. when reloading without personalization changes
303
+ *
304
+ * @public
305
+ * @static
306
+ * @param {sap.ui.fl.Layer} [sLayer] - Active layer, CUSTOMER by default
307
+ * @returns {boolean} Returns true if RTA is about to start or starting
308
+ */
309
+ RuntimeAuthoring.willRTAStartAfterReload = function(sLayer) {
310
+ return ReloadManager.needsAutomaticStart(sLayer || Layer.CUSTOMER);
311
+ };
312
+
302
313
  RuntimeAuthoring.prototype.addDependent = function(oObject, sName, bCreateGetter) {
303
314
  bCreateGetter = typeof bCreateGetter === "undefined" ? true : !!bCreateGetter;
304
315
  if (!(sName in this._dependents)) {
@@ -382,7 +393,7 @@ sap.ui.define([
382
393
  var oUriParams = UriParameters.fromQuery(window.location.search);
383
394
  var sUriLayer = oUriParams.get("sap-ui-layer");
384
395
 
385
- mFlexSettings = jQuery.extend({}, this.getFlexSettings(), mFlexSettings);
396
+ mFlexSettings = Object.assign({}, this.getFlexSettings(), mFlexSettings);
386
397
  if (sUriLayer) {
387
398
  mFlexSettings.layer = sUriLayer.toUpperCase();
388
399
  }
@@ -459,7 +470,6 @@ sap.ui.define([
459
470
  }
460
471
  var oFlexInfoSession = PersistenceWriteAPI.getResetAndPublishInfoFromSession(this.getRootControlInstance());
461
472
  this.bInitialResetEnabled = !!oFlexInfoSession.isResetEnabled;
462
- this.bInitialPublishEnabled = !!oFlexInfoSession.isPublishEnabled;
463
473
 
464
474
  this._oSerializer = new LREPSerializer({commandStack: this.getCommandStack(), rootControl: this.getRootControl()});
465
475
 
@@ -483,12 +493,13 @@ sap.ui.define([
483
493
  //add root control is triggering overlay creation, so we need to wait for the scope to be set.
484
494
  this._oDesignTime.addRootElement(this._oRootControl);
485
495
 
486
- jQuery(Overlay.getOverlayContainer()).addClass("sapUiRta");
496
+ //TODO: remove when Overlay.getOverlayContainer() does not return jQuery any more
497
+ Overlay.getOverlayContainer().get(0).classList.add("sapUiRta");
487
498
  if (this.getLayer() === Layer.USER) {
488
- jQuery(Overlay.getOverlayContainer()).addClass("sapUiRtaPersonalize");
499
+ Overlay.getOverlayContainer().get(0).classList.add("sapUiRtaPersonalize");
489
500
  } else {
490
501
  // RTA Visual Improvements
491
- jQuery("body").addClass("sapUiRtaMode");
502
+ document.body.classList.add("sapUiRtaMode");
492
503
  }
493
504
  this._oDesignTime.getSelectionManager().attachChange(function(oEvent) {
494
505
  this.fireSelectionChange({selection: oEvent.getParameter("selection")});
@@ -558,6 +569,7 @@ sap.ui.define([
558
569
  validateFlexEnabled(this);
559
570
  }
560
571
  this._sStatus = STARTED;
572
+ RuntimeAuthoring.disableRestart(Layer.CUSTOMER);
561
573
  this.fireStart({
562
574
  editablePluginsCount: this.getPluginManager().getEditableOverlaysCount()
563
575
  });
@@ -576,6 +588,18 @@ sap.ui.define([
576
588
  return Promise.reject("RuntimeAuthoring is already started");
577
589
  };
578
590
 
591
+ function showSaveConfirmation() {
592
+ return Utils.showMessageBox("warning", "MSG_UNSAVED_CHANGES_ON_CLOSE", {
593
+ titleKey: "TIT_UNSAVED_CHANGES_ON_CLOSE",
594
+ actionKeys: [
595
+ "BTN_UNSAVED_CHANGES_ON_CLOSE_SAVE",
596
+ "BTN_UNSAVED_CHANGES_ON_CLOSE_DONT_SAVE"
597
+ ],
598
+ emphasizedActionKey: "BTN_UNSAVED_CHANGES_ON_CLOSE_SAVE",
599
+ showCancel: true
600
+ });
601
+ }
602
+
579
603
  /**
580
604
  * Stops Runtime Authoring
581
605
  *
@@ -585,13 +609,33 @@ sap.ui.define([
585
609
  * @returns {Promise} Resolves with undefined
586
610
  */
587
611
  RuntimeAuthoring.prototype.stop = function(bSkipSave, bSkipRestart) {
588
- checkToolbarAndExecuteFunction.call(this, "setBusy", true);
612
+ var bUserCancelled;
589
613
  var oReloadInfo;
614
+ checkToolbarAndExecuteFunction.call(this, "setBusy", true);
590
615
  return waitForPendingActions.call(this)
616
+ .then(function() {
617
+ var oCommandStack = this.getCommandStack();
618
+ var sLayer = this.getLayer();
619
+ if (sLayer !== Layer.USER && !bSkipSave && oCommandStack.canUndo()) {
620
+ return showSaveConfirmation()
621
+ .then(function (sAction) {
622
+ if (sAction === MessageBox.Action.CANCEL) {
623
+ bUserCancelled = true;
624
+ return Promise.reject();
625
+ }
626
+ if (sAction === this._getTextResources().getText("BTN_UNSAVED_CHANGES_ON_CLOSE_DONT_SAVE")) {
627
+ return this._oSerializer.clearCommandStack(/*bRemoveChanges = */true);
628
+ }
629
+ return undefined;
630
+ }.bind(this));
631
+ }
632
+ return undefined;
633
+ }.bind(this))
591
634
  .then(function() {
592
635
  if (bSkipRestart) {
593
636
  return {};
594
637
  }
638
+ //Reload check must happen before _serializeToLrep is called
595
639
  return ReloadManager.checkReloadOnExit({
596
640
  layer: this.getLayer(),
597
641
  selector: this.getRootControlInstance(),
@@ -603,20 +647,31 @@ sap.ui.define([
603
647
  }.bind(this))
604
648
  .then(function(oReturn) {
605
649
  oReloadInfo = oReturn;
606
- return bSkipSave ? Promise.resolve() : this._serializeToLrep();
650
+ if (!bSkipSave) {
651
+ // serializeToLrep has to be called even when no changes were made -> to invalidate cache
652
+ return this._serializeToLrep();
653
+ }
654
+ return undefined;
607
655
  }.bind(this))
608
- .then(checkToolbarAndExecuteFunction.bind(this, "hide", bSkipSave))
609
656
  .then(function() {
657
+ checkToolbarAndExecuteFunction.call(this, "hide", bSkipSave);
610
658
  this.fireStop();
611
659
  if (!bSkipRestart) {
612
660
  ReloadManager.handleUrlParametersOnExit(oReloadInfo);
613
661
  }
614
662
  }.bind(this))
615
- .catch(showTechnicalError)
663
+ .catch(function(vError) {
664
+ if (!bUserCancelled) {
665
+ return showTechnicalError(vError);
666
+ }
667
+ return undefined;
668
+ })
616
669
  .then(function() {
617
670
  checkToolbarAndExecuteFunction.call(this, "setBusy", false);
618
- this._sStatus = STOPPED;
619
- jQuery("body").removeClass("sapUiRtaMode");
671
+ if (!bUserCancelled) {
672
+ this._sStatus = STOPPED;
673
+ document.body.classList.remove("sapUiRtaMode");
674
+ }
620
675
  }.bind(this));
621
676
  };
622
677
 
@@ -693,9 +748,13 @@ sap.ui.define([
693
748
 
694
749
  Overlay.getOverlayContainer().toggleClass("sapUiRtaVisualizationMode", (sNewMode === "visualization"));
695
750
  if (sNewMode === "visualization") {
696
- jQuery(".sapUiDtOverlayMovable").css("cursor", "default");
751
+ document.querySelectorAll(".sapUiDtOverlayMovable").forEach(function(oNode) {
752
+ oNode.style.cursor = "default";
753
+ });
697
754
  } else {
698
- jQuery(".sapUiDtOverlayMovable").css("cursor", "move");
755
+ document.querySelectorAll(".sapUiDtOverlayMovable").forEach(function(oNode) {
756
+ oNode.style.cursor = "move";
757
+ });
699
758
  }
700
759
 
701
760
  this._oToolbarControlsModel.setProperty("/modeSwitcher", sNewMode);
@@ -813,51 +872,6 @@ sap.ui.define([
813
872
  }.bind(this));
814
873
  };
815
874
 
816
- /**
817
- * Function to handle ABAP transport of the changes
818
- *
819
- * @returns {Promise} Returns a Promise processing the transport of changes
820
- */
821
- RuntimeAuthoring.prototype.transport = function() {
822
- this.getPluginManager().handleStopCutPaste();
823
-
824
- BusyIndicator.show(500);
825
- return this._serializeToLrep().then(function() {
826
- BusyIndicator.hide();
827
- var bVariantByStartupParameter = FlexUtils.isVariantByStartupParameter(this._oRootControl);
828
- var bAppVariantRunning = SmartVariantManagementApplyAPI.isApplicationVariant({control: this._oRootControl}) && !bVariantByStartupParameter;
829
- return (bAppVariantRunning ? RtaAppVariantFeature.getAppVariantDescriptor(this._oRootControl) : Promise.resolve())
830
- .then(function(oAppVariantDescriptor) {
831
- var aAppVariantDescriptor = [];
832
- if (oAppVariantDescriptor) {
833
- aAppVariantDescriptor.push(oAppVariantDescriptor);
834
- }
835
- return PersistenceWriteAPI.publish({
836
- selector: this.getRootControlInstance(),
837
- styleClass: Utils.getRtaStyleClassName(),
838
- layer: this.getLayer(),
839
- appVariantDescriptors: aAppVariantDescriptor
840
- })
841
- .then(function(sMessage) {
842
- if (sMessage !== "Error" && sMessage !== "Cancel") {
843
- MessageToast.show(sMessage);
844
- if (this.getShowToolbars()) {
845
- PersistenceWriteAPI.getResetAndPublishInfo({
846
- selector: this.getRootControlInstance(),
847
- layer: this.getLayer()
848
- })
849
- .then(function(oPublishAndResetInfo) {
850
- this._oToolbarControlsModel.setProperty("/publishEnabled", oPublishAndResetInfo.isPublishEnabled);
851
- this._oToolbarControlsModel.setProperty("/restoreEnabled", oPublishAndResetInfo.isResetEnabled);
852
- }.bind(this));
853
- }
854
- }
855
- }.bind(this));
856
- }.bind(this));
857
- }.bind(this))
858
- .catch(showTechnicalError);
859
- };
860
-
861
875
  RuntimeAuthoring.prototype.undo = function() {
862
876
  this.getPluginManager().handleStopCutPaste();
863
877
  return this.getCommandStack().undo();
@@ -896,6 +910,20 @@ sap.ui.define([
896
910
  return serializeAndSave.call(this, undefined, bCondenseAnyLayer);
897
911
  };
898
912
 
913
+ /**
914
+ * Condenses the given changes and saves the result.
915
+ * For the function to do anything at least two changes have to be passed.
916
+ *
917
+ * @param {object[]} aChanges - Array of flex object instances
918
+ * @returns {Promise} Resolves when the save and condense is done
919
+ * @private
920
+ * @ui5-restricted Visual Editor
921
+ */
922
+ RuntimeAuthoring.prototype.condenseAndSaveChanges = function(/* aChanges */) {
923
+ // for now there is no functionality to only consider passed changes during condensing, so the standard save functionality is triggered
924
+ return this._serializeToLrep.apply(this, arguments);
925
+ };
926
+
899
927
  /**
900
928
  * Check for unsaved changes before leaving UI adaptation at runtime
901
929
  *
@@ -905,8 +933,7 @@ sap.ui.define([
905
933
  RuntimeAuthoring.prototype._onUnload = function() {
906
934
  // this function is still in the prototype scope for easier testing
907
935
  var oCommandStack = this.getCommandStack();
908
- var bUnsaved = oCommandStack.canUndo();
909
- if (bUnsaved && this.getShowWindowUnloadDialog()) {
936
+ if (oCommandStack.canUndo() && this.getShowWindowUnloadDialog()) {
910
937
  return this._getTextResources().getText("MSG_UNSAVED_CHANGES");
911
938
  }
912
939
  window.onbeforeunload = this._oldUnloadHandler;
@@ -1016,7 +1043,7 @@ sap.ui.define([
1016
1043
  }
1017
1044
 
1018
1045
  /**
1019
- * Adapt the enablement of undo/redo/reset/transport button
1046
+ * Adapt the enablement of undo/redo/reset button
1020
1047
  *
1021
1048
  * @returns {Promise} Resolves as soon as the MessageBox is closed
1022
1049
  */
@@ -1056,16 +1083,17 @@ sap.ui.define([
1056
1083
  var oCommandStack = this.getCommandStack();
1057
1084
  var bCanUndo = oCommandStack.canUndo();
1058
1085
  var bCanRedo = oCommandStack.canRedo();
1059
- var bTranslationRelevantDirtyChange = this._oToolbarControlsModel.getProperty("/translationVisible") &&
1086
+ var bWasSaved = oCommandStack.getSaved();
1087
+ var bTranslationRelevantDirtyChange = this._oToolbarControlsModel.getProperty("/translation/visible") &&
1060
1088
  TranslationAPI.hasTranslationRelevantDirtyChanges({layer: Layer.CUSTOMER, selector: this.getRootControlInstance()});
1061
1089
 
1062
1090
  // TODO: move to the setter to the ChangesState
1063
1091
  this._oVersionsModel.setDirtyChanges(PersistenceWriteAPI.hasDirtyChanges({selector: this.getRootControlInstance()}));
1064
- this._oToolbarControlsModel.setProperty("/undoEnabled", bCanUndo);
1065
- this._oToolbarControlsModel.setProperty("/redoEnabled", bCanRedo);
1066
- this._oToolbarControlsModel.setProperty("/publishEnabled", this.bInitialPublishEnabled || bCanUndo);
1067
- this._oToolbarControlsModel.setProperty("/restoreEnabled", this.bInitialResetEnabled || bCanUndo);
1068
- this._oToolbarControlsModel.setProperty("/translationEnabled", this.bPersistedDataTranslatable || bTranslationRelevantDirtyChange);
1092
+ this._oToolbarControlsModel.setProperty("/undo/enabled", bCanUndo);
1093
+ this._oToolbarControlsModel.setProperty("/redo/enabled", bCanRedo);
1094
+ this._oToolbarControlsModel.setProperty("/save/enabled", bCanUndo);
1095
+ this._oToolbarControlsModel.setProperty("/restore/enabled", this.bInitialResetEnabled || bCanUndo || bWasSaved);
1096
+ this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable || bTranslationRelevantDirtyChange);
1069
1097
  }
1070
1098
  this.fireUndoRedoStackModified();
1071
1099
  }
@@ -1085,19 +1113,19 @@ sap.ui.define([
1085
1113
  }
1086
1114
 
1087
1115
  function onKeyDown(oEvent) {
1088
- // if for example the addField Dialog/transport/reset Popup is open, we don't want the user to be able to undo/redo
1116
+ // if for example the addField Dialog/reset Popup is open, we don't want the user to be able to undo/redo
1089
1117
  var bMacintosh = Device.os.macintosh;
1090
1118
  var bFocusInsideOverlayContainer = Overlay.getOverlayContainer().get(0).contains(document.activeElement);
1091
1119
  var bFocusInsideRtaToolbar = this.getShowToolbars() && this.getToolbar().getDomRef().contains(document.activeElement);
1092
1120
  var bFocusOnContextMenu = false;
1093
1121
  // there might be two divs with that style-class (compact and expanded context menu)
1094
- jQuery(".sapUiDtContextMenu").each(function(iIndex, oDomRef) {
1095
- if (oDomRef.contains(document.activeElement)) {
1122
+ document.querySelectorAll(".sapUiDtContextMenu").forEach(function(oNode) {
1123
+ if (oNode.contains(document.activeElement)) {
1096
1124
  bFocusOnContextMenu = true;
1097
1125
  }
1098
1126
  });
1099
1127
  var bFocusOnBody = document.body === document.activeElement;
1100
- var bFocusInsideRenameField = jQuery(document.activeElement).parents(".sapUiRtaEditableField").length > 0;
1128
+ var bFocusInsideRenameField = DOMUtil.getParents(document.activeElement, ".sapUiRtaEditableField").length > 0;
1101
1129
 
1102
1130
  if ((bFocusInsideOverlayContainer || bFocusInsideRtaToolbar || bFocusOnContextMenu || bFocusOnBody) && !bFocusInsideRenameField) {
1103
1131
  // OSX: replace CTRL with CMD
@@ -1127,15 +1155,6 @@ sap.ui.define([
1127
1155
  }
1128
1156
  }
1129
1157
 
1130
- function onSaveAsContextBasedAdaptation(oEvent) {
1131
- var mPropertyBag = {
1132
- parameters: oEvent.mParameters,
1133
- control: this.getRootControlInstance(),
1134
- layer: this.getLayer()
1135
- };
1136
- return ContextBasedAdaptationsAPI.create(mPropertyBag);
1137
- }
1138
-
1139
1158
  function saveOnly(oEvent) {
1140
1159
  var fnCallback = oEvent.getParameter("callback") || function() {};
1141
1160
  return this.save()
@@ -1144,7 +1163,7 @@ sap.ui.define([
1144
1163
 
1145
1164
  function serializeAndSave(bActivateVersion, bCondenseAnyLayer) {
1146
1165
  if (this.getShowToolbars()) {
1147
- this.bPersistedDataTranslatable = this._oToolbarControlsModel.getProperty("/translationEnabled");
1166
+ this.bPersistedDataTranslatable = this._oToolbarControlsModel.getProperty("/translation/enabled");
1148
1167
  }
1149
1168
  var mPropertyBag = {
1150
1169
  // Save changes on the current layer and discard dirty changes on other layers
@@ -1170,6 +1189,7 @@ sap.ui.define([
1170
1189
  if (sAction === MessageBox.Action.OK) {
1171
1190
  return activate.call(this, sVersionTitle);
1172
1191
  }
1192
+ return undefined;
1173
1193
  }.bind(this));
1174
1194
  }
1175
1195
  return activate.call(this, sVersionTitle);
@@ -1190,7 +1210,7 @@ sap.ui.define([
1190
1210
  }).then(function() {
1191
1211
  showMessageToast.call(this, "MSG_DRAFT_ACTIVATION_SUCCESS");
1192
1212
  this.bInitialResetEnabled = true;
1193
- this._oToolbarControlsModel.setProperty("/restoreEnabled", true);
1213
+ this._oToolbarControlsModel.setProperty("/restore/enabled", true);
1194
1214
  this.getCommandStack().removeAllCommands();
1195
1215
  }.bind(this))
1196
1216
  .catch(function(oError) {
@@ -1318,7 +1338,7 @@ sap.ui.define([
1318
1338
  }.bind(this));
1319
1339
  }
1320
1340
 
1321
- function createToolsMenu(aButtonsVisibility) {
1341
+ function createToolsMenu(mButtonsAvailability) {
1322
1342
  if (!this.getDependent("toolbar")) {
1323
1343
  var bUserLayer = this.getLayer() === Layer.USER;
1324
1344
  var oProperties = {
@@ -1333,7 +1353,6 @@ sap.ui.define([
1333
1353
  };
1334
1354
 
1335
1355
  if (!bUserLayer) {
1336
- oProperties.transport = this.transport.bind(this);
1337
1356
  oProperties.publishVersion = onPublishVersion.bind(this);
1338
1357
  oProperties.undo = this.undo.bind(this);
1339
1358
  oProperties.redo = this.redo.bind(this);
@@ -1341,7 +1360,6 @@ sap.ui.define([
1341
1360
  oProperties.activate = onActivate.bind(this);
1342
1361
  oProperties.discardDraft = onDiscardDraft.bind(this);
1343
1362
  oProperties.switchVersion = onSwitchVersion.bind(this);
1344
- oProperties.saveAsContextBasedAdaptation = onSaveAsContextBasedAdaptation.bind(this);
1345
1363
  oProperties.openChangeCategorySelectionPopover = this.getChangeVisualization
1346
1364
  ? this.getChangeVisualization().openChangeCategorySelectionPopover.bind(this.getChangeVisualization())
1347
1365
  : function() {};
@@ -1363,8 +1381,8 @@ sap.ui.define([
1363
1381
  return Promise.all([oToolbar.onFragmentLoaded(), FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer())])
1364
1382
  .then(function(aArguments) {
1365
1383
  var bTranslationAvailable = aArguments[1];
1366
- var bSaveAsAvailable = aButtonsVisibility.saveAsAvailable;
1367
- var bExtendedOverview = bSaveAsAvailable && RtaAppVariantFeature.isOverviewExtended();
1384
+ var bAppVariantsAvailable = mButtonsAvailability.saveAsAvailable;
1385
+ var bExtendedOverview = bAppVariantsAvailable && RtaAppVariantFeature.isOverviewExtended();
1368
1386
  var oUriParameters = UriParameters.fromURL(window.location.href);
1369
1387
  // the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
1370
1388
  var bVisualizationButtonVisible;
@@ -1372,24 +1390,55 @@ sap.ui.define([
1372
1390
  this.bPersistedDataTranslatable = false;
1373
1391
 
1374
1392
  this._oToolbarControlsModel = new JSONModel({
1375
- undoEnabled: false,
1376
- redoEnabled: false,
1377
- translationVisible: bTranslationAvailable,
1378
- translationEnabled: this.bPersistedDataTranslatable,
1379
- publishVisible: aButtonsVisibility.publishAvailable,
1380
- publishEnabled: this.bInitialPublishEnabled,
1381
- restoreEnabled: this.bInitialResetEnabled,
1382
- appVariantsOverviewVisible: bSaveAsAvailable && bExtendedOverview,
1383
- appVariantsOverviewEnabled: bSaveAsAvailable && bExtendedOverview,
1384
- saveAsVisible: bSaveAsAvailable,
1385
- contextBasedAdaptationVisible: aButtonsVisibility.contextBasedAdaptationAvailable,
1386
- saveAsEnabled: false,
1387
- manageAppsVisible: bSaveAsAvailable && !bExtendedOverview,
1388
- manageAppsEnabled: bSaveAsAvailable && !bExtendedOverview,
1389
1393
  modeSwitcher: this.getMode(),
1390
- visualizationButtonVisible: bVisualizationButtonVisible
1394
+ undo: {
1395
+ enabled: false
1396
+ },
1397
+ redo: {
1398
+ enabled: false
1399
+ },
1400
+ save: {
1401
+ enabled: false
1402
+ },
1403
+ translation: {
1404
+ visible: bTranslationAvailable,
1405
+ enabled: this.bPersistedDataTranslatable
1406
+ },
1407
+ appVariantMenu: {
1408
+ visible: bAppVariantsAvailable,
1409
+ enabled: bAppVariantsAvailable,
1410
+ overview: {
1411
+ visible: bAppVariantsAvailable && bExtendedOverview,
1412
+ enabled: bAppVariantsAvailable && bExtendedOverview
1413
+ },
1414
+ manageApps: {
1415
+ visible: bAppVariantsAvailable && !bExtendedOverview,
1416
+ enabled: bAppVariantsAvailable && !bExtendedOverview
1417
+ },
1418
+ saveAs: {
1419
+ visible: bAppVariantsAvailable,
1420
+ enabled: bAppVariantsAvailable
1421
+ }
1422
+ },
1423
+ restore: {
1424
+ visible: !this._oVersionsModel.getProperty("/versioningEnabled"),
1425
+ enabled: this.bInitialResetEnabled
1426
+ },
1427
+ contextBasedAdaptation: {
1428
+ visible: mButtonsAvailability.contextBasedAdaptationAvailable,
1429
+ enabled: mButtonsAvailability.contextBasedAdaptationAvailable
1430
+ },
1431
+ actionsMenuButton: {
1432
+ enabled: true
1433
+ },
1434
+ visualizationButton: {
1435
+ visible: bVisualizationButtonVisible,
1436
+ enabled: bVisualizationButtonVisible
1437
+ }
1391
1438
  });
1392
1439
 
1440
+ this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
1441
+
1393
1442
  var oTranslationPromise = new Promise(function(resolve) {
1394
1443
  if (!bTranslationAvailable) {
1395
1444
  resolve();
@@ -1399,20 +1448,20 @@ sap.ui.define([
1399
1448
  TranslationAPI.getSourceLanguages({selector: this.getRootControlInstance(), layer: this.getLayer()})
1400
1449
  .then(function(aSourceLanguages) {
1401
1450
  this.bPersistedDataTranslatable = aSourceLanguages.length > 0;
1402
- this._oToolbarControlsModel.setProperty("/translationEnabled", this.bPersistedDataTranslatable);
1451
+ this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable);
1403
1452
  }.bind(this)).finally(resolve);
1404
1453
  }.bind(this));
1405
1454
 
1406
1455
  var oSaveAsPromise = new Promise(function(resolve) {
1407
- if (!bSaveAsAvailable) {
1456
+ if (!bAppVariantsAvailable) {
1408
1457
  resolve();
1409
1458
  return;
1410
1459
  }
1411
1460
 
1412
1461
  RtaAppVariantFeature.isManifestSupported().then(function(bResult) {
1413
- this._oToolbarControlsModel.setProperty("/saveAsEnabled", bResult);
1414
- this._oToolbarControlsModel.setProperty("/appVariantsOverviewEnabled", bResult);
1415
- this._oToolbarControlsModel.setProperty("/manageAppsEnabled", bResult);
1462
+ this._oToolbarControlsModel.setProperty("/appVariantMenu/saveAs/enabled", bResult);
1463
+ this._oToolbarControlsModel.setProperty("/appVariantMenu/overview/enabled", bResult);
1464
+ this._oToolbarControlsModel.setProperty("/appVariantMenu/manageApps/enabled", bResult);
1416
1465
  }.bind(this)).finally(resolve);
1417
1466
  }.bind(this));
1418
1467
 
@@ -1572,6 +1621,7 @@ sap.ui.define([
1572
1621
  Log.error("sap.ui.rta: " + oError.message);
1573
1622
  });
1574
1623
  }
1624
+ return undefined;
1575
1625
  }.bind(this));
1576
1626
  return this._pElementModified;
1577
1627
  }
@@ -1650,94 +1700,93 @@ sap.ui.define([
1650
1700
  }
1651
1701
  }
1652
1702
  } else {
1653
- this._mServices[sName] = mService = {
1654
- status: SERVICE_STARTING,
1655
- location: sServiceLocation,
1656
- initPromise: new Promise(function(fnResolve, fnReject) {
1657
- sap.ui.require(
1658
- [sServiceLocation],
1659
- function(fnServiceFactory) {
1660
- mService.factory = fnServiceFactory;
1661
-
1662
- if (!this._oServiceEventBus) {
1663
- this._oServiceEventBus = new ServiceEventBus();
1664
- }
1703
+ this._mServices[sName] = mService = {};
1704
+ mService.status = SERVICE_STARTING;
1705
+ mService.location = sServiceLocation;
1706
+ mService.initPromise = new Promise(function(fnResolve, fnReject) {
1707
+ sap.ui.require(
1708
+ [sServiceLocation],
1709
+ function(fnServiceFactory) {
1710
+ mService.factory = fnServiceFactory;
1711
+
1712
+ if (!this._oServiceEventBus) {
1713
+ this._oServiceEventBus = new ServiceEventBus();
1714
+ }
1665
1715
 
1666
- DtUtil.wrapIntoPromise(fnServiceFactory)(
1667
- this,
1668
- this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
1669
- )
1670
- .then(function(oService) {
1671
- if (this.bIsDestroyed) {
1672
- throw DtUtil.createError(
1673
- "RuntimeAuthoring#startService",
1674
- DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
1675
- "sap.ui.rta"
1676
- );
1677
- }
1678
- if (!isPlainObject(oService)) {
1679
- throw DtUtil.createError(
1680
- "RuntimeAuthoring#startService",
1681
- DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
1682
- "sap.ui.rta"
1683
- );
1684
- }
1685
-
1686
- mService.service = oService;
1687
- mService.exports = {};
1688
-
1689
- // Expose events API if there is at least one event
1690
- if (Array.isArray(oService.events) && oService.events.length > 0) {
1691
- jQuery.extend(mService.exports, {
1692
- attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
1693
- detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
1694
- attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
1695
- });
1696
- }
1697
-
1698
- // Expose methods/properties from exports object if any
1699
- var mExports = oService.exports || {};
1700
- jQuery.extend(
1701
- mService.exports,
1702
- Object.keys(mExports).reduce(function(mResult, sKey) {
1703
- var vValue = mExports[sKey];
1704
- mResult[sKey] = typeof vValue === "function"
1705
- ? DtUtil.waitForSynced(this._oDesignTime, vValue)
1706
- : vValue;
1707
- return mResult;
1708
- }.bind(this), {})
1716
+ DtUtil.wrapIntoPromise(fnServiceFactory)(
1717
+ this,
1718
+ this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
1719
+ )
1720
+ .then(function(oService) {
1721
+ if (this.bIsDestroyed) {
1722
+ throw DtUtil.createError(
1723
+ "RuntimeAuthoring#startService",
1724
+ DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
1725
+ "sap.ui.rta"
1709
1726
  );
1710
-
1711
- mService.status = SERVICE_STARTED;
1712
- fnResolve(Object.freeze(mService.exports));
1713
- }.bind(this))
1714
- .catch(fnReject);
1715
- }.bind(this),
1716
- function(vError) {
1717
- mService.status = SERVICE_FAILED;
1718
- fnReject(
1719
- DtUtil.propagateError(
1720
- vError,
1721
- "RuntimeAuthoring#startService",
1722
- DtUtil.printf("Can't load service '{0}' by its name: {1}", sName, sServiceLocation),
1723
- "sap.ui.rta"
1724
- )
1725
- );
1726
- }
1727
- );
1728
- }.bind(this))
1729
- .catch(function(vError) {
1727
+ }
1728
+ if (!isPlainObject(oService)) {
1729
+ throw DtUtil.createError(
1730
+ "RuntimeAuthoring#startService",
1731
+ DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
1732
+ "sap.ui.rta"
1733
+ );
1734
+ }
1735
+
1736
+ mService.service = oService;
1737
+ mService.exports = {};
1738
+
1739
+ // Expose events API if there is at least one event
1740
+ if (Array.isArray(oService.events) && oService.events.length > 0) {
1741
+ Object.assign(mService.exports, {
1742
+ attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
1743
+ detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
1744
+ attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
1745
+ });
1746
+ }
1747
+
1748
+ // Expose methods/properties from exports object if any
1749
+ var mExports = oService.exports || {};
1750
+ Object.assign(
1751
+ mService.exports,
1752
+ Object.keys(mExports).reduce(function(mResult, sKey) {
1753
+ var vValue = mExports[sKey];
1754
+ mResult[sKey] = typeof vValue === "function"
1755
+ ? DtUtil.waitForSynced(this._oDesignTime, vValue)
1756
+ : vValue;
1757
+ return mResult;
1758
+ }.bind(this), {})
1759
+ );
1760
+
1761
+ mService.status = SERVICE_STARTED;
1762
+ fnResolve(Object.freeze(mService.exports));
1763
+ }.bind(this))
1764
+ .catch(fnReject);
1765
+ }.bind(this),
1766
+ function(vError) {
1730
1767
  mService.status = SERVICE_FAILED;
1731
- return Promise.reject(
1768
+ fnReject(
1732
1769
  DtUtil.propagateError(
1733
1770
  vError,
1734
1771
  "RuntimeAuthoring#startService",
1735
- DtUtil.printf("Error during service '{0}' initialization.", sName),
1772
+ DtUtil.printf("Can't load service '{0}' by its name: {1}", sName, sServiceLocation),
1736
1773
  "sap.ui.rta"
1737
1774
  )
1738
1775
  );
1739
- })
1740
- };
1776
+ }
1777
+ );
1778
+ }.bind(this))
1779
+ .catch(function(vError) {
1780
+ mService.status = SERVICE_FAILED;
1781
+ return Promise.reject(
1782
+ DtUtil.propagateError(
1783
+ vError,
1784
+ "RuntimeAuthoring#startService",
1785
+ DtUtil.printf("Error during service '{0}' initialization.", sName),
1786
+ "sap.ui.rta"
1787
+ )
1788
+ );
1789
+ });
1741
1790
 
1742
1791
  return mService.initPromise;
1743
1792
  }
@@ -1776,4 +1825,4 @@ sap.ui.define([
1776
1825
  };
1777
1826
 
1778
1827
  return RuntimeAuthoring;
1779
- });
1828
+ });