@openui5/sap.ui.rta 1.97.1 → 1.98.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 (145) hide show
  1. package/.reuse/dep5 +25 -30
  2. package/THIRDPARTY.txt +13 -20
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +1 -1
  5. package/src/sap/ui/rta/Client.js +1 -1
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +184 -134
  7. package/src/sap/ui/rta/Utils.js +1 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  9. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -4
  10. package/src/sap/ui/rta/appVariant/Feature.js +6 -5
  11. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  12. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  13. package/src/sap/ui/rta/command/AddXML.js +1 -1
  14. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  15. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  16. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  17. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  18. package/src/sap/ui/rta/command/Combine.js +1 -1
  19. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  20. package/src/sap/ui/rta/command/CompositeCommand.js +5 -5
  21. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  23. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  24. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  25. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  26. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  27. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  28. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  29. package/src/sap/ui/rta/command/LREPSerializer.js +11 -3
  30. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  31. package/src/sap/ui/rta/command/Move.js +1 -1
  32. package/src/sap/ui/rta/command/Property.js +1 -1
  33. package/src/sap/ui/rta/command/Remove.js +1 -1
  34. package/src/sap/ui/rta/command/Rename.js +1 -1
  35. package/src/sap/ui/rta/command/Reveal.js +1 -1
  36. package/src/sap/ui/rta/command/Settings.js +1 -1
  37. package/src/sap/ui/rta/command/Split.js +1 -1
  38. package/src/sap/ui/rta/command/Stack.js +15 -21
  39. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  42. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  43. package/src/sap/ui/rta/enablement/elementActionTest.js +2 -2
  44. package/src/sap/ui/rta/library.js +2 -2
  45. package/src/sap/ui/rta/messagebundle.properties +30 -13
  46. package/src/sap/ui/rta/messagebundle_ar.properties +15 -6
  47. package/src/sap/ui/rta/messagebundle_bg.properties +15 -6
  48. package/src/sap/ui/rta/messagebundle_ca.properties +15 -6
  49. package/src/sap/ui/rta/messagebundle_cs.properties +15 -6
  50. package/src/sap/ui/rta/messagebundle_cy.properties +15 -6
  51. package/src/sap/ui/rta/messagebundle_da.properties +15 -6
  52. package/src/sap/ui/rta/messagebundle_de.properties +15 -6
  53. package/src/sap/ui/rta/messagebundle_el.properties +15 -6
  54. package/src/sap/ui/rta/messagebundle_en.properties +15 -6
  55. package/src/sap/ui/rta/messagebundle_en_GB.properties +15 -6
  56. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +15 -6
  57. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +17 -8
  58. package/src/sap/ui/rta/messagebundle_es.properties +15 -6
  59. package/src/sap/ui/rta/messagebundle_es_MX.properties +18 -9
  60. package/src/sap/ui/rta/messagebundle_et.properties +16 -7
  61. package/src/sap/ui/rta/messagebundle_fi.properties +15 -6
  62. package/src/sap/ui/rta/messagebundle_fr.properties +15 -6
  63. package/src/sap/ui/rta/messagebundle_fr_CA.properties +15 -6
  64. package/src/sap/ui/rta/messagebundle_hi.properties +15 -6
  65. package/src/sap/ui/rta/messagebundle_hr.properties +15 -6
  66. package/src/sap/ui/rta/messagebundle_hu.properties +15 -6
  67. package/src/sap/ui/rta/messagebundle_id.properties +18 -9
  68. package/src/sap/ui/rta/messagebundle_it.properties +16 -7
  69. package/src/sap/ui/rta/messagebundle_iw.properties +15 -6
  70. package/src/sap/ui/rta/messagebundle_ja.properties +15 -6
  71. package/src/sap/ui/rta/messagebundle_kk.properties +15 -6
  72. package/src/sap/ui/rta/messagebundle_ko.properties +16 -7
  73. package/src/sap/ui/rta/messagebundle_lt.properties +15 -6
  74. package/src/sap/ui/rta/messagebundle_lv.properties +15 -6
  75. package/src/sap/ui/rta/messagebundle_ms.properties +15 -6
  76. package/src/sap/ui/rta/messagebundle_nl.properties +15 -6
  77. package/src/sap/ui/rta/messagebundle_no.properties +15 -6
  78. package/src/sap/ui/rta/messagebundle_pl.properties +15 -6
  79. package/src/sap/ui/rta/messagebundle_pt.properties +15 -6
  80. package/src/sap/ui/rta/messagebundle_pt_PT.properties +15 -6
  81. package/src/sap/ui/rta/messagebundle_ro.properties +15 -6
  82. package/src/sap/ui/rta/messagebundle_ru.properties +15 -6
  83. package/src/sap/ui/rta/messagebundle_sh.properties +15 -6
  84. package/src/sap/ui/rta/messagebundle_sk.properties +15 -6
  85. package/src/sap/ui/rta/messagebundle_sl.properties +15 -6
  86. package/src/sap/ui/rta/messagebundle_sv.properties +15 -6
  87. package/src/sap/ui/rta/messagebundle_th.properties +15 -6
  88. package/src/sap/ui/rta/messagebundle_tr.properties +15 -6
  89. package/src/sap/ui/rta/messagebundle_uk.properties +17 -8
  90. package/src/sap/ui/rta/messagebundle_vi.properties +15 -6
  91. package/src/sap/ui/rta/messagebundle_zh_CN.properties +15 -6
  92. package/src/sap/ui/rta/messagebundle_zh_TW.properties +15 -6
  93. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  94. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  95. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  96. package/src/sap/ui/rta/plugin/ControlVariant.js +3 -4
  97. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  98. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  99. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  100. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  101. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  102. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  103. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  104. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  105. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  106. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  107. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -1
  108. package/src/sap/ui/rta/plugin/Selection.js +15 -26
  109. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  110. package/src/sap/ui/rta/plugin/Split.js +1 -1
  111. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  112. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +15 -84
  113. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  114. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +0 -67
  115. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -10
  116. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
  117. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +17 -47
  118. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  119. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  120. package/src/sap/ui/rta/service/Action.js +1 -1
  121. package/src/sap/ui/rta/service/ControllerExtension.js +5 -6
  122. package/src/sap/ui/rta/service/Outline.js +6 -3
  123. package/src/sap/ui/rta/service/Property.js +1 -1
  124. package/src/sap/ui/rta/service/Selection.js +1 -1
  125. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +1 -0
  126. package/src/sap/ui/rta/toolbar/Adaptation.js +12 -12
  127. package/src/sap/ui/rta/toolbar/Base.js +3 -3
  128. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  129. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  130. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
  131. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  132. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  133. package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +19 -10
  134. package/src/sap/ui/rta/toolbar/translation/Translation.js +114 -45
  135. package/src/sap/ui/rta/toolbar/translation/TranslationPopover.fragment.xml +8 -13
  136. package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +41 -0
  137. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  138. package/src/sap/ui/rta/util/PopupManager.js +5 -2
  139. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  140. package/src/sap/ui/rta/util/adaptationStarter.js +40 -2
  141. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +7 -3
  142. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  143. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +26 -44
  144. package/src/sap/ui/rta/util/showMessageBox.js +4 -3
  145. package/src/sap/ui/rta/util/validateFlexEnabled.js +2 -1
