@openui5/sap.ui.rta 1.139.0 → 1.141.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 (154) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +6 -6
  3. package/src/sap/ui/rta/.library +1 -1
  4. package/src/sap/ui/rta/Client.js +1 -1
  5. package/src/sap/ui/rta/RuntimeAuthoring.js +1 -1
  6. package/src/sap/ui/rta/Utils.js +1 -1
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +7 -30
  8. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -41
  9. package/src/sap/ui/rta/appVariant/Feature.js +5 -4
  10. package/src/sap/ui/rta/command/AddIFrame.js +6 -8
  11. package/src/sap/ui/rta/command/AddProperty.js +2 -2
  12. package/src/sap/ui/rta/command/AddXML.js +3 -3
  13. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +17 -19
  14. package/src/sap/ui/rta/command/AnnotationCommand.js +1 -1
  15. package/src/sap/ui/rta/command/BaseCommand.js +3 -4
  16. package/src/sap/ui/rta/command/BindProperty.js +4 -4
  17. package/src/sap/ui/rta/command/Combine.js +4 -4
  18. package/src/sap/ui/rta/command/CommandFactory.js +55 -77
  19. package/src/sap/ui/rta/command/CompositeCommand.js +19 -39
  20. package/src/sap/ui/rta/command/ControlVariantConfigure.js +16 -20
  21. package/src/sap/ui/rta/command/ControlVariantSave.js +19 -28
  22. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +38 -43
  23. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +15 -26
  24. package/src/sap/ui/rta/command/ControlVariantSwitch.js +29 -50
  25. package/src/sap/ui/rta/command/CreateContainer.js +3 -3
  26. package/src/sap/ui/rta/command/CustomAdd.js +2 -2
  27. package/src/sap/ui/rta/command/ExtendControllerCommand.js +2 -4
  28. package/src/sap/ui/rta/command/FlexCommand.js +34 -44
  29. package/src/sap/ui/rta/command/LREPSerializer.js +20 -23
  30. package/src/sap/ui/rta/command/LocalReset.js +3 -3
  31. package/src/sap/ui/rta/command/ManifestCommand.js +1 -1
  32. package/src/sap/ui/rta/command/Move.js +5 -5
  33. package/src/sap/ui/rta/command/Property.js +3 -3
  34. package/src/sap/ui/rta/command/Remove.js +4 -4
  35. package/src/sap/ui/rta/command/Rename.js +3 -3
  36. package/src/sap/ui/rta/command/Resize.js +2 -2
  37. package/src/sap/ui/rta/command/Reveal.js +3 -3
  38. package/src/sap/ui/rta/command/Settings.js +2 -2
  39. package/src/sap/ui/rta/command/Split.js +3 -3
  40. package/src/sap/ui/rta/command/Stack.js +51 -55
  41. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +10 -10
  42. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +4 -4
  43. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
  44. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +11 -11
  45. package/src/sap/ui/rta/command/manifest/AddLibrary.js +4 -8
  46. package/src/sap/ui/rta/enablement/elementActionTest.js +21 -9
  47. package/src/sap/ui/rta/library.js +2 -2
  48. package/src/sap/ui/rta/messagebundle_ar.properties +32 -17
  49. package/src/sap/ui/rta/messagebundle_bg.properties +32 -17
  50. package/src/sap/ui/rta/messagebundle_ca.properties +32 -17
  51. package/src/sap/ui/rta/messagebundle_cnr.properties +31 -16
  52. package/src/sap/ui/rta/messagebundle_cs.properties +31 -16
  53. package/src/sap/ui/rta/messagebundle_cy.properties +30 -15
  54. package/src/sap/ui/rta/messagebundle_da.properties +32 -17
  55. package/src/sap/ui/rta/messagebundle_de.properties +33 -18
  56. package/src/sap/ui/rta/messagebundle_el.properties +32 -17
  57. package/src/sap/ui/rta/messagebundle_en.properties +32 -17
  58. package/src/sap/ui/rta/messagebundle_en_GB.properties +32 -17
  59. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +11 -1
  60. package/src/sap/ui/rta/messagebundle_es.properties +32 -17
  61. package/src/sap/ui/rta/messagebundle_es_MX.properties +39 -24
  62. package/src/sap/ui/rta/messagebundle_et.properties +31 -16
  63. package/src/sap/ui/rta/messagebundle_fi.properties +30 -15
  64. package/src/sap/ui/rta/messagebundle_fr.properties +32 -17
  65. package/src/sap/ui/rta/messagebundle_fr_CA.properties +30 -15
  66. package/src/sap/ui/rta/messagebundle_hi.properties +32 -17
  67. package/src/sap/ui/rta/messagebundle_hr.properties +31 -16
  68. package/src/sap/ui/rta/messagebundle_hu.properties +31 -16
  69. package/src/sap/ui/rta/messagebundle_id.properties +32 -17
  70. package/src/sap/ui/rta/messagebundle_it.properties +31 -16
  71. package/src/sap/ui/rta/messagebundle_iw.properties +30 -15
  72. package/src/sap/ui/rta/messagebundle_ja.properties +32 -17
  73. package/src/sap/ui/rta/messagebundle_kk.properties +32 -17
  74. package/src/sap/ui/rta/messagebundle_ko.properties +30 -15
  75. package/src/sap/ui/rta/messagebundle_lt.properties +31 -16
  76. package/src/sap/ui/rta/messagebundle_lv.properties +31 -16
  77. package/src/sap/ui/rta/messagebundle_mk.properties +31 -16
  78. package/src/sap/ui/rta/messagebundle_ms.properties +32 -17
  79. package/src/sap/ui/rta/messagebundle_nl.properties +32 -17
  80. package/src/sap/ui/rta/messagebundle_no.properties +31 -16
  81. package/src/sap/ui/rta/messagebundle_pl.properties +31 -16
  82. package/src/sap/ui/rta/messagebundle_pt.properties +32 -17
  83. package/src/sap/ui/rta/messagebundle_pt_PT.properties +32 -17
  84. package/src/sap/ui/rta/messagebundle_ro.properties +31 -16
  85. package/src/sap/ui/rta/messagebundle_ru.properties +31 -16
  86. package/src/sap/ui/rta/messagebundle_sh.properties +31 -16
  87. package/src/sap/ui/rta/messagebundle_sk.properties +31 -16
  88. package/src/sap/ui/rta/messagebundle_sl.properties +31 -16
  89. package/src/sap/ui/rta/messagebundle_sr.properties +31 -16
  90. package/src/sap/ui/rta/messagebundle_sv.properties +31 -16
  91. package/src/sap/ui/rta/messagebundle_th.properties +30 -15
  92. package/src/sap/ui/rta/messagebundle_tr.properties +31 -16
  93. package/src/sap/ui/rta/messagebundle_uk.properties +31 -16
  94. package/src/sap/ui/rta/messagebundle_vi.properties +33 -18
  95. package/src/sap/ui/rta/messagebundle_zh_CN.properties +31 -16
  96. package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -17
  97. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +10 -10
  98. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +1 -1
  99. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  100. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  101. package/src/sap/ui/rta/plugin/ControlVariant.js +65 -87
  102. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  103. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  104. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  105. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +1 -1
  106. package/src/sap/ui/rta/plugin/LocalReset.js +26 -35
  107. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  108. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  109. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  110. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  111. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  112. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  113. package/src/sap/ui/rta/plugin/Split.js +1 -1
  114. package/src/sap/ui/rta/plugin/Stretch.js +7 -6
  115. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +17 -5
  118. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  119. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  120. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  121. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +1 -1
  122. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +1 -1
  123. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +1 -1
  124. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  125. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  126. package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
  127. package/src/sap/ui/rta/plugin/rename/RenameDialog.js +2 -7
  128. package/src/sap/ui/rta/service/Action.js +1 -1
  129. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  130. package/src/sap/ui/rta/service/Outline.js +1 -1
  131. package/src/sap/ui/rta/service/Property.js +1 -1
  132. package/src/sap/ui/rta/service/Selection.js +1 -1
  133. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  134. package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
  135. package/src/sap/ui/rta/toolbar/Base.js +7 -7
  136. package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
  137. package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
  138. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  139. package/src/sap/ui/rta/toolbar/Standalone.js +3 -3
  140. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  141. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  142. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  143. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  144. package/src/sap/ui/rta/util/PopupManager.js +3 -3
  145. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  146. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  147. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  148. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +6 -6
  149. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  150. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
  151. package/src/sap/ui/rta/util/changeVisualization/resolveBinding.js +79 -0
  152. package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +1 -1
  153. package/src/sap/ui/rta/util/guidedTour/content/GeneralTour.js +1 -1
  154. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @class
