@openui5/sap.ui.rta 1.133.1 → 1.135.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 (165) hide show
  1. package/.reuse/dep5 +0 -7
  2. package/THIRDPARTY.txt +2 -23
  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 +38 -17
  7. package/src/sap/ui/rta/Utils.js +11 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +26 -26
  9. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +0 -4
  10. package/src/sap/ui/rta/appVariant/Feature.js +85 -91
  11. package/src/sap/ui/rta/appVariant/Utils.js +50 -56
  12. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
  14. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  15. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  16. package/src/sap/ui/rta/command/AddXML.js +1 -1
  17. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  18. package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
  19. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  20. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  21. package/src/sap/ui/rta/command/Combine.js +1 -1
  22. package/src/sap/ui/rta/command/CommandFactory.js +71 -47
  23. package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
  24. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  25. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  26. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  27. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  28. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  29. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  30. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  31. package/src/sap/ui/rta/command/ExtendControllerCommand.js +92 -0
  32. package/src/sap/ui/rta/command/FlexCommand.js +54 -43
  33. package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
  34. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  35. package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
  36. package/src/sap/ui/rta/command/Move.js +1 -1
  37. package/src/sap/ui/rta/command/Property.js +1 -1
  38. package/src/sap/ui/rta/command/Remove.js +1 -1
  39. package/src/sap/ui/rta/command/Rename.js +1 -1
  40. package/src/sap/ui/rta/command/Resize.js +1 -1
  41. package/src/sap/ui/rta/command/Reveal.js +1 -1
  42. package/src/sap/ui/rta/command/Settings.js +1 -1
  43. package/src/sap/ui/rta/command/Split.js +1 -1
  44. package/src/sap/ui/rta/command/Stack.js +1 -1
  45. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  46. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  47. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  48. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  49. package/src/sap/ui/rta/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
  50. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -7
  51. package/src/sap/ui/rta/library.js +2 -2
  52. package/src/sap/ui/rta/messagebundle.properties +22 -7
  53. package/src/sap/ui/rta/messagebundle_ar.properties +3 -1
  54. package/src/sap/ui/rta/messagebundle_bg.properties +4 -2
  55. package/src/sap/ui/rta/messagebundle_ca.properties +3 -1
  56. package/src/sap/ui/rta/messagebundle_cnr.properties +4 -2
  57. package/src/sap/ui/rta/messagebundle_cs.properties +3 -1
  58. package/src/sap/ui/rta/messagebundle_cy.properties +3 -1
  59. package/src/sap/ui/rta/messagebundle_da.properties +4 -2
  60. package/src/sap/ui/rta/messagebundle_de.properties +3 -1
  61. package/src/sap/ui/rta/messagebundle_el.properties +3 -1
  62. package/src/sap/ui/rta/messagebundle_en.properties +3 -1
  63. package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -1
  64. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
  65. package/src/sap/ui/rta/messagebundle_es.properties +3 -1
  66. package/src/sap/ui/rta/messagebundle_es_MX.properties +4 -2
  67. package/src/sap/ui/rta/messagebundle_et.properties +3 -1
  68. package/src/sap/ui/rta/messagebundle_fi.properties +4 -2
  69. package/src/sap/ui/rta/messagebundle_fr.properties +12 -10
  70. package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -5
  71. package/src/sap/ui/rta/messagebundle_hi.properties +3 -1
  72. package/src/sap/ui/rta/messagebundle_hr.properties +34 -32
  73. package/src/sap/ui/rta/messagebundle_hu.properties +3 -1
  74. package/src/sap/ui/rta/messagebundle_id.properties +3 -1
  75. package/src/sap/ui/rta/messagebundle_it.properties +48 -46
  76. package/src/sap/ui/rta/messagebundle_iw.properties +3 -1
  77. package/src/sap/ui/rta/messagebundle_ja.properties +3 -1
  78. package/src/sap/ui/rta/messagebundle_kk.properties +3 -1
  79. package/src/sap/ui/rta/messagebundle_ko.properties +3 -1
  80. package/src/sap/ui/rta/messagebundle_lt.properties +3 -1
  81. package/src/sap/ui/rta/messagebundle_lv.properties +3 -1
  82. package/src/sap/ui/rta/messagebundle_mk.properties +3 -1
  83. package/src/sap/ui/rta/messagebundle_ms.properties +3 -1
  84. package/src/sap/ui/rta/messagebundle_nl.properties +3 -1
  85. package/src/sap/ui/rta/messagebundle_no.properties +3 -1
  86. package/src/sap/ui/rta/messagebundle_pl.properties +3 -1
  87. package/src/sap/ui/rta/messagebundle_pt.properties +3 -1
  88. package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -1
  89. package/src/sap/ui/rta/messagebundle_ro.properties +3 -1
  90. package/src/sap/ui/rta/messagebundle_ru.properties +3 -1
  91. package/src/sap/ui/rta/messagebundle_sh.properties +4 -2
  92. package/src/sap/ui/rta/messagebundle_sk.properties +3 -1
  93. package/src/sap/ui/rta/messagebundle_sl.properties +3 -1
  94. package/src/sap/ui/rta/messagebundle_sr.properties +4 -2
  95. package/src/sap/ui/rta/messagebundle_sv.properties +3 -1
  96. package/src/sap/ui/rta/messagebundle_th.properties +3 -1
  97. package/src/sap/ui/rta/messagebundle_tr.properties +3 -1
  98. package/src/sap/ui/rta/messagebundle_uk.properties +3 -1
  99. package/src/sap/ui/rta/messagebundle_vi.properties +3 -1
  100. package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -1
  101. package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -1
  102. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +41 -35
  103. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +168 -0
  104. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  105. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  106. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  107. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  108. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  109. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  110. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +161 -0
  111. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  112. package/src/sap/ui/rta/plugin/Plugin.js +7 -4
  113. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  114. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  115. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  116. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  117. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  118. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  119. package/src/sap/ui/rta/plugin/Settings.js +71 -61
  120. package/src/sap/ui/rta/plugin/Split.js +1 -1
  121. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  122. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  123. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  124. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  125. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  126. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  127. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +38 -51
  128. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +85 -47
  129. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +97 -33
  130. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +72 -17
  131. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  132. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  133. package/src/sap/ui/rta/service/Action.js +1 -1
  134. package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
  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/Toolbar.adaptation.less +5 -0
  140. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
  141. package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
  142. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  143. package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
  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 +1 -1
  151. package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
  152. package/src/sap/ui/rta/util/PluginManager.js +5 -7
  153. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  154. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  155. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  156. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  157. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  158. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  159. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
  160. package/src/sap/ui/rta/util/isReuseComponent.js +44 -0
  161. package/src/sap/ui/rta/util/validateText.js +1 -1
  162. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
  163. package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +12 -7
  164. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
  165. package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
