@openui5/sap.ui.rta 1.136.4 → 1.139.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 (182) hide show
  1. package/README.md +1 -1
  2. package/REUSE.toml +8 -29
  3. package/THIRDPARTY.txt +72 -90
  4. package/package.json +7 -7
  5. package/src/sap/ui/rta/.library +1 -1
  6. package/src/sap/ui/rta/Client.js +1 -1
  7. package/src/sap/ui/rta/RuntimeAuthoring.js +90 -127
  8. package/src/sap/ui/rta/Utils.js +1 -1
  9. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +5 -4
  10. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  11. package/src/sap/ui/rta/command/AddIFrame.js +12 -5
  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/AnnotationCommand.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 +1 -1
  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/ExtendControllerCommand.js +1 -1
  29. package/src/sap/ui/rta/command/FlexCommand.js +2 -3
  30. package/src/sap/ui/rta/command/LREPSerializer.js +2 -85
  31. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  32. package/src/sap/ui/rta/command/ManifestCommand.js +1 -1
  33. package/src/sap/ui/rta/command/Move.js +1 -1
  34. package/src/sap/ui/rta/command/Property.js +1 -1
  35. package/src/sap/ui/rta/command/Remove.js +1 -1
  36. package/src/sap/ui/rta/command/Rename.js +1 -1
  37. package/src/sap/ui/rta/command/Resize.js +1 -1
  38. package/src/sap/ui/rta/command/Reveal.js +1 -1
  39. package/src/sap/ui/rta/command/Settings.js +1 -1
  40. package/src/sap/ui/rta/command/Split.js +1 -1
  41. package/src/sap/ui/rta/command/Stack.js +115 -87
  42. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  43. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  44. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  45. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  46. package/src/sap/ui/rta/command/manifest/AddLibrary.js +1 -1
  47. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  48. package/src/sap/ui/rta/library.js +2 -2
  49. package/src/sap/ui/rta/messagebundle.properties +39 -57
  50. package/src/sap/ui/rta/messagebundle_ar.properties +7 -31
  51. package/src/sap/ui/rta/messagebundle_bg.properties +8 -32
  52. package/src/sap/ui/rta/messagebundle_ca.properties +8 -32
  53. package/src/sap/ui/rta/messagebundle_cnr.properties +7 -31
  54. package/src/sap/ui/rta/messagebundle_cs.properties +7 -31
  55. package/src/sap/ui/rta/messagebundle_cy.properties +8 -32
  56. package/src/sap/ui/rta/messagebundle_da.properties +8 -32
  57. package/src/sap/ui/rta/messagebundle_de.properties +6 -30
  58. package/src/sap/ui/rta/messagebundle_el.properties +8 -32
  59. package/src/sap/ui/rta/messagebundle_en.properties +8 -32
  60. package/src/sap/ui/rta/messagebundle_en_GB.properties +8 -32
  61. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +29 -48
  62. package/src/sap/ui/rta/messagebundle_es.properties +8 -32
  63. package/src/sap/ui/rta/messagebundle_es_MX.properties +15 -39
  64. package/src/sap/ui/rta/messagebundle_et.properties +8 -32
  65. package/src/sap/ui/rta/messagebundle_fi.properties +8 -32
  66. package/src/sap/ui/rta/messagebundle_fr.properties +9 -33
  67. package/src/sap/ui/rta/messagebundle_fr_CA.properties +8 -32
  68. package/src/sap/ui/rta/messagebundle_hi.properties +7 -31
  69. package/src/sap/ui/rta/messagebundle_hr.properties +8 -32
  70. package/src/sap/ui/rta/messagebundle_hu.properties +8 -32
  71. package/src/sap/ui/rta/messagebundle_id.properties +9 -33
  72. package/src/sap/ui/rta/messagebundle_it.properties +8 -32
  73. package/src/sap/ui/rta/messagebundle_iw.properties +7 -31
  74. package/src/sap/ui/rta/messagebundle_ja.properties +8 -32
  75. package/src/sap/ui/rta/messagebundle_kk.properties +9 -33
  76. package/src/sap/ui/rta/messagebundle_ko.properties +8 -32
  77. package/src/sap/ui/rta/messagebundle_lt.properties +8 -32
  78. package/src/sap/ui/rta/messagebundle_lv.properties +8 -32
  79. package/src/sap/ui/rta/messagebundle_mk.properties +8 -32
  80. package/src/sap/ui/rta/messagebundle_ms.properties +8 -32
  81. package/src/sap/ui/rta/messagebundle_nl.properties +7 -31
  82. package/src/sap/ui/rta/messagebundle_no.properties +8 -32
  83. package/src/sap/ui/rta/messagebundle_pl.properties +8 -32
  84. package/src/sap/ui/rta/messagebundle_pt.properties +8 -32
  85. package/src/sap/ui/rta/messagebundle_pt_PT.properties +8 -32
  86. package/src/sap/ui/rta/messagebundle_ro.properties +8 -32
  87. package/src/sap/ui/rta/messagebundle_ru.properties +8 -32
  88. package/src/sap/ui/rta/messagebundle_sh.properties +7 -31
  89. package/src/sap/ui/rta/messagebundle_sk.properties +8 -32
  90. package/src/sap/ui/rta/messagebundle_sl.properties +8 -32
  91. package/src/sap/ui/rta/messagebundle_sr.properties +7 -31
  92. package/src/sap/ui/rta/messagebundle_sv.properties +8 -32
  93. package/src/sap/ui/rta/messagebundle_th.properties +8 -32
  94. package/src/sap/ui/rta/messagebundle_tr.properties +8 -32
  95. package/src/sap/ui/rta/messagebundle_uk.properties +8 -32
  96. package/src/sap/ui/rta/messagebundle_vi.properties +9 -33
  97. package/src/sap/ui/rta/messagebundle_zh_CN.properties +8 -32
  98. package/src/sap/ui/rta/messagebundle_zh_TW.properties +8 -32
  99. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  100. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +3 -2
  101. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  102. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  103. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  104. package/src/sap/ui/rta/plugin/CreateContainer.js +57 -35
  105. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  106. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  107. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +3 -2
  108. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  109. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  110. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  111. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  112. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  113. package/src/sap/ui/rta/plugin/Selection.js +14 -7
  114. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  115. package/src/sap/ui/rta/plugin/Split.js +1 -1
  116. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +11 -1
  118. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  119. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  120. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  121. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  122. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +16 -3
  123. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +1 -1
  124. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +1 -1
  125. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +3 -3
  126. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  127. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +256 -203
  128. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +28 -75
  129. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +72 -17
  130. package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
  131. package/src/sap/ui/rta/plugin/rename/RenameDialog.fragment.xml +2 -2
  132. package/src/sap/ui/rta/plugin/rename/RenameDialog.js +41 -23
  133. package/src/sap/ui/rta/service/Action.js +1 -1
  134. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  135. package/src/sap/ui/rta/service/Outline.js +1 -1
  136. package/src/sap/ui/rta/service/Property.js +1 -1
  137. package/src/sap/ui/rta/service/Selection.js +1 -1
  138. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  139. package/src/sap/ui/rta/themes/base/AddIFrame.less +23 -33
  140. package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +4 -2
  141. package/src/sap/ui/rta/toolbar/Adaptation.js +16 -3
  142. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  143. package/src/sap/ui/rta/toolbar/Fiori.js +2 -7
  144. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  145. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  146. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  147. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  148. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  149. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  150. package/src/sap/ui/rta/util/Animation.js +4 -6
  151. package/src/sap/ui/rta/util/BindingsExtractor.js +44 -53
  152. package/src/sap/ui/rta/util/PluginManager.js +6 -6
  153. package/src/sap/ui/rta/util/PopupManager.js +90 -109
  154. package/src/sap/ui/rta/util/ReloadManager.js +53 -98
  155. package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
  156. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  157. package/src/sap/ui/rta/util/adaptationStarter.js +59 -80
  158. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +3 -3
  159. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  160. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +5 -4
  161. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -4
  162. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +13 -25
  163. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +5 -7
  164. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +9 -9
  165. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +5 -5
  166. package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +8 -8
  167. package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +5 -5
  168. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +5 -5
  169. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +2 -2
  170. package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +22 -5
  171. package/src/sap/ui/rta/util/guidedTour/TourMarker.fragment.xml +1 -1
  172. package/src/sap/ui/rta/util/guidedTour/content/GeneralTour.js +1 -1
  173. package/src/sap/ui/rta/util/hasStableId.js +11 -19
  174. package/src/sap/ui/rta/util/showMessageBox.js +15 -15
  175. package/src/sap/ui/rta/util/validateFlexEnabled.js +35 -34
  176. package/src/sap/ui/rta/util/validateStableIds.js +22 -31
  177. package/src/sap/ui/rta/util/validateText.js +7 -7
  178. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +34 -9
  179. package/src/sap/ui/rta/util/whatsNew/WhatsNewOverview.js +2 -6
  180. package/src/sap/ui/rta/util/whatsNew/WhatsNewOverviewDialog.fragment.xml +1 -0
  181. package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +4 -4
  182. package/src/sap/ui/rta/util/whatsNew/whatsNewContent/WhatsNewFeatures.js +8 -22
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @class
23
23
  * @extends sap.ui.rta.command.FlexCommand