@@ -6,87 +6,93 @@
6
6
 
7
7
  // Provides class sap.ui.rta.RuntimeAuthoring.
8
8
  sap.ui.define([
9
+ "sap/base/strings/capitalize",
10
+ "sap/base/util/UriParameters",
11
+ "sap/base/Log",
12
+ "sap/m/MessageBox",
13
+ "sap/m/MessageToast",
9
14
  "sap/ui/thirdparty/jquery",
10
15
  "sap/ui/base/ManagedObject",
11
- "sap/ui/rta/toolbar/Fiori",
12
- "sap/ui/rta/toolbar/Standalone",
13
- "sap/ui/rta/toolbar/Personalization",
14
- "sap/ui/rta/toolbar/FioriLike",
16
+ "sap/ui/core/BusyIndicator",
15
17
  "sap/ui/dt/DesignTime",
18
+ "sap/ui/dt/DOMUtil",
19
+ "sap/ui/dt/ElementUtil",
16
20
  "sap/ui/dt/Overlay",
17
- "sap/ui/rta/command/Stack",
18
- "sap/ui/rta/command/LREPSerializer",
19
- "sap/ui/rta/Utils",
21
+ "sap/ui/dt/OverlayRegistry",
20
22
  "sap/ui/dt/Util",
21
- "sap/ui/dt/ElementUtil",
22
- "sap/ui/fl/library",
23
- "sap/ui/fl/Utils",
24
- "sap/ui/fl/LayerUtils",
25
- "sap/ui/fl/Layer",
26
- "sap/ui/fl/write/api/ReloadInfoAPI",
23
+ "sap/ui/events/KeyCodes",
24
+ "sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
25
+ "sap/ui/fl/apply/api/SmartVariantManagementApplyAPI",
27
26
  "sap/ui/fl/write/api/FeaturesAPI",
28
- "sap/ui/fl/write/api/VersionsAPI",
29
27
  "sap/ui/fl/write/api/PersistenceWriteAPI",
30
- "sap/m/MessageBox",
31
- "sap/m/MessageToast",
32
- "sap/ui/rta/util/PluginManager",
33
- "sap/ui/rta/util/PopupManager",
34
- "sap/ui/core/BusyIndicator",
35
- "sap/ui/dt/DOMUtil",
28
+ "sap/ui/fl/write/api/ReloadInfoAPI",
29
+ "sap/ui/fl/write/api/VersionsAPI",
30
+ "sap/ui/fl/Layer",
31
+ "sap/ui/fl/LayerUtils",
32
+ "sap/ui/fl/library",
33
+ "sap/ui/fl/Utils",
34
+ "sap/ui/model/json/JSONModel",
35
+ "sap/ui/performance/Measurement",
36
36
  "sap/ui/rta/appVariant/Feature",
37
- "sap/ui/Device",
37
+ "sap/ui/rta/command/BaseCommand",
38
+ "sap/ui/rta/command/LREPSerializer",
39
+ "sap/ui/rta/command/Stack",
38
40
  "sap/ui/rta/service/index",
41
+ "sap/ui/rta/toolbar/Fiori",
42
+ "sap/ui/rta/toolbar/FioriLike",
43
+ "sap/ui/rta/toolbar/Personalization",
44
+ "sap/ui/rta/toolbar/Standalone",
45
+ "sap/ui/rta/util/changeVisualization/ChangeVisualization",
46
+ "sap/ui/rta/util/PluginManager",
47
+ "sap/ui/rta/util/PopupManager",
39
48
  "sap/ui/rta/util/ServiceEventBus",
40
- "sap/ui/dt/OverlayRegistry",
41
- "sap/base/strings/capitalize",
42
- "sap/base/util/UriParameters",
43
- "sap/ui/performance/Measurement",
44
- "sap/base/Log",
45
- "sap/ui/events/KeyCodes",
46
- "sap/ui/model/json/JSONModel",
47
49
  "sap/ui/rta/util/validateFlexEnabled",
48
- "sap/ui/rta/util/changeVisualization/ChangeVisualization"
50
+ "sap/ui/rta/Utils",
51
+ "sap/ui/Device"
49
52
  ], function(
53
+ capitalize,
54
+ UriParameters,
55
+ Log,
56
+ MessageBox,
57
+ MessageToast,
50
58
  jQuery,
51
59
  ManagedObject,
52
- FioriToolbar,
53
- StandaloneToolbar,
54
- PersonalizationToolbar,
55
- FioriLikeToolbar,
60
+ BusyIndicator,
56
61
  DesignTime,
62
+ DOMUtil,
63
+ ElementUtil,
57
64
  Overlay,
58
- CommandStack,
59
- LREPSerializer,
60
- Utils,
65
+ OverlayRegistry,
61
66
  DtUtil,
62
- ElementUtil,
63
- flexLibrary,
64
- FlexUtils,
65
- LayerUtils,
66
- Layer,
67
- ReloadInfoAPI,
67
+ KeyCodes,
68
+ FlexRuntimeInfoAPI,
69
+ SmartVariantManagementApplyAPI,
68
70
  FeaturesAPI,
69
- VersionsAPI,
70
71
  PersistenceWriteAPI,
71
- MessageBox,
72
- MessageToast,
73
- PluginManager,
74
- PopupManager,
75
- BusyIndicator,
76
- DOMUtil,
72
+ ReloadInfoAPI,
73
+ VersionsAPI,
74
+ Layer,
75
+ LayerUtils,
76
+ flexLibrary,
77
+ FlexUtils,
78
+ JSONModel,
79
+ Measurement,
77
80
  RtaAppVariantFeature,
78
- Device,
81
+ BaseCommand,
82
+ LREPSerializer,
83
+ CommandStack,
79
84
  ServicesIndex,
85
+ FioriToolbar,
86
+ FioriLikeToolbar,
87
+ PersonalizationToolbar,
88
+ StandaloneToolbar,
89
+ ChangeVisualization,
90
+ PluginManager,
91
+ PopupManager,
80
92
  ServiceEventBus,
81
- OverlayRegistry,
82
- capitalize,
83
- UriParameters,
84
- Measurement,
85
- Log,
86
- KeyCodes,
87
- JSONModel,
88
93
  validateFlexEnabled,
89
- ChangeVisualization
94
+ Utils,
95
+ Device
90
96
  ) {
91
97
  "use strict";
92
98
 
@@ -104,7 +110,7 @@ sap.ui.define([
104
110
  * @class The runtime authoring allows to adapt the fields of a running application.
105
111
  * @extends sap.ui.base.ManagedObject
106
112
  * @author SAP SE
107
- * @version 1.97.1
113
+ * @version 1.98.0
108
114
  * @constructor
109
115
  * @private
110
116
  * @since 1.30
@@ -215,6 +221,7 @@ sap.ui.define([
215
221
  _sAppTitle: null,
216
222
  _dependents: null,
217
223
  _sStatus: STOPPED,
224
+ _bHasSwitchedToNavigationMode: false,
218
225
  constructor: function() {
219
226
  // call parent constructor
220
227
  ManagedObject.apply(this, arguments);
@@ -223,6 +230,7 @@ sap.ui.define([
223
230
  this._mServices = {};
224
231
  this._mCustomServicesDictinary = {};
225
232
  this._mUShellServices = {};
233
+ this._pElementModified = Promise.resolve();
226
234
 
227
235
  this.addDependent(new PluginManager(), "pluginManager");
228
236
  this.addDependent(new PopupManager(), "popupManager");
@@ -470,6 +478,9 @@ sap.ui.define([
470
478
  scope: this.getMetadataScope(),
471
479
  plugins: aPlugins
472
480
  });
481
+
482
+ addOrRemoveStyleClass(this.getRootControlInstance(), true);
483
+
473
484
  //add root control is triggering overlay creation, so we need to wait for the scope to be set.
474
485
  this._oDesignTime.addRootElement(this._oRootControl);
475
486
 
@@ -497,6 +508,7 @@ sap.ui.define([
497
508
  // Register function for checking unsaved before leaving RTA
498
509
  this._oldUnloadHandler = window.onbeforeunload;
499
510
  window.onbeforeunload = this._onUnload.bind(this);
511
+ return undefined;
500
512
  }.bind(this))
501
513
  .then(function () {
502
514
  if (this.getShowToolbars()) {
@@ -504,6 +516,7 @@ sap.ui.define([
504
516
  return this._getToolbarButtonsVisibility()
505
517
  .then(this._createToolsMenu.bind(this));
506
518
  }
519
+ return undefined;
507
520
  }.bind(this))
508
521
  // this is needed to initially check if undo is available, e.g. when the stack gets initialized with changes
509
522
  .then(this._onStackModified.bind(this))
@@ -522,6 +535,7 @@ sap.ui.define([
522
535
  // the show() method of the toolbar relies on this RTA instance being set on the PopupManager
523
536
  return this.getToolbar().show();
524
537
  }
538
+ return undefined;
525
539
  }.bind(this))
526
540
  .then(function () {
527
541
  if (Device.browser.name === "ff") {
@@ -533,8 +547,6 @@ sap.ui.define([
533
547
  .then(function() {
534
548
  this.fnKeyDown = this._onKeyDown.bind(this);
535
549
  jQuery(document).on("keydown", this.fnKeyDown);
536
-
537
- addOrRemoveStyleClass(this.getRootControlInstance(), true);
538
550
  }.bind(this))
539
551
  .then(function () {
540
552
  this._sStatus = STARTED;
@@ -552,8 +564,10 @@ sap.ui.define([
552
564
  this.destroy();
553
565
  return Promise.reject(vError);
554
566
  }
567
+ return undefined;
555
568
  }.bind(this));
556
569
  }
570
+ return undefined;
557
571
  };
558
572
 
559
573
  function _ffContextMenuHandler() {
@@ -709,6 +723,7 @@ sap.ui.define([
709
723
  if (this.getShowToolbars() && this.getToolbar && this.getToolbar()) {
710
724
  return this.getToolbar()[sName](vValue);
711
725
  }
726
+ return undefined;
712
727
  };
713
728
 
714
729
  /**
@@ -723,17 +738,25 @@ sap.ui.define([
723
738
  return [];
724
739
  };
725
740
 
741
+ function waitForPendingActions() {
742
+ return Promise.resolve(this._oDesignTime && this._oDesignTime.waitForBusyPlugins())
743
+ .then(function() {
744
+ return this._pElementModified;
745
+ }.bind(this));
746
+ }
747
+
726
748
  /**
727
- * stop Runtime Authoring
749
+ * Stops Runtime Authoring
728
750
  *
729
751
  * @public
730
- * @param {boolean} bDontSaveChanges - stop RTA with or w/o saving changes
731
- * @param {boolean} bSkipRestart - stop RTA with or w/o checking if a reload is needed to apply e.g. personalization/app descriptor changes
732
- * @returns {Promise} promise with no parameters
752
+ * @param {boolean} bDontSaveChanges - Stop RTA with or w/o saving changes
753
+ * @param {boolean} bSkipRestart - Stop RTA with or w/o checking if a reload is needed to apply e.g. personalization/app descriptor changes
754
+ * @returns {Promise} Resolves with undefined
733
755
  */
734
756
  RuntimeAuthoring.prototype.stop = function(bDontSaveChanges, bSkipRestart) {
735
757
  this._checkToolbarAndExecuteFunction("setBusy", true);
736
- return this._handleReloadOnExit(bSkipRestart)
758
+ return waitForPendingActions.call(this)
759
+ .then(this._handleReloadOnExit.bind(this, bSkipRestart))
737
760
  .then(function(oReloadInfo) {
738
761
  return ((bDontSaveChanges) ? Promise.resolve() : this._serializeToLrep(this))
739
762
  .then(this._checkToolbarAndExecuteFunction.bind(this, "hide", bDontSaveChanges))
@@ -745,6 +768,7 @@ sap.ui.define([
745
768
  oReloadInfo.triggerHardReload = (oReloadInfo.reloadMethod === this._RELOAD.RELOAD_PAGE); // StandAlone or AppDescriptorChanges case
746
769
  return this._handleUrlParameterOnExit(oReloadInfo);
747
770
  }
771
+ return undefined;
748
772
  }.bind(this));
749
773
  }.bind(this))
750
774
  .catch(fnShowTechnicalError)
@@ -837,10 +861,12 @@ sap.ui.define([
837
861
  return this._getTextResources().getText("MSG_UNSAVED_CHANGES");
838
862
  }
839
863
  window.onbeforeunload = this._oldUnloadHandler;
864
+ return undefined;
840
865
  };
841
866
 
842
867
  RuntimeAuthoring.prototype._serializeAndSave = function() {
843
- return this._oSerializer.saveCommands(this._oVersionsModel.getProperty("/versioningEnabled"));
868
+ // Save changes on the current layer and discard dirty changes on other layers
869
+ return this._oSerializer.saveCommands(this._oVersionsModel.getProperty("/versioningEnabled"), this.getLayer(), true);
844
870
  };
845
871
 
846
872
  RuntimeAuthoring.prototype._serializeToLrep = function() {
@@ -935,16 +961,16 @@ sap.ui.define([
935
961
  };
936
962
 
937
963
  RuntimeAuthoring.prototype._onSwitchVersion = function (oEvent) {
938
- var nVersion = oEvent.getParameter("version");
939
- var nDisplayedVersion = this._oVersionsModel.getProperty("/displayedVersion");
964
+ var sVersion = oEvent.getParameter("version");
965
+ var sDisplayedVersion = this._oVersionsModel.getProperty("/displayedVersion");
940
966
 
941
- if (nVersion === nDisplayedVersion) {
967
+ if (sVersion === sDisplayedVersion) {
942
968
  // already displayed version needs no switch
943
969
  return;
944
970
  }
945
971
 
946
972
  if (this.canUndo()) {
947
- this._nSwitchToVersion = nVersion;
973
+ this._sSwitchToVersion = sVersion;
948
974
  Utils.showMessageBox("warning", "MSG_SWITCH_VERSION_DIALOG", {
949
975
  titleKey: "TIT_SWITCH_VERSION_DIALOG",
950
976
  actions: [MessageBox.Action.YES, MessageBox.Action.NO, MessageBox.Action.CANCEL],
@@ -952,22 +978,20 @@ sap.ui.define([
952
978
  }).then(function (sAction) {
953
979
  if (sAction === MessageBox.Action.YES) {
954
980
  this._serializeToLrep(this)
955
- .then(this._switchVersion.bind(this, this._nSwitchToVersion));
981
+ .then(this._switchVersion.bind(this, this._sSwitchToVersion));
956
982
  } else if (sAction === MessageBox.Action.NO) {
957
983
  // avoids the data loss popup; a reload is triggered later and will destroy RTA & the command stack
958
984
  this.getCommandStack().removeAllCommands(true);
959
- this._switchVersion(this._nSwitchToVersion);
985
+ this._switchVersion(this._sSwitchToVersion);
960
986
  }
961
987
  return undefined;
962
988
  }.bind(this));
963
989
  return;
964
990
  }
965
- this._switchVersion(nVersion);
991
+ this._switchVersion(sVersion);
966
992
  };
967
993
 
968
- RuntimeAuthoring.prototype._switchVersion = function (nVersion) {
969
- var sVersion = nVersion.toString();
970
-
994
+ RuntimeAuthoring.prototype._switchVersion = function (sVersion) {
971
995
  RuntimeAuthoring.enableRestart(this.getLayer(), this.getRootControlInstance());
972
996
 
973
997
  if (!FlexUtils.getUshellContainer()) {
@@ -984,7 +1008,7 @@ sap.ui.define([
984
1008
  VersionsAPI.loadVersionForApplication({
985
1009
  selector: this.getRootControlInstance(),
986
1010
  layer: this.getLayer(),
987
- version: nVersion
1011
+ version: sVersion
988
1012
  });
989
1013
  var aVersionsParameter = mParsedHash.params[sap.ui.fl.Versions.UrlParameter];
990
1014
  if (
@@ -1047,6 +1071,14 @@ sap.ui.define([
1047
1071
  return oToolbar.onFragmentLoaded().then(function() {
1048
1072
  var bSaveAsAvailable = aButtonsVisibility.saveAsAvailable;
1049
1073
  var bExtendedOverview = bSaveAsAvailable && RtaAppVariantFeature.isOverviewExtended();
1074
+ var oUriParameters = UriParameters.fromURL(window.location.href);
1075
+ // the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
1076
+ var bVisualizationButtonVisible;
1077
+ if (oUriParameters.has("fiori-tools-rta-mode") && oUriParameters.get("fiori-tools-rta-mode") !== "false") {
1078
+ bVisualizationButtonVisible = false;
1079
+ } else {
1080
+ bVisualizationButtonVisible = true;
1081
+ }
1050
1082
 
1051
1083
  this._oToolbarControlsModel = new JSONModel({
1052
1084
  undoEnabled: false,
@@ -1062,7 +1094,8 @@ sap.ui.define([
1062
1094
  saveAsEnabled: false,
1063
1095
  manageAppsVisible: bSaveAsAvailable && !bExtendedOverview,
1064
1096
  manageAppsEnabled: bSaveAsAvailable && !bExtendedOverview,
1065
- modeSwitcher: this.getMode()
1097
+ modeSwitcher: this.getMode(),
1098
+ visualizationButtonVisible: bVisualizationButtonVisible
1066
1099
  });
1067
1100
 
1068
1101
  if (bSaveAsAvailable) {
@@ -1073,12 +1106,13 @@ sap.ui.define([
1073
1106
  }.bind(this));
1074
1107
  }
1075
1108
 
1076
- /* TODO enable as soon as the code is ready
1077
- FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer()).then(function(oResult) {
1078
- this._oToolbarControlsModel.setProperty("/translationVisible", oResult);
1109
+ /*
1110
+ FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer()).then(function() {
1111
+ this._oToolbarControlsModel.setProperty("/translationVisible", true);
1079
1112
  }.bind(this));
1080
1113
  */
1081
1114
 
1115
+
1082
1116
  this.getToolbar().setModel(this._oVersionsModel, "versions");
1083
1117
  this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
1084
1118
  }.bind(this));
@@ -1141,8 +1175,9 @@ sap.ui.define([
1141
1175
  BusyIndicator.show(500);
1142
1176
  return this._serializeToLrep().then(function () {
1143
1177
  BusyIndicator.hide();
1144
- var bAppVariantRunning = FlexUtils.isApplicationVariant(this._oRootControl) && !FlexUtils.isVariantByStartupParameter(this._oRootControl);
1145
- return ((bAppVariantRunning) ? RtaAppVariantFeature.getAppVariantDescriptor(this._oRootControl) : Promise.resolve())
1178
+ var bVariantByStartupParameter = FlexUtils.isVariantByStartupParameter(this._oRootControl);
1179
+ var bAppVariantRunning = SmartVariantManagementApplyAPI.isApplicationVariant({control: this._oRootControl}) && !bVariantByStartupParameter;
1180
+ return (bAppVariantRunning ? RtaAppVariantFeature.getAppVariantDescriptor(this._oRootControl) : Promise.resolve())
1146
1181
  .then(function(oAppVariantDescriptor) {
1147
1182
  var aAppVariantDescriptor = [];
1148
1183
  if (oAppVariantDescriptor) {
@@ -1214,13 +1249,14 @@ sap.ui.define([
1214
1249
 
1215
1250
  /**
1216
1251
  * Shows a message toast.
1217
- * @param {string} sMessageKey The text key for the message
1252
+ * @param {string} sMessageKey - The text key for the message
1253
+ * @param {object} mOptions - Options for message toast
1218
1254
  * @private
1219
1255
  */
1220
- RuntimeAuthoring.prototype._showMessageToast = function(sMessageKey) {
1256
+ RuntimeAuthoring.prototype._showMessageToast = function(sMessageKey, mOptions) {
1221
1257
  var sMessage = this._getTextResources().getText(sMessageKey);
1222
1258
 
1223
- MessageToast.show(sMessage);
1259
+ MessageToast.show(sMessage, mOptions || {});
1224
1260
  };
1225
1261
 
1226
1262
  /**
@@ -1228,7 +1264,7 @@ sap.ui.define([
1228
1264
  *
1229
1265
  * @public
1230
1266
  * @static
1231
- * @param {string} sLayer The active layer
1267
+ * @param {sap.ui.fl.Layer} sLayer - Active layer
1232
1268
  * @returns {boolean} Returns true if restart is needed
1233
1269
  */
1234
1270
  RuntimeAuthoring.needsRestart = function(sLayer) {
@@ -1241,11 +1277,11 @@ sap.ui.define([
1241
1277
  *
1242
1278
  * @public
1243
1279
  * @static
1244
- * @param {string} sLayer - The active layer
1245
- * @param {sap.ui.core.Control} oRootControl - root control for which RTA was started
1280
+ * @param {sap.ui.fl.Layer} sLayer - Active layer
1281
+ * @param {sap.ui.core.Control} oRootControl - Root control for which RTA was started
1246
1282
  */
1247
1283
  RuntimeAuthoring.enableRestart = function(sLayer, oRootControl) {
1248
- var sFlexReference = FlexUtils.getComponentClassName(oRootControl);
1284
+ var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oRootControl});
1249
1285
  var vParameter = sFlexReference || true;
1250
1286
  window.sessionStorage.setItem("sap.ui.rta.restart." + sLayer, vParameter);
1251
1287
  };
@@ -1255,7 +1291,7 @@ sap.ui.define([
1255
1291
  *
1256
1292
  * @public
1257
1293
  * @static
1258
- * @param {string} sLayer The active layer
1294
+ * @param {sap.ui.fl.Layer} sLayer - Active layer
1259
1295
  */
1260
1296
  RuntimeAuthoring.disableRestart = function(sLayer) {
1261
1297
  window.sessionStorage.removeItem("sap.ui.rta.restart." + sLayer);
@@ -1381,35 +1417,38 @@ sap.ui.define([
1381
1417
  * @private
1382
1418
  */
1383
1419
  RuntimeAuthoring.prototype._handleElementModified = function(oEvent) {
1384
- this.getPluginManager().handleStopCutPaste();
1385
-
1386
- var vAction = oEvent.getParameter("action");
1420
+ // events are synchronously reset after the handlers are called
1421
+ var oCommand = oEvent.getParameter("command");
1387
1422
  var sNewControlID = oEvent.getParameter("newControlId");
1423
+ var vAction = oEvent.getParameter("action");
1388
1424
 
1389
- var oCommand = oEvent.getParameter("command");
1390
- if (oCommand instanceof sap.ui.rta.command.BaseCommand) {
1391
- if (sNewControlID) {
1392
- this._scheduleOnCreated(sNewControlID, function (oElementOverlay) {
1393
- var oDesignTimeMetadata = oElementOverlay.getDesignTimeMetadata();
1394
- var fnSelect = oDesignTimeMetadata.getData().select;
1395
- if (typeof fnSelect === "function") {
1396
- fnSelect(oElementOverlay.getElement());
1425
+ this._pElementModified = this._pElementModified.then(function() {
1426
+ this.getPluginManager().handleStopCutPaste();
1427
+
1428
+ if (oCommand instanceof BaseCommand) {
1429
+ if (sNewControlID) {
1430
+ this._scheduleOnCreated(sNewControlID, function (oElementOverlay) {
1431
+ var oDesignTimeMetadata = oElementOverlay.getDesignTimeMetadata();
1432
+ var fnSelect = oDesignTimeMetadata.getData().select;
1433
+ if (typeof fnSelect === "function") {
1434
+ fnSelect(oElementOverlay.getElement());
1435
+ }
1436
+ });
1437
+ if (vAction) {
1438
+ this._scheduleRenameOnCreatedContainer(vAction, sNewControlID);
1397
1439
  }
1398
- });
1399
- if (vAction) {
1400
- this._scheduleRenameOnCreatedContainer(vAction, sNewControlID);
1401
1440
  }
1441
+ return this.getCommandStack().pushAndExecute(oCommand)
1442
+ // Error handling when a command fails is done in the Stack
1443
+ .catch(function(oError) {
1444
+ if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
1445
+ Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
1446
+ }
1447
+ Log.error("sap.ui.rta: " + oError.message);
1448
+ });
1402
1449
  }
1403
- return this.getCommandStack().pushAndExecute(oCommand)
1404
- // Error handling when a command fails is done in the Stack
1405
- .catch(function(oError) {
1406
- if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
1407
- Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
1408
- }
1409
- Log.error("sap.ui.rta: " + oError.message);
1410
- });
1411
- }
1412
- return Promise.resolve();
1450
+ }.bind(this));
1451
+ return this._pElementModified;
1413
1452
  };
1414
1453
 
1415
1454
  /**
@@ -1509,6 +1548,7 @@ sap.ui.define([
1509
1548
  if (oReloadInfo.triggerHardReload) {
1510
1549
  this._reloadPage();
1511
1550
  }
1551
+ return undefined;
1512
1552
  };
1513
1553
 
1514
1554
  /**
@@ -1584,6 +1624,7 @@ sap.ui.define([
1584
1624
  if (oReloadInfo.allContexts) {
1585
1625
  return "MSG_RELOAD_WITHOUT_ALL_CONTEXT";
1586
1626
  }
1627
+ return undefined;
1587
1628
  };
1588
1629
 
1589
1630
  /**
@@ -1624,24 +1665,25 @@ sap.ui.define([
1624
1665
  if (!sReason) {
1625
1666
  return Promise.resolve();
1626
1667
  }
1627
- return Utils.showMessageBox("information", sReason)
1628
- .then(function() {
1629
- RuntimeAuthoring.enableRestart(oReloadInfo.layer, this.getRootControlInstance());
1630
- // allContexts do not change the url parameter to trigger a reload
1631
- if (
1632
- oReloadInfo.allContexts &&
1633
- !oReloadInfo.hasHigherLayerChanges &&
1634
- this._getUShellService("AppLifeCycle")
1635
- ) {
1636
- this._getUShellService("AppLifeCycle").reloadCurrentApp();
1637
- }
1638
- if (FlexUtils.getUshellContainer()) {
1639
- // clears FlexState and triggers reloading of the flex data without blocking
1640
- var oParsedHash = ReloadInfoAPI.handleParametersOnStart(oReloadInfo);
1641
- return this._triggerCrossAppNavigation(oParsedHash);
1642
- }
1643
- return this._triggerHardReload(oReloadInfo);
1644
- }.bind(this));
1668
+ // showing messages in visual editor is leading to blocked screen. In this case we should reload without message
1669
+ return (this.getFlexSettings().developerMode ? Promise.resolve() : Utils.showMessageBox("information", sReason))
1670
+ .then(function() {
1671
+ RuntimeAuthoring.enableRestart(oReloadInfo.layer, this.getRootControlInstance());
1672
+ // allContexts do not change the url parameter to trigger a reload
1673
+ if (
1674
+ oReloadInfo.allContexts &&
1675
+ !oReloadInfo.hasHigherLayerChanges &&
1676
+ this._getUShellService("AppLifeCycle")
1677
+ ) {
1678
+ this._getUShellService("AppLifeCycle").reloadCurrentApp();
1679
+ }
1680
+ if (FlexUtils.getUshellContainer()) {
1681
+ // clears FlexState and triggers reloading of the flex data without blocking
1682
+ var oParsedHash = ReloadInfoAPI.handleParametersOnStart(oReloadInfo);
1683
+ return this._triggerCrossAppNavigation(oParsedHash);
1684
+ }
1685
+ return this._triggerHardReload(oReloadInfo);
1686
+ }.bind(this));
1645
1687
  };
1646
1688
 
1647
1689
  /**
@@ -1746,6 +1788,13 @@ sap.ui.define([
1746
1788
  oTabHandlingPlugin[(sNewMode === "navigation") ? "restoreTabIndex" : "removeTabIndex"]();
1747
1789
  }
1748
1790
 
1791
+ if (sNewMode === "navigation" && !this._bHasSwitchedToNavigationMode) {
1792
+ this._showMessageToast("MSG_NAVIGATION_MODE_CHANGES_WARNING", {
1793
+ duration: 5000
1794
+ });
1795
+ this._bHasSwitchedToNavigationMode = true;
1796
+ }
1797
+
1749
1798
  oTabHandlingPlugin[(sNewMode === "adaptation") ? "restoreOverlayTabIndex" : "removeOverlayTabIndex"]();
1750
1799
  oSelectionPlugin.setIsActive(!(sNewMode === "visualization"));
1751
1800
 
@@ -1781,6 +1830,7 @@ sap.ui.define([
1781
1830
  if (ServicesIndex.hasOwnProperty(sName)) {
1782
1831
  return ServicesIndex[sName].replace(/\./g, "/");
1783
1832
  }
1833
+ return undefined;
1784
1834
  }
1785
1835
 
1786
1836
  /**
@@ -46,7 +46,7 @@ function(
46
46
  * @class Utility functionality to work with controls, e.g. iterate through aggregations, find parents, etc.
47
47
  *
48
48
  * @author SAP SE
49
- * @version 1.97.1
49
+ * @version 1.98.0
50
50
  *
51
51
  * @private
52
52
  * @static
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.base.ManagedObject
26
26
  * @author SAP SE
27
- * @version 1.97.1
27
+ * @version 1.98.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.53
@@ -45,10 +45,9 @@ sap.ui.define([
45
45
  if (xhr.status >= 200 && xhr.status < 400) {
46
46
  resolve(xhr.response);
47
47
  } else {
48
- reject({
49
- status: xhr.status,
50
- message: xhr.statusText
51
- });
48
+ var oError = new Error(xhr.statusText);
49
+ oError.status = xhr.status;
50
+ reject(oError);
52
51
  }
53
52
  };
54
53
  });
@@ -12,7 +12,8 @@ sap.ui.define([
12
12
  "sap/ui/fl/registry/Settings",
13
13
  "sap/ui/fl/write/_internal/appVariant/AppVariantFactory",
14
14
  "sap/ui/fl/write/api/FeaturesAPI",
15
- "sap/base/util/merge"
15
+ "sap/base/util/merge",
16
+ "sap/base/Log"
16
17
  ], function(
17
18
  FlexUtils,
18
19
  AppVariantUtils,
@@ -21,7 +22,8 @@ sap.ui.define([
21
22
  Settings,
22
23
  AppVariantFactory,
23
24
  FeaturesAPI,
24
- merge
25
+ merge,
26
+ Log
25
27
  ) {
26
28
  "use strict";
27
29
 
@@ -148,9 +150,8 @@ sap.ui.define([
148
150
  return AppVariantUtils.getManifirstSupport(oDescriptor["sap.app"].id).then(function(oResult) {
149
151
  return oResult.response;
150
152
  }).catch(function(oError) {
151
- var oErrorInfo = AppVariantUtils.buildErrorInfo("MSG_APP_VARIANT_FEATURE_FAILED", oError);
152
- oErrorInfo.overviewDialog = true;
153
- return AppVariantUtils.showRelevantDialog(oErrorInfo, false);
153
+ Log.error("Response status code is: " + oError.status, "Stacktrace: " + oError.stack);
154
+ return false;
154
155
  });
155
156
  },
156
157
  /**
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.97.1
19
+ * @version 1.98.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.75
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  * @class
15
15
  * @extends sap.ui.rta.command.FlexCommand
16
16
  * @author SAP SE
17
- * @version 1.97.1
17
+ * @version 1.98.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.78