@@ -36,19 +36,19 @@ sap.ui.define([
36
36
  ) {
37
37
  "use strict";
38
38
 
39
- var _sIdRunningApp;
40
- var _bKeyUser;
41
- var _sLayer;
42
- var _oCrossAppNavService;
43
- var sModulePath;
44
- var oI18n;
39
+ let _sIdRunningApp;
40
+ let _bKeyUser;
41
+ let _sLayer;
42
+ let _oCrossAppNavService;
43
+ let sModulePath;
44
+ let oI18n;
45
45
 
46
46
  return Controller.extend("sap.ui.rta.appVariant.manageApps.webapp.controller.ManageApps", {
47
47
  onInit() {
48
48
  _sIdRunningApp = this.getOwnerComponent().getIdRunningApp();
49
49
  _bKeyUser = this.getOwnerComponent().getIsOverviewForKeyUser();
50
50
  _sLayer = this.getOwnerComponent().getLayer();
51
- var oUShellContainer = FlUtils.getUshellContainer();
51
+ const oUShellContainer = FlUtils.getUshellContainer();
52
52
 
53
53
  if (!oI18n) {
54
54
  this._createResourceBundle();
@@ -79,7 +79,7 @@ sap.ui.define([
79
79
  }.bind(this))
80
80
  .catch(function(oError) {
81
81
  AppVariantUtils.closeOverviewDialog();
82
- var oErrorInfo = AppVariantUtils.buildErrorInfo("MSG_MANAGE_APPS_FAILED", oError);
82
+ const oErrorInfo = AppVariantUtils.buildErrorInfo("MSG_MANAGE_APPS_FAILED", oError);
83
83
  oErrorInfo.overviewDialog = true;
84
84
  BusyIndicator.hide();
85
85
  return AppVariantUtils.showRelevantDialog(oErrorInfo, false);
@@ -100,15 +100,15 @@ sap.ui.define([
100
100
  },
101
101
 
102
102
  _highlightNewCreatedAppVariant(aAppVariantOverviewAttributes) {
103
- var oTable = this.byId("Table1");
103
+ const oTable = this.byId("Table1");
104
104
  if (!oTable) {
105
105
  return Promise.resolve();
106
106
  }
107
107
  oTable.focus();
108
108
 
109
- aAppVariantOverviewAttributes.forEach(function(oAppVariantDescriptor, index) {
110
- if (oAppVariantDescriptor.currentStatus === oI18n.getText("MAA_NEW_APP_VARIANT")
111
- || oAppVariantDescriptor.currentStatus === oI18n.getText("MAA_OPERATION_IN_PROGRESS")
109
+ aAppVariantOverviewAttributes.forEach(function(oAppVariantManifest, index) {
110
+ if (oAppVariantManifest.currentStatus === oI18n.getText("MAA_NEW_APP_VARIANT")
111
+ || oAppVariantManifest.currentStatus === oI18n.getText("MAA_OPERATION_IN_PROGRESS")
112
112
  ) {
113
113
  if (oTable.getItems().length >= index) {
114
114
  oTable.getItems()[index].focus();
@@ -120,11 +120,11 @@ sap.ui.define([
120
120
  },
121
121
 
122
122
  _arrangeOverviewDataAndBindToModel(aAppVariantOverviewAttributes) {
123
- var aAdaptingAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
123
+ const aAdaptingAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
124
124
  return oAppVariantProperty.appId === _sIdRunningApp;
125
125
  });
126
126
 
127
- var oAdaptingAppAttributes = aAdaptingAppAttributes[0];
127
+ const oAdaptingAppAttributes = aAdaptingAppAttributes[0];
128
128
  if (oAdaptingAppAttributes && oAdaptingAppAttributes.appVarStatus !== "R") {
129
129
  oAdaptingAppAttributes.currentStatus = oI18n.getText("MAA_CURRENTLY_ADAPTING");
130
130
  }
@@ -135,11 +135,11 @@ sap.ui.define([
135
135
 
136
136
  aAppVariantOverviewAttributes.unshift(oAdaptingAppAttributes);
137
137
 
138
- var aReferenceAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
138
+ const aReferenceAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
139
139
  return oAppVariantProperty.isOriginal;
140
140
  });
141
141
 
142
- var oReferenceAppAttributes = aReferenceAppAttributes[0];
142
+ const oReferenceAppAttributes = aReferenceAppAttributes[0];
143
143
 
144
144
  aAppVariantOverviewAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
145
145
  return !oAppVariantProperty.isOriginal;
@@ -149,11 +149,11 @@ sap.ui.define([
149
149
 
150
150
  // Bind the app variant overview to JSON model
151
151
 
152
- var oModelData = {
152
+ const oModelData = {
153
153
  appVariants: aAppVariantOverviewAttributes
154
154
  };
155
155
 
156
- var oModel = Model.createModel(oModelData);
156
+ const oModel = Model.createModel(oModelData);
157
157
  this.getView().setModel(oModel);
158
158
 
159
159
  return Promise.resolve(aAppVariantOverviewAttributes);
@@ -216,8 +216,8 @@ sap.ui.define([
216
216
  },
217
217
 
218
218
  onMenuAction(oEvent) {
219
- var oItem = oEvent.getParameter("item");
220
- var sItemPath = "";
219
+ let oItem = oEvent.getParameter("item");
220
+ let sItemPath = "";
221
221
 
222
222
  while (oItem instanceof MenuItem) {
223
223
  sItemPath = `${oItem.getText()} > ${sItemPath}`;
@@ -242,11 +242,11 @@ sap.ui.define([
242
242
  },
243
243
 
244
244
  handleUiAdaptation(oEvent) {
245
- var sSemanticObject = this.getModelProperty("semanticObject", oEvent.getSource().getBindingContext());
246
- var sAction = this.getModelProperty("action", oEvent.getSource().getBindingContext());
247
- var oParams = this.getModelProperty("params", oEvent.getSource().getBindingContext());
245
+ const sSemanticObject = this.getModelProperty("semanticObject", oEvent.getSource().getBindingContext());
246
+ const sAction = this.getModelProperty("action", oEvent.getSource().getBindingContext());
247
+ const oParams = this.getModelProperty("params", oEvent.getSource().getBindingContext());
248
248
 
249
- var oNavigationParams;
249
+ let oNavigationParams;
250
250
  if (sSemanticObject && sAction && oParams) {
251
251
  oNavigationParams = {
252
252
  target: {
@@ -271,23 +271,23 @@ sap.ui.define([
271
271
  },
272
272
 
273
273
  copyId(oEvent) {
274
- var sCopiedId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
274
+ const sCopiedId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
275
275
  AppVariantUtils.copyId(sCopiedId);
276
276
  MessageToast.show(oI18n.getText("MAA_COPY_ID_SUCCESS"));
277
277
  },
278
278
 
279
279
  deleteAppVariant(oEvent) {
280
- var oInfo = {};
280
+ const oInfo = {};
281
281
  if (!oI18n) {
282
282
  this._createResourceBundle();
283
283
  }
284
- var sMessage = oI18n.getText("MSG_APP_VARIANT_DELETE_CONFIRMATION");
284
+ const sMessage = oI18n.getText("MSG_APP_VARIANT_DELETE_CONFIRMATION");
285
285
  oInfo.text = sMessage;
286
286
  oInfo.deleteAppVariant = true;
287
287
 
288
- var sAppVarId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
289
- var sCurrentStatus = this.getModelProperty("currentStatus", oEvent.getSource().getBindingContext());
290
- var bCurrentlyAdapting = sCurrentStatus === oI18n.getText("MAA_CURRENTLY_ADAPTING");
288
+ const sAppVarId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
289
+ const sCurrentStatus = this.getModelProperty("currentStatus", oEvent.getSource().getBindingContext());
290
+ const bCurrentlyAdapting = sCurrentStatus === oI18n.getText("MAA_CURRENTLY_ADAPTING");
291
291
 
292
292
  return AppVariantUtils.showRelevantDialog(oInfo)
293
293
  .then(function() {
@@ -1,9 +1,9 @@
1
1
 
2
2
  MAA_DIALOG_ICON=Ic\u00F4ne
3
3
  MAA_DIALOG_DESCRIPTION=Description
4
- MAA_DIALOG_COPY_ID_ACTION=Copier l'action d'ID
4
+ MAA_DIALOG_COPY_ID_ACTION=Action Copier l'ID
5
5
  MAA_DIALOG_ADAPT_UI_ACTION=Adapter l'action d'IU
6
- MAA_DIALOG_SAVE_AS_ACTION=Enregistrer en tant qu'action
6
+ MAA_DIALOG_SAVE_AS_ACTION=Action Enregistrer sous
7
7
  MAA_DIALOG_ACTIONS=Actions
8
8
  MAA_DIALOG_DELETE_APPVAR=Supprimer la variante d'application
9
9
  MAA_DIALOG_ADAPT_UI=Adapter l'IU
@@ -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.133.1
19
+ * @version 1.135.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.133.1
17
+ * @version 1.135.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.78
@@ -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.133.1
19
+ * @version 1.135.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.54
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.rta.command.FlexCommand
26
26
  * @author SAP SE
27
- * @version 1.133.1
27
+ * @version 1.135.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.76
@@ -5,10 +5,18 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  "sap/ui/fl/write/api/ChangesWriteAPI",
8
+ "sap/ui/fl/write/api/FeaturesAPI",
9
+ "sap/ui/fl/write/api/LocalResetAPI",
10
+ "sap/ui/fl/write/api/PersistenceWriteAPI",
11
+ "sap/ui/fl/LayerUtils",
8
12
  "sap/ui/rta/command/FlexCommand",
9
13
  "sap/ui/rta/library"
10
14
  ], function(
11
15
  ChangesWriteAPI,
16
+ FeaturesAPI,
17
+ LocalResetAPI,
18
+ PersistenceWriteAPI,
19
+ LayerUtils,
12
20
  FlexCommand,
13
21
  rtaLibrary
14
22
  ) {
@@ -21,7 +29,7 @@ sap.ui.define([
21
29
  * @extends sap.ui.rta.command.FlexCommand
22
30
  *
23
31
  * @author SAP SE
24
- * @version 1.133.1
32
+ * @version 1.135.0
25
33
  *
26
34
  * @constructor
27
35
  * @private
@@ -40,6 +48,10 @@ sap.ui.define([
40
48
  },
41
49
  content: {
42
50
  type: "any"
51
+ },
52
+ changesToDelete: {
53
+ type: "object[]",
54
+ defaultValue: []
43
55
  }
44
56
  },
45
57
  events: {}
@@ -47,6 +59,7 @@ sap.ui.define([
47
59
  });
48
60
 
49
61
  AnnotationCommand.prototype._createChange = function(mFlexSettings, sVariantManagementReference, sCommand) {
62
+ this._aToBeResetChanges = [];
50
63
  const mChangeSpecificData = {
51
64
  ...this._getChangeSpecificData(),
52
65
  ...mFlexSettings,
@@ -55,6 +68,36 @@ sap.ui.define([
55
68
  jsOnly: this.getJsOnly(),
56
69
  generator: mFlexSettings.generator || rtaLibrary.GENERATOR_NAME
57
70
  };
71
+
72
+ if (this.getChangesToDelete().length) {
73
+ // If available, all changes of the current layer must be deleted via the LocalResetAPI
74
+ // Changes in a lower layer can't be deleted via the LocalResetAPI and must be deleted via the deactivate change
75
+ const aToBeDeactivatedChanges = [];
76
+ if (FeaturesAPI.isLocalResetEnabled()) {
77
+ this.getChangesToDelete().forEach((oFlexObject) => {
78
+ if (LayerUtils.compareAgainstCurrentLayer(oFlexObject.getLayer(), mFlexSettings.layer) === -1) {
79
+ aToBeDeactivatedChanges.push(oFlexObject);
80
+ } else {
81
+ this._aToBeResetChanges.push(oFlexObject);
82
+ }
83
+ });
84
+ } else {
85
+ aToBeDeactivatedChanges.push(...this.getChangesToDelete());
86
+ }
87
+
88
+ if (aToBeDeactivatedChanges.length) {
89
+ this._oDeactivateChange = ChangesWriteAPI.create({
90
+ changeSpecificData: {
91
+ changeType: "deactivateChanges",
92
+ content: { changeIds: aToBeDeactivatedChanges.map((oFlexObject) => oFlexObject.getId()) },
93
+ generator: mFlexSettings.generator || rtaLibrary.GENERATOR_NAME,
94
+ layer: mFlexSettings.layer
95
+ },
96
+ selector: this.getAppComponent()
97
+ });
98
+ }
99
+ }
100
+
58
101
  return ChangesWriteAPI.create({
59
102
  changeSpecificData: mChangeSpecificData,
60
103
  annotationChange: true,
@@ -62,12 +105,29 @@ sap.ui.define([
62
105
  });
63
106
  };
64
107
 
65
- AnnotationCommand.prototype.execute = function() {
66
- return Promise.resolve();
108
+ AnnotationCommand.prototype.execute = async function() {
109
+ // Annotation changes can only be applied during app start, so execute and undo only have to take care of reset / deactivate changes
110
+ if (this._aToBeResetChanges.length) {
111
+ await LocalResetAPI.resetChanges(this._aToBeResetChanges, this.getAppComponent(), true);
112
+ }
113
+ if (this._oDeactivateChange) {
114
+ PersistenceWriteAPI.add({
115
+ selector: this.getAppComponent(),
116
+ flexObjects: [this._oDeactivateChange]
117
+ });
118
+ }
67
119
  };
68
120
 
69
- AnnotationCommand.prototype.undo = function() {
70
- return Promise.resolve();
121
+ AnnotationCommand.prototype.undo = async function() {
122
+ if (this._aToBeResetChanges.length) {
123
+ await LocalResetAPI.restoreChanges(this._aToBeResetChanges, this.getAppComponent(), true);
124
+ }
125
+ if (this._oDeactivateChange) {
126
+ PersistenceWriteAPI.remove({
127
+ selector: this.getAppComponent(),
128
+ flexObjects: [this._oDeactivateChange]
129
+ });
130
+ }
71
131
  };
72
132
 
73
133
  /**
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  * @extends sap.ui.base.ManagedObject
17
17
  *
18
18
  * @author SAP SE
19
- * @version 1.133.1
19
+ * @version 1.135.0
20
20
  *
21
21
  * @constructor
22
22
  * @private
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @extends sap.ui.rta.command.FlexCommand
28
28
  * @author SAP SE
29
- * @version 1.133.1
29
+ * @version 1.135.0
30
30
  * @constructor
31
31
  * @private
32
32
  * @since 1.38
@@ -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.133.1
19
+ * @version 1.135.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.46
@@ -27,19 +27,19 @@ sap.ui.define([
27
27
  "use strict";
28
28
 
29
29
  function evaluateTemplateBinding(oElementOverlay) {
30
- var mBoundControl = ElementUtil.getAggregationInformation(oElementOverlay.getElement());
30
+ const mBoundControl = ElementUtil.getAggregationInformation(oElementOverlay.getElement());
31
31
  if (mBoundControl.elementId) {
32
32
  // check for additional binding
33
- var oBoundControlOverlay = OverlayRegistry.getOverlay(mBoundControl.elementId);
34
- var oParentElementOverlay = oBoundControlOverlay.getParentElementOverlay();
35
- var bAdditionalBinding = oParentElementOverlay ?
33
+ const oBoundControlOverlay = OverlayRegistry.getOverlay(mBoundControl.elementId);
34
+ const oParentElementOverlay = oBoundControlOverlay.getParentElementOverlay();
35
+ const bAdditionalBinding = oParentElementOverlay ?
36
36
  !!ElementUtil.getAggregationInformation(oParentElementOverlay.getElement()).templateId : false;
37
37
 
38
38
  if (bAdditionalBinding) {
39
39
  throw DtUtil.createError("CommandFactory#evaluateTemplateBinding", "Multiple template bindings are not supported", "sap.ui.rta");
40
40
  }
41
41
 
42
- var sTemplateId = ElementUtil.extractTemplateId(mBoundControl);
42
+ const sTemplateId = ElementUtil.extractTemplateId(mBoundControl);
43
43
  if (sTemplateId) {
44
44
  return {
45
45
  templateSelector: mBoundControl.elementId,
@@ -56,10 +56,10 @@ sap.ui.define([
56
56
  // For the Move Action the UI control is already moved while the corresponding object in the binding template is in the source position.
57
57
  // Therefore we have to overwrite the index of the control in the stack with the source index (iIndex) to determine the needed template object.
58
58
  function getTemplateElementId(vElementOrId, iIndex) {
59
- var oElement = (typeof vElementOrId === "string") ? Element.getElementById(vElementOrId) : vElementOrId;
60
- var oElementOverlay = OverlayRegistry.getOverlay(oElement);
59
+ const oElement = (typeof vElementOrId === "string") ? Element.getElementById(vElementOrId) : vElementOrId;
60
+ const oElementOverlay = OverlayRegistry.getOverlay(oElement);
61
61
  if (oElementOverlay) {
62
- var mBoundControl = ElementUtil.getAggregationInformation(oElement);
62
+ const mBoundControl = ElementUtil.getAggregationInformation(oElement);
63
63
  if (typeof iIndex === "number") {
64
64
  mBoundControl.stack[0].index = iIndex;
65
65
  }
@@ -75,9 +75,9 @@ sap.ui.define([
75
75
  }
76
76
 
77
77
  function configureActionCommand(oCommand, vAction) {
78
- var sChangeType;
79
- var bJsOnly = false;
80
- var bVariantIndependent = false;
78
+ let sChangeType;
79
+ let bJsOnly = false;
80
+ let bVariantIndependent = false;
81
81
 
82
82
  if (typeof vAction === "string") {
83
83
  sChangeType = vAction;
@@ -102,6 +102,20 @@ sap.ui.define([
102
102
  }
103
103
 
104
104
  function configureAddXmlCommand(oElement, mSettings, oDesignTimeMetadata) {
105
+ let vAction;
106
+ if (oDesignTimeMetadata) {
107
+ vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
108
+ }
109
+ // the change type is not configurable via designtime
110
+ // it can also not be disabled with 'not-adaptable' or null
111
+ const oAction = vAction || {};
112
+ Object.assign(oAction, {
113
+ changeType: mSettings.name
114
+ });
115
+ return oAction;
116
+ }
117
+
118
+ function configureExtendControllerCommand(oElement, mSettings, oDesignTimeMetadata) {
105
119
  var vAction;
106
120
  if (oDesignTimeMetadata) {
107
121
  vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
@@ -121,8 +135,8 @@ sap.ui.define([
121
135
  }
122
136
 
123
137
  function configureCreateContainerCommand(oElement, mSettings, oDesignTimeMetadata) {
124
- var oNewAddedElement = mSettings.element || Element.getElementById(mSettings.element.id);
125
- var oAction = oDesignTimeMetadata.getActionDataFromAggregations("createContainer", oNewAddedElement)[0];
138
+ const oNewAddedElement = mSettings.element || Element.getElementById(mSettings.element.id);
139
+ const oAction = oDesignTimeMetadata.getActionDataFromAggregations("createContainer", oNewAddedElement)[0];
126
140
  return oAction;
127
141
  }
128
142
 
@@ -134,14 +148,14 @@ sap.ui.define([
134
148
  }
135
149
 
136
150
  function configureMoveCommand(oElement, mSettings, oDesignTimeMetadata) {
137
- var oMovedElement = mSettings.movedElements[0].element || Element.getElementById(mSettings.movedElements[0].id);
138
- var oAction = oDesignTimeMetadata.getAction("move", oMovedElement);
151
+ const oMovedElement = mSettings.movedElements[0].element || Element.getElementById(mSettings.movedElements[0].id);
152
+ const oAction = oDesignTimeMetadata.getAction("move", oMovedElement);
139
153
  return oAction;
140
154
  }
141
155
 
142
156
  function adjustMoveCommand(mSettings) {
143
- var aTemplateMovedElements = mSettings.movedElements.map(function(oMovedElement) {
144
- var oMovedElementInTemplate = Element.getElementById(getTemplateElementId(oMovedElement.element, oMovedElement.sourceIndex));
157
+ const aTemplateMovedElements = mSettings.movedElements.map(function(oMovedElement) {
158
+ const oMovedElementInTemplate = Element.getElementById(getTemplateElementId(oMovedElement.element, oMovedElement.sourceIndex));
145
159
  evaluateResult(oMovedElementInTemplate);
146
160
  return oMovedElementInTemplate;
147
161
  });
@@ -161,8 +175,8 @@ sap.ui.define([
161
175
  }
162
176
 
163
177
  function configureRenameCommand(oElement, mSettings, oDesignTimeMetadata) {
164
- var oRenamedElement = mSettings.renamedElement;
165
- var oAction = oDesignTimeMetadata.getAction("rename", oRenamedElement);
178
+ const oRenamedElement = mSettings.renamedElement;
179
+ const oAction = oDesignTimeMetadata.getAction("rename", oRenamedElement);
166
180
  return oAction;
167
181
  }
168
182
 
@@ -174,13 +188,13 @@ sap.ui.define([
174
188
  }
175
189
 
176
190
  function configureRemoveCommand(oElement, mSettings, oDesignTimeMetadata) {
177
- var oRemovedElement = mSettings.removedElement;
191
+ let oRemovedElement = mSettings.removedElement;
178
192
  if (!oRemovedElement) {
179
193
  oRemovedElement = oElement;
180
194
  } else if (!(oRemovedElement instanceof ManagedObject)) {
181
195
  throw new Error("No valid 'removedElement' found");
182
196
  }
183
- var oAction = oDesignTimeMetadata.getAction("remove", oRemovedElement);
197
+ const oAction = oDesignTimeMetadata.getAction("remove", oRemovedElement);
184
198
  return oAction;
185
199
  }
186
200
 
@@ -192,8 +206,8 @@ sap.ui.define([
192
206
  }
193
207
 
194
208
  function configureCombineCommand(oElement, mSettings, oDesignTimeMetadata) {
195
- var oCombineElement = mSettings.source;
196
- var oAction = oDesignTimeMetadata.getAction("combine", oCombineElement);
209
+ const oCombineElement = mSettings.source;
210
+ const oAction = oDesignTimeMetadata.getAction("combine", oCombineElement);
197
211
  return oAction;
198
212
  }
199
213
 
@@ -202,7 +216,7 @@ sap.ui.define([
202
216
  evaluateResult(mSettings.element);
203
217
  mSettings.source = Element.getElementById(getTemplateElementId(mSettings.source));
204
218
  evaluateResult(mSettings.source);
205
- var aTemplateCombineElements = mSettings.combineElements.map(function(oCombineField) {
219
+ const aTemplateCombineElements = mSettings.combineElements.map(function(oCombineField) {
206
220
  oCombineField = Element.getElementById(getTemplateElementId(oCombineField));
207
221
  evaluateResult(oCombineField);
208
222
  return oCombineField;
@@ -211,8 +225,8 @@ sap.ui.define([
211
225
  }
212
226
 
213
227
  function configureSplitCommand(oElement, mSettings, oDesignTimeMetadata) {
214
- var oSplitElement = mSettings.source;
215
- var oAction = oDesignTimeMetadata.getAction("split", oSplitElement);
228
+ const oSplitElement = mSettings.source;
229
+ const oAction = oDesignTimeMetadata.getAction("split", oSplitElement);
216
230
  return oAction;
217
231
  }
218
232
 
@@ -226,7 +240,7 @@ sap.ui.define([
226
240
  }
227
241
 
228
242
  function configureAddDelegatePropertyCommand(oElement, mSettings, oDesignTimeMetadata) {
229
- var oNewAddedElement = mSettings.element;
243
+ const oNewAddedElement = mSettings.element;
230
244
  return oDesignTimeMetadata.getAction("add", oNewAddedElement, "delegate");
231
245
  }
232
246
 
@@ -238,8 +252,8 @@ sap.ui.define([
238
252
  }
239
253
 
240
254
  function configureRevealCommand(oElement, mSettings, oDesignTimeMetadata) {
241
- var oRevealedElement = mSettings.element;
242
- var oAction = oDesignTimeMetadata.getAction("reveal", oRevealedElement);
255
+ const oRevealedElement = mSettings.element;
256
+ const oAction = oDesignTimeMetadata.getAction("reveal", oRevealedElement);
243
257
  return oAction;
244
258
  }
245
259
 
@@ -257,9 +271,9 @@ sap.ui.define([
257
271
  }
258
272
 
259
273
  function configureCustomAddCommand(oElement, mSettings, oDesignTimeMetadata) {
260
- var oAddAction = oDesignTimeMetadata.getAction("add", mSettings.element);
274
+ const oAddAction = oDesignTimeMetadata.getAction("add", mSettings.element);
261
275
  if (oAddAction && oAddAction.custom && typeof oAddAction.custom.getItems === "function") {
262
- var oAction = {
276
+ const oAction = {
263
277
  ...oAddAction.custom,
264
278
  changeOnRelevantContainer: mSettings.changeOnRelevantContainer,
265
279
  changeType: mSettings.changeType
@@ -282,7 +296,7 @@ sap.ui.define([
282
296
  return "propertyChange";
283
297
  }
284
298
 
285
- var mCommands = { // Command names lower camel case
299
+ const mCommands = { // Command names lower camel case
286
300
  composite: {
287
301
  clazz: "sap/ui/rta/command/CompositeCommand",
288
302
  noSelector: true
@@ -306,6 +320,11 @@ sap.ui.define([
306
320
  configure: configureAddXmlCommand,
307
321
  adjustForBinding: adjustSelectorForCommand
308
322
  },
323
+ codeExt: {
324
+ clazz: "sap/ui/rta/command/ExtendControllerCommand",
325
+ configure: configureExtendControllerCommand,
326
+ adjustForBinding: adjustSelectorForCommand
327
+ },
309
328
  createContainer: {
310
329
  clazz: "sap/ui/rta/command/CreateContainer",
311
330
  configure: configureCreateContainerCommand,
@@ -376,11 +395,16 @@ sap.ui.define([
376
395
  clazz: "sap/ui/rta/command/Settings"
377
396
  },
378
397
  addLibrary: {
379
- clazz: "sap/ui/rta/command/appDescriptor/AddLibrary",
398
+ clazz: "sap/ui/rta/command/manifest/AddLibrary",
380
399
  noSelector: true
381
400
  },
401
+ // left for compatibility reasons
382
402
  appDescriptor: {
383
- clazz: "sap/ui/rta/command/AppDescriptorCommand",
403
+ clazz: "sap/ui/rta/command/ManifestCommand",
404
+ noSelector: true
405
+ },
406
+ manifest: {
407
+ clazz: "sap/ui/rta/command/ManifestCommand",
384
408
  noSelector: true
385
409
  },
386
410
  annotation: {
@@ -406,24 +430,24 @@ sap.ui.define([
406
430
  };
407
431
 
408
432
  function getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings, sVariantManagementReference) {
409
- var oCommand;
433
+ let oCommand;
410
434
  sCommand = sCommand[0].toLowerCase() + sCommand.slice(1); // first char of command name is lower case
411
- var mCommand = mCommands[sCommand];
412
- var mAllFlexSettings = mFlexSettings;
435
+ const mCommand = mCommands[sCommand];
436
+ let mAllFlexSettings = mFlexSettings;
413
437
 
414
438
  if (!mCommand) {
415
439
  return Promise.reject(DtUtil.createError("CommandFactory#getCommandFor", `Command '${sCommand}' doesn't exist, check typing`, "sap.ui.rta"));
416
440
  }
417
441
 
418
442
  return new Promise(function(fnResolve) {
419
- var sClassName = mCommand.clazz;
443
+ const sClassName = mCommand.clazz;
420
444
  sap.ui.require([sClassName], function(Command) {
421
445
  fnResolve(Command);
422
446
  });
423
447
  })
424
448
 
425
449
  .then(function(Command) {
426
- var bIsUiElement = vElement instanceof ManagedObject;
450
+ const bIsUiElement = vElement instanceof ManagedObject;
427
451
 
428
452
  // only sap.ui.rta.command.FlexCommand requires a selector property
429
453
  if (!mCommand.noSelector && !bIsUiElement) {
@@ -436,12 +460,12 @@ sap.ui.define([
436
460
  name: sCommand
437
461
  };
438
462
 
439
- var oAction;
463
+ let oAction;
440
464
  if (mCommand.configure) {
441
465
  oAction = mCommand.configure(vElement, mSettings, oDesignTimeMetadata);
442
466
  }
443
467
 
444
- var oElementOverlay;
468
+ let oElementOverlay;
445
469
  if (bIsUiElement) {
446
470
  oElementOverlay = OverlayRegistry.getOverlay(vElement);
447
471
  }
@@ -454,7 +478,7 @@ sap.ui.define([
454
478
  oElementOverlay = OverlayRegistry.getOverlay(vElement);
455
479
  }
456
480
 
457
- var mTemplateSettings;
481
+ let mTemplateSettings;
458
482
  if (oElementOverlay && vElement.sParentAggregationName) {
459
483
  mTemplateSettings = evaluateTemplateBinding(oElementOverlay);
460
484
  }
@@ -468,7 +492,7 @@ sap.ui.define([
468
492
 
469
493
  oCommand = new Command(mSettings);
470
494
 
471
- var bSuccessfullyConfigured = true; // configuration is optional
495
+ let bSuccessfullyConfigured = true; // configuration is optional
472
496
  if (mCommand.configure) {
473
497
  bSuccessfullyConfigured = configureActionCommand(oCommand, oAction);
474
498
  }
@@ -493,14 +517,14 @@ sap.ui.define([
493
517
  * @extends sap.ui.base.ManagedObject
494
518
  *
495
519
  * @author SAP SE
496
- * @version 1.133.1
520
+ * @version 1.135.0
497
521
  *
498
522
  * @constructor
499
523
  * @private
500
524
  * @since 1.34
501
525
  * @alias sap.ui.rta.command.CommandFactory
502
526
  */
503
- var CommandFactory = ManagedObject.extend("sap.ui.rta.command.CommandFactory", {
527
+ const CommandFactory = ManagedObject.extend("sap.ui.rta.command.CommandFactory", {
504
528
  metadata: {
505
529
  library: "sap.ui.rta",
506
530
  properties: {
@@ -562,7 +586,7 @@ sap.ui.define([
562
586
  };
563
587
 
564
588
  if (mFlexSettings.scenario || mFlexSettings.baseId) {
565
- var sLRepRootNamespace = FlexUtils.buildLrepRootNamespace(mFlexSettings.baseId, mFlexSettings.scenario, mFlexSettings.projectId);
589
+ const sLRepRootNamespace = FlexUtils.buildLrepRootNamespace(mFlexSettings.baseId, mFlexSettings.scenario, mFlexSettings.projectId);
566
590
  mFlexSettings.rootNamespace = sLRepRootNamespace;
567
591
  mFlexSettings.namespace = `${sLRepRootNamespace}changes/`;
568
592
  }
@@ -571,4 +595,4 @@ sap.ui.define([
571
595
  };
572
596
 
573
597
  return CommandFactory;
574
- }, /* bExport= */true);
598
+ }, /* bExport= */true);