@openui5/sap.ui.rta 1.105.0 → 1.106.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 (159) 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 +25 -13
  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/command/AddIFrame.js +1 -1
  10. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  11. package/src/sap/ui/rta/command/AddXML.js +1 -1
  12. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  13. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  14. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  15. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  16. package/src/sap/ui/rta/command/Combine.js +1 -1
  17. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  18. package/src/sap/ui/rta/command/CompositeCommand.js +7 -5
  19. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  23. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  24. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  25. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  26. package/src/sap/ui/rta/command/FlexCommand.js +2 -2
  27. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  28. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  29. package/src/sap/ui/rta/command/Move.js +1 -1
  30. package/src/sap/ui/rta/command/Property.js +1 -1
  31. package/src/sap/ui/rta/command/Remove.js +1 -1
  32. package/src/sap/ui/rta/command/Rename.js +1 -1
  33. package/src/sap/ui/rta/command/Resize.js +1 -1
  34. package/src/sap/ui/rta/command/Reveal.js +1 -1
  35. package/src/sap/ui/rta/command/Settings.js +1 -1
  36. package/src/sap/ui/rta/command/Split.js +1 -1
  37. package/src/sap/ui/rta/command/Stack.js +15 -5
  38. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  39. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  42. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  43. package/src/sap/ui/rta/enablement/elementActionTest.js +89 -15
  44. package/src/sap/ui/rta/library.js +2 -2
  45. package/src/sap/ui/rta/messagebundle.properties +31 -0
  46. package/src/sap/ui/rta/messagebundle_ar.properties +13 -11
  47. package/src/sap/ui/rta/messagebundle_bg.properties +13 -11
  48. package/src/sap/ui/rta/messagebundle_ca.properties +13 -11
  49. package/src/sap/ui/rta/messagebundle_cs.properties +13 -11
  50. package/src/sap/ui/rta/messagebundle_cy.properties +13 -11
  51. package/src/sap/ui/rta/messagebundle_da.properties +13 -11
  52. package/src/sap/ui/rta/messagebundle_de.properties +3 -1
  53. package/src/sap/ui/rta/messagebundle_el.properties +13 -11
  54. package/src/sap/ui/rta/messagebundle_en.properties +4 -2
  55. package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -2
  56. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
  57. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
  58. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +3 -1
  59. package/src/sap/ui/rta/messagebundle_es.properties +13 -11
  60. package/src/sap/ui/rta/messagebundle_es_MX.properties +13 -11
  61. package/src/sap/ui/rta/messagebundle_et.properties +13 -11
  62. package/src/sap/ui/rta/messagebundle_fi.properties +13 -11
  63. package/src/sap/ui/rta/messagebundle_fr.properties +13 -11
  64. package/src/sap/ui/rta/messagebundle_fr_CA.properties +13 -11
  65. package/src/sap/ui/rta/messagebundle_hi.properties +13 -11
  66. package/src/sap/ui/rta/messagebundle_hr.properties +13 -11
  67. package/src/sap/ui/rta/messagebundle_hu.properties +13 -11
  68. package/src/sap/ui/rta/messagebundle_id.properties +13 -11
  69. package/src/sap/ui/rta/messagebundle_it.properties +13 -11
  70. package/src/sap/ui/rta/messagebundle_iw.properties +13 -11
  71. package/src/sap/ui/rta/messagebundle_ja.properties +13 -11
  72. package/src/sap/ui/rta/messagebundle_kk.properties +13 -11
  73. package/src/sap/ui/rta/messagebundle_ko.properties +13 -11
  74. package/src/sap/ui/rta/messagebundle_lt.properties +13 -11
  75. package/src/sap/ui/rta/messagebundle_lv.properties +13 -11
  76. package/src/sap/ui/rta/messagebundle_ms.properties +13 -11
  77. package/src/sap/ui/rta/messagebundle_nl.properties +13 -11
  78. package/src/sap/ui/rta/messagebundle_no.properties +13 -11
  79. package/src/sap/ui/rta/messagebundle_pl.properties +13 -11
  80. package/src/sap/ui/rta/messagebundle_pt.properties +13 -11
  81. package/src/sap/ui/rta/messagebundle_pt_PT.properties +13 -11
  82. package/src/sap/ui/rta/messagebundle_ro.properties +13 -11
  83. package/src/sap/ui/rta/messagebundle_ru.properties +13 -11
  84. package/src/sap/ui/rta/messagebundle_sh.properties +13 -11
  85. package/src/sap/ui/rta/messagebundle_sk.properties +13 -11
  86. package/src/sap/ui/rta/messagebundle_sl.properties +13 -11
  87. package/src/sap/ui/rta/messagebundle_sv.properties +13 -11
  88. package/src/sap/ui/rta/messagebundle_th.properties +13 -11
  89. package/src/sap/ui/rta/messagebundle_tr.properties +13 -11
  90. package/src/sap/ui/rta/messagebundle_uk.properties +13 -11
  91. package/src/sap/ui/rta/messagebundle_vi.properties +13 -11
  92. package/src/sap/ui/rta/messagebundle_zh_CN.properties +13 -11
  93. package/src/sap/ui/rta/messagebundle_zh_TW.properties +13 -11
  94. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
  95. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  96. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  97. package/src/sap/ui/rta/plugin/CompVariant.js +8 -6
  98. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  99. package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
  100. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  101. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  102. package/src/sap/ui/rta/plugin/EasyAdd.js +3 -1
  103. package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
  104. package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
  105. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  106. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  107. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  108. package/src/sap/ui/rta/plugin/Rename.js +3 -3
  109. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  110. package/src/sap/ui/rta/plugin/Resize.js +3 -3
  111. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  112. package/src/sap/ui/rta/plugin/Settings.js +2 -2
  113. package/src/sap/ui/rta/plugin/Split.js +2 -2
  114. package/src/sap/ui/rta/plugin/Stretch.js +3 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +9 -6
  118. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
  119. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  120. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  121. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +3 -3
  122. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  123. package/src/sap/ui/rta/service/Action.js +1 -1
  124. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  125. package/src/sap/ui/rta/service/Outline.js +1 -1
  126. package/src/sap/ui/rta/service/Property.js +1 -1
  127. package/src/sap/ui/rta/service/Selection.js +1 -1
  128. package/src/sap/ui/rta/service/SupportTools.js +189 -0
  129. package/src/sap/ui/rta/service/index.js +7 -6
  130. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
  131. package/src/sap/ui/rta/toolbar/Adaptation.js +8 -1
  132. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  133. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  134. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  135. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  136. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  137. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  138. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +132 -0
  139. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
  140. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
  141. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  142. package/src/sap/ui/rta/util/BindingsExtractor.js +89 -42
  143. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  144. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  145. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  146. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  147. package/src/sap/ui/rta/util/adaptationStarter.js +13 -4
  148. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
  149. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +40 -37
  150. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
  151. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
  152. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +60 -41
  153. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +52 -81
  154. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/CombineVisualization.js +0 -0
  155. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +2 -0
  156. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +0 -0
  157. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +0 -0
  158. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
  159. package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -35