24
24
  * @extends sap.ui.base.ManagedObject
25
25
  * @author SAP SE
26
- * @version 1.139.0
26
+ * @version 1.141.0
27
27
  * @constructor
28
28
  * @private
29
29
  * @since 1.42
@@ -52,7 +52,7 @@ sap.ui.define([
52
52
  }
53
53
 
54
54
  /**
55
- * Promise to ensure that the event triggered methods are executed sequentionally.
55
+ * Promise to ensure that the event triggered methods are executed sequentially.
56
56
  */
57
57
  LREPSerializer.prototype._lastPromise = Promise.resolve();
58
58
 
@@ -67,14 +67,14 @@ sap.ui.define([
67
67
  * @public
68
68
  */
69
69
  LREPSerializer.prototype.needsReload = function() {
70
- this._lastPromise = this._lastPromise.catch(function() {
70
+ this._lastPromise = this._lastPromise
71
+ .catch(() => {
71
72
  // _lastPromise chain must not be interrupted
72
- }).then(function() {
73
+ })
74
+ .then(() => {
73
75
  const aCommands = this.getCommandStack().getAllExecutedCommands();
74
- return aCommands.some(function(oCommand) {
75
- return !!oCommand.needsReload;
76
- });
77
- }.bind(this));
76
+ return aCommands.some((oCommand) => !!oCommand.needsReload);
77
+ });
78
78
  return this._lastPromise;
79
79
  };
80
80
  /**
@@ -92,15 +92,17 @@ sap.ui.define([
92
92
  * @public
93
93
  */
94
94
  LREPSerializer.prototype.saveCommands = function(mPropertyBag) {
95
- this._lastPromise = this._lastPromise.catch(function(oError) {
95
+ this._lastPromise = this._lastPromise
96
+ .catch((oError) => {
96
97
  Log.error(oError);
97
98
  // _lastPromise chain must not be interrupted
98
- }).then(function() {
99
+ })
100
+ .then(async () => {
99
101
  const oRootControl = getRootControlInstance(this.getRootControl());
100
102
  if (!oRootControl) {
101
103
  throw new Error("Can't save commands without root control instance!");
102
104
  }
103
- return PersistenceWriteAPI.save({
105
+ await PersistenceWriteAPI.save({
104
106
  selector: oRootControl,
105
107
  skipUpdateCache: false,
106
108
  draft: !!mPropertyBag.saveAsDraft,
@@ -110,12 +112,10 @@ sap.ui.define([
110
112
  adaptationId: mPropertyBag.adaptationId,
111
113
  condenseAnyLayer: mPropertyBag.condenseAnyLayer
112
114
  });
113
- }.bind(this))
114
- .then(function() {
115
115
  Log.info("UI adaptation successfully wrote changes to the persistence");
116
116
  this.getCommandStack().setSaved(true);
117
117
  this.getCommandStack().removeAllCommands();
118
- }.bind(this));
118
+ });
119
119
 
120
120
  return this._lastPromise;
121
121
  };
@@ -145,21 +145,18 @@ sap.ui.define([
145
145
  };
146
146
 
147
147
  /**
148
- * @description
149
148
  * At this point command stack is not aware if the changes have been already booked for the new app variant.
150
149
  * Therefore if there shall be some UI changes present in command stack, we undo all the changes till the beginning.
151
150
  * In the last when user presses 'Save and Exit', there will be no change registered for the current app.
152
- * @param {boolean} bRemoveChanges if LREPSerializer should clear the dirty changes in the persistence
153
- * @returns {Promise} returns a promise with true or false
151
+ * @param {boolean} bRemoveChanges - Whether LREPSerializer should clear the dirty changes in the persistence
152
+ * @returns {Promise} Resolves with true or false
154
153
  */
155
- LREPSerializer.prototype.clearCommandStack = function(bRemoveChanges) {
154
+ LREPSerializer.prototype.clearCommandStack = async function(bRemoveChanges) {
156
155
  const oCommandStack = this.getCommandStack();
157
156
 
158
- return this._triggerUndoChanges(bRemoveChanges)
159
- .then(function() {
160
- oCommandStack.removeAllCommands();
161
- return true;
162
- });
157
+ await this._triggerUndoChanges(bRemoveChanges);
158
+ oCommandStack.removeAllCommands();
159
+ return true;
163
160
  };
164
161
 
165
162
  return LREPSerializer;
@@ -20,13 +20,13 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.139.0
23
+ * @version 1.141.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.90
27
27
  * @alias sap.ui.rta.command.LocalReset
28
28
  */
29
- var LocalReset = BaseCommand.extend("sap.ui.rta.command.LocalReset", {
29
+ const LocalReset = BaseCommand.extend("sap.ui.rta.command.LocalReset", {
30
30
  metadata: {
31
31
  library: "sap.ui.rta",
32
32
  properties: {
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @override
50
50
  */
51
51
  LocalReset.prototype.prepare = function(mFlexSettings) {
52
- var oContainerControl = this.getElement();
52
+ const oContainerControl = this.getElement();
53
53
  this._oAppComponent = FlUtils.getAppComponentForControl(oContainerControl);
54
54
  this._aAffectedChanges = LocalResetAPI.getNestedUIChangesForControl(
55
55
  oContainerControl,
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  *
23
23
  * @author SAP SE
24
- * @version 1.139.0
24
+ * @version 1.141.0
25
25
  *
26
26
  * @constructor
27
27
  * @private
@@ -17,13 +17,13 @@ function(
17
17
  * @class
18
18
  * @extends sap.ui.rta.command.FlexCommand
19
19
  * @author SAP SE
20
- * @version 1.139.0
20
+ * @version 1.141.0
21
21
  * @constructor
22
22
  * @private
23
23
  * @since 1.34
24
24
  * @alias sap.ui.rta.command.Move
25
25
  */
26
- var Move = FlexCommand.extend("sap.ui.rta.command.Move", {
26
+ const Move = FlexCommand.extend("sap.ui.rta.command.Move", {
27
27
  metadata: {
28
28
  library: "sap.ui.rta",
29
29
  properties: {
@@ -49,8 +49,8 @@ function(
49
49
  * @override
50
50
  */
51
51
  Move.prototype._getChangeSpecificData = function() {
52
- var mSource = this.getSource();
53
- var mTarget = this.getTarget();
52
+ const mSource = this.getSource();
53
+ const mTarget = this.getTarget();
54
54
 
55
55
  // replace elements by their id, unify format and help with serialization
56
56
  if (mSource.parent) {
@@ -61,7 +61,7 @@ function(
61
61
  mTarget.id = mTarget.parent.getId();
62
62
  delete mTarget.parent;
63
63
  }
64
- var mSpecificInfo = {
64
+ const mSpecificInfo = {
65
65
  changeType: this.getChangeType(),
66
66
  content: {
67
67
  source: mSource,
@@ -16,13 +16,13 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.139.0
19
+ * @version 1.141.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.34
23
23
  * @alias sap.ui.rta.command.Property
24
24
  */
25
- var Property = FlexCommand.extend("sap.ui.rta.command.Property", {
25
+ const Property = FlexCommand.extend("sap.ui.rta.command.Property", {
26
26
  metadata: {
27
27
  library: "sap.ui.rta",
28
28
  properties: {
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  });
50
50
 
51
51
  Property.prototype._getChangeSpecificData = function() {
52
- var oElement = this.getElement();
52
+ const oElement = this.getElement();
53
53
  // general format
54
54
  return {
55
55
  changeType: this.getChangeType(),
@@ -12,13 +12,13 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
12
12
  * @class
13
13
  * @extends sap.ui.rta.command.FlexCommand
14
14
  * @author SAP SE
15
- * @version 1.139.0
15
+ * @version 1.141.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.42
19
19
  * @alias sap.ui.rta.command.Remove
20
20
  */
21
- var Remove = FlexCommand.extend("sap.ui.rta.command.Remove", {
21
+ const Remove = FlexCommand.extend("sap.ui.rta.command.Remove", {
22
22
  metadata: {
23
23
  library: "sap.ui.rta",
24
24
  properties: {
@@ -33,9 +33,9 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
33
33
  });
34
34
 
35
35
  Remove.prototype._getChangeSpecificData = function() {
36
- var oElement = this.getRemovedElement() || this.getElement();
36
+ const oElement = this.getRemovedElement() || this.getElement();
37
37
 
38
- var mSpecificInfo = {
38
+ const mSpecificInfo = {
39
39
  changeType: this.getChangeType(),
40
40
  removedElement: {
41
41
  id: oElement.getId()
@@ -12,13 +12,13 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
12
12
  * @class
13
13
  * @extends sap.ui.rta.command.FlexCommand
14
14
  * @author SAP SE
15
- * @version 1.139.0
15
+ * @version 1.141.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.34
19
19
  * @alias sap.ui.rta.command.Rename
20
20
  */
21
- var Rename = FlexCommand.extend("sap.ui.rta.command.Rename", {
21
+ const Rename = FlexCommand.extend("sap.ui.rta.command.Rename", {
22
22
  metadata: {
23
23
  library: "sap.ui.rta",
24
24
  properties: {
@@ -38,7 +38,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
38
38
  });
39
39
 
40
40
  Rename.prototype._getChangeSpecificData = function() {
41
- var mSpecificInfo = {
41
+ const mSpecificInfo = {
42
42
  changeType: this.getChangeType(),
43
43
  content: {
44
44
  renamedElement: {
@@ -16,13 +16,13 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.139.0
19
+ * @version 1.141.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.101
23
23
  * @alias sap.ui.rta.command.Resize
24
24
  */
25
- var Resize = FlexCommand.extend("sap.ui.rta.command.Resize", {
25
+ const Resize = FlexCommand.extend("sap.ui.rta.command.Resize", {
26
26
  metadata: {
27
27
  library: "sap.ui.rta",
28
28
  properties: {
@@ -12,13 +12,13 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
12
12
  * @class
13
13
  * @extends sap.ui.rta.command.FlexCommand
14
14
  * @author SAP SE
15
- * @version 1.139.0
15
+ * @version 1.141.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.44
19
19
  * @alias sap.ui.rta.command.Reveal
20
20
  */
21
- var Reveal = FlexCommand.extend("sap.ui.rta.command.Reveal", {
21
+ const Reveal = FlexCommand.extend("sap.ui.rta.command.Reveal", {
22
22
  metadata: {
23
23
  library: "sap.ui.rta",
24
24
  properties: {
@@ -32,7 +32,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
32
32
  });
33
33
 
34
34
  Reveal.prototype._getChangeSpecificData = function() {
35
- var mSpecificChangeInfo = {
35
+ const mSpecificChangeInfo = {
36
36
  changeType: this.getChangeType(),
37
37
  content: {}
38
38
  };
@@ -12,13 +12,13 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
12
12
  * @class
13
13
  * @extends sap.ui.rta.command.FlexCommand
14
14
  * @author SAP SE
15
- * @version 1.139.0
15
+ * @version 1.141.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.44
19
19
  * @alias sap.ui.rta.command.Settings
20
20
  */
21
- var Settings = FlexCommand.extend("sap.ui.rta.command.Settings", {
21
+ const Settings = FlexCommand.extend("sap.ui.rta.command.Settings", {
22
22
  metadata: {
23
23
  library: "sap.ui.rta",
24
24
  properties: {
@@ -14,13 +14,13 @@ sap.ui.define([
14
14
  * @class
15
15
  * @extends sap.ui.rta.command.FlexCommand
16
16
  * @author SAP SE
17
- * @version 1.139.0
17
+ * @version 1.141.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.46
21
21
  * @alias sap.ui.rta.command.Split
22
22
  */
23
- var Split = FlexCommand.extend("sap.ui.rta.command.Split", {
23
+ const Split = FlexCommand.extend("sap.ui.rta.command.Split", {
24
24
  metadata: {
25
25
  library: "sap.ui.rta",
26
26
  properties: {
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  * @override
47
47
  */
48
48
  Split.prototype._getChangeSpecificData = function() {
49
- var mSpecificInfo = {
49
+ const mSpecificInfo = {
50
50
  changeType: this.getChangeType(),
51
51
  content: {
52
52
  newElementIds: this.getNewElementIds(),
@@ -28,24 +28,16 @@ sap.ui.define([
28
28
  ) {
29
29
  "use strict";
30
30
 
31
- function toAvailableChanges(mChanges, aChanges, sFileName) {
32
- var oChange = mChanges[sFileName];
33
- if (oChange) {
34
- aChanges.push(oChange);
35
- }
36
- return aChanges;
37
- }
38
-
39
31
  function pushToStack(oComponent, mComposite, oStack, oChange) {
40
- var oSelector = oChange.getSelector && oChange.getSelector();
41
- var oCommand = new Settings({
32
+ const oSelector = oChange.getSelector && oChange.getSelector();
33
+ const oCommand = new Settings({
42
34
  selector: oSelector,
43
35
  changeType: oChange.getChangeType(),
44
36
  element: JsControlTreeModifier.bySelector(oSelector, oComponent)
45
37
  });
46
38
  oCommand._oPreparedChange = oChange;
47
39
  // check if change belongs to a composite command
48
- var sCompositeId = oChange.getSupportInformation().compositeCommand;
40
+ const sCompositeId = oChange.getSupportInformation().compositeCommand;
49
41
  if (sCompositeId) {
50
42
  if (!mComposite[sCompositeId]) {
51
43
  mComposite[sCompositeId] = new CompositeCommand();
@@ -92,13 +84,13 @@ sap.ui.define([
92
84
  * @class
93
85
  * @extends sap.ui.base.ManagedObject
94
86
  * @author SAP SE
95
- * @version 1.139.0
87
+ * @version 1.141.0
96
88
  * @constructor
97
89
  * @private
98
90
  * @since 1.34
99
91
  * @alias sap.ui.rta.command.Stack
100
92
  */
101
- var Stack = ManagedObject.extend("sap.ui.rta.command.Stack", {
93
+ const Stack = ManagedObject.extend("sap.ui.rta.command.Stack", {
102
94
  metadata: {
103
95
  library: "sap.ui.rta",
104
96
  properties: {
@@ -146,33 +138,35 @@ sap.ui.define([
146
138
  * Creates a stack prefilled with Settings commands. Every command contains a change from the given file name list
147
139
  *
148
140
  * @param {sap.ui.base.ManagedObject} oControl - Used to get the component
149
- * @param {string[]} aFileNames - Array of file names of changes the stack should be initialized with
141
+ * @param {string[]} [aFileNames] - Array of file names of changes the stack should be initialized with
150
142
  * @returns {Promise} Resolves with a stack as parameter
151
143
  */
152
- Stack.initializeWithChanges = function(oControl, aFileNames) {
153
- var oStack = new Stack();
144
+ Stack.initializeWithChanges = async function(oControl, aFileNames) {
145
+ const oStack = new Stack();
154
146
  oStack._aPersistedChanges = aFileNames;
155
- if (aFileNames && aFileNames.length > 0) {
156
- var oComponent = FlUtils.getAppComponentForControl(oControl);
157
- var mPropertyBag = {
147
+ if (aFileNames?.length > 0) {
148
+ const oComponent = FlUtils.getAppComponentForControl(oControl);
149
+ const mPropertyBag = {
158
150
  selector: oComponent,
159
151
  invalidateCache: false
160
152
  };
161
- return PersistenceWriteAPI._getUIChanges(mPropertyBag)
162
-
163
- .then(function(aChanges) {
164
- var mComposite = {};
165
- var mChanges = {};
166
- aChanges.forEach(function(oChange) {
167
- mChanges[oChange.getId()] = oChange;
168
- });
169
- aFileNames
170
- .reduce(toAvailableChanges.bind(null, mChanges), [])
171
- .forEach(pushToStack.bind(null, oComponent, mComposite, oStack));
172
- return oStack;
153
+ const aChanges = await PersistenceWriteAPI._getUIChanges(mPropertyBag);
154
+ const mComposite = {};
155
+ const mChanges = {};
156
+ aChanges.forEach((oChange) => {
157
+ mChanges[oChange.getId()] = oChange;
173
158
  });
159
+ aFileNames
160
+ .reduce((aChanges, sFileName) => {
161
+ const oChange = mChanges[sFileName];
162
+ if (oChange) {
163
+ aChanges.push(oChange);
164
+ }
165
+ return aChanges;
166
+ }, [])
167
+ .forEach(pushToStack.bind(null, oComponent, mComposite, oStack));
174
168
  }
175
- return Promise.resolve(oStack);
169
+ return oStack;
176
170
  };
177
171
 
178
172
  Stack.prototype.init = function() {
@@ -221,12 +215,12 @@ sap.ui.define([
221
215
  };
222
216
 
223
217
  Stack.prototype.removeCommand = function(vObject, bSuppressInvalidate) {
224
- var oRemovedCommand = this.removeAggregation("commands", vObject, bSuppressInvalidate);
218
+ const oRemovedCommand = this.removeAggregation("commands", vObject, bSuppressInvalidate);
225
219
  return oRemovedCommand;
226
220
  };
227
221
 
228
222
  Stack.prototype.removeAllCommands = function(bSuppressInvalidate) {
229
- var aCommands = this.removeAllAggregation("commands", bSuppressInvalidate);
223
+ const aCommands = this.removeAllAggregation("commands", bSuppressInvalidate);
230
224
  this._toBeExecuted = -1;
231
225
  this.fireModified();
232
226
  return aCommands;
@@ -297,10 +291,12 @@ sap.ui.define([
297
291
 
298
292
  Stack.prototype.execute = function() {
299
293
  this.setLastCommandExecuted(
300
- this.getLastCommandExecuted().catch(() => {
294
+ this.getLastCommandExecuted()
295
+ .catch(() => {
301
296
  // continue also if previous command failed
302
- }).then(async () => {
303
- var oCommand = this._getCommandToBeExecuted();
297
+ })
298
+ .then(async () => {
299
+ const oCommand = this._getCommandToBeExecuted();
304
300
  if (oCommand) {
305
301
  try {
306
302
  await addCommandChangesToPersistence.call(this, oCommand);
@@ -318,7 +314,7 @@ sap.ui.define([
318
314
  this._toBeExecuted--;
319
315
  // Remove Flex Changes for failed command from persistence
320
316
  removeCommandChangesFromPersistence.call(this, oError.command);
321
- var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
317
+ const oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
322
318
  // AddXMLAtExtensionPoint errors explain to the user what they did wrong, so they shouldn't open an incident
323
319
  const sErrorMessage = oCommand.isA("sap.ui.rta.command.AddXMLAtExtensionPoint") ?
324
320
  oError.message : oRtaResourceBundle.getText("MSG_GENERIC_ERROR_MESSAGE", [oError.message]);
@@ -338,13 +334,15 @@ sap.ui.define([
338
334
 
339
335
  Stack.prototype._unExecute = function() {
340
336
  this.setLastCommandUnExecuted(
341
- this.getLastCommandUnExecuted().catch(() => {
337
+ this.getLastCommandUnExecuted()
338
+ .catch(() => {
342
339
  // continue also if previous undo failed
343
- }).then(async () => {
340
+ })
341
+ .then(async () => {
344
342
  if (this.canUndo()) {
345
343
  this._bUndoneCommands = true;
346
344
  this._toBeExecuted++;
347
- var oCommand = this._getCommandToBeExecuted();
345
+ const oCommand = this._getCommandToBeExecuted();
348
346
  const aDiscardedChanges = oCommand.getDiscardedChanges?.();
349
347
  if (oCommand) {
350
348
  await oCommand.undo();
@@ -365,9 +363,7 @@ sap.ui.define([
365
363
  };
366
364
 
367
365
  Stack.prototype.canSave = function() {
368
- return this.canUndo() && this.getAllExecutedCommands().some(function(oCommand) {
369
- return oCommand.getRelevantForSave();
370
- });
366
+ return this.canUndo() && this.getAllExecutedCommands().some((oCommand) => oCommand.getRelevantForSave());
371
367
  };
372
368
 
373
369
  Stack.prototype.undo = function() {
@@ -394,10 +390,10 @@ sap.ui.define([
394
390
  * @public
395
391
  */
396
392
  Stack.prototype.getAllExecutedCommands = function() {
397
- var aAllExecutedCommands = [];
398
- var aCommands = this.getCommands();
399
- for (var i = aCommands.length - 1; i > this._toBeExecuted; i--) {
400
- var aSubCommands = this.getSubCommands(aCommands[i]);
393
+ let aAllExecutedCommands = [];
394
+ const aCommands = this.getCommands();
395
+ for (let i = aCommands.length - 1; i > this._toBeExecuted; i--) {
396
+ const aSubCommands = this.getSubCommands(aCommands[i]);
401
397
  aAllExecutedCommands = aAllExecutedCommands.concat(aSubCommands);
402
398
  }
403
399
  return aAllExecutedCommands;
@@ -411,12 +407,12 @@ sap.ui.define([
411
407
  * @private
412
408
  */
413
409
  Stack.prototype.getSubCommands = function(oCommand) {
414
- var aCommands = [];
410
+ let aCommands = [];
415
411
  if (oCommand.getCommands) {
416
- oCommand.getCommands().forEach(function(oSubCommand) {
417
- var aSubCommands = this.getSubCommands(oSubCommand);
412
+ oCommand.getCommands().forEach((oSubCommand) => {
413
+ const aSubCommands = this.getSubCommands(oSubCommand);
418
414
  aCommands = aCommands.concat(aSubCommands);
419
- }, this);
415
+ });
420
416
  } else {
421
417
  aCommands.push(oCommand);
422
418
  }
@@ -430,10 +426,10 @@ sap.ui.define([
430
426
  * @private
431
427
  */
432
428
  Stack.prototype.compositeLastTwoCommands = function() {
433
- var oLastCommand = this.pop();
434
- var oSecondLastCommand = this.pop();
429
+ const oLastCommand = this.pop();
430
+ const oSecondLastCommand = this.pop();
435
431
 
436
- var oCompositeCommand = new CompositeCommand();
432
+ const oCompositeCommand = new CompositeCommand();
437
433
  oCompositeCommand.addCommand(oSecondLastCommand);
438
434
  oCompositeCommand.addCommand(oLastCommand);
439
435
  this.push(oCompositeCommand);
@@ -20,13 +20,13 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.139.0
23
+ * @version 1.141.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.102
27
27
  * @alias sap.ui.rta.command.compVariant.CompVariantContent
28
28
  */
29
- var CompVariantContent = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantContent", {
29
+ const CompVariantContent = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantContent", {
30
30
  metadata: {
31
31
  library: "sap.ui.rta",
32
32
  properties: {
@@ -47,7 +47,7 @@ sap.ui.define([
47
47
  });
48
48
 
49
49
  function callFlAPIFunction(sFunctionName, sKey, oValue) {
50
- var mPropertyBag = {
50
+ const mPropertyBag = {
51
51
  ...oValue,
52
52
  ...this.mInformation,
53
53
  id: sKey,
@@ -58,11 +58,11 @@ sap.ui.define([
58
58
 
59
59
  // private function of the SmartVariantManagement are approved and documented to be used from here
60
60
  function setVariantContent(oContent) {
61
- var oVariantManagementControl = this.getElement();
62
- var oCurrentVariantContent = oVariantManagementControl._getVariantContent(this.getVariantId());
63
- var oNewVariantContent = { ...oCurrentVariantContent };
61
+ const oVariantManagementControl = this.getElement();
62
+ const oCurrentVariantContent = oVariantManagementControl._getVariantContent(this.getVariantId());
63
+ let oNewVariantContent = { ...oCurrentVariantContent };
64
64
  if (oVariantManagementControl.isPageVariant()) {
65
- var oContentToBeSet = {};
65
+ const oContentToBeSet = {};
66
66
  oContentToBeSet[this.getPersistencyKey()] = oContent;
67
67
  oVariantManagementControl._applyVariantByPersistencyKey(this.getPersistencyKey(), oContentToBeSet, "KEY_USER");
68
68
  oNewVariantContent[this.getPersistencyKey()] = oContent;
@@ -84,15 +84,15 @@ sap.ui.define([
84
84
 
85
85
  CompVariantContent.prototype.execute = function() {
86
86
  this.getElement().setModified(true);
87
- var oNewVariantContent = setVariantContent.call(this, this.getNewContent());
87
+ const oNewVariantContent = setVariantContent.call(this, this.getNewContent());
88
88
  callFlAPIFunction.call(this, "updateVariantContent", this.getVariantId(), {content: oNewVariantContent});
89
89
  return Promise.resolve();
90
90
  };
91
91
 
92
92
  CompVariantContent.prototype.undo = function() {
93
- var oVariant = callFlAPIFunction.call(this, "revert", this.getVariantId(), {});
93
+ const oVariant = callFlAPIFunction.call(this, "revert", this.getVariantId(), {});
94
94
  this.getElement().setModified(this.getIsModifiedBefore());
95
- var oVariantManagementControl = this.getElement();
95
+ const oVariantManagementControl = this.getElement();
96
96
  if (oVariantManagementControl.isPageVariant()) {
97
97
  setVariantContent.call(this, oVariant.getContent()[this.getPersistencyKey()]);
98
98
  } else {
@@ -20,13 +20,13 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.139.0
23
+ * @version 1.141.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.87
27
27
  * @alias sap.ui.rta.command.compVariant.CompVariantSaveAs
28
28
  */
29
- var CompVariantSaveAs = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSaveAs", {
29
+ const CompVariantSaveAs = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSaveAs", {
30
30
  metadata: {
31
31
  library: "sap.ui.rta",
32
32
  properties: {
@@ -71,8 +71,8 @@ sap.ui.define([
71
71
  * @returns {Promise} Returns resolve after execution
72
72
  */
73
73
  CompVariantSaveAs.prototype.execute = function() {
74
- var oNewVariantProperties = this.getNewVariantProperties();
75
- var mPropertyBag = {
74
+ const oNewVariantProperties = this.getNewVariantProperties();
75
+ const mPropertyBag = {
76
76
  changeSpecificData: {
77
77
  // in case of redo the variant is still saved and the ID should be reused
78
78
  id: this._oVariant ? this._oVariant.getVariantId() : undefined,
@@ -18,13 +18,13 @@ sap.ui.define([
18
18
  * @class
19
19
  * @extends sap.ui.rta.command.BaseCommand
20
20
  * @author SAP SE
21
- * @version 1.139.0
21
+ * @version 1.141.0
22
22
  * @constructor
23
23
  * @private
24
24
  * @since 1.87
25
25
  * @alias sap.ui.rta.command.compVariant.CompVariantSwitch
26
26
  */
27
- var CompVariantSwitch = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSwitch", {
27
+ const CompVariantSwitch = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSwitch", {
28
28
  metadata: {
29
29
  library: "sap.ui.rta",
30
30
  properties: {