@openui5/sap.ui.rta 1.107.0 → 1.108.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 (147) hide show
  1. package/THIRDPARTY.txt +1 -1
  2. package/package.json +6 -6
  3. package/src/sap/ui/rta/.library +1 -1
  4. package/src/sap/ui/rta/Client.js +1 -1
  5. package/src/sap/ui/rta/RuntimeAuthoring.js +14 -5
  6. package/src/sap/ui/rta/Utils.js +1 -1
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  8. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  9. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  10. package/src/sap/ui/rta/command/AddXML.js +1 -1
  11. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  12. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  13. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  14. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  15. package/src/sap/ui/rta/command/Combine.js +1 -1
  16. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  17. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  18. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  19. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  23. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  24. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  25. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  26. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  27. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  28. package/src/sap/ui/rta/command/Move.js +1 -1
  29. package/src/sap/ui/rta/command/Property.js +1 -1
  30. package/src/sap/ui/rta/command/Remove.js +1 -1
  31. package/src/sap/ui/rta/command/Rename.js +1 -1
  32. package/src/sap/ui/rta/command/Resize.js +1 -1
  33. package/src/sap/ui/rta/command/Reveal.js +1 -1
  34. package/src/sap/ui/rta/command/Settings.js +1 -1
  35. package/src/sap/ui/rta/command/Split.js +1 -1
  36. package/src/sap/ui/rta/command/Stack.js +1 -1
  37. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  38. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +49 -27
  39. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +10 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +8 -4
  42. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  43. package/src/sap/ui/rta/library.js +2 -2
  44. package/src/sap/ui/rta/messagebundle.properties +20 -10
  45. package/src/sap/ui/rta/messagebundle_ar.properties +6 -1
  46. package/src/sap/ui/rta/messagebundle_bg.properties +14 -9
  47. package/src/sap/ui/rta/messagebundle_ca.properties +6 -1
  48. package/src/sap/ui/rta/messagebundle_cs.properties +6 -1
  49. package/src/sap/ui/rta/messagebundle_cy.properties +6 -1
  50. package/src/sap/ui/rta/messagebundle_da.properties +6 -1
  51. package/src/sap/ui/rta/messagebundle_de.properties +6 -1
  52. package/src/sap/ui/rta/messagebundle_el.properties +6 -1
  53. package/src/sap/ui/rta/messagebundle_en.properties +6 -1
  54. package/src/sap/ui/rta/messagebundle_en_GB.properties +6 -1
  55. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +6 -1
  56. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
  57. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
  58. package/src/sap/ui/rta/messagebundle_es.properties +6 -1
  59. package/src/sap/ui/rta/messagebundle_es_MX.properties +6 -1
  60. package/src/sap/ui/rta/messagebundle_et.properties +6 -1
  61. package/src/sap/ui/rta/messagebundle_fi.properties +6 -1
  62. package/src/sap/ui/rta/messagebundle_fr.properties +6 -1
  63. package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -2
  64. package/src/sap/ui/rta/messagebundle_hi.properties +6 -1
  65. package/src/sap/ui/rta/messagebundle_hr.properties +6 -1
  66. package/src/sap/ui/rta/messagebundle_hu.properties +6 -1
  67. package/src/sap/ui/rta/messagebundle_id.properties +6 -1
  68. package/src/sap/ui/rta/messagebundle_it.properties +6 -1
  69. package/src/sap/ui/rta/messagebundle_iw.properties +6 -1
  70. package/src/sap/ui/rta/messagebundle_ja.properties +6 -1
  71. package/src/sap/ui/rta/messagebundle_kk.properties +6 -1
  72. package/src/sap/ui/rta/messagebundle_ko.properties +6 -1
  73. package/src/sap/ui/rta/messagebundle_lt.properties +6 -1
  74. package/src/sap/ui/rta/messagebundle_lv.properties +6 -1
  75. package/src/sap/ui/rta/messagebundle_ms.properties +6 -1
  76. package/src/sap/ui/rta/messagebundle_nl.properties +6 -1
  77. package/src/sap/ui/rta/messagebundle_no.properties +6 -1
  78. package/src/sap/ui/rta/messagebundle_pl.properties +6 -1
  79. package/src/sap/ui/rta/messagebundle_pt.properties +6 -1
  80. package/src/sap/ui/rta/messagebundle_pt_PT.properties +6 -1
  81. package/src/sap/ui/rta/messagebundle_ro.properties +6 -1
  82. package/src/sap/ui/rta/messagebundle_ru.properties +6 -1
  83. package/src/sap/ui/rta/messagebundle_sh.properties +6 -1
  84. package/src/sap/ui/rta/messagebundle_sk.properties +6 -1
  85. package/src/sap/ui/rta/messagebundle_sl.properties +6 -1
  86. package/src/sap/ui/rta/messagebundle_sv.properties +6 -1
  87. package/src/sap/ui/rta/messagebundle_th.properties +6 -1
  88. package/src/sap/ui/rta/messagebundle_tr.properties +6 -1
  89. package/src/sap/ui/rta/messagebundle_uk.properties +6 -1
  90. package/src/sap/ui/rta/messagebundle_vi.properties +6 -1
  91. package/src/sap/ui/rta/messagebundle_zh_CN.properties +6 -1
  92. package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -1
  93. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  94. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  95. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  96. package/src/sap/ui/rta/plugin/CompVariant.js +75 -29
  97. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  98. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  99. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  100. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  101. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  102. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  103. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  104. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  105. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  106. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  107. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  108. package/src/sap/ui/rta/plugin/RenameHandler.js +3 -1
  109. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  110. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  111. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  112. package/src/sap/ui/rta/plugin/Split.js +1 -1
  113. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  114. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  118. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  119. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  120. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
  121. package/src/sap/ui/rta/service/Action.js +1 -1
  122. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  123. package/src/sap/ui/rta/service/Outline.js +1 -1
  124. package/src/sap/ui/rta/service/Property.js +1 -1
  125. package/src/sap/ui/rta/service/Selection.js +1 -1
  126. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  127. package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
  128. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  129. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  130. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  131. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  132. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  133. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  134. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +7 -8
  135. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  136. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  137. package/src/sap/ui/rta/util/PluginManager.js +2 -2
  138. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  139. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  140. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  141. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  142. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +16 -0
  143. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +21 -4
  144. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +28 -0
  145. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +135 -53
  146. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +39 -0
  147. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +6 -3
package/THIRDPARTY.txt CHANGED
@@ -382,7 +382,7 @@ Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/D
382
382
 
383
383
  Library: sap.ui.integration:
384
384
 
385
- Component: UI5 Web Components, version: 1.0.1
385
+ Component: UI5 Web Components, version: 1.7.0
386
386
  Copyright: SAP
387
387
  License: Apache-2.0
388
388
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.rta",
3
- "version": "1.107.0",
3
+ "version": "1.108.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.rta",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,10 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.107.0",
18
- "@openui5/sap.ui.core": "1.107.0",
19
- "@openui5/sap.ui.dt": "1.107.0",
20
- "@openui5/sap.ui.fl": "1.107.0",
21
- "@openui5/sap.ui.layout": "1.107.0"
17
+ "@openui5/sap.m": "1.108.0",
18
+ "@openui5/sap.ui.core": "1.108.0",
19
+ "@openui5/sap.ui.dt": "1.108.0",
20
+ "@openui5/sap.ui.fl": "1.108.0",
21
+ "@openui5/sap.ui.layout": "1.108.0"
22
22
  }
23
23
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.107.0</version>
9
+ <version>1.108.0</version>
10
10
 
11
11
  <documentation>SAPUI5 library with RTA controls.</documentation>
12
12
 
@@ -57,7 +57,7 @@ sap.ui.define([
57
57
  * @alias sap.ui.rta.Client
58
58
  * @author SAP SE
59
59
  * @since 1.56.0
60
- * @version 1.107.0
60
+ * @version 1.108.0
61
61
  * @private
62
62
  * @ui5-restricted
63
63
  */
@@ -118,7 +118,7 @@ sap.ui.define([
118
118
  * @class The runtime authoring allows to adapt the fields of a running application.
119
119
  * @extends sap.ui.base.ManagedObject
120
120
  * @author SAP SE
121
- * @version 1.107.0
121
+ * @version 1.108.0
122
122
  * @constructor
123
123
  * @private
124
124
  * @since 1.30
@@ -970,6 +970,7 @@ sap.ui.define([
970
970
  * Checks the publish button, draft buttons(activate and delete) and app variant support (i.e. Save As and Overview of App Variants) availability
971
971
  * The publish button shall not be available if the system is productive and if a merge error occurred during merging changes into the view on startup
972
972
  * The app variant support shall not be available if the system is productive and if the platform is not enabled (See Feature.js) to show the app variant tooling
973
+ * The app variant support shall also not be available if the current app is a home page
973
974
  * isProductiveSystem should only return true if it is a test or development system with the provision of custom catalog extensions
974
975
  *
975
976
  * @param {object} oRootControl - Root control instance
@@ -981,15 +982,23 @@ sap.ui.define([
981
982
  return Promise.all([
982
983
  FeaturesAPI.isPublishAvailable(),
983
984
  RtaAppVariantFeature.isSaveAsAvailable(oRootControl, sLayer, oSerializer),
984
- FeaturesAPI.isContextBasedAdaptationAvailable(sLayer)
985
+ FeaturesAPI.isContextBasedAdaptationAvailable(sLayer),
986
+ FlexUtils.getUShellService("AppLifeCycle").then(function(oAppLifeCycle) {
987
+ if (oAppLifeCycle) {
988
+ var mRunningApp = oAppLifeCycle.getCurrentApplication();
989
+ return mRunningApp ? mRunningApp.homePage : false;
990
+ }
991
+ return false;
992
+ })
985
993
  ]).then(function(aRtaFeaturesAvailability) {
986
994
  var bIsPublishAvailable = aRtaFeaturesAvailability[0];
987
995
  var bIsSaveAsAvailable = aRtaFeaturesAvailability[1];
988
996
  var bIsContextBasedAdaptationAvailable = aRtaFeaturesAvailability[2];
997
+ var bIsHomePage = aRtaFeaturesAvailability[3];
989
998
  return {
990
999
  publishAvailable: bIsPublishAvailable,
991
- saveAsAvailable: bIsPublishAvailable && bIsSaveAsAvailable,
992
- contextBasedAdaptationAvailable: bIsContextBasedAdaptationAvailable
1000
+ saveAsAvailable: !bIsHomePage && bIsPublishAvailable && bIsSaveAsAvailable,
1001
+ contextBasedAdaptationAvailable: !bIsHomePage && bIsContextBasedAdaptationAvailable
993
1002
  };
994
1003
  });
995
1004
  }
@@ -1051,7 +1060,7 @@ sap.ui.define([
1051
1060
  TranslationAPI.hasTranslationRelevantDirtyChanges({layer: Layer.CUSTOMER, selector: this.getRootControlInstance()});
1052
1061
 
1053
1062
  // TODO: move to the setter to the ChangesState
1054
- this._oVersionsModel.setDirtyChanges(bCanUndo);
1063
+ this._oVersionsModel.setDirtyChanges(PersistenceWriteAPI.hasDirtyChanges({selector: this.getRootControlInstance()}));
1055
1064
  this._oToolbarControlsModel.setProperty("/undoEnabled", bCanUndo);
1056
1065
  this._oToolbarControlsModel.setProperty("/redoEnabled", bCanRedo);
1057
1066
  this._oToolbarControlsModel.setProperty("/publishEnabled", this.bInitialPublishEnabled || bCanUndo);
@@ -45,7 +45,7 @@ function(
45
45
  *
46
46
  * @namespace
47
47
  * @author SAP SE
48
- * @version 1.107.0
48
+ * @version 1.108.0
49
49
  *
50
50
  * @private
51
51
  * @since 1.30
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.base.ManagedObject
26
26
  * @author SAP SE
27
- * @version 1.107.0
27
+ * @version 1.108.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.53
@@ -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.107.0
19
+ * @version 1.108.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.107.0
17
+ * @version 1.108.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.107.0
19
+ * @version 1.108.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.107.0
27
+ * @version 1.108.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.76
@@ -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.107.0
24
+ * @version 1.108.0
25
25
  *
26
26
  * @constructor
27
27
  * @private
@@ -13,7 +13,7 @@ sap.ui.define(["sap/ui/base/ManagedObject"], function(ManagedObject) {
13
13
  * @extends sap.ui.base.ManagedObject
14
14
  *
15
15
  * @author SAP SE
16
- * @version 1.107.0
16
+ * @version 1.108.0
17
17
  *
18
18
  * @constructor
19
19
  * @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.107.0
29
+ * @version 1.108.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.107.0
19
+ * @version 1.108.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.46
@@ -485,7 +485,7 @@ sap.ui.define([
485
485
  * @extends sap.ui.base.ManagedObject
486
486
  *
487
487
  * @author SAP SE
488
- * @version 1.107.0
488
+ * @version 1.108.0
489
489
  *
490
490
  * @constructor
491
491
  * @private
@@ -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.107.0
24
+ * @version 1.108.0
25
25
  *
26
26
  * @constructor
27
27
  * @private
@@ -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.107.0
25
+ * @version 1.108.0
26
26
  * @constructor
27
27
  * @private
28
28
  * @since 1.52
@@ -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.107.0
23
+ * @version 1.108.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.86
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @extends sap.ui.rta.command.BaseCommand
28
28
  * @author SAP SE
29
- * @version 1.107.0
29
+ * @version 1.108.0
30
30
  * @constructor
31
31
  * @private
32
32
  * @since 1.86
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @class
18
18
  * @extends sap.ui.rta.command.BaseCommand
19
19
  * @author SAP SE
20
- * @version 1.107.0
20
+ * @version 1.108.0
21
21
  * @constructor
22
22
  * @private
23
23
  * @since 1.50
@@ -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.107.0
23
+ * @version 1.108.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.50
@@ -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.107.0
15
+ * @version 1.108.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @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.107.0
15
+ * @version 1.108.0
16
16
  * @constructor
17
17
  * @private
18
18
  * @since 1.62
@@ -31,7 +31,7 @@ sap.ui.define([
31
31
  * @extends sap.ui.rta.command.BaseCommand
32
32
  *
33
33
  * @author SAP SE
34
- * @version 1.107.0
34
+ * @version 1.108.0
35
35
  *
36
36
  * @constructor
37
37
  * @private
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @class
30
30
  * @extends sap.ui.base.ManagedObject
31
31
  * @author SAP SE
32
- * @version 1.107.0
32
+ * @version 1.108.0
33
33
  * @constructor
34
34
  * @private
35
35
  * @since 1.42
@@ -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.107.0
23
+ * @version 1.108.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.107.0
20
+ * @version 1.108.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.107.0
19
+ * @version 1.108.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.107.0
15
+ * @version 1.108.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.107.0
15
+ * @version 1.108.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.107.0
19
+ * @version 1.108.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.107.0
15
+ * @version 1.108.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.107.0
15
+ * @version 1.108.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.107.0
17
+ * @version 1.108.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.46
@@ -59,7 +59,7 @@ sap.ui.define([
59
59
  * @class
60
60
  * @extends sap.ui.base.ManagedObject
61
61
  * @author SAP SE
62
- * @version 1.107.0
62
+ * @version 1.108.0
63
63
  * @constructor
64
64
  * @private
65
65
  * @since 1.34
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @extends sap.ui.rta.command.AppDescriptorCommand
18
18
  *
19
19
  * @author SAP SE
20
- * @version 1.107.0
20
+ * @version 1.108.0
21
21
  *
22
22
  * @constructor
23
23
  * @private
@@ -4,9 +4,13 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- "sap/ui/rta/command/BaseCommand"
7
+ "sap/ui/rta/command/BaseCommand",
8
+ "sap/ui/fl/write/api/SmartVariantManagementWriteAPI",
9
+ "sap/ui/rta/library"
8
10
  ], function(
9
- BaseCommand
11
+ BaseCommand,
12
+ SmartVariantManagementWriteAPI,
13
+ rtaLibrary
10
14
  ) {
11
15
  "use strict";
12
16
 
@@ -16,7 +20,7 @@ sap.ui.define([
16
20
  * @class
17
21
  * @extends sap.ui.rta.command.BaseCommand
18
22
  * @author SAP SE
19
- * @version 1.107.0
23
+ * @version 1.108.0
20
24
  * @constructor
21
25
  * @private
22
26
  * @since 1.102
@@ -32,51 +36,69 @@ sap.ui.define([
32
36
  persistencyKey: {
33
37
  type: "string"
34
38
  },
35
- oldContent: {
36
- type: "object"
37
- },
38
39
  newContent: {
39
40
  type: "object"
41
+ },
42
+ isModifiedBefore: {
43
+ type: "boolean"
40
44
  }
41
45
  }
42
46
  }
43
47
  });
44
48
 
45
- CompVariantContent.prototype.execute = function() {
46
- this.setOldContent(getCurrentVariantContent.call(this));
47
- setVariantContent.call(this, this.getNewContent());
48
-
49
- return Promise.resolve();
50
- };
51
-
52
- CompVariantContent.prototype.undo = function() {
53
- setVariantContent.call(this, this.getOldContent());
54
-
55
- return Promise.resolve();
56
- };
49
+ function callFlAPIFunction(sFunctionName, sKey, oValue) {
50
+ var mPropertyBag = Object.assign({}, oValue, this.mInformation, {
51
+ id: sKey,
52
+ control: this.getElement()
53
+ });
54
+ return SmartVariantManagementWriteAPI[sFunctionName](mPropertyBag);
55
+ }
57
56
 
58
57
  // private function of the SmartVariantManagement are approved and documented to be used from here
59
58
  function setVariantContent(oContent) {
60
- var oContentToBeSet = {};
61
59
  var oVariantManagementControl = this.getElement();
60
+ var oCurrentVariantContent = oVariantManagementControl._getVariantContent(this.getVariantId());
61
+ var oNewVariantContent = Object.assign({}, oCurrentVariantContent);
62
62
  if (oVariantManagementControl.isPageVariant()) {
63
+ var oContentToBeSet = {};
63
64
  oContentToBeSet[this.getPersistencyKey()] = oContent;
64
65
  oVariantManagementControl._applyVariantByPersistencyKey(this.getPersistencyKey(), oContentToBeSet, "KEY_USER");
66
+ oNewVariantContent[this.getPersistencyKey()] = oContent;
65
67
  } else {
66
- oContentToBeSet = oContent;
67
- oVariantManagementControl._applyVariant(oVariantManagementControl._getPersoController(), oContentToBeSet, "KEY_USER");
68
+ oVariantManagementControl._applyVariant(oVariantManagementControl._getPersoController(), oContent, "KEY_USER");
69
+ oNewVariantContent = oContent;
68
70
  }
71
+ return oNewVariantContent;
69
72
  }
70
73
 
71
- // private function of the SmartVariantManagement are approved and documented to be used from here
72
- function getCurrentVariantContent() {
74
+ CompVariantContent.prototype.prepare = function(mFlexSettings, sVariantManagementReference, sCommand) {
75
+ this.mInformation = {
76
+ layer: mFlexSettings.layer,
77
+ command: sCommand, // used for ChangeVisualization and should end up in the support object in change definition
78
+ generator: rtaLibrary.GENERATOR_NAME // also to be saved in the support section
79
+ };
80
+ return true;
81
+ };
82
+
83
+ CompVariantContent.prototype.execute = function() {
84
+ this.setIsModifiedBefore(this.getElement().getModified());
85
+ this.getElement().setModified(true);
86
+ var oNewVariantContent = setVariantContent.call(this, this.getNewContent());
87
+ callFlAPIFunction.call(this, "updateVariantContent", this.getVariantId(), {content: oNewVariantContent});
88
+ return Promise.resolve();
89
+ };
90
+
91
+ CompVariantContent.prototype.undo = function() {
92
+ var oVariant = callFlAPIFunction.call(this, "revert", this.getVariantId(), {});
93
+ this.getElement().setModified(this.getIsModifiedBefore());
73
94
  var oVariantManagementControl = this.getElement();
74
- var oOldContent = oVariantManagementControl._getVariantContent(this.getVariantId());
75
95
  if (oVariantManagementControl.isPageVariant()) {
76
- oOldContent = oOldContent && oOldContent[this.getPersistencyKey()];
96
+ setVariantContent.call(this, oVariant.getContent()[this.getPersistencyKey()]);
97
+ } else {
98
+ setVariantContent.call(this, oVariant.getContent());
77
99
  }
78
- return oOldContent;
79
- }
100
+ return Promise.resolve();
101
+ };
80
102
 
81
103
  return CompVariantContent;
82
104
  });
@@ -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.107.0
23
+ * @version 1.108.0
24
24
  * @constructor
25
25
  * @private
26
26
  * @since 1.87
@@ -41,6 +41,9 @@ sap.ui.define([
41
41
  },
42
42
  previousDefault: {
43
43
  type: "string"
44
+ },
45
+ activateAfterUndo: {
46
+ type: "boolean"
44
47
  }
45
48
  }
46
49
  }
@@ -127,6 +130,12 @@ sap.ui.define([
127
130
  variantId: this._oVariant.getVariantId()
128
131
  });
129
132
 
133
+ // when changing a read only variant a new variant has to be created.
134
+ // on undo the changes have to be reverted via the activateVariant call
135
+ if (this.getActivateAfterUndo()) {
136
+ this.getElement().activateVariant(this.getPreviousVariantId());
137
+ }
138
+
130
139
  return Promise.resolve();
131
140
  };
132
141
 
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.BaseCommand
18
18
  * @author SAP SE
19
- * @version 1.107.0
19
+ * @version 1.108.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @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.107.0
25
+ * @version 1.108.0
26
26
  * @constructor
27
27
  * @private
28
28
  * @since 1.87
@@ -43,6 +43,9 @@ sap.ui.define([
43
43
  },
44
44
  onlySave: {
45
45
  type: "boolean"
46
+ },
47
+ isModifiedBefore: {
48
+ type: "boolean"
46
49
  }
47
50
  }
48
51
  }
@@ -77,16 +80,17 @@ sap.ui.define([
77
80
  */
78
81
  CompVariantUpdate.prototype.execute = function() {
79
82
  if (this.getOnlySave()) {
83
+ this.setIsModifiedBefore(this.getElement().getModified());
80
84
  this.getElement().setModified(false);
81
85
  var sKey = Object.keys(this.getNewVariantProperties())[0];
82
- callFlAPIFunction.call(this, "updateVariant", sKey, this.getNewVariantProperties()[sKey]);
86
+ callFlAPIFunction.call(this, "saveVariantContent", sKey, this.getNewVariantProperties()[sKey]);
83
87
  } else {
84
88
  each(this.getNewVariantProperties(), function(sVariantId, oValue) {
85
89
  if (oValue.deleted) {
86
90
  callFlAPIFunction.call(this, "removeVariant", sVariantId, {});
87
91
  this.getElement().removeVariant({variantId: sVariantId});
88
92
  } else {
89
- var oVariant = callFlAPIFunction.call(this, "updateVariant", sVariantId, oValue);
93
+ var oVariant = callFlAPIFunction.call(this, "updateVariantMetadata", sVariantId, oValue);
90
94
  this.getElement().updateVariant(oVariant);
91
95
  }
92
96
  }.bind(this));
@@ -105,9 +109,9 @@ sap.ui.define([
105
109
  */
106
110
  CompVariantUpdate.prototype.undo = function() {
107
111
  if (this.getOnlySave()) {
108
- this.getElement().setModified(true);
109
112
  var sVariantId = Object.keys(this.getNewVariantProperties())[0];
110
113
  callFlAPIFunction.call(this, "revert", sVariantId, {});
114
+ this.getElement().setModified(this.getIsModifiedBefore());
111
115
  } else {
112
116
  each(this.getNewVariantProperties(), function(sVariantId, oValue) {
113
117
  var oVariant = callFlAPIFunction.call(this, "revert", sVariantId, {});
@@ -53,7 +53,7 @@ sap.ui.define([
53
53
  * E.g. <code>elementActionTest.only("Remove");</code>
54
54
  *
55
55
  * @author SAP SE
56
- * @version 1.107.0
56
+ * @version 1.108.0
57
57
  *
58
58
  * @static
59
59
  * @since 1.42