@@ -10,33 +10,27 @@ sap.ui.define([
10
10
  "sap/ui/core/Control",
11
11
  "sap/ui/core/format/DateFormat",
12
12
  "sap/ui/events/KeyCodes",
13
- "sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory",
13
+ "sap/ui/rta/util/changeVisualization/commands/getCommandVisualization",
14
14
  "sap/ui/fl/Utils",
15
15
  "sap/ui/fl/util/resolveBinding",
16
16
  "sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils",
17
- "sap/ui/core/Core"
17
+ "sap/ui/core/Core",
18
+ "sap/ui/rta/util/changeVisualization/ChangeCategories"
18
19
  ], function(
19
20
  Fragment,
20
21
  JSONModel,
21
22
  Control,
22
23
  DateFormat,
23
24
  KeyCodes,
24
- getVisualizationCategory,
25
+ getCommandVisualization,
25
26
  FlUtils,
26
27
  resolveBinding,
27
28
  ChangeVisualizationUtils,
28
- Core
29
+ Core,
30
+ ChangeCategories
29
31
  ) {
30
32
  "use strict";
31
33
 
32
- var CATEGORY_ICONS = {
33
- add: "sap-icon://add",
34
- move: "sap-icon://move",
35
- rename: "sap-icon://edit",
36
- combinesplit: "sap-icon://combine",
37
- remove: "sap-icon://less"
38
- };
39
-
40
34
  /**
41
35
  * @class
42
36
  * Constructor for a new <code>sap.ui.rta.util.changeVisualization.ChangeIndicator</code> class.
@@ -46,7 +40,7 @@ sap.ui.define([
46
40
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
47
41
  * @author SAP SE
48
42
  * @since 1.84.0
49
- * @version 1.105.0
43
+ * @version 1.106.0
50
44
  * @private
51
45
  */
52
46
  var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
@@ -180,38 +174,47 @@ sap.ui.define([
180
174
 
181
175
  var mPropertyBag = { appComponent: FlUtils.getAppComponentForControl(oAffectedElement) };
182
176
  var oOverlay = Core.byId(sOverlayId);
183
- var oVisualizationUtil = getVisualizationCategory(mChangeInformation);
184
177
  var sElementLabel = oOverlay.getDesignTimeMetadata().getLabel(oAffectedElement);
185
- var oDescription = oVisualizationUtil && oVisualizationUtil.getDescription(mPayload, sElementLabel, mPropertyBag);
186
- sElementLabel = sElementLabel && "'" + sElementLabel + "'";
187
- var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
188
- var sChangeTextKey = (
189
- "TXT_CHANGEVISUALIZATION_CHANGE_"
190
- + mChangeInformation.commandName.toUpperCase()
191
- );
192
-
178
+ var oCommandVisualization = getCommandVisualization(mChangeInformation);
179
+ var oDescription = oCommandVisualization && oCommandVisualization.getDescription(mPayload, sElementLabel, mPropertyBag) || {};
180
+ var sCommandName = mChangeInformation.commandName;
193
181
  var sDescriptionText;
194
182
  var sDescriptionTooltip;
195
- // for settings commands if available description and tooltip should be taken as is from the change handler
196
- if (mPayload.description && mChangeInformation.commandName === "settings") {
197
- sDescriptionText = mPayload.description;
198
- sDescriptionTooltip = mPayload.descriptionTooltip || "";
183
+
184
+ // 'Settings' with a custom description should overwrite the description from the CommandVisualization
185
+ if (sCommandName === "settings" && mPayload.description) {
186
+ oDescription.descriptionText = mPayload.description;
187
+ oDescription.descriptionTooltip = mPayload.descriptionTooltip;
188
+ } else if (mChangeInformation.changeCategory === "other") {
189
+ // To retrieve the generic description for commands without visualization
190
+ sCommandName = "other";
191
+ }
192
+
193
+ if (oDescription.descriptionText) {
194
+ sDescriptionText = oDescription.descriptionText;
195
+ sDescriptionTooltip = oDescription.descriptionTooltip || "";
199
196
  } else {
200
- if (oDescription) {
201
- sDescriptionText = oDescription.descriptionText;
202
- sDescriptionTooltip = oDescription.descriptionTooltip;
203
- } else {
204
- sDescriptionText = oRtaResourceBundle.getText(sChangeTextKey, sShortenedElementLabel);
205
- sDescriptionTooltip = oRtaResourceBundle.getText(sChangeTextKey, sElementLabel);
206
- }
207
- sDescriptionTooltip = sDescriptionText.length < sDescriptionTooltip.length ? sDescriptionTooltip : null;
197
+ sElementLabel = sElementLabel && "'" + sElementLabel + "'";
198
+ var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
199
+ var sChangeTextKey = (
200
+ "TXT_CHANGEVISUALIZATION_CHANGE_"
201
+ + sCommandName.toUpperCase()
202
+ );
203
+ sDescriptionText = oRtaResourceBundle.getText(sChangeTextKey, sShortenedElementLabel);
204
+ sDescriptionTooltip = oRtaResourceBundle.getText(sChangeTextKey, sElementLabel);
208
205
  }
206
+ sDescriptionTooltip = sDescriptionText.length < sDescriptionTooltip.length ? sDescriptionTooltip : null;
209
207
  var sDetailButtonText = oDescription && oDescription.buttonText;
208
+ var sIconTooltip = oRtaResourceBundle.getText(
209
+ "TXT_CHANGEVISUALIZATION_OVERVIEW_"
210
+ + mChangeInformation.changeCategory.toUpperCase()
211
+ );
210
212
 
211
213
  return {
212
214
  description: sDescriptionText,
213
215
  tooltip: sDescriptionTooltip,
214
- buttonText: sDetailButtonText
216
+ buttonText: sDetailButtonText,
217
+ iconTooltip: sIconTooltip
215
218
  };
216
219
  }
217
220
 
@@ -231,7 +234,6 @@ sap.ui.define([
231
234
  var oTexts = getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId);
232
235
  var oDates = getDates(mChangeInformation, oRtaResourceBundle);
233
236
 
234
-
235
237
  return {
236
238
  id: mChangeInformation.id,
237
239
  change: mChangeInformation,
@@ -240,7 +242,8 @@ sap.ui.define([
240
242
  fullDate: oDates.fullDate,
241
243
  relativeDate: oDates.relativeDate,
242
244
  detailButtonText: oTexts.buttonText,
243
- icon: CATEGORY_ICONS[mChangeInformation.commandCategory]
245
+ icon: ChangeCategories.getIconForCategory(mChangeInformation.changeCategory),
246
+ iconTooltip: oTexts.iconTooltip
244
247
  };
245
248
  }
246
249
 
@@ -18,13 +18,13 @@
18
18
  </MessageStrip>
19
19
  <List
20
20
  class="sapUiRtaChangesList"
21
- items="{visualizationModel>/commandCategories/}">
21
+ items="{visualizationModel>/changeCategories/}">
22
22
  <StandardListItem
23
23
  title="{visualizationModel>title}"
24
24
  counter="{visualizationModel>count}"
25
25
  type="{= ${visualizationModel>count} > 0 ? 'Active' : 'Inactive'}"
26
26
  icon="{visualizationModel>icon}"
27
- press=".onCommandCategorySelection"/>
27
+ press=".onChangeCategorySelection"/>
28
28
  </List>
29
29
  </Popover>
30
30
  </core:FragmentDefinition>
@@ -31,7 +31,8 @@
31
31
  <cells>
32
32
  <core:Icon
33
33
  src="{details>icon}"
34
- class="sapUiTinyMarginBegin"/>
34
+ class="sapUiTinyMarginBegin"
35
+ tooltip="{details>iconTooltip}"/>
35
36
  <HBox alignItems="Center">
36
37
  <Text
37
38
  text="{details>description}"
@@ -13,7 +13,9 @@ sap.ui.define([
13
13
  "sap/ui/core/util/reflection/JsControlTreeModifier",
14
14
  "sap/ui/dt/ElementUtil",
15
15
  "sap/ui/fl/write/api/ChangesWriteAPI",
16
- "sap/ui/fl/Utils"
16
+ "sap/ui/fl/Utils",
17
+ "sap/ui/fl/changeHandler/common/ChangeCategories",
18
+ "sap/ui/core/Core"
17
19
  ], function(
18
20
  includes,
19
21
  values,
@@ -23,7 +25,9 @@ sap.ui.define([
23
25
  JsControlTreeModifier,
24
26
  ElementUtil,
25
27
  ChangesWriteAPI,
26
- FlUtils
28
+ FlUtils,
29
+ ChangeCategories,
30
+ Core
27
31
  ) {
28
32
  "use strict";
29
33
 
@@ -35,7 +39,7 @@ sap.ui.define([
35
39
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
36
40
  * @author SAP SE
37
41
  * @since 1.86.0
38
- * @version 1.105.0
42
+ * @version 1.106.0
39
43
  * @private
40
44
  */
41
45
  var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
@@ -44,7 +48,7 @@ sap.ui.define([
44
48
  /**
45
49
  * Available command categories
46
50
  */
47
- commandCategories: {
51
+ changeCategories: {
48
52
  type: "object",
49
53
  defaultValue: []
50
54
  },
@@ -58,7 +62,11 @@ sap.ui.define([
58
62
  },
59
63
  constructor: function () {
60
64
  ManagedObject.prototype.constructor.apply(this, arguments);
61
- this._oChangeIndicatorData = {};
65
+
66
+ // List of entries with indicator data, grouped by Change ID
67
+ this._oRegisteredChanges = {};
68
+
69
+ // List of actual change indicator objects, grouped by selector
62
70
  this._oChangeIndicators = {};
63
71
  }
64
72
  });
@@ -68,12 +76,12 @@ sap.ui.define([
68
76
  };
69
77
 
70
78
  /**
71
- * Returns all registered changes.
79
+ * Returns the change indicator data for all registered changes.
72
80
  *
73
- * @returns {object[]} Registered changes
81
+ * @returns {object[]} Change indicator data for all registered changes
74
82
  */
75
- ChangeIndicatorRegistry.prototype.getChanges = function () {
76
- return values(this._oChangeIndicatorData || {}).map(function (oChange) {
83
+ ChangeIndicatorRegistry.prototype.getAllRegisteredChanges = function () {
84
+ return values(this._oRegisteredChanges || {}).map(function (oChange) {
77
85
  return Object.assign({}, oChange);
78
86
  });
79
87
  };
@@ -81,55 +89,61 @@ sap.ui.define([
81
89
  /**
82
90
  * Returns the IDs of all registered changes.
83
91
  *
84
- * @returns {string[]} Promise with both design time and runtime change
92
+ * @returns {string[]} Array with both design time and runtime registered changes
85
93
  */
86
- ChangeIndicatorRegistry.prototype.getChangeIds = function () {
87
- return Object.keys(this._oChangeIndicatorData || {});
94
+ ChangeIndicatorRegistry.prototype.getRegisteredChangeIds = function () {
95
+ return Object.keys(this._oRegisteredChanges || {});
88
96
  };
89
97
 
90
98
  /**
91
- * Returns a registered change.
99
+ * Returns a data entry of a registered change indicator for a change ID.
92
100
  *
93
101
  * @param {string} sChangeId - ID of the registered change
94
102
  * @returns {object} Registered change
95
103
  */
96
- ChangeIndicatorRegistry.prototype.getChange = function (sChangeId) {
97
- return this._oChangeIndicatorData[sChangeId] && Object.assign({}, this._oChangeIndicatorData[sChangeId]);
104
+ ChangeIndicatorRegistry.prototype.getRegisteredChange = function (sChangeId) {
105
+ return this._oRegisteredChanges[sChangeId] && Object.assign({}, this._oRegisteredChanges[sChangeId]);
98
106
  };
99
107
 
100
108
  /**
101
109
  * Groups all registered changes by their selectors and returns a list of selectors
102
- * with all dependent and non-dependent changes.
110
+ * with all dependent and non-dependent change indicator data.
103
111
  *
104
- * @returns {object[]} Change indicators
112
+ * @returns {object} List of selectors with change indicator data.
105
113
  */
106
- ChangeIndicatorRegistry.prototype.getChangeIndicatorData = function () {
114
+ ChangeIndicatorRegistry.prototype.getSelectorsWithRegisteredChanges = function () {
107
115
  var oChangeIndicators = {};
108
116
 
109
- function addSelector (sSelectorId, sAffectedElementId, oChange, bDependent) {
117
+ function addSelector (sSelectorId, sAffectedElementId, oChangeIndicatorData, bDependent) {
110
118
  if (oChangeIndicators[sSelectorId] === undefined) {
111
119
  oChangeIndicators[sSelectorId] = [];
112
120
  }
113
121
  oChangeIndicators[sSelectorId].push(Object.assign(
114
122
  {
115
- id: oChange.change.getId(),
123
+ id: oChangeIndicatorData.change.getId(),
116
124
  dependent: bDependent,
117
125
  affectedElementId: sAffectedElementId,
118
- payload: oChange.visualizationInfo.payload || {}
126
+ payload: oChangeIndicatorData.visualizationInfo.payload || {}
119
127
  },
120
- _omit(oChange, ["visualizationInfo"])
128
+ _omit(oChangeIndicatorData, ["visualizationInfo"])
121
129
  ));
122
130
  }
123
131
 
124
- values(this._oChangeIndicatorData).forEach(function (oChange) {
125
- oChange.visualizationInfo.displayElementIds.forEach(function (sSelectorId, iIndex) {
126
- addSelector(sSelectorId, oChange.visualizationInfo.affectedElementIds[iIndex], oChange, false);
127
- });
132
+ values(this._oRegisteredChanges)
133
+ .forEach(function (oChangeIndicatorData) {
134
+ oChangeIndicatorData.visualizationInfo.displayElementIds
135
+ .forEach(function (sId, iIndex) {
136
+ // in some cases (like with simple forms) you have to pass the stable id of the child element because the parent id is unstable
137
+ if (oChangeIndicatorData.visualizationInfo.hasParentWithUnstableId) {
138
+ sId = Core.byId(sId).getParent().getId();
139
+ }
140
+ addSelector(sId, oChangeIndicatorData.visualizationInfo.affectedElementIds[iIndex], oChangeIndicatorData, false);
141
+ });
128
142
 
129
- oChange.visualizationInfo.dependentElementIds.forEach(function (sSelectorId) {
130
- addSelector(sSelectorId, sSelectorId, oChange, true);
143
+ oChangeIndicatorData.visualizationInfo.dependentElementIds.forEach(function (sId) {
144
+ addSelector(sId, sId, oChangeIndicatorData, true);
145
+ });
131
146
  });
132
- });
133
147
 
134
148
  return oChangeIndicators;
135
149
  };
@@ -163,20 +177,24 @@ sap.ui.define([
163
177
  ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName) {
164
178
  var oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
165
179
  return getVisualizationInfo(oChange, oAppComponent).then(function(mChangeVisualizationInfo) {
166
- var aCategories = this.getCommandCategories();
167
- var sCommandCategory;
180
+ var aCategories = this.getChangeCategories();
181
+ var sChangeCategory;
182
+ // For "settings", the control developer can choose one of the existing categories
168
183
  if (sCommandName === "settings" && includes(Object.keys(aCategories), mChangeVisualizationInfo.payload.category)) {
169
- sCommandCategory = mChangeVisualizationInfo.payload.category;
184
+ sChangeCategory = mChangeVisualizationInfo.payload.category;
170
185
  } else {
171
- sCommandCategory = Object.keys(aCategories).find(function (sCommandCategoryName) {
172
- return includes(aCategories[sCommandCategoryName], sCommandName);
186
+ sChangeCategory = Object.keys(aCategories).find(function (sChangeCategoryName) {
187
+ return includes(aCategories[sChangeCategoryName], sCommandName);
173
188
  });
189
+ if (!sChangeCategory) {
190
+ sChangeCategory = ChangeCategories.OTHER;
191
+ }
174
192
  }
175
193
 
176
- this._oChangeIndicatorData[oChange.getId()] = {
194
+ this._oRegisteredChanges[oChange.getId()] = {
177
195
  change: oChange,
178
196
  commandName: sCommandName,
179
- commandCategory: sCommandCategory,
197
+ changeCategory: sChangeCategory,
180
198
  visualizationInfo: mChangeVisualizationInfo
181
199
  };
182
200
  }.bind(this));
@@ -206,6 +224,7 @@ sap.ui.define([
206
224
  affectedElementIds: aAffectedElementIds,
207
225
  dependentElementIds: getSelectorIds(mVisualizationInfo.dependentControls) || [],
208
226
  displayElementIds: getSelectorIds(mVisualizationInfo.displayControls) || aAffectedElementIds,
227
+ hasParentWithUnstableId: mVisualizationInfo.hasParentWithUnstableId,
209
228
  payload: mVisualizationInfo.payload || {}
210
229
  };
211
230
  });
@@ -249,8 +268,8 @@ sap.ui.define([
249
268
  * Resets the change and change indicator registries.
250
269
  */
251
270
  ChangeIndicatorRegistry.prototype.reset = function () {
252
- Object.keys(this._oChangeIndicatorData).forEach(function (sKeyToRemove) {
253
- this.removeChange(sKeyToRemove);
271
+ Object.keys(this._oRegisteredChanges).forEach(function (sKeyToRemove) {
272
+ this.removeRegisteredChange(sKeyToRemove);
254
273
  }.bind(this));
255
274
 
256
275
  values(this._oChangeIndicators).forEach(function (oIndicator) {
@@ -260,12 +279,12 @@ sap.ui.define([
260
279
  };
261
280
 
262
281
  /**
263
- * Removes a change.
282
+ * Removes a data entry of a registered change indicator.
264
283
  *
265
284
  * @param {string} sChangeId - ID of the registered change
266
285
  */
267
- ChangeIndicatorRegistry.prototype.removeChange = function (sChangeId) {
268
- delete this._oChangeIndicatorData[sChangeId];
286
+ ChangeIndicatorRegistry.prototype.removeRegisteredChange = function (sChangeId) {
287
+ delete this._oRegisteredChanges[sChangeId];
269
288
  };
270
289
 
271
290
  return ChangeIndicatorRegistry;
@@ -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.0
60
+ * @version 1.106.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,12 @@ 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
+ var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
350
319
  var oCurrentChanges = aChanges
351
320
  .filter(function(oChange) {
352
- return oChange.getFileType() === "change";
321
+ // Filter out changes with different fileTypes (e.g. variant)
322
+ // or without selectors (e.g. App Descriptor changes)
323
+ return oChange.getFileType() === "change" && oChange.getSelector();
353
324
  })
354
325
  .reduce(function(oChanges, oChange) {
355
326
  oChanges[oChange.getId()] = oChange;
@@ -379,7 +350,7 @@ sap.ui.define([
379
350
  };
380
351
 
381
352
  ChangeVisualization.prototype._selectChange = function(sChangeId) {
382
- var aDependentElements = this._oChangeIndicatorRegistry.getChange(sChangeId).visualizationInfo.dependentElementIds;
353
+ var aDependentElements = this._oChangeIndicatorRegistry.getRegisteredChange(sChangeId).visualizationInfo.dependentElementIds;
383
354
  aDependentElements.forEach(function(sElementId) {
384
355
  var oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
385
356
  oOverlayDomRef.scrollIntoViewIfNeeded();
@@ -399,7 +370,7 @@ sap.ui.define([
399
370
  };
400
371
 
401
372
  ChangeVisualization.prototype._updateChangeIndicators = function() {
402
- var oSelectors = this._oChangeIndicatorRegistry.getChangeIndicatorData();
373
+ var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
403
374
  var oIndicators = {};
404
375
  var aVisualizedChanges = [];
405
376
  Object.keys(oSelectors)
@@ -469,10 +440,10 @@ sap.ui.define([
469
440
  return aChangeVizInfo.filter(function(oChangeVizInfo) {
470
441
  return (
471
442
  !oChangeVizInfo.dependent
472
- && oChangeVizInfo.commandCategory
443
+ && oChangeVizInfo.changeCategory
473
444
  && (
474
- oRootData.commandCategory === CATEGORY_ALL
475
- || oRootData.commandCategory === oChangeVizInfo.commandCategory
445
+ oRootData.changeCategory === ChangeCategories.ALL
446
+ || oRootData.changeCategory === oChangeVizInfo.changeCategory
476
447
  )
477
448
  );
478
449
  });
@@ -562,7 +533,7 @@ sap.ui.define([
562
533
  // show all change visualizations at startup
563
534
  this._updateChangeRegistry()
564
535
  .then(function() {
565
- this._selectCommandCategory(this._sSelectedCommandCategory);
536
+ this._selectChangeCategory(this._sSelectedChangeCategory);
566
537
  this._updateVisualizationModelMenuData();
567
538
  oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
568
539
  }.bind(this));
@@ -20,6 +20,8 @@ sap.ui.define([
20
20
  * current element label.
21
21
  *
22
22
  * @param {object} mPayload - Change visualization payload from the change handler
23
+ * @param {string} mPayload.sourceParentContainer - Parent container from where the element was moved
24
+ * @param {string} mPayload.targetParentContainer - Parent 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