@openui5/sap.ui.rta 1.109.0 → 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 (196) 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 +224 -143
  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 +2 -2
  24. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +2 -2
  25. package/src/sap/ui/rta/command/AppDescriptorCommand.js +2 -2
  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 +2 -2
  32. package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
  33. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +2 -2
  34. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +2 -2
  35. package/src/sap/ui/rta/command/ControlVariantSwitch.js +2 -2
  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 +2 -2
  39. package/src/sap/ui/rta/command/LREPSerializer.js +27 -12
  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 -2
  52. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
  53. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
  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 +2 -2
  57. package/src/sap/ui/rta/library.js +3 -3
  58. package/src/sap/ui/rta/messagebundle.properties +59 -13
  59. package/src/sap/ui/rta/messagebundle_ar.properties +32 -11
  60. package/src/sap/ui/rta/messagebundle_bg.properties +32 -11
  61. package/src/sap/ui/rta/messagebundle_ca.properties +32 -11
  62. package/src/sap/ui/rta/messagebundle_cs.properties +32 -11
  63. package/src/sap/ui/rta/messagebundle_cy.properties +31 -10
  64. package/src/sap/ui/rta/messagebundle_da.properties +31 -10
  65. package/src/sap/ui/rta/messagebundle_de.properties +34 -13
  66. package/src/sap/ui/rta/messagebundle_el.properties +31 -10
  67. package/src/sap/ui/rta/messagebundle_en.properties +30 -9
  68. package/src/sap/ui/rta/messagebundle_en_GB.properties +30 -9
  69. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +28 -5
  70. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +28 -5
  71. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +28 -7
  72. package/src/sap/ui/rta/messagebundle_es.properties +31 -10
  73. package/src/sap/ui/rta/messagebundle_es_MX.properties +31 -10
  74. package/src/sap/ui/rta/messagebundle_et.properties +31 -10
  75. package/src/sap/ui/rta/messagebundle_fi.properties +31 -10
  76. package/src/sap/ui/rta/messagebundle_fr.properties +31 -10
  77. package/src/sap/ui/rta/messagebundle_fr_CA.properties +32 -11
  78. package/src/sap/ui/rta/messagebundle_hi.properties +32 -11
  79. package/src/sap/ui/rta/messagebundle_hr.properties +32 -11
  80. package/src/sap/ui/rta/messagebundle_hu.properties +31 -10
  81. package/src/sap/ui/rta/messagebundle_id.properties +32 -11
  82. package/src/sap/ui/rta/messagebundle_it.properties +32 -11
  83. package/src/sap/ui/rta/messagebundle_iw.properties +31 -10
  84. package/src/sap/ui/rta/messagebundle_ja.properties +32 -11
  85. package/src/sap/ui/rta/messagebundle_kk.properties +31 -10
  86. package/src/sap/ui/rta/messagebundle_ko.properties +31 -10
  87. package/src/sap/ui/rta/messagebundle_lt.properties +31 -10
  88. package/src/sap/ui/rta/messagebundle_lv.properties +32 -11
  89. package/src/sap/ui/rta/messagebundle_ms.properties +32 -11
  90. package/src/sap/ui/rta/messagebundle_nl.properties +31 -10
  91. package/src/sap/ui/rta/messagebundle_no.properties +32 -11
  92. package/src/sap/ui/rta/messagebundle_pl.properties +32 -11
  93. package/src/sap/ui/rta/messagebundle_pt.properties +32 -11
  94. package/src/sap/ui/rta/messagebundle_pt_PT.properties +31 -10
  95. package/src/sap/ui/rta/messagebundle_ro.properties +32 -11
  96. package/src/sap/ui/rta/messagebundle_ru.properties +32 -11
  97. package/src/sap/ui/rta/messagebundle_sh.properties +31 -10
  98. package/src/sap/ui/rta/messagebundle_sk.properties +31 -10
  99. package/src/sap/ui/rta/messagebundle_sl.properties +31 -10
  100. package/src/sap/ui/rta/messagebundle_sv.properties +32 -11
  101. package/src/sap/ui/rta/messagebundle_th.properties +33 -12
  102. package/src/sap/ui/rta/messagebundle_tr.properties +31 -10
  103. package/src/sap/ui/rta/messagebundle_uk.properties +31 -10
  104. package/src/sap/ui/rta/messagebundle_vi.properties +32 -11
  105. package/src/sap/ui/rta/messagebundle_zh_CN.properties +32 -11
  106. package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -11
  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 +4 -6
  111. package/src/sap/ui/rta/plugin/ControlVariant.js +2 -2
  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 +2 -2
  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 +28 -18
  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 +2 -2
  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/AddIFrame.less +1 -1
  149. package/src/sap/ui/rta/themes/base/Dialogs.less +1 -1
  150. package/src/sap/ui/rta/themes/base/FieldRepository.less +1 -1
  151. package/src/sap/ui/rta/themes/base/library.source.less +1 -1
  152. package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
  153. package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +82 -0
  154. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +35 -79
  155. package/src/sap/ui/rta/toolbar/Adaptation.js +83 -25
  156. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
  157. package/src/sap/ui/rta/toolbar/Base.js +4 -4
  158. package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
  159. package/src/sap/ui/rta/toolbar/Fiori.js +11 -10
  160. package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
  161. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
  162. package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
  163. package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
  164. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +263 -0
  165. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +149 -0
  166. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +185 -0
  167. package/src/sap/ui/rta/toolbar/contextBased/{SaveAsContextBasedAdaptationDialog.fragment.xml → SaveAsAdaptationDialog.fragment.xml} +19 -15
  168. package/src/sap/ui/rta/toolbar/translation/Translation.js +2 -2
  169. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +4 -4
  170. package/src/sap/ui/rta/util/Animation.js +5 -9
  171. package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
  172. package/src/sap/ui/rta/util/PluginManager.js +2 -2
  173. package/src/sap/ui/rta/util/PopupManager.js +2 -2
  174. package/src/sap/ui/rta/util/ReloadManager.js +2 -2
  175. package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
  176. package/src/sap/ui/rta/util/StylesLoader.js +1 -1
  177. package/src/sap/ui/rta/util/UrlParser.js +1 -1
  178. package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
  179. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
  180. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +3 -3
  181. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +1 -1
  182. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +27 -3
  183. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -2
  184. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +109 -71
  185. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
  186. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
  187. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
  188. package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
  189. package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
  190. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
  191. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
  192. package/src/sap/ui/rta/util/hasStableId.js +1 -1
  193. package/src/sap/ui/rta/util/showMessageBox.js +1 -1
  194. package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
  195. package/src/sap/ui/rta/util/validateStableIds.js +1 -1
  196. 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.109.0
119
+ * @version 1.110.0
122
120
  * @constructor
123
121
  * @private
124
122
  * @since 1.30
@@ -395,7 +393,7 @@ sap.ui.define([
395
393
  var oUriParams = UriParameters.fromQuery(window.location.search);
396
394
  var sUriLayer = oUriParams.get("sap-ui-layer");
397
395
 
398
- mFlexSettings = jQuery.extend({}, this.getFlexSettings(), mFlexSettings);
396
+ mFlexSettings = Object.assign({}, this.getFlexSettings(), mFlexSettings);
399
397
  if (sUriLayer) {
400
398
  mFlexSettings.layer = sUriLayer.toUpperCase();
401
399
  }
@@ -472,7 +470,6 @@ sap.ui.define([
472
470
  }
473
471
  var oFlexInfoSession = PersistenceWriteAPI.getResetAndPublishInfoFromSession(this.getRootControlInstance());
474
472
  this.bInitialResetEnabled = !!oFlexInfoSession.isResetEnabled;
475
- this.bInitialPublishEnabled = !!oFlexInfoSession.isPublishEnabled;
476
473
 
477
474
  this._oSerializer = new LREPSerializer({commandStack: this.getCommandStack(), rootControl: this.getRootControl()});
478
475
 
@@ -496,12 +493,13 @@ sap.ui.define([
496
493
  //add root control is triggering overlay creation, so we need to wait for the scope to be set.
497
494
  this._oDesignTime.addRootElement(this._oRootControl);
498
495
 
499
- 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");
500
498
  if (this.getLayer() === Layer.USER) {
501
- jQuery(Overlay.getOverlayContainer()).addClass("sapUiRtaPersonalize");
499
+ Overlay.getOverlayContainer().get(0).classList.add("sapUiRtaPersonalize");
502
500
  } else {
503
501
  // RTA Visual Improvements
504
- jQuery("body").addClass("sapUiRtaMode");
502
+ document.body.classList.add("sapUiRtaMode");
505
503
  }
506
504
  this._oDesignTime.getSelectionManager().attachChange(function(oEvent) {
507
505
  this.fireSelectionChange({selection: oEvent.getParameter("selection")});
@@ -590,6 +588,18 @@ sap.ui.define([
590
588
  return Promise.reject("RuntimeAuthoring is already started");
591
589
  };
592
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
+
593
603
  /**
594
604
  * Stops Runtime Authoring
595
605
  *
@@ -599,13 +609,33 @@ sap.ui.define([
599
609
  * @returns {Promise} Resolves with undefined
600
610
  */
601
611
  RuntimeAuthoring.prototype.stop = function(bSkipSave, bSkipRestart) {
602
- checkToolbarAndExecuteFunction.call(this, "setBusy", true);
612
+ var bUserCancelled;
603
613
  var oReloadInfo;
614
+ checkToolbarAndExecuteFunction.call(this, "setBusy", true);
604
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))
605
634
  .then(function() {
606
635
  if (bSkipRestart) {
607
636
  return {};
608
637
  }
638
+ //Reload check must happen before _serializeToLrep is called
609
639
  return ReloadManager.checkReloadOnExit({
610
640
  layer: this.getLayer(),
611
641
  selector: this.getRootControlInstance(),
@@ -617,20 +647,31 @@ sap.ui.define([
617
647
  }.bind(this))
618
648
  .then(function(oReturn) {
619
649
  oReloadInfo = oReturn;
620
- 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;
621
655
  }.bind(this))
622
- .then(checkToolbarAndExecuteFunction.bind(this, "hide", bSkipSave))
623
656
  .then(function() {
657
+ checkToolbarAndExecuteFunction.call(this, "hide", bSkipSave);
624
658
  this.fireStop();
625
659
  if (!bSkipRestart) {
626
660
  ReloadManager.handleUrlParametersOnExit(oReloadInfo);
627
661
  }
628
662
  }.bind(this))
629
- .catch(showTechnicalError)
663
+ .catch(function(vError) {
664
+ if (!bUserCancelled) {
665
+ return showTechnicalError(vError);
666
+ }
667
+ return undefined;
668
+ })
630
669
  .then(function() {
631
670
  checkToolbarAndExecuteFunction.call(this, "setBusy", false);
632
- this._sStatus = STOPPED;
633
- jQuery("body").removeClass("sapUiRtaMode");
671
+ if (!bUserCancelled) {
672
+ this._sStatus = STOPPED;
673
+ document.body.classList.remove("sapUiRtaMode");
674
+ }
634
675
  }.bind(this));
635
676
  };
636
677
 
@@ -707,9 +748,13 @@ sap.ui.define([
707
748
 
708
749
  Overlay.getOverlayContainer().toggleClass("sapUiRtaVisualizationMode", (sNewMode === "visualization"));
709
750
  if (sNewMode === "visualization") {
710
- jQuery(".sapUiDtOverlayMovable").css("cursor", "default");
751
+ document.querySelectorAll(".sapUiDtOverlayMovable").forEach(function(oNode) {
752
+ oNode.style.cursor = "default";
753
+ });
711
754
  } else {
712
- jQuery(".sapUiDtOverlayMovable").css("cursor", "move");
755
+ document.querySelectorAll(".sapUiDtOverlayMovable").forEach(function(oNode) {
756
+ oNode.style.cursor = "move";
757
+ });
713
758
  }
714
759
 
715
760
  this._oToolbarControlsModel.setProperty("/modeSwitcher", sNewMode);
@@ -865,6 +910,20 @@ sap.ui.define([
865
910
  return serializeAndSave.call(this, undefined, bCondenseAnyLayer);
866
911
  };
867
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
+
868
927
  /**
869
928
  * Check for unsaved changes before leaving UI adaptation at runtime
870
929
  *
@@ -874,8 +933,7 @@ sap.ui.define([
874
933
  RuntimeAuthoring.prototype._onUnload = function() {
875
934
  // this function is still in the prototype scope for easier testing
876
935
  var oCommandStack = this.getCommandStack();
877
- var bUnsaved = oCommandStack.canUndo();
878
- if (bUnsaved && this.getShowWindowUnloadDialog()) {
936
+ if (oCommandStack.canUndo() && this.getShowWindowUnloadDialog()) {
879
937
  return this._getTextResources().getText("MSG_UNSAVED_CHANGES");
880
938
  }
881
939
  window.onbeforeunload = this._oldUnloadHandler;
@@ -1025,16 +1083,17 @@ sap.ui.define([
1025
1083
  var oCommandStack = this.getCommandStack();
1026
1084
  var bCanUndo = oCommandStack.canUndo();
1027
1085
  var bCanRedo = oCommandStack.canRedo();
1028
- var bTranslationRelevantDirtyChange = this._oToolbarControlsModel.getProperty("/translationVisible") &&
1086
+ var bWasSaved = oCommandStack.getSaved();
1087
+ var bTranslationRelevantDirtyChange = this._oToolbarControlsModel.getProperty("/translation/visible") &&
1029
1088
  TranslationAPI.hasTranslationRelevantDirtyChanges({layer: Layer.CUSTOMER, selector: this.getRootControlInstance()});
1030
1089
 
1031
1090
  // TODO: move to the setter to the ChangesState
1032
1091
  this._oVersionsModel.setDirtyChanges(PersistenceWriteAPI.hasDirtyChanges({selector: this.getRootControlInstance()}));
1033
- this._oToolbarControlsModel.setProperty("/undoEnabled", bCanUndo);
1034
- this._oToolbarControlsModel.setProperty("/redoEnabled", bCanRedo);
1035
- this._oToolbarControlsModel.setProperty("/publishEnabled", this.bInitialPublishEnabled || bCanUndo);
1036
- this._oToolbarControlsModel.setProperty("/restoreEnabled", this.bInitialResetEnabled || bCanUndo);
1037
- 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);
1038
1097
  }
1039
1098
  this.fireUndoRedoStackModified();
1040
1099
  }
@@ -1060,13 +1119,13 @@ sap.ui.define([
1060
1119
  var bFocusInsideRtaToolbar = this.getShowToolbars() && this.getToolbar().getDomRef().contains(document.activeElement);
1061
1120
  var bFocusOnContextMenu = false;
1062
1121
  // there might be two divs with that style-class (compact and expanded context menu)
1063
- jQuery(".sapUiDtContextMenu").each(function(iIndex, oDomRef) {
1064
- if (oDomRef.contains(document.activeElement)) {
1122
+ document.querySelectorAll(".sapUiDtContextMenu").forEach(function(oNode) {
1123
+ if (oNode.contains(document.activeElement)) {
1065
1124
  bFocusOnContextMenu = true;
1066
1125
  }
1067
1126
  });
1068
1127
  var bFocusOnBody = document.body === document.activeElement;
1069
- var bFocusInsideRenameField = jQuery(document.activeElement).parents(".sapUiRtaEditableField").length > 0;
1128
+ var bFocusInsideRenameField = DOMUtil.getParents(document.activeElement, ".sapUiRtaEditableField").length > 0;
1070
1129
 
1071
1130
  if ((bFocusInsideOverlayContainer || bFocusInsideRtaToolbar || bFocusOnContextMenu || bFocusOnBody) && !bFocusInsideRenameField) {
1072
1131
  // OSX: replace CTRL with CMD
@@ -1096,15 +1155,6 @@ sap.ui.define([
1096
1155
  }
1097
1156
  }
1098
1157
 
1099
- function onSaveAsContextBasedAdaptation(oEvent) {
1100
- var mPropertyBag = {
1101
- parameters: oEvent.mParameters,
1102
- control: this.getRootControlInstance(),
1103
- layer: this.getLayer()
1104
- };
1105
- return ContextBasedAdaptationsAPI.create(mPropertyBag);
1106
- }
1107
-
1108
1158
  function saveOnly(oEvent) {
1109
1159
  var fnCallback = oEvent.getParameter("callback") || function() {};
1110
1160
  return this.save()
@@ -1113,7 +1163,7 @@ sap.ui.define([
1113
1163
 
1114
1164
  function serializeAndSave(bActivateVersion, bCondenseAnyLayer) {
1115
1165
  if (this.getShowToolbars()) {
1116
- this.bPersistedDataTranslatable = this._oToolbarControlsModel.getProperty("/translationEnabled");
1166
+ this.bPersistedDataTranslatable = this._oToolbarControlsModel.getProperty("/translation/enabled");
1117
1167
  }
1118
1168
  var mPropertyBag = {
1119
1169
  // Save changes on the current layer and discard dirty changes on other layers
@@ -1139,6 +1189,7 @@ sap.ui.define([
1139
1189
  if (sAction === MessageBox.Action.OK) {
1140
1190
  return activate.call(this, sVersionTitle);
1141
1191
  }
1192
+ return undefined;
1142
1193
  }.bind(this));
1143
1194
  }
1144
1195
  return activate.call(this, sVersionTitle);
@@ -1159,7 +1210,7 @@ sap.ui.define([
1159
1210
  }).then(function() {
1160
1211
  showMessageToast.call(this, "MSG_DRAFT_ACTIVATION_SUCCESS");
1161
1212
  this.bInitialResetEnabled = true;
1162
- this._oToolbarControlsModel.setProperty("/restoreEnabled", true);
1213
+ this._oToolbarControlsModel.setProperty("/restore/enabled", true);
1163
1214
  this.getCommandStack().removeAllCommands();
1164
1215
  }.bind(this))
1165
1216
  .catch(function(oError) {
@@ -1287,7 +1338,7 @@ sap.ui.define([
1287
1338
  }.bind(this));
1288
1339
  }
1289
1340
 
1290
- function createToolsMenu(aButtonsVisibility) {
1341
+ function createToolsMenu(mButtonsAvailability) {
1291
1342
  if (!this.getDependent("toolbar")) {
1292
1343
  var bUserLayer = this.getLayer() === Layer.USER;
1293
1344
  var oProperties = {
@@ -1309,7 +1360,6 @@ sap.ui.define([
1309
1360
  oProperties.activate = onActivate.bind(this);
1310
1361
  oProperties.discardDraft = onDiscardDraft.bind(this);
1311
1362
  oProperties.switchVersion = onSwitchVersion.bind(this);
1312
- oProperties.saveAsContextBasedAdaptation = onSaveAsContextBasedAdaptation.bind(this);
1313
1363
  oProperties.openChangeCategorySelectionPopover = this.getChangeVisualization
1314
1364
  ? this.getChangeVisualization().openChangeCategorySelectionPopover.bind(this.getChangeVisualization())
1315
1365
  : function() {};
@@ -1331,8 +1381,8 @@ sap.ui.define([
1331
1381
  return Promise.all([oToolbar.onFragmentLoaded(), FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer())])
1332
1382
  .then(function(aArguments) {
1333
1383
  var bTranslationAvailable = aArguments[1];
1334
- var bSaveAsAvailable = aButtonsVisibility.saveAsAvailable;
1335
- var bExtendedOverview = bSaveAsAvailable && RtaAppVariantFeature.isOverviewExtended();
1384
+ var bAppVariantsAvailable = mButtonsAvailability.saveAsAvailable;
1385
+ var bExtendedOverview = bAppVariantsAvailable && RtaAppVariantFeature.isOverviewExtended();
1336
1386
  var oUriParameters = UriParameters.fromURL(window.location.href);
1337
1387
  // the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
1338
1388
  var bVisualizationButtonVisible;
@@ -1340,24 +1390,55 @@ sap.ui.define([
1340
1390
  this.bPersistedDataTranslatable = false;
1341
1391
 
1342
1392
  this._oToolbarControlsModel = new JSONModel({
1343
- undoEnabled: false,
1344
- redoEnabled: false,
1345
- translationVisible: bTranslationAvailable,
1346
- translationEnabled: this.bPersistedDataTranslatable,
1347
- publishVisible: aButtonsVisibility.publishAvailable,
1348
- publishEnabled: this.bInitialPublishEnabled,
1349
- restoreEnabled: this.bInitialResetEnabled,
1350
- appVariantsOverviewVisible: bSaveAsAvailable && bExtendedOverview,
1351
- appVariantsOverviewEnabled: bSaveAsAvailable && bExtendedOverview,
1352
- saveAsVisible: bSaveAsAvailable,
1353
- contextBasedAdaptationVisible: aButtonsVisibility.contextBasedAdaptationAvailable,
1354
- saveAsEnabled: false,
1355
- manageAppsVisible: bSaveAsAvailable && !bExtendedOverview,
1356
- manageAppsEnabled: bSaveAsAvailable && !bExtendedOverview,
1357
1393
  modeSwitcher: this.getMode(),
1358
- 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
+ }
1359
1438
  });
1360
1439
 
1440
+ this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
1441
+
1361
1442
  var oTranslationPromise = new Promise(function(resolve) {
1362
1443
  if (!bTranslationAvailable) {
1363
1444
  resolve();
@@ -1367,20 +1448,20 @@ sap.ui.define([
1367
1448
  TranslationAPI.getSourceLanguages({selector: this.getRootControlInstance(), layer: this.getLayer()})
1368
1449
  .then(function(aSourceLanguages) {
1369
1450
  this.bPersistedDataTranslatable = aSourceLanguages.length > 0;
1370
- this._oToolbarControlsModel.setProperty("/translationEnabled", this.bPersistedDataTranslatable);
1451
+ this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable);
1371
1452
  }.bind(this)).finally(resolve);
1372
1453
  }.bind(this));
1373
1454
 
1374
1455
  var oSaveAsPromise = new Promise(function(resolve) {
1375
- if (!bSaveAsAvailable) {
1456
+ if (!bAppVariantsAvailable) {
1376
1457
  resolve();
1377
1458
  return;
1378
1459
  }
1379
1460
 
1380
1461
  RtaAppVariantFeature.isManifestSupported().then(function(bResult) {
1381
- this._oToolbarControlsModel.setProperty("/saveAsEnabled", bResult);
1382
- this._oToolbarControlsModel.setProperty("/appVariantsOverviewEnabled", bResult);
1383
- 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);
1384
1465
  }.bind(this)).finally(resolve);
1385
1466
  }.bind(this));
1386
1467
 
@@ -1540,6 +1621,7 @@ sap.ui.define([
1540
1621
  Log.error("sap.ui.rta: " + oError.message);
1541
1622
  });
1542
1623
  }
1624
+ return undefined;
1543
1625
  }.bind(this));
1544
1626
  return this._pElementModified;
1545
1627
  }
@@ -1618,94 +1700,93 @@ sap.ui.define([
1618
1700
  }
1619
1701
  }
1620
1702
  } else {
1621
- this._mServices[sName] = mService = {
1622
- status: SERVICE_STARTING,
1623
- location: sServiceLocation,
1624
- initPromise: new Promise(function(fnResolve, fnReject) {
1625
- sap.ui.require(
1626
- [sServiceLocation],
1627
- function(fnServiceFactory) {
1628
- mService.factory = fnServiceFactory;
1629
-
1630
- if (!this._oServiceEventBus) {
1631
- this._oServiceEventBus = new ServiceEventBus();
1632
- }
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
+ }
1633
1715
 
1634
- DtUtil.wrapIntoPromise(fnServiceFactory)(
1635
- this,
1636
- this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
1637
- )
1638
- .then(function(oService) {
1639
- if (this.bIsDestroyed) {
1640
- throw DtUtil.createError(
1641
- "RuntimeAuthoring#startService",
1642
- DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
1643
- "sap.ui.rta"
1644
- );
1645
- }
1646
- if (!isPlainObject(oService)) {
1647
- throw DtUtil.createError(
1648
- "RuntimeAuthoring#startService",
1649
- DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
1650
- "sap.ui.rta"
1651
- );
1652
- }
1653
-
1654
- mService.service = oService;
1655
- mService.exports = {};
1656
-
1657
- // Expose events API if there is at least one event
1658
- if (Array.isArray(oService.events) && oService.events.length > 0) {
1659
- jQuery.extend(mService.exports, {
1660
- attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
1661
- detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
1662
- attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
1663
- });
1664
- }
1665
-
1666
- // Expose methods/properties from exports object if any
1667
- var mExports = oService.exports || {};
1668
- jQuery.extend(
1669
- mService.exports,
1670
- Object.keys(mExports).reduce(function(mResult, sKey) {
1671
- var vValue = mExports[sKey];
1672
- mResult[sKey] = typeof vValue === "function"
1673
- ? DtUtil.waitForSynced(this._oDesignTime, vValue)
1674
- : vValue;
1675
- return mResult;
1676
- }.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"
1677
1726
  );
1678
-
1679
- mService.status = SERVICE_STARTED;
1680
- fnResolve(Object.freeze(mService.exports));
1681
- }.bind(this))
1682
- .catch(fnReject);
1683
- }.bind(this),
1684
- function(vError) {
1685
- mService.status = SERVICE_FAILED;
1686
- fnReject(
1687
- DtUtil.propagateError(
1688
- vError,
1689
- "RuntimeAuthoring#startService",
1690
- DtUtil.printf("Can't load service '{0}' by its name: {1}", sName, sServiceLocation),
1691
- "sap.ui.rta"
1692
- )
1693
- );
1694
- }
1695
- );
1696
- }.bind(this))
1697
- .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) {
1698
1767
  mService.status = SERVICE_FAILED;
1699
- return Promise.reject(
1768
+ fnReject(
1700
1769
  DtUtil.propagateError(
1701
1770
  vError,
1702
1771
  "RuntimeAuthoring#startService",
1703
- DtUtil.printf("Error during service '{0}' initialization.", sName),
1772
+ DtUtil.printf("Can't load service '{0}' by its name: {1}", sName, sServiceLocation),
1704
1773
  "sap.ui.rta"
1705
1774
  )
1706
1775
  );
1707
- })
1708
- };
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
+ });
1709
1790
 
1710
1791
  return mService.initPromise;
1711
1792
  }
@@ -1744,4 +1825,4 @@ sap.ui.define([
1744
1825
  };
1745
1826
 
1746
1827
  return RuntimeAuthoring;
1747
- });
1828
+ });