24
24
  * @author SAP SE
25
- * @version 1.136.4
25
+ * @version 1.139.0
26
26
  * @constructor
27
27
  * @private
28
28
  * @since 1.135
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  * @extends sap.ui.rta.command.BaseCommand
36
36
  *
37
37
  * @author SAP SE
38
- * @version 1.136.4
38
+ * @version 1.139.0
39
39
  *
40
40
  * @constructor
41
41
  * @private
@@ -121,8 +121,7 @@ sap.ui.define([
121
121
  this.setSelector(oSelector);
122
122
  }
123
123
 
124
- const oChange = await this._createChange(mFlexSettings, sVariantManagementReference, sCommand);
125
- this._oPreparedChange = oChange;
124
+ this._oPreparedChange = await this._createChange(mFlexSettings, sVariantManagementReference, sCommand);
126
125
  return true;
127
126
  } catch (oError) {
128
127
  Log.error(oError.message || oError.name);
@@ -5,16 +5,12 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  "sap/ui/base/ManagedObject",
8
- "sap/ui/rta/command/FlexCommand",
9
- "sap/ui/rta/command/ManifestCommand",
10
8
  "sap/ui/fl/Utils",
11
9
  "sap/ui/dt/ElementUtil",
12
10
  "sap/base/Log",
13
11
  "sap/ui/fl/write/api/PersistenceWriteAPI"
14
12
  ], function(
15
13
  ManagedObject,
16
- FlexCommand,
17
- ManifestCommand,
18
14
  FlUtils,
19
15
  ElementUtil,
20
16
  Log,
@@ -27,7 +23,7 @@ sap.ui.define([
27
23
  * @class
28
24
  * @extends sap.ui.base.ManagedObject
29
25
  * @author SAP SE
30
- * @version 1.136.4
26
+ * @version 1.139.0
31
27
  * @constructor
32
28
  * @private
33
29
  * @since 1.42
@@ -61,78 +57,7 @@ sap.ui.define([
61
57
  LREPSerializer.prototype._lastPromise = Promise.resolve();
62
58
 
63
59
  LREPSerializer.prototype.setCommandStack = function(oCommandStack) {
64
- if (this.getCommandStack()) {
65
- this.getCommandStack().removeCommandExecutionHandler(this._fnHandleCommandExecuted);
66
- }
67
60
  this.setProperty("commandStack", oCommandStack);
68
- oCommandStack.addCommandExecutionHandler(this._fnHandleCommandExecuted);
69
- };
70
- LREPSerializer.prototype.init = function() {
71
- this._fnHandleCommandExecuted = this.handleCommandExecuted.bind(this);
72
- };
73
- LREPSerializer.prototype.exit = function() {
74
- this.getCommandStack().removeCommandExecutionHandler(this._fnHandleCommandExecuted);
75
- };
76
- LREPSerializer.prototype._isPersistedChange = function(oPreparedChange) {
77
- return !!this.getCommandStack()._aPersistedChanges
78
- && this.getCommandStack()._aPersistedChanges.indexOf(oPreparedChange.getId()) !== -1;
79
- };
80
-
81
- LREPSerializer.prototype.handleCommandExecuted = function(oEvent) {
82
- return (function(oEvent) {
83
- const oParams = oEvent;
84
- this._lastPromise = this._lastPromise.catch(function() {
85
- // _lastPromise chain must not be interrupted
86
- }).then(function() {
87
- const aCommands = this.getCommandStack().getSubCommands(oParams.command);
88
- let oAppComponent;
89
- const aFlexObjects = [];
90
- if (oParams.undo) {
91
- aCommands.forEach(function(oCommand) {
92
- // for revertable changes which don't belong to LREP (variantSwitch) or runtime only changes
93
- if (!(oCommand instanceof FlexCommand || oCommand instanceof ManifestCommand)
94
- || oCommand.getRuntimeOnly()) {
95
- return;
96
- }
97
- const oChange = oCommand.getPreparedChange();
98
- oAppComponent = oCommand.getAppComponent();
99
- if (oAppComponent) {
100
- aFlexObjects.push(oChange);
101
- }
102
- });
103
- if (oAppComponent) {
104
- return PersistenceWriteAPI.remove({
105
- flexObjects: aFlexObjects,
106
- selector: oAppComponent
107
- });
108
- }
109
- return Promise.resolve();
110
- }
111
- const aManifestCreateAndAdd = [];
112
- aCommands.forEach(function(oCommand) {
113
- // Runtime only changes should not be added to the persistence
114
- if (oCommand.getRuntimeOnly()) {
115
- return;
116
- }
117
- if (oCommand instanceof FlexCommand) {
118
- oAppComponent = oCommand.getAppComponent();
119
- if (oAppComponent) {
120
- const oPreparedChange = oCommand.getPreparedChange();
121
- if (!this._isPersistedChange(oPreparedChange)) {
122
- aFlexObjects.push(oCommand.getPreparedChange());
123
- }
124
- }
125
- } else if (oCommand instanceof ManifestCommand) {
126
- aManifestCreateAndAdd.push(oCommand.createAndStoreChange());
127
- }
128
- }.bind(this));
129
- if (oAppComponent) {
130
- PersistenceWriteAPI.add({flexObjects: aFlexObjects, selector: oAppComponent});
131
- }
132
- return Promise.all(aManifestCreateAndAdd);
133
- }.bind(this));
134
- return this._lastPromise;
135
- }.bind(this))(oEvent);
136
61
  };
137
62
 
138
63
  /**
@@ -230,19 +155,11 @@ sap.ui.define([
230
155
  LREPSerializer.prototype.clearCommandStack = function(bRemoveChanges) {
231
156
  const oCommandStack = this.getCommandStack();
232
157
 
233
- // Detach the event 'commandExecuted' here to stop the communication of LREPSerializer with Flex
234
- if (!bRemoveChanges) {
235
- oCommandStack.detachCommandExecuted(this.handleCommandExecuted.bind(this));
236
- }
237
158
  return this._triggerUndoChanges(bRemoveChanges)
238
159
  .then(function() {
239
160
  oCommandStack.removeAllCommands();
240
- // Attach the event 'commandExecuted' here to start the communication of LREPSerializer with Flex
241
- if (!bRemoveChanges) {
242
- oCommandStack.attachCommandExecuted(this.handleCommandExecuted.bind(this));
243
- }
244
161
  return true;
245
- }.bind(this));
162
+ });
246
163
  };
247
164
 
248
165
  return LREPSerializer;
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.136.4
23
+ * @version 1.139.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.90
@@ -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.136.4
24
+ * @version 1.139.0
25
25
  *
26
26
  * @constructor
27
27
  * @private
@@ -17,7 +17,7 @@ function(
17
17
  * @class
18
18
  * @extends sap.ui.rta.command.FlexCommand
19
19
  * @author SAP SE
20
- * @version 1.136.4
20
+ * @version 1.139.0
21
21
  * @constructor
22
22
  * @private
23
23
  * @since 1.34
@@ -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.136.4
19
+ * @version 1.139.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.34
@@ -12,7 +12,7 @@ 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.136.4
15
+ * @version 1.139.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.42
@@ -12,7 +12,7 @@ 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.136.4
15
+ * @version 1.139.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.34
@@ -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.136.4
19
+ * @version 1.139.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.101
@@ -12,7 +12,7 @@ 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.136.4
15
+ * @version 1.139.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.44
@@ -12,7 +12,7 @@ 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.136.4
15
+ * @version 1.139.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.44
@@ -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.136.4
17
+ * @version 1.139.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.46
@@ -5,22 +5,26 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  "sap/ui/base/ManagedObject",
8
+ "sap/ui/core/util/reflection/JsControlTreeModifier",
9
+ "sap/ui/core/Lib",
8
10
  "sap/ui/fl/write/api/PersistenceWriteAPI",
9
11
  "sap/ui/fl/Utils",
10
- "sap/ui/rta/command/Settings",
11
12
  "sap/ui/rta/command/CompositeCommand",
12
- "sap/ui/core/util/reflection/JsControlTreeModifier",
13
- "sap/ui/rta/util/showMessageBox",
14
- "sap/ui/core/Lib"
13
+ "sap/ui/rta/command/FlexCommand",
14
+ "sap/ui/rta/command/ManifestCommand",
15
+ "sap/ui/rta/command/Settings",
16
+ "sap/ui/rta/util/showMessageBox"
15
17
  ], function(
16
18
  ManagedObject,
19
+ JsControlTreeModifier,
20
+ Lib,
17
21
  PersistenceWriteAPI,
18
22
  FlUtils,
19
- Settings,
20
23
  CompositeCommand,
21
- JsControlTreeModifier,
22
- showMessageBox,
23
- Lib
24
+ FlexCommand,
25
+ ManifestCommand,
26
+ Settings,
27
+ showMessageBox
24
28
  ) {
25
29
  "use strict";
26
30
 
@@ -88,7 +92,7 @@ sap.ui.define([
88
92
  * @class
89
93
  * @extends sap.ui.base.ManagedObject
90
94
  * @author SAP SE
91
- * @version 1.136.4
95
+ * @version 1.139.0
92
96
  * @constructor
93
97
  * @private
94
98
  * @since 1.34
@@ -112,7 +116,16 @@ sap.ui.define([
112
116
  lastCommandExecuted: {
113
117
  type: "object",
114
118
  defaultValue: Promise.resolve()
119
+ },
120
+
121
+ /**
122
+ * Promise is resolved when last command of the stack is unexecuted
123
+ */
124
+ lastCommandUnExecuted: {
125
+ type: "object",
126
+ defaultValue: Promise.resolve()
115
127
  }
128
+
116
129
  },
117
130
  aggregations: {
118
131
  commands: {
@@ -122,20 +135,9 @@ sap.ui.define([
122
135
  },
123
136
  events: {
124
137
  /**
125
- * Fired if the Stack changes because of a change execution or if all commands get removed.
126
- * In case of change execution the modified event will be fired after the commandExecuted event.
138
+ * Fired if the Stack changes because of a change execution or if commands get removed.
127
139
  */
128
- modified: {},
129
-
130
- /**
131
- * Fired after a successful execution of a command (also includes undo).
132
- */
133
- commandExecuted: {
134
- parameters: {
135
- command: {type: "object"},
136
- undo: {type: "boolean"}
137
- }
138
- }
140
+ modified: {}
139
141
  }
140
142
  }
141
143
  });
@@ -173,33 +175,11 @@ sap.ui.define([
173
175
  return Promise.resolve(oStack);
174
176
  };
175
177
 
176
- /**
177
- * @param {function} fnHandler Handler are called when commands are executed or undone. They get parameter
178
- * like the commandExecuted event and the stack will wait for any processing
179
- * until they are done.
180
- */
181
- Stack.prototype.addCommandExecutionHandler = function(fnHandler) {
182
- this._aCommandExecutionHandler.push(fnHandler);
183
- };
184
-
185
- Stack.prototype.removeCommandExecutionHandler = function(fnHandler) {
186
- var i = this._aCommandExecutionHandler.indexOf(fnHandler);
187
- if (i > -1) {
188
- this._aCommandExecutionHandler.splice(i, 1);
189
- }
190
- };
191
-
192
178
  Stack.prototype.init = function() {
193
179
  this._aCommandExecutionHandler = [];
194
180
  this._toBeExecuted = -1;
195
181
  };
196
182
 
197
- Stack.prototype._waitForCommandExecutionHandler = function(mParam) {
198
- return Promise.all(this._aCommandExecutionHandler.map(function(fnHandler) {
199
- return fnHandler(mParam);
200
- }));
201
- };
202
-
203
183
  Stack.prototype._getCommandToBeExecuted = function() {
204
184
  return this.getCommands()[this._toBeExecuted];
205
185
  };
@@ -256,36 +236,88 @@ sap.ui.define([
256
236
  return this.getCommands().length === 0;
257
237
  };
258
238
 
239
+ async function addCommandChangesToPersistence(oCommand) {
240
+ let oAppComponent;
241
+ const aSubCommands = this.getSubCommands(oCommand);
242
+ const aManifestPromises = [];
243
+ let aChanges = aSubCommands.map((oSubCommand) => {
244
+ // Filter out runtime only changes
245
+ if (oSubCommand.getRuntimeOnly()) {
246
+ return undefined;
247
+ }
248
+ // Manifest changes are stored separately
249
+ if (oSubCommand instanceof ManifestCommand) {
250
+ aManifestPromises.push(oSubCommand.createAndStoreChange());
251
+ return undefined;
252
+ }
253
+ if (oSubCommand instanceof FlexCommand) {
254
+ oAppComponent = oSubCommand.getAppComponent();
255
+ if (oAppComponent) {
256
+ return oSubCommand.getPreparedChange();
257
+ }
258
+ }
259
+ return undefined;
260
+ }).filter(Boolean);
261
+ await Promise.all(aManifestPromises);
262
+ // Filter out persisted changes
263
+ if (this._aPersistedChanges) {
264
+ aChanges = aChanges.filter((oChange) => this._aPersistedChanges.indexOf(oChange.getId()) === -1);
265
+ }
266
+ if (oAppComponent) {
267
+ PersistenceWriteAPI.add({
268
+ flexObjects: aChanges,
269
+ selector: oAppComponent
270
+ });
271
+ }
272
+ }
273
+
274
+ function removeCommandChangesFromPersistence(oCommand) {
275
+ let oAppComponent;
276
+ const aFlexObjects = [];
277
+ const aSubCommands = this.getSubCommands(oCommand);
278
+ aSubCommands.forEach((oSubCommand) => {
279
+ // for revertable changes which don't belong to LREP (variantSwitch) or runtime only changes
280
+ if (!(oSubCommand instanceof FlexCommand || oSubCommand instanceof ManifestCommand)
281
+ || oSubCommand.getRuntimeOnly()) {
282
+ return;
283
+ }
284
+ const oChange = oSubCommand.getPreparedChange();
285
+ oAppComponent = oSubCommand.getAppComponent();
286
+ if (oAppComponent) {
287
+ aFlexObjects.push(oChange);
288
+ }
289
+ });
290
+ if (oAppComponent) {
291
+ PersistenceWriteAPI.remove({
292
+ flexObjects: aFlexObjects,
293
+ selector: oAppComponent
294
+ });
295
+ }
296
+ }
297
+
259
298
  Stack.prototype.execute = function() {
260
299
  this.setLastCommandExecuted(
261
- this.getLastCommandExecuted().catch(function() {
300
+ this.getLastCommandExecuted().catch(() => {
262
301
  // continue also if previous command failed
263
- }).then(function() {
302
+ }).then(async () => {
264
303
  var oCommand = this._getCommandToBeExecuted();
265
304
  if (oCommand) {
266
- var mParam = {
267
- command: oCommand,
268
- undo: false
269
- };
270
- return oCommand.execute()
271
-
272
- .then(this._waitForCommandExecutionHandler.bind(this, mParam))
273
-
274
- .then(function() {
305
+ try {
306
+ await addCommandChangesToPersistence.call(this, oCommand);
307
+ await oCommand.execute();
275
308
  this._toBeExecuted--;
276
309
  const aDiscardedChanges = oCommand.getDiscardedChanges?.();
277
310
  if (aDiscardedChanges) {
278
311
  handleDiscardedChanges.call(this, aDiscardedChanges, false);
279
312
  }
280
- this.fireCommandExecuted(mParam);
281
313
  this.fireModified();
282
- }.bind(this))
283
-
284
- .catch(function(oError) {
285
- oError ||= new Error("Executing of the change failed.");
314
+ } catch (oCaughtError) {
315
+ const oError = oCaughtError || new Error("Executing of the change failed.");
286
316
  oError.index = this._toBeExecuted;
287
317
  oError.command = this.removeCommand(this._toBeExecuted); // remove failing command
288
318
  this._toBeExecuted--;
319
+ // Remove Flex Changes for failed command from persistence
320
+ removeCommandChangesFromPersistence.call(this, oError.command);
289
321
  var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
290
322
  // AddXMLAtExtensionPoint errors explain to the user what they did wrong, so they shouldn't open an incident
291
323
  const sErrorMessage = oCommand.isA("sap.ui.rta.command.AddXMLAtExtensionPoint") ?
@@ -295,41 +327,37 @@ sap.ui.define([
295
327
  {title: oRtaResourceBundle.getText("HEADER_ERROR")},
296
328
  "error"
297
329
  );
298
- return Promise.reject(oError);
299
- }.bind(this));
330
+ throw oError;
331
+ }
300
332
  }
301
333
  return undefined;
302
- }.bind(this))
334
+ })
303
335
  );
304
336
  return this.getLastCommandExecuted();
305
337
  };
306
338
 
307
339
  Stack.prototype._unExecute = function() {
308
- if (this.canUndo()) {
309
- this._bUndoneCommands = true;
310
- this._toBeExecuted++;
311
- var oCommand = this._getCommandToBeExecuted();
312
- const aDiscardedChanges = oCommand.getDiscardedChanges?.();
313
- if (oCommand) {
314
- var mParam = {
315
- command: oCommand,
316
- undo: true
317
- };
318
- return oCommand.undo()
319
-
320
- .then(this._waitForCommandExecutionHandler.bind(this, mParam))
321
-
322
- .then(function() {
323
- if (aDiscardedChanges) {
324
- handleDiscardedChanges.call(this, aDiscardedChanges, true);
340
+ this.setLastCommandUnExecuted(
341
+ this.getLastCommandUnExecuted().catch(() => {
342
+ // continue also if previous undo failed
343
+ }).then(async () => {
344
+ if (this.canUndo()) {
345
+ this._bUndoneCommands = true;
346
+ this._toBeExecuted++;
347
+ var oCommand = this._getCommandToBeExecuted();
348
+ const aDiscardedChanges = oCommand.getDiscardedChanges?.();
349
+ if (oCommand) {
350
+ await oCommand.undo();
351
+ removeCommandChangesFromPersistence.call(this, oCommand);
352
+ if (aDiscardedChanges) {
353
+ handleDiscardedChanges.call(this, aDiscardedChanges, true);
354
+ }
355
+ this.fireModified();
325
356
  }
326
- this.fireCommandExecuted(mParam);
327
- this.fireModified();
328
- }.bind(this));
329
- }
330
- return Promise.resolve();
331
- }
332
- return Promise.resolve();
357
+ }
358
+ })
359
+ );
360
+ return this.getLastCommandUnExecuted();
333
361
  };
334
362
 
335
363
  Stack.prototype.canUndo = function() {
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.136.4
23
+ * @version 1.139.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.102
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @class
21
21
  * @extends sap.ui.rta.command.BaseCommand
22
22
  * @author SAP SE
23
- * @version 1.136.4
23
+ * @version 1.139.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.87
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * @class
19
19
  * @extends sap.ui.rta.command.BaseCommand
20
20
  * @author SAP SE
21
- * @version 1.136.4
21
+ * @version 1.139.0
22
22
  * @constructor
23
23
  * @private
24
24
  * @since 1.87
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @class
23
23
  * @extends sap.ui.rta.command.BaseCommand
24
24
  * @author SAP SE
25
- * @version 1.136.4
25
+ * @version 1.139.0
26
26
  * @constructor
27
27
  * @private
28
28
  * @since 1.87
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @extends sap.ui.rta.command.ManifestCommand
20
20
  *
21
21
  * @author SAP SE
22
- * @version 1.136.4
22
+ * @version 1.139.0
23
23
  *
24
24
  * @constructor
25
25
  * @private
@@ -61,7 +61,7 @@ sap.ui.define([
61
61
  * E.g. <code>elementActionTest.only("Remove");</code>
62
62
  *
63
63
  * @author SAP SE
64
- * @version 1.136.4
64
+ * @version 1.139.0
65
65
  *
66
66
  * @static
67
67
  * @since 1.42
@@ -22,14 +22,14 @@ sap.ui.define([
22
22
  * @namespace
23
23
  * @alias sap.ui.rta
24
24
  * @author SAP SE
25
- * @version 1.136.4
25
+ * @version 1.139.0
26
26
  * @since 1.50
27
27
  * @private
28
28
  */
29
29
  var thisLib = Lib.init({
30
30
  name: "sap.ui.rta",
31
31
  apiVersion: 2,
32
- version: "1.136.4",
32
+ version: "1.139.0",
33
33
  dependencies: ["sap.ui.core", "sap.m", "sap.ui.fl", "sap.ui.dt"],
34
34
  types: [],
35
35
  interfaces: [],