@openui5/sap.ui.rta 1.115.1 → 1.117.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 (178) hide show
  1. package/.eslintrc.json +33 -2
  2. package/.reuse/dep5 +0 -5
  3. package/THIRDPARTY.txt +1 -7
  4. package/package.json +6 -6
  5. package/src/sap/ui/rta/.library +1 -1
  6. package/src/sap/ui/rta/Client.js +60 -59
  7. package/src/sap/ui/rta/RuntimeAuthoring.js +256 -254
  8. package/src/sap/ui/rta/Utils.js +42 -42
  9. package/src/sap/ui/rta/api/startAdaptation.js +2 -2
  10. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +3 -3
  11. package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -27
  12. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +100 -103
  13. package/src/sap/ui/rta/appVariant/Feature.js +75 -77
  14. package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +6 -7
  15. package/src/sap/ui/rta/appVariant/Utils.js +17 -17
  16. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +36 -36
  17. package/src/sap/ui/rta/command/AddIFrame.js +7 -7
  18. package/src/sap/ui/rta/command/AddProperty.js +7 -7
  19. package/src/sap/ui/rta/command/AddXML.js +1 -1
  20. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +7 -7
  21. package/src/sap/ui/rta/command/AppDescriptorCommand.js +18 -18
  22. package/src/sap/ui/rta/command/BaseCommand.js +1 -2
  23. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  24. package/src/sap/ui/rta/command/Combine.js +1 -1
  25. package/src/sap/ui/rta/command/CommandFactory.js +11 -11
  26. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  27. package/src/sap/ui/rta/command/ControlVariantConfigure.js +28 -3
  28. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  29. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +26 -24
  30. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
  31. package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -11
  32. package/src/sap/ui/rta/command/CreateContainer.js +2 -2
  33. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  34. package/src/sap/ui/rta/command/FlexCommand.js +30 -30
  35. package/src/sap/ui/rta/command/LREPSerializer.js +20 -10
  36. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  37. package/src/sap/ui/rta/command/Move.js +1 -1
  38. package/src/sap/ui/rta/command/Property.js +1 -1
  39. package/src/sap/ui/rta/command/Remove.js +1 -1
  40. package/src/sap/ui/rta/command/Rename.js +1 -1
  41. package/src/sap/ui/rta/command/Resize.js +1 -1
  42. package/src/sap/ui/rta/command/Reveal.js +1 -1
  43. package/src/sap/ui/rta/command/Settings.js +1 -1
  44. package/src/sap/ui/rta/command/Split.js +1 -1
  45. package/src/sap/ui/rta/command/Stack.js +4 -4
  46. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  47. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  48. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  49. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  50. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  51. package/src/sap/ui/rta/enablement/TestDelegate.js +92 -92
  52. package/src/sap/ui/rta/enablement/elementActionTest.js +230 -112
  53. package/src/sap/ui/rta/library.js +2 -2
  54. package/src/sap/ui/rta/messagebundle.properties +11 -1
  55. package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
  56. package/src/sap/ui/rta/messagebundle_bg.properties +5 -0
  57. package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
  58. package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
  59. package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
  60. package/src/sap/ui/rta/messagebundle_da.properties +5 -0
  61. package/src/sap/ui/rta/messagebundle_de.properties +6 -1
  62. package/src/sap/ui/rta/messagebundle_el.properties +5 -0
  63. package/src/sap/ui/rta/messagebundle_en.properties +5 -0
  64. package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
  65. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
  66. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
  67. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
  68. package/src/sap/ui/rta/messagebundle_es.properties +5 -0
  69. package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
  70. package/src/sap/ui/rta/messagebundle_et.properties +5 -0
  71. package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
  72. package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
  73. package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
  74. package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
  75. package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
  76. package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
  77. package/src/sap/ui/rta/messagebundle_id.properties +5 -0
  78. package/src/sap/ui/rta/messagebundle_it.properties +5 -0
  79. package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
  80. package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
  81. package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
  82. package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
  83. package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
  84. package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
  85. package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
  86. package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
  87. package/src/sap/ui/rta/messagebundle_no.properties +5 -0
  88. package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
  89. package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
  90. package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
  91. package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
  92. package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
  93. package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
  94. package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
  95. package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
  96. package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
  97. package/src/sap/ui/rta/messagebundle_th.properties +5 -0
  98. package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
  99. package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
  100. package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
  101. package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
  102. package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
  103. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +44 -44
  104. package/src/sap/ui/rta/plugin/BaseCreate.js +29 -29
  105. package/src/sap/ui/rta/plugin/Combine.js +9 -9
  106. package/src/sap/ui/rta/plugin/ControlVariant.js +21 -21
  107. package/src/sap/ui/rta/plugin/CreateContainer.js +6 -6
  108. package/src/sap/ui/rta/plugin/CutPaste.js +46 -46
  109. package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
  110. package/src/sap/ui/rta/plugin/EasyAdd.js +4 -4
  111. package/src/sap/ui/rta/plugin/EasyRemove.js +5 -5
  112. package/src/sap/ui/rta/plugin/LocalReset.js +25 -25
  113. package/src/sap/ui/rta/plugin/Plugin.js +20 -20
  114. package/src/sap/ui/rta/plugin/RTAElementMover.js +42 -42
  115. package/src/sap/ui/rta/plugin/Remove.js +11 -11
  116. package/src/sap/ui/rta/plugin/Rename.js +7 -7
  117. package/src/sap/ui/rta/plugin/RenameHandler.js +17 -17
  118. package/src/sap/ui/rta/plugin/Resize.js +62 -62
  119. package/src/sap/ui/rta/plugin/Selection.js +14 -14
  120. package/src/sap/ui/rta/plugin/Settings.js +20 -20
  121. package/src/sap/ui/rta/plugin/Split.js +7 -7
  122. package/src/sap/ui/rta/plugin/Stretch.js +4 -4
  123. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -87
  124. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +18 -18
  125. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +98 -99
  126. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +144 -144
  127. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
  128. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +67 -67
  129. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +38 -39
  130. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -0
  131. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +29 -29
  132. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +5 -5
  133. package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
  134. package/src/sap/ui/rta/service/Action.js +36 -37
  135. package/src/sap/ui/rta/service/ControllerExtension.js +4 -4
  136. package/src/sap/ui/rta/service/Outline.js +59 -59
  137. package/src/sap/ui/rta/service/Property.js +125 -125
  138. package/src/sap/ui/rta/service/Receiver.js +78 -77
  139. package/src/sap/ui/rta/service/Selection.js +6 -6
  140. package/src/sap/ui/rta/service/SupportTools.js +188 -37
  141. package/src/sap/ui/rta/service/index.js +1 -1
  142. package/src/sap/ui/rta/themes/base/FlexSupportExtension.less +14 -0
  143. package/src/sap/ui/rta/themes/base/library.source.less +2 -1
  144. package/src/sap/ui/rta/toolbar/Adaptation.js +81 -26
  145. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
  146. package/src/sap/ui/rta/toolbar/Base.js +17 -15
  147. package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -2
  148. package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
  149. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  150. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
  151. package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
  152. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  153. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +13 -6
  154. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
  155. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -3
  156. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +0 -2
  157. package/src/sap/ui/rta/toolbar/translation/Translation.js +41 -41
  158. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +9 -9
  159. package/src/sap/ui/rta/util/Animation.js +5 -5
  160. package/src/sap/ui/rta/util/BindingsExtractor.js +33 -33
  161. package/src/sap/ui/rta/util/PluginManager.js +25 -25
  162. package/src/sap/ui/rta/util/PopupManager.js +27 -27
  163. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  164. package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
  165. package/src/sap/ui/rta/util/StylesLoader.js +9 -9
  166. package/src/sap/ui/rta/util/UrlParser.js +19 -19
  167. package/src/sap/ui/rta/util/adaptationStarter.js +34 -31
  168. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +23 -19
  169. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
  170. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +76 -63
  171. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +6 -6
  172. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
  173. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
  174. package/src/sap/ui/rta/util/hasStableId.js +2 -2
  175. package/src/sap/ui/rta/util/showMessageBox.js +4 -5
  176. package/src/sap/ui/rta/util/validateFlexEnabled.js +5 -5
  177. package/src/sap/ui/rta/util/validateStableIds.js +8 -8
  178. package/ui5.yaml +1 -1
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  function evaluateTemplateBinding(oElementOverlay) {
28
28
  var mBoundControl = ElementUtil.getAggregationInformation(oElementOverlay.getElement());
29
29
  if (mBoundControl.elementId) {
30
- //check for additional binding
30
+ // check for additional binding
31
31
  var oBoundControlOverlay = OverlayRegistry.getOverlay(mBoundControl.elementId);
32
32
  var oParentElementOverlay = oBoundControlOverlay.getParentElementOverlay();
33
33
  var bAdditionalBinding = oParentElementOverlay ?
@@ -261,7 +261,7 @@ sap.ui.define([
261
261
  changeOnRelevantContainer: mSettings.changeOnRelevantContainer,
262
262
  changeType: mSettings.changeType
263
263
  });
264
- delete mSettings["changeOnRelevantContainer"]; // this property is not required for a sap.ui.rta.command.CustomAdd
264
+ delete mSettings.changeOnRelevantContainer; // this property is not required for a sap.ui.rta.command.CustomAdd
265
265
  return oAction;
266
266
  }
267
267
  return undefined;
@@ -408,14 +408,14 @@ sap.ui.define([
408
408
  return Promise.reject(DtUtil.createError("CommandFactory#getCommandFor", "Command '" + sCommand + "' doesn't exist, check typing", "sap.ui.rta"));
409
409
  }
410
410
 
411
- return new Promise(function (fnResolve) {
411
+ return new Promise(function(fnResolve) {
412
412
  var sClassName = mCommand.clazz;
413
- sap.ui.require([sClassName], function (Command) {
413
+ sap.ui.require([sClassName], function(Command) {
414
414
  fnResolve(Command);
415
415
  });
416
416
  })
417
417
 
418
- .then(function (Command) {
418
+ .then(function(Command) {
419
419
  var bIsUiElement = vElement instanceof ManagedObject;
420
420
 
421
421
  // only sap.ui.rta.command.FlexCommand requires a selector property
@@ -460,7 +460,7 @@ sap.ui.define([
460
460
 
461
461
  oCommand = new Command(mSettings);
462
462
 
463
- var bSuccessfullyConfigured = true; //configuration is optional
463
+ var bSuccessfullyConfigured = true; // configuration is optional
464
464
  if (mCommand.configure) {
465
465
  bSuccessfullyConfigured = configureActionCommand(oCommand, oAction);
466
466
  }
@@ -485,7 +485,7 @@ sap.ui.define([
485
485
  * @extends sap.ui.base.ManagedObject
486
486
  *
487
487
  * @author SAP SE
488
- * @version 1.115.1
488
+ * @version 1.117.0
489
489
  *
490
490
  * @constructor
491
491
  * @private
@@ -505,7 +505,7 @@ sap.ui.define([
505
505
  }
506
506
  });
507
507
 
508
- CommandFactory.prototype.init = function () {
508
+ CommandFactory.prototype.init = function() {
509
509
  this.setProperty("flexSettings", {
510
510
  layer: Layer.CUSTOMER,
511
511
  developerMode: true
@@ -517,7 +517,7 @@ sap.ui.define([
517
517
  *
518
518
  * @param {Object} [mFlexSettings] - Property bag. See {@link sap.ui.rta.RuntimeAuthoring#setFlexSettings} method for more information
519
519
  */
520
- CommandFactory.prototype.setFlexSettings = function (mFlexSettings) {
520
+ CommandFactory.prototype.setFlexSettings = function(mFlexSettings) {
521
521
  this.setProperty("flexSettings", Object.assign(this.getFlexSettings(), mFlexSettings));
522
522
  };
523
523
 
@@ -530,7 +530,7 @@ sap.ui.define([
530
530
  * @param {string} sVariantManagementReference - Variant management reference
531
531
  * @returns {Promise} A promise which will return the created command
532
532
  */
533
- CommandFactory.prototype.getCommandFor = function (vElement, sCommand, mSettings, oDesignTimeMetadata, sVariantManagementReference) {
533
+ CommandFactory.prototype.getCommandFor = function(vElement, sCommand, mSettings, oDesignTimeMetadata, sVariantManagementReference) {
534
534
  return getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, this.getFlexSettings(), sVariantManagementReference);
535
535
  };
536
536
 
@@ -549,7 +549,7 @@ sap.ui.define([
549
549
  * @param {string} [mFlexSettings.generator] - Generator of the change. Will be saved in the change
550
550
  * @returns {Promise} A promise which will return the created command
551
551
  */
552
- CommandFactory.getCommandFor = function (vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings) {
552
+ CommandFactory.getCommandFor = function(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings) {
553
553
  if (!mFlexSettings) {
554
554
  mFlexSettings = {
555
555
  layer: Layer.CUSTOMER,
@@ -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.115.1
24
+ * @version 1.117.0
25
25
  *
26
26
  * @constructor
27
27
  * @private
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.rta.command.BaseCommand
26
26
  * @author SAP SE
27
- * @version 1.115.1
27
+ * @version 1.117.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.52
@@ -66,13 +66,29 @@ sap.ui.define([
66
66
  * @public
67
67
  * @returns {Promise} Returns resolve after execution
68
68
  */
69
- ControlVariantConfigure.prototype.execute = function() {
69
+ ControlVariantConfigure.prototype.execute = async function() {
70
70
  var oVariantManagementControl = this.getControl();
71
71
  this.oAppComponent = flUtils.getAppComponentForControl(oVariantManagementControl);
72
72
  this.oModel = this.oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
73
73
  this.sVariantManagementReference = JsControlTreeModifier.getSelector(oVariantManagementControl, this.oAppComponent).id;
74
74
 
75
75
  this._aPreparedChanges = [];
76
+ if (this.getChanges().some((oChange) => {
77
+ if (
78
+ oChange.visible === false
79
+ && oChange.variantReference === this.oModel.getCurrentVariantReference(this.sVariantManagementReference)
80
+ ) {
81
+ this._sOldVReference = oChange.variantReference;
82
+ return true;
83
+ }
84
+ return false;
85
+ })) {
86
+ await this.oModel.updateCurrentVariant({
87
+ variantManagementReference: this.sVariantManagementReference,
88
+ newVariantReference: this.sVariantManagementReference
89
+ });
90
+ }
91
+
76
92
  this.getChanges().forEach(function(mChangeProperties) {
77
93
  mChangeProperties.appComponent = this.oAppComponent;
78
94
  mChangeProperties.generator = rtaLibrary.GENERATOR_NAME;
@@ -94,7 +110,7 @@ sap.ui.define([
94
110
  Object.keys(mChangeProperties).forEach(function(sProperty) {
95
111
  var sOriginalProperty = "original" + sProperty.charAt(0).toUpperCase() + sProperty.substr(1);
96
112
  if (sProperty === "visible") {
97
- mPropertyBag[sProperty] = true; /*visibility of the variant always set back to true on undo*/
113
+ mPropertyBag[sProperty] = true; /* visibility of the variant always set back to true on undo */
98
114
  } else if (mChangeProperties[sOriginalProperty]) {
99
115
  mPropertyBag[sProperty] = mChangeProperties[sOriginalProperty];
100
116
  mPropertyBag[sOriginalProperty] = mChangeProperties[sProperty];
@@ -107,6 +123,15 @@ sap.ui.define([
107
123
  }.bind(this));
108
124
 
109
125
  this._aPreparedChanges = null;
126
+ if (this._sOldVReference) {
127
+ return this.oModel.updateCurrentVariant({
128
+ variantManagementReference: this.sVariantManagementReference,
129
+ newVariantReference: this._sOldVReference
130
+ }).then(() => {
131
+ delete this._sOldVReference;
132
+ });
133
+ }
134
+
110
135
  return Promise.resolve();
111
136
  };
112
137
 
@@ -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.115.1
23
+ * @version 1.117.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.86
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @class
29
29
  * @extends sap.ui.rta.command.BaseCommand
30
30
  * @author SAP SE
31
- * @version 1.115.1
31
+ * @version 1.117.0
32
32
  * @constructor
33
33
  * @private
34
34
  * @since 1.86
@@ -88,9 +88,9 @@ sap.ui.define([
88
88
  this.oVariantManagementControl.openSaveAsDialogForKeyUser(rtaUtils.getRtaStyleClassName(),
89
89
  ContextSharingAPI.createComponent(mComponentPropertyBag));
90
90
  }.bind(this))
91
- .then(function(bState) {
92
- return bState;
93
- });
91
+ .then(function(bState) {
92
+ return bState;
93
+ });
94
94
  };
95
95
 
96
96
  ControlVariantSaveAs.prototype.getPreparedChange = function() {
@@ -113,17 +113,17 @@ sap.ui.define([
113
113
  mParams.newVariantReference = this.sNewVariantReference;
114
114
  mParams.generator = rtaLibrary.GENERATOR_NAME;
115
115
  return this.oModel._handleSave(this.oVariantManagementControl, mParams)
116
- .then(function(aDirtyChanges) {
117
- this._aPreparedChanges = aDirtyChanges;
118
- this._oVariantChange = aDirtyChanges[0];
119
- this.sNewVariantReference = this._oVariantChange.getId();
120
- this._aPreparedChanges.forEach(function(oChange) {
121
- if (oChange.getFileType() === "change") {
122
- oChange.setSavedToVariant(true);
123
- }
124
- });
125
- this.getModel().invalidateMap();
126
- }.bind(this));
116
+ .then(function(aDirtyChanges) {
117
+ this._aPreparedChanges = aDirtyChanges;
118
+ this._oVariantChange = aDirtyChanges[0];
119
+ this.sNewVariantReference = this._oVariantChange.getId();
120
+ this._aPreparedChanges.forEach(function(oChange) {
121
+ if (oChange.getFileType() === "change") {
122
+ oChange.setSavedToVariant(true);
123
+ }
124
+ });
125
+ this.getModel().invalidateMap();
126
+ }.bind(this));
127
127
  };
128
128
 
129
129
  /**
@@ -133,11 +133,13 @@ sap.ui.define([
133
133
  */
134
134
  ControlVariantSaveAs.prototype.undo = function() {
135
135
  if (this._oVariantChange) {
136
+ var aChangesToBeDeleted = [];
136
137
  this._aPreparedChanges.forEach(function(oChange) {
137
138
  if (oChange.getFileType() === "ctrl_variant_management_change") {
138
- this.oModel.oFlexController.deleteChange(oChange);
139
+ aChangesToBeDeleted.push(oChange);
139
140
  }
140
- }.bind(this));
141
+ });
142
+ this.oModel.oChangePersistence.deleteChanges(aChangesToBeDeleted);
141
143
 
142
144
  var mPropertyBag = {
143
145
  variant: this._oVariantChange,
@@ -147,13 +149,13 @@ sap.ui.define([
147
149
  };
148
150
 
149
151
  return this.oModel.removeVariant(mPropertyBag, true)
150
- .then(function() {
151
- return this.oModel.addAndApplyChangesOnVariant(this._aControlChanges);
152
- }.bind(this))
153
- .then(function() {
154
- this._aPreparedChanges = null;
155
- this._oVariantChange = null;
156
- }.bind(this));
152
+ .then(function() {
153
+ return this.oModel.addAndApplyChangesOnVariant(this._aControlChanges);
154
+ }.bind(this))
155
+ .then(function() {
156
+ this._aPreparedChanges = null;
157
+ this._oVariantChange = null;
158
+ }.bind(this));
157
159
  }
158
160
  return Promise.resolve();
159
161
  };
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.rta.command.BaseCommand
26
26
  * @author SAP SE
27
- * @version 1.115.1
27
+ * @version 1.117.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.50
@@ -88,9 +88,9 @@ sap.ui.define([
88
88
  };
89
89
 
90
90
  return Promise.resolve(this.oModel.addVariantChange(this.sVariantManagementReference, mPropertyBag))
91
- .then(function(oChange) {
92
- this._oVariantChange = oChange;
93
- }.bind(this));
91
+ .then(function(oChange) {
92
+ this._oVariantChange = oChange;
93
+ }.bind(this));
94
94
  };
95
95
 
96
96
  /**
@@ -107,9 +107,9 @@ sap.ui.define([
107
107
  var oChange = this._oVariantChange;
108
108
 
109
109
  return Promise.resolve(this.oModel.deleteVariantChange(this.sVariantManagementReference, mPropertyBag, oChange))
110
- .then(function() {
111
- this._oVariantChange = null;
112
- }.bind(this));
110
+ .then(function() {
111
+ this._oVariantChange = null;
112
+ }.bind(this));
113
113
  };
114
114
 
115
115
  return ControlVariantSetTitle;
@@ -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.115.1
25
+ * @version 1.117.0
26
26
  * @constructor
27
27
  * @private
28
28
  * @since 1.50
@@ -53,9 +53,9 @@ sap.ui.define([
53
53
 
54
54
  function discardVariantContent(sVReference) {
55
55
  return this.oModel.eraseDirtyChangesOnVariant(this.sVariantManagementReference, sVReference)
56
- .then(function(aDirtyChanges) {
57
- this._aSourceVariantDirtyChanges = aDirtyChanges;
58
- }.bind(this));
56
+ .then(function(aDirtyChanges) {
57
+ this._aSourceVariantDirtyChanges = aDirtyChanges;
58
+ }.bind(this));
59
59
  }
60
60
 
61
61
  ControlVariantSwitch.prototype._getAppComponent = function() {
@@ -78,13 +78,13 @@ sap.ui.define([
78
78
  this.sVariantManagementReference = JsControlTreeModifier.getSelector(oElement, oAppComponent).id;
79
79
 
80
80
  return Promise.resolve()
81
- .then(function() {
82
- if (this.getDiscardVariantContent()) {
83
- return discardVariantContent.call(this, this.getSourceVariantReference());
84
- }
85
- return undefined;
86
- }.bind(this))
87
- .then(this._updateModelVariant.bind(this, sNewVariantReference, oAppComponent));
81
+ .then(function() {
82
+ if (this.getDiscardVariantContent()) {
83
+ return discardVariantContent.call(this, this.getSourceVariantReference());
84
+ }
85
+ return undefined;
86
+ }.bind(this))
87
+ .then(this._updateModelVariant.bind(this, sNewVariantReference, oAppComponent));
88
88
  };
89
89
 
90
90
  /**
@@ -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.115.1
15
+ * @version 1.117.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.34
@@ -32,7 +32,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
32
32
  type: "string",
33
33
  group: "content"
34
34
  },
35
- label: { //legacy property => exposed in tests
35
+ label: { // legacy property => exposed in tests
36
36
  type: "string"
37
37
  },
38
38
  parentId: {
@@ -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.115.1
15
+ * @version 1.117.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.62
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.ui.rta.command.BaseCommand
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.115.1
36
+ * @version 1.117.0
37
37
  *
38
38
  * @constructor
39
39
  * @private
@@ -121,14 +121,14 @@ sap.ui.define([
121
121
  }
122
122
 
123
123
  return this._createChange(mFlexSettings, sVariantManagementReference, sCommand)
124
- .then(function(oChange) {
125
- this._oPreparedChange = oChange;
126
- return true;
127
- }.bind(this))
128
- .catch(function(oError) {
129
- Log.error(oError.message || oError.name);
130
- return false;
131
- });
124
+ .then(function(oChange) {
125
+ this._oPreparedChange = oChange;
126
+ return true;
127
+ }.bind(this))
128
+ .catch(function(oError) {
129
+ Log.error(oError.message || oError.name);
130
+ return false;
131
+ });
132
132
  };
133
133
 
134
134
  /**
@@ -160,12 +160,12 @@ sap.ui.define([
160
160
  changeType: this.getChangeType()
161
161
  };
162
162
  objectValues(mProperties)
163
- .filter(function (oProperty) {
164
- return oProperty.group === "content";
165
- })
166
- .forEach(function (oProperty) {
167
- mChangeSpecificData[oProperty.name] = oProperty.get(this);
168
- }, this);
163
+ .filter(function(oProperty) {
164
+ return oProperty.group === "content";
165
+ })
166
+ .forEach(function(oProperty) {
167
+ mChangeSpecificData[oProperty.name] = oProperty.get(this);
168
+ }, this);
169
169
  return mChangeSpecificData;
170
170
  };
171
171
 
@@ -205,25 +205,26 @@ sap.ui.define([
205
205
  if (sVariantReference && !this.getVariantIndependent()) {
206
206
  var mVariantObj = {
207
207
  variantManagementReference: sVariantManagementReference,
208
- variantReference: sVariantReference
208
+ variantReference: sVariantReference,
209
+ isChangeOnStandardVariant: sVariantManagementReference === sVariantReference
209
210
  };
210
211
  mChangeSpecificData = Object.assign({}, mChangeSpecificData, mVariantObj);
211
212
  }
212
213
  mChangeSpecificData.command = sCommand;
213
214
  mChangeSpecificData.generator = mFlexSettings.generator || rtaLibrary.GENERATOR_NAME;
214
215
  return ChangesWriteAPI.create({changeSpecificData: mChangeSpecificData, selector: this._validateControlForChange(mFlexSettings)})
215
- .then(function(oChange) {
216
- // originalSelector is only present when making a change on/inside a template; the selector does not work with the JS propagation hook (the template has no parent),
217
- // therefore the selector is changed to the parent (already the selector of the command) and the original selector saved as dependent.
218
- // Also 'boundAggregation' property gets saved in the change content
219
- // ATTENTION! the change gets applied as soon as the parent is available, so there might be possible side effects with lazy loading
220
- if (mFlexSettings && mFlexSettings.originalSelector) {
221
- oChange.addDependentControl(mFlexSettings.originalSelector, "originalSelector", {modifier: JsControlTreeModifier, appComponent: this.getAppComponent()});
222
- oChange.setSelector(Object.assign(oChange.getSelector(), JsControlTreeModifier.getSelector(this.getSelector().id, this.getAppComponent())));
223
- oChange.setContent(Object.assign({}, oChange.getContent(), mFlexSettings.content));
224
- }
225
- return oChange;
226
- }.bind(this));
216
+ .then(function(oChange) {
217
+ // originalSelector is only present when making a change on/inside a template; the selector does not work with the JS propagation hook (the template has no parent),
218
+ // therefore the selector is changed to the parent (already the selector of the command) and the original selector saved as dependent.
219
+ // Also 'boundAggregation' property gets saved in the change content
220
+ // ATTENTION! the change gets applied as soon as the parent is available, so there might be possible side effects with lazy loading
221
+ if (mFlexSettings && mFlexSettings.originalSelector) {
222
+ oChange.addDependentControl(mFlexSettings.originalSelector, "originalSelector", {modifier: JsControlTreeModifier, appComponent: this.getAppComponent()});
223
+ oChange.setSelector(Object.assign(oChange.getSelector(), JsControlTreeModifier.getSelector(this.getSelector().id, this.getAppComponent())));
224
+ oChange.setContent(Object.assign({}, oChange.getContent(), mFlexSettings.content));
225
+ }
226
+ return oChange;
227
+ }.bind(this));
227
228
  };
228
229
 
229
230
  /**
@@ -243,13 +244,12 @@ sap.ui.define([
243
244
  * @returns {Promise} Returns an empty promise
244
245
  */
245
246
  FlexCommand.prototype._applyChange = function(vChange) {
246
- //TODO: remove the following compatibility code when concept is implemented
247
+ // TODO: remove the following compatibility code when concept is implemented
247
248
  var oChange = vChange.change || vChange;
248
249
 
249
250
  var oAppComponent = this.getAppComponent();
250
251
  var oSelectorElement = JsControlTreeModifier.bySelector(oChange.getSelector(), oAppComponent);
251
252
 
252
-
253
253
  var mPropertyBag = {
254
254
  modifier: JsControlTreeModifier,
255
255
  appComponent: oAppComponent,
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @class
28
28
  * @extends sap.ui.base.ManagedObject
29
29
  * @author SAP SE
30
- * @version 1.115.1
30
+ * @version 1.117.0
31
31
  * @constructor
32
32
  * @private
33
33
  * @since 1.42
@@ -76,18 +76,20 @@ sap.ui.define([
76
76
  this.getCommandStack().removeCommandExecutionHandler(this._fnHandleCommandExecuted);
77
77
  };
78
78
  LREPSerializer.prototype._isPersistedChange = function(oPreparedChange) {
79
- return !!this.getCommandStack()._aPersistedChanges && this.getCommandStack()._aPersistedChanges.indexOf(oPreparedChange.getId()) !== -1;
79
+ return !!this.getCommandStack()._aPersistedChanges
80
+ && this.getCommandStack()._aPersistedChanges.indexOf(oPreparedChange.getId()) !== -1;
80
81
  };
81
82
 
82
83
  LREPSerializer.prototype.handleCommandExecuted = function(oEvent) {
83
- return (function (oEvent) {
84
+ return (function(oEvent) {
84
85
  var oParams = oEvent;
85
86
  this._lastPromise = this._lastPromise.catch(function() {
86
87
  // _lastPromise chain must not be interrupted
87
88
  }).then(function() {
88
89
  var aCommands = this.getCommandStack().getSubCommands(oParams.command);
90
+ var oAppComponent;
91
+ var aFlexObjects = [];
89
92
  if (oParams.undo) {
90
- var aRemovePromises = [];
91
93
  aCommands.forEach(function(oCommand) {
92
94
  // for revertable changes which don't belong to LREP (variantSwitch) or runtime only changes
93
95
  if (!(oCommand instanceof FlexCommand || oCommand instanceof AppDescriptorCommand)
@@ -95,12 +97,18 @@ sap.ui.define([
95
97
  return;
96
98
  }
97
99
  var oChange = oCommand.getPreparedChange();
98
- var oAppComponent = oCommand.getAppComponent();
100
+ oAppComponent = oCommand.getAppComponent();
99
101
  if (oAppComponent) {
100
- aRemovePromises.push(PersistenceWriteAPI.remove({change: oChange, selector: oAppComponent}));
102
+ aFlexObjects.push(oChange);
101
103
  }
102
104
  });
103
- return Promise.all(aRemovePromises);
105
+ if (oAppComponent) {
106
+ return PersistenceWriteAPI.remove({
107
+ flexObjects: aFlexObjects,
108
+ selector: oAppComponent
109
+ });
110
+ }
111
+ return Promise.resolve();
104
112
  }
105
113
  var aDescriptorCreateAndAdd = [];
106
114
  aCommands.forEach(function(oCommand) {
@@ -109,18 +117,20 @@ sap.ui.define([
109
117
  return;
110
118
  }
111
119
  if (oCommand instanceof FlexCommand) {
112
- var oAppComponent = oCommand.getAppComponent();
120
+ oAppComponent = oCommand.getAppComponent();
113
121
  if (oAppComponent) {
114
122
  var oPreparedChange = oCommand.getPreparedChange();
115
123
  if (!this._isPersistedChange(oPreparedChange)) {
116
- PersistenceWriteAPI.add({change: oCommand.getPreparedChange(), selector: oAppComponent});
124
+ aFlexObjects.push(oCommand.getPreparedChange());
117
125
  }
118
126
  }
119
127
  } else if (oCommand instanceof AppDescriptorCommand) {
120
128
  aDescriptorCreateAndAdd.push(oCommand.createAndStoreChange());
121
129
  }
122
130
  }.bind(this));
123
-
131
+ if (oAppComponent) {
132
+ PersistenceWriteAPI.add({flexObjects: aFlexObjects, selector: oAppComponent});
133
+ }
124
134
  return Promise.all(aDescriptorCreateAndAdd);
125
135
  }.bind(this));
126
136
  return this._lastPromise;
@@ -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.115.1
23
+ * @version 1.117.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.90
@@ -17,7 +17,7 @@ function(
17
17
  * @class
18
18
  * @extends sap.ui.rta.command.FlexCommand
19
19
  * @author SAP SE
20
- * @version 1.115.1
20
+ * @version 1.117.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.115.1
19
+ * @version 1.117.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.115.1
15
+ * @version 1.117.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.115.1
15
+ * @version 1.117.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.115.1
19
+ * @version 1.117.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.115.1
15
+ * @version 1.117.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.115.1
15
+ * @version 1.117.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.115.1
17
+ * @version 1.117.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.46