@openui5/sap.ui.rta 1.105.1 → 1.107.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 (163) hide show
  1. package/.reuse/dep5 +20 -17
  2. package/THIRDPARTY.txt +31 -21
  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 +652 -653
  7. package/src/sap/ui/rta/Utils.js +1 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  9. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +2 -0
  10. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  11. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  12. package/src/sap/ui/rta/command/AddXML.js +1 -1
  13. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  14. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  15. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  16. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  17. package/src/sap/ui/rta/command/Combine.js +1 -1
  18. package/src/sap/ui/rta/command/CommandFactory.js +6 -5
  19. package/src/sap/ui/rta/command/CompositeCommand.js +7 -5
  20. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  23. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  24. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  25. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  26. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  27. package/src/sap/ui/rta/command/FlexCommand.js +3 -3
  28. package/src/sap/ui/rta/command/LREPSerializer.js +3 -2
  29. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  30. package/src/sap/ui/rta/command/Move.js +1 -1
  31. package/src/sap/ui/rta/command/Property.js +1 -1
  32. package/src/sap/ui/rta/command/Remove.js +1 -1
  33. package/src/sap/ui/rta/command/Rename.js +1 -1
  34. package/src/sap/ui/rta/command/Resize.js +1 -1
  35. package/src/sap/ui/rta/command/Reveal.js +1 -1
  36. package/src/sap/ui/rta/command/Settings.js +1 -1
  37. package/src/sap/ui/rta/command/Split.js +1 -1
  38. package/src/sap/ui/rta/command/Stack.js +26 -7
  39. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  42. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  43. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  44. package/src/sap/ui/rta/enablement/elementActionTest.js +89 -15
  45. package/src/sap/ui/rta/library.js +2 -2
  46. package/src/sap/ui/rta/messagebundle.properties +31 -0
  47. package/src/sap/ui/rta/messagebundle_ar.properties +16 -11
  48. package/src/sap/ui/rta/messagebundle_bg.properties +16 -11
  49. package/src/sap/ui/rta/messagebundle_ca.properties +16 -11
  50. package/src/sap/ui/rta/messagebundle_cs.properties +16 -11
  51. package/src/sap/ui/rta/messagebundle_cy.properties +16 -11
  52. package/src/sap/ui/rta/messagebundle_da.properties +16 -11
  53. package/src/sap/ui/rta/messagebundle_de.properties +17 -12
  54. package/src/sap/ui/rta/messagebundle_el.properties +16 -11
  55. package/src/sap/ui/rta/messagebundle_en.properties +7 -2
  56. package/src/sap/ui/rta/messagebundle_en_GB.properties +7 -2
  57. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
  58. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
  59. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
  60. package/src/sap/ui/rta/messagebundle_es.properties +16 -11
  61. package/src/sap/ui/rta/messagebundle_es_MX.properties +16 -11
  62. package/src/sap/ui/rta/messagebundle_et.properties +16 -11
  63. package/src/sap/ui/rta/messagebundle_fi.properties +16 -11
  64. package/src/sap/ui/rta/messagebundle_fr.properties +16 -11
  65. package/src/sap/ui/rta/messagebundle_fr_CA.properties +16 -11
  66. package/src/sap/ui/rta/messagebundle_hi.properties +16 -11
  67. package/src/sap/ui/rta/messagebundle_hr.properties +16 -11
  68. package/src/sap/ui/rta/messagebundle_hu.properties +16 -11
  69. package/src/sap/ui/rta/messagebundle_id.properties +16 -11
  70. package/src/sap/ui/rta/messagebundle_it.properties +16 -11
  71. package/src/sap/ui/rta/messagebundle_iw.properties +16 -11
  72. package/src/sap/ui/rta/messagebundle_ja.properties +16 -11
  73. package/src/sap/ui/rta/messagebundle_kk.properties +16 -11
  74. package/src/sap/ui/rta/messagebundle_ko.properties +16 -11
  75. package/src/sap/ui/rta/messagebundle_lt.properties +16 -11
  76. package/src/sap/ui/rta/messagebundle_lv.properties +16 -11
  77. package/src/sap/ui/rta/messagebundle_ms.properties +16 -11
  78. package/src/sap/ui/rta/messagebundle_nl.properties +16 -11
  79. package/src/sap/ui/rta/messagebundle_no.properties +16 -11
  80. package/src/sap/ui/rta/messagebundle_pl.properties +16 -11
  81. package/src/sap/ui/rta/messagebundle_pt.properties +16 -11
  82. package/src/sap/ui/rta/messagebundle_pt_PT.properties +16 -11
  83. package/src/sap/ui/rta/messagebundle_ro.properties +16 -11
  84. package/src/sap/ui/rta/messagebundle_ru.properties +16 -11
  85. package/src/sap/ui/rta/messagebundle_sh.properties +16 -11
  86. package/src/sap/ui/rta/messagebundle_sk.properties +16 -11
  87. package/src/sap/ui/rta/messagebundle_sl.properties +16 -11
  88. package/src/sap/ui/rta/messagebundle_sv.properties +16 -11
  89. package/src/sap/ui/rta/messagebundle_th.properties +16 -11
  90. package/src/sap/ui/rta/messagebundle_tr.properties +16 -11
  91. package/src/sap/ui/rta/messagebundle_uk.properties +16 -11
  92. package/src/sap/ui/rta/messagebundle_vi.properties +16 -11
  93. package/src/sap/ui/rta/messagebundle_zh_CN.properties +16 -11
  94. package/src/sap/ui/rta/messagebundle_zh_TW.properties +16 -11
  95. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +7 -5
  96. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  97. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  98. package/src/sap/ui/rta/plugin/CompVariant.js +8 -6
  99. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  100. package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
  101. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  102. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  103. package/src/sap/ui/rta/plugin/EasyAdd.js +3 -1
  104. package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
  105. package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
  106. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  107. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  108. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  109. package/src/sap/ui/rta/plugin/Rename.js +3 -3
  110. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  111. package/src/sap/ui/rta/plugin/Resize.js +3 -3
  112. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  113. package/src/sap/ui/rta/plugin/Settings.js +2 -2
  114. package/src/sap/ui/rta/plugin/Split.js +2 -2
  115. package/src/sap/ui/rta/plugin/Stretch.js +3 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  118. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +9 -6
  119. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
  120. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  121. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  122. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +3 -3
  123. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  124. package/src/sap/ui/rta/service/Action.js +1 -1
  125. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  126. package/src/sap/ui/rta/service/Outline.js +6 -4
  127. package/src/sap/ui/rta/service/Property.js +1 -1
  128. package/src/sap/ui/rta/service/Selection.js +1 -1
  129. package/src/sap/ui/rta/service/SupportTools.js +189 -0
  130. package/src/sap/ui/rta/service/index.js +7 -6
  131. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
  132. package/src/sap/ui/rta/toolbar/Adaptation.js +9 -1
  133. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +3 -1
  134. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  135. package/src/sap/ui/rta/toolbar/BaseRenderer.js +6 -4
  136. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  137. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  138. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  139. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  140. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  141. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +125 -0
  142. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
  143. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
  144. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  145. package/src/sap/ui/rta/util/BindingsExtractor.js +97 -41
  146. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  147. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  148. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  149. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  150. package/src/sap/ui/rta/util/StylesLoader.js +3 -3
  151. package/src/sap/ui/rta/util/adaptationStarter.js +13 -4
  152. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
  153. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +44 -41
  154. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
  155. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
  156. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +69 -43
  157. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +57 -83
  158. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/CombineVisualization.js +1 -1
  159. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +13 -10
  160. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +1 -1
  161. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +1 -1
  162. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
  163. package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -35
@@ -18,7 +18,8 @@ sap.ui.define([
18
18
  "sap/ui/model/resource/ResourceModel",
19
19
  "sap/ui/model/json/JSONModel",
20
20
  "sap/ui/rta/util/changeVisualization/ChangeIndicator",
21
- "sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry"
21
+ "sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry",
22
+ "sap/ui/rta/util/changeVisualization/ChangeCategories"
22
23
  ], function(
23
24
  Fragment,
24
25
  difference,
@@ -33,42 +34,11 @@ sap.ui.define([
33
34
  ResourceModel,
34
35
  JSONModel,
35
36
  ChangeIndicator,
36
- ChangeIndicatorRegistry
37
+ ChangeIndicatorRegistry,
38
+ ChangeCategories
37
39
  ) {
38
40
  "use strict";
39
41
 
40
- var VALID_COMMANDS = {
41
- add: [
42
- "createContainer",
43
- "addDelegateProperty",
44
- "reveal",
45
- "addIFrame"
46
- ],
47
- move: [
48
- "move"
49
- ],
50
- rename: [
51
- "rename"
52
- ],
53
- combinesplit: [
54
- "combine",
55
- "split"
56
- ],
57
- remove: [
58
- "remove"
59
- ]
60
- };
61
- var CATEGORY_ALL = "all";
62
-
63
- var CATEGORY_ICONS = {
64
- all: "sap-icon://show",
65
- add: "sap-icon://add",
66
- move: "sap-icon://move",
67
- rename: "sap-icon://edit",
68
- combinesplit: "sap-icon://combine",
69
- remove: "sap-icon://less"
70
- };
71
-
72
42
  /**
73
43
  * When clicking anywhere on the application, the menu must close
74
44
  */
@@ -87,7 +57,7 @@ sap.ui.define([
87
57
  * @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
88
58
  * @author SAP SE
89
59
  * @since 1.84.0
90
- * @version 1.105.1
60
+ * @version 1.107.0
91
61
  * @private
92
62
  */
93
63
  var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
@@ -117,7 +87,7 @@ sap.ui.define([
117
87
  },
118
88
  constructor: function() {
119
89
  this._oChangeIndicatorRegistry = new ChangeIndicatorRegistry({
120
- commandCategories: VALID_COMMANDS
90
+ changeCategories: ChangeCategories.getCategories()
121
91
  });
122
92
 
123
93
  Control.prototype.constructor.apply(this, arguments);
@@ -131,7 +101,7 @@ sap.ui.define([
131
101
  active: this.getIsActive()
132
102
  });
133
103
  this._oChangeVisualizationModel.setDefaultBindingMode("OneWay");
134
- this._sSelectedCommandCategory = "all";
104
+ this._sSelectedChangeCategory = ChangeCategories.ALL;
135
105
  this._bSetModeChanged = false;
136
106
 
137
107
  // For the event handlers to work, the function instance has to remain stable
@@ -176,37 +146,37 @@ sap.ui.define([
176
146
  ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
177
147
  var aVisualizedChanges = this._oChangeVisualizationModel.getData().visualizedChanges;
178
148
  var aHiddenChanges = [];
179
- var aRegisteredChanges = this._oChangeIndicatorRegistry.getChanges();
180
- aRegisteredChanges.forEach(function(oChange) {
149
+ var aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
150
+ aAllRegisteredChanges.forEach(function(oRegisteredChange) {
181
151
  var oVisualizedChange = aVisualizedChanges.find(function(oVisualizedChange) {
182
- return oChange.change.getId() === oVisualizedChange.id;
152
+ return oRegisteredChange.change.getId() === oVisualizedChange.id;
183
153
  });
184
- if (!oVisualizedChange && !oChange.dependent) {
185
- aHiddenChanges.push(oChange);
154
+ if (!oVisualizedChange && !oRegisteredChange.dependent) {
155
+ aHiddenChanges.push(oRegisteredChange);
186
156
  }
187
157
  });
188
- var aCommandData = Object.keys(VALID_COMMANDS).map(function(sCommandCategoryName) {
189
- var sTitle = this._getCommandCategoryLabel(
190
- sCommandCategoryName,
191
- this._getChangesForCommandCategory(sCommandCategoryName, aVisualizedChanges).length
158
+ var aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
159
+ var sTitle = this._getChangeCategoryLabel(
160
+ sChangeCategoryName,
161
+ this._getChangesForChangeCategory(sChangeCategoryName, aVisualizedChanges).length
192
162
  );
193
163
  return {
194
- key: sCommandCategoryName,
195
- count: this._getChangesForCommandCategory(sCommandCategoryName, aVisualizedChanges).length,
164
+ key: sChangeCategoryName,
165
+ count: this._getChangesForChangeCategory(sChangeCategoryName, aVisualizedChanges).length,
196
166
  title: sTitle,
197
- icon: CATEGORY_ICONS[sCommandCategoryName]
167
+ icon: ChangeCategories.getIconForCategory(sChangeCategoryName)
198
168
  };
199
169
  }.bind(this));
200
170
 
201
171
  aCommandData.unshift({
202
- key: CATEGORY_ALL,
203
- count: this._getChangesForCommandCategory(CATEGORY_ALL, aVisualizedChanges).length,
204
- title: this._getCommandCategoryLabel(CATEGORY_ALL, this._getChangesForCommandCategory(CATEGORY_ALL, aVisualizedChanges).length),
205
- icon: CATEGORY_ICONS[CATEGORY_ALL]
172
+ key: ChangeCategories.ALL,
173
+ count: this._getChangesForChangeCategory(ChangeCategories.ALL, aVisualizedChanges).length,
174
+ title: this._getChangeCategoryLabel(ChangeCategories.ALL, this._getChangesForChangeCategory(ChangeCategories.ALL, aVisualizedChanges).length),
175
+ icon: ChangeCategories.getIconForCategory(ChangeCategories.ALL)
206
176
  });
207
177
 
208
178
  this._updateVisualizationModel({
209
- commandCategories: aCommandData,
179
+ changeCategories: aCommandData,
210
180
  hiddenChanges: aHiddenChanges,
211
181
  popupInfoMessage: this._oTextBundle.getText(
212
182
  "MSG_CHANGEVISUALIZATION_HIDDEN_CHANGES_INFO",
@@ -215,21 +185,21 @@ sap.ui.define([
215
185
  });
216
186
  };
217
187
 
218
- ChangeVisualization.prototype._getChangesForCommandCategory = function(sCommandCategory, aChanges) {
188
+ ChangeVisualization.prototype._getChangesForChangeCategory = function(sChangeCategory, aChanges) {
219
189
  return aChanges.filter(function(oChange) {
220
- return sCommandCategory === CATEGORY_ALL
221
- ? oChange.commandCategory !== undefined
222
- : sCommandCategory === oChange.commandCategory;
190
+ return sChangeCategory === ChangeCategories.ALL
191
+ ? oChange.changeCategory !== undefined
192
+ : sChangeCategory === oChange.changeCategory;
223
193
  });
224
194
  };
225
195
 
226
- ChangeVisualization.prototype._getCommandCategoryLabel = function(sCommandCategoryName, iChangesCount) {
227
- var sLabelKey = "TXT_CHANGEVISUALIZATION_OVERVIEW_" + sCommandCategoryName.toUpperCase();
196
+ ChangeVisualization.prototype._getChangeCategoryLabel = function(sChangeCategoryName, iChangesCount) {
197
+ var sLabelKey = "TXT_CHANGEVISUALIZATION_OVERVIEW_" + sChangeCategoryName.toUpperCase();
228
198
  return this._oTextBundle.getText(sLabelKey, [iChangesCount]);
229
199
  };
230
200
 
231
- ChangeVisualization.prototype._getCommandCategoryButton = function(sCommandCategoryName) {
232
- var sButtonKey = "BTN_CHANGEVISUALIZATION_OVERVIEW_" + sCommandCategoryName.toUpperCase();
201
+ ChangeVisualization.prototype._getChangeCategoryButton = function(sChangeCategoryName) {
202
+ var sButtonKey = "BTN_CHANGEVISUALIZATION_OVERVIEW_" + sChangeCategoryName.toUpperCase();
233
203
  return this._oTextBundle.getText(sButtonKey);
234
204
  };
235
205
 
@@ -263,24 +233,23 @@ sap.ui.define([
263
233
  };
264
234
 
265
235
  /**
266
- * Sets the selected command category and visualizes all changes for the given category
236
+ * Sets the selected change category and visualizes all changes for the given category
267
237
  *
268
238
  * @param {event} oEvent - Event
269
- * @returns {Promise} - Promise of category change
270
239
  */
271
- ChangeVisualization.prototype.onCommandCategorySelection = function(oEvent) {
272
- var sSelectedCommandCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
273
- this._selectCommandCategory(sSelectedCommandCategory);
240
+ ChangeVisualization.prototype.onChangeCategorySelection = function(oEvent) {
241
+ var sSelectedChangeCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
242
+ this._selectChangeCategory(sSelectedChangeCategory);
274
243
  };
275
244
 
276
- ChangeVisualization.prototype._selectCommandCategory = function(sSelectedCommandCategory) {
277
- this._sSelectedCommandCategory = sSelectedCommandCategory;
245
+ ChangeVisualization.prototype._selectChangeCategory = function(sSelectedChangeCategory) {
246
+ this._sSelectedChangeCategory = sSelectedChangeCategory;
278
247
 
279
- var sCommandCategoryText = this._getCommandCategoryButton(sSelectedCommandCategory);
248
+ var sChangeCategoryText = this._getChangeCategoryButton(sSelectedChangeCategory);
280
249
 
281
250
  this._updateVisualizationModel({
282
- commandCategory: sSelectedCommandCategory,
283
- commandCategoryText: sCommandCategoryText
251
+ changeCategory: sSelectedChangeCategory,
252
+ changeCategoryText: sChangeCategoryText
284
253
  });
285
254
 
286
255
  this._updateChangeIndicators();
@@ -288,7 +257,7 @@ sap.ui.define([
288
257
  };
289
258
 
290
259
  ChangeVisualization.prototype._getCommandForChange = function(oChange) {
291
- var sCommand = oChange.getDefinition().support.command;
260
+ var sCommand = oChange.getSupportInformation().command;
292
261
  if (sCommand) {
293
262
  return sCommand;
294
263
  }
@@ -346,10 +315,13 @@ sap.ui.define([
346
315
 
347
316
  ChangeVisualization.prototype._updateChangeRegistry = function() {
348
317
  return this._collectChanges().then(function(aChanges) {
349
- var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getChangeIds();
318
+ this._oChangeIndicatorRegistry.removeOutdatedRegisteredChanges();
319
+ var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
350
320
  var oCurrentChanges = aChanges
351
321
  .filter(function(oChange) {
352
- return oChange.getFileType() === "change";
322
+ // Filter out changes with different fileTypes (e.g. variant)
323
+ // or without selectors (e.g. App Descriptor changes)
324
+ return oChange.getFileType() === "change" && oChange.getSelector();
353
325
  })
354
326
  .reduce(function(oChanges, oChange) {
355
327
  oChanges[oChange.getId()] = oChange;
@@ -359,7 +331,7 @@ sap.ui.define([
359
331
 
360
332
  // Remove registered changes which no longer exist
361
333
  difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function(sChangeIdToRemove) {
362
- this._oChangeIndicatorRegistry.removeChange(sChangeIdToRemove);
334
+ this._oChangeIndicatorRegistry.removeRegisteredChange(sChangeIdToRemove);
363
335
  }.bind(this));
364
336
 
365
337
  var aPromises = [];
@@ -379,10 +351,12 @@ sap.ui.define([
379
351
  };
380
352
 
381
353
  ChangeVisualization.prototype._selectChange = function(sChangeId) {
382
- var aDependentElements = this._oChangeIndicatorRegistry.getChange(sChangeId).visualizationInfo.dependentElementIds;
354
+ var aDependentElements = this._oChangeIndicatorRegistry.getRegisteredChange(sChangeId).visualizationInfo.dependentElementIds;
383
355
  aDependentElements.forEach(function(sElementId) {
384
356
  var oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
385
- oOverlayDomRef.scrollIntoViewIfNeeded();
357
+ oOverlayDomRef.scrollIntoView({
358
+ block: "nearest"
359
+ });
386
360
  oOverlayDomRef.classList.add("sapUiRtaChangeIndicatorDependent");
387
361
  oOverlayDomRef.addEventListener("animationend", function() {
388
362
  oOverlayDomRef.classList.remove("sapUiRtaChangeIndicatorDependent");
@@ -399,7 +373,7 @@ sap.ui.define([
399
373
  };
400
374
 
401
375
  ChangeVisualization.prototype._updateChangeIndicators = function() {
402
- var oSelectors = this._oChangeIndicatorRegistry.getChangeIndicatorData();
376
+ var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
403
377
  var oIndicators = {};
404
378
  var aVisualizedChanges = [];
405
379
  Object.keys(oSelectors)
@@ -469,10 +443,10 @@ sap.ui.define([
469
443
  return aChangeVizInfo.filter(function(oChangeVizInfo) {
470
444
  return (
471
445
  !oChangeVizInfo.dependent
472
- && oChangeVizInfo.commandCategory
446
+ && oChangeVizInfo.changeCategory
473
447
  && (
474
- oRootData.commandCategory === CATEGORY_ALL
475
- || oRootData.commandCategory === oChangeVizInfo.commandCategory
448
+ oRootData.changeCategory === ChangeCategories.ALL
449
+ || oRootData.changeCategory === oChangeVizInfo.changeCategory
476
450
  )
477
451
  );
478
452
  });
@@ -562,7 +536,7 @@ sap.ui.define([
562
536
  // show all change visualizations at startup
563
537
  this._updateChangeRegistry()
564
538
  .then(function() {
565
- this._selectCommandCategory(this._sSelectedCommandCategory);
539
+ this._selectChangeCategory(this._sSelectedChangeCategory);
566
540
  this._updateVisualizationModelMenuData();
567
541
  oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
568
542
  }.bind(this));
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * Creates a localized description for combine changes based on the provided
26
26
  * payload containing the combined elements.
27
27
  *
28
- * @param {object} mPayload - Change visualization payload from the change handler
28
+ * @param {object} mPayload - Change visualization description payload from the change handler
29
29
  * @param {array.<string>} mPayload.originalSelectors - Selectors of the elements that were combined
30
30
  * @param {string} sLabel - Current element label
31
31
  * @param {object} mPropertyBag - Additional properties
@@ -19,7 +19,9 @@ sap.ui.define([
19
19
  * Creates a localized description and button text for move changes based on the provided
20
20
  * current element label.
21
21
  *
22
- * @param {object} mPayload - Change visualization payload from the change handler
22
+ * @param {object} mPayload - Change visualization description payload from the change handler
23
+ * @param {string} mPayload.sourceContainer - container from where the element was moved
24
+ * @param {string} mPayload.targetContainer - container to where the element was moved
23
25
  * @param {string} sLabel - Change handler label
24
26
  * @param {object} mPropertyBag - Additional properties
25
27
  * @returns {object} Localized description text and button text
@@ -30,19 +32,20 @@ sap.ui.define([
30
32
  var sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE_WITHIN", sLabel);
31
33
  var sButtonText;
32
34
  var oAppComponent = mPropertyBag.appComponent;
33
- var sSourceParentId = (
34
- mPayload.sourceParentContainer
35
- && JsControlTreeModifier.getControlIdBySelector(mPayload.sourceParentContainer, oAppComponent)
35
+
36
+ var sSourceId = (
37
+ mPayload.sourceContainer
38
+ && JsControlTreeModifier.getControlIdBySelector(mPayload.sourceContainer, oAppComponent)
36
39
  );
37
- var sTargetParentId = (
38
- mPayload.targetParentContainer
39
- && JsControlTreeModifier.getControlIdBySelector(mPayload.targetParentContainer, oAppComponent)
40
+ var sTargetId = (
41
+ mPayload.targetContainer
42
+ && JsControlTreeModifier.getControlIdBySelector(mPayload.targetContainer, oAppComponent)
40
43
  );
41
44
 
42
- if (sSourceParentId !== sTargetParentId) {
45
+ if (sSourceId !== sTargetId) {
43
46
  sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", ChangeVisualizationUtils.shortenString(sLabel));
44
- sDescriptionTooltip = (sSourceParentId && oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", sLabel)) || "";
45
- sButtonText = sSourceParentId && oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE");
47
+ sDescriptionTooltip = (sSourceId && oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", sLabel)) || "";
48
+ sButtonText = sSourceId && oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE");
46
49
  }
47
50
  return { descriptionText: sDescriptionText, descriptionTooltip: sDescriptionTooltip, buttonText: sButtonText };
48
51
  };
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * Creates a localized description for rename changes based on the provided
18
18
  * change handler payload or the current element label.
19
19
  *
20
- * @param {object} mPayload - Change visualization payload from the change handler
20
+ * @param {object} mPayload - Change visualization description payload from the change handler
21
21
  * @param {string} [mPayload.originalLabel] - Label before the change was applied
22
22
  * @param {object} [mPayload.newLabel] - Label after the change was applied
23
23
  * @param {string} sFallbackLabel - New label as a fallback if change handler provides no info
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * Creates a localized description and button text for split changes based on the provided
20
20
  * current element label
21
21
  *
22
- * @param {object} mPayload - Change visualization payload from the change handler
22
+ * @param {object} mPayload - Change visualization description payload from the change handler
23
23
  * @param {string} sLabel - Current element label
24
24
  * @returns {object} Localized description text and button text
25
25
  */
@@ -0,0 +1,37 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/rta/util/changeVisualization/commands/RenameVisualization",
9
+ "sap/ui/rta/util/changeVisualization/commands/MoveVisualization",
10
+ "sap/ui/rta/util/changeVisualization/commands/CombineVisualization",
11
+ "sap/ui/rta/util/changeVisualization/commands/SplitVisualization"
12
+ ], function(
13
+ RenameVisualization,
14
+ MoveVisualization,
15
+ CombineVisualization,
16
+ SplitVisualization
17
+ ) {
18
+ "use strict";
19
+
20
+ var mCommands = {
21
+ rename: RenameVisualization,
22
+ move: MoveVisualization,
23
+ combine: CombineVisualization,
24
+ split: SplitVisualization
25
+ };
26
+
27
+ return function(mIndicatorInformation) {
28
+ var sCommandName = mIndicatorInformation.commandName;
29
+
30
+ // Settings commands can be assigned to existing categories
31
+ // (e.g. "move" to display the "Show Source" button)
32
+ if (sCommandName === "settings") {
33
+ sCommandName = mIndicatorInformation.changeCategory;
34
+ }
35
+ return mCommands[sCommandName];
36
+ };
37
+ });
@@ -1,35 +0,0 @@
1
- /*!
2
- * OpenUI5
3
- * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
- * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
- */
6
-
7
- sap.ui.define([
8
- "sap/ui/rta/util/changeVisualization/categories/RenameVisualization",
9
- "sap/ui/rta/util/changeVisualization/categories/MoveVisualization",
10
- "sap/ui/rta/util/changeVisualization/categories/CombineVisualization",
11
- "sap/ui/rta/util/changeVisualization/categories/SplitVisualization"
12
- ], function(
13
- RenameVisualization,
14
- MoveVisualization,
15
- CombineVisualization,
16
- SplitVisualization
17
- ) {
18
- "use strict";
19
-
20
- var mCategories = {
21
- rename: RenameVisualization,
22
- move: MoveVisualization,
23
- combine: CombineVisualization,
24
- split: SplitVisualization
25
- };
26
-
27
- return function(mIndicatorInformation) {
28
- var sCategoryName = mIndicatorInformation.commandName;
29
- // to enable e.g. move changes in settings commands to show the 'Show Source' button
30
- if (sCategoryName === "settings") {
31
- sCategoryName = mIndicatorInformation.commandCategory;
32
- }
33
- return mCategories[sCategoryName];
34
- };
35
- });