@openui5/sap.ui.rta 1.120.6 → 1.121.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 (164) hide show
  1. package/.reuse/dep5 +23 -21
  2. package/THIRDPARTY.txt +6 -43
  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 +507 -759
  7. package/src/sap/ui/rta/Utils.js +1 -146
  8. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
  9. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  10. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
  11. package/src/sap/ui/rta/appVariant/Utils.js +3 -3
  12. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
  14. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
  15. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
  16. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
  17. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
  18. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
  19. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
  20. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
  21. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
  22. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
  23. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  24. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  25. package/src/sap/ui/rta/command/AddXML.js +1 -1
  26. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
  27. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  28. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  29. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  30. package/src/sap/ui/rta/command/Combine.js +1 -1
  31. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  32. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  33. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  34. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  35. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -5
  36. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  37. package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
  38. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  39. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  40. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  41. package/src/sap/ui/rta/command/LREPSerializer.js +4 -3
  42. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  43. package/src/sap/ui/rta/command/Move.js +1 -1
  44. package/src/sap/ui/rta/command/Property.js +1 -1
  45. package/src/sap/ui/rta/command/Remove.js +1 -1
  46. package/src/sap/ui/rta/command/Rename.js +1 -1
  47. package/src/sap/ui/rta/command/Resize.js +1 -1
  48. package/src/sap/ui/rta/command/Reveal.js +1 -1
  49. package/src/sap/ui/rta/command/Settings.js +1 -1
  50. package/src/sap/ui/rta/command/Split.js +1 -1
  51. package/src/sap/ui/rta/command/Stack.js +23 -1
  52. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  53. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  54. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  55. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  56. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  57. package/src/sap/ui/rta/enablement/elementActionTest.js +180 -258
  58. package/src/sap/ui/rta/library.js +3 -2
  59. package/src/sap/ui/rta/messagebundle.properties +8 -0
  60. package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
  61. package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
  62. package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
  63. package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
  64. package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
  65. package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
  66. package/src/sap/ui/rta/messagebundle_da.properties +4 -0
  67. package/src/sap/ui/rta/messagebundle_de.properties +5 -1
  68. package/src/sap/ui/rta/messagebundle_el.properties +4 -0
  69. package/src/sap/ui/rta/messagebundle_en.properties +4 -0
  70. package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
  71. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
  72. package/src/sap/ui/rta/messagebundle_es.properties +4 -0
  73. package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
  74. package/src/sap/ui/rta/messagebundle_et.properties +6 -2
  75. package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
  76. package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
  77. package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
  78. package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
  79. package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
  80. package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
  81. package/src/sap/ui/rta/messagebundle_id.properties +5 -1
  82. package/src/sap/ui/rta/messagebundle_it.properties +10 -6
  83. package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
  84. package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
  85. package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
  86. package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
  87. package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
  88. package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
  89. package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
  90. package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
  91. package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
  92. package/src/sap/ui/rta/messagebundle_no.properties +4 -0
  93. package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
  94. package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
  95. package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
  96. package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
  97. package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
  98. package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
  99. package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
  100. package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
  101. package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
  102. package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
  103. package/src/sap/ui/rta/messagebundle_th.properties +9 -5
  104. package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
  105. package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
  106. package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
  107. package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
  108. package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
  109. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
  110. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  111. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  112. package/src/sap/ui/rta/plugin/CompVariant.js +43 -1
  113. package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
  114. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  115. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  116. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  117. package/src/sap/ui/rta/plugin/EasyAdd.js +2 -2
  118. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  119. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  120. package/src/sap/ui/rta/plugin/Plugin.js +18 -10
  121. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  122. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  123. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  124. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  125. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  126. package/src/sap/ui/rta/plugin/Selection.js +24 -9
  127. package/src/sap/ui/rta/plugin/Settings.js +17 -15
  128. package/src/sap/ui/rta/plugin/Split.js +1 -1
  129. package/src/sap/ui/rta/plugin/Stretch.js +14 -13
  130. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  131. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  132. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +134 -67
  133. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  134. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
  135. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
  136. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
  137. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
  138. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
  139. package/src/sap/ui/rta/service/Action.js +1 -1
  140. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  141. package/src/sap/ui/rta/service/Outline.js +22 -18
  142. package/src/sap/ui/rta/service/Property.js +1 -1
  143. package/src/sap/ui/rta/service/Selection.js +1 -1
  144. package/src/sap/ui/rta/service/SupportTools.js +23 -19
  145. package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
  146. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  147. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  148. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  149. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  150. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  151. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  152. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  153. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  154. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +12 -5
  155. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  156. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  157. package/src/sap/ui/rta/util/ReloadManager.js +19 -59
  158. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  159. package/src/sap/ui/rta/util/ServiceManager.js +193 -0
  160. package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
  161. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
  162. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
  163. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
  164. package/LICENSES/BSD-2-Clause.txt +0 -22
@@ -17,7 +17,8 @@ sap.ui.define([
17
17
  "sap/ui/model/json/JSONModel",
18
18
  "sap/ui/rta/util/changeVisualization/commands/getCommandVisualization",
19
19
  "sap/ui/rta/util/changeVisualization/ChangeCategories",
20
- "sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
20
+ "sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils",
21
+ "sap/ui/dt/OverlayRegistry"
21
22
  ], function(
22
23
  DateFormat,
23
24
  Control,
@@ -31,7 +32,8 @@ sap.ui.define([
31
32
  JSONModel,
32
33
  getCommandVisualization,
33
34
  ChangeCategories,
34
- ChangeVisualizationUtils
35
+ ChangeVisualizationUtils,
36
+ OverlayRegistry
35
37
  ) {
36
38
  "use strict";
37
39
 
@@ -44,10 +46,10 @@ sap.ui.define([
44
46
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
45
47
  * @author SAP SE
46
48
  * @since 1.84.0
47
- * @version 1.120.6
49
+ * @version 1.121.0
48
50
  * @private
49
51
  */
50
- var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
52
+ const ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
51
53
  metadata: {
52
54
  library: "sap.ui.rta",
53
55
  properties: {
@@ -81,6 +83,12 @@ sap.ui.define([
81
83
  */
82
84
  selectorId: {
83
85
  type: "string"
86
+ },
87
+ /**
88
+ * ID of the element that is connected to the corresponding indicator element (e.g. section/anchor bar)
89
+ */
90
+ connectedElementId: {
91
+ type: "string"
84
92
  }
85
93
  },
86
94
  aggregations: {
@@ -121,7 +129,7 @@ sap.ui.define([
121
129
  oRm.openStart("div", oControl);
122
130
  oRm.class("sapUiRtaChangeIndicator");
123
131
  oRm.class("sapUiRtaChangeIndicatorChange");
124
- var sTooltip = oControl.getTooltip_AsString();
132
+ const sTooltip = oControl.getTooltip_AsString();
125
133
  if (sTooltip) {
126
134
  oRm.attr("title", sTooltip);
127
135
  }
@@ -153,6 +161,9 @@ sap.ui.define([
153
161
  // is needed to prevent that multiple events listeners are attached
154
162
  // to the same overlay because setVisible is called multiple times
155
163
  this._bEventAttachedToElement = false;
164
+ this._oRenderPromise = new Promise((resolve) => {
165
+ this._fnRendered = resolve;
166
+ });
156
167
  }
157
168
  });
158
169
 
@@ -162,19 +173,24 @@ sap.ui.define([
162
173
  oOverlay[sEventHandler]("keydown", this._onKeyDown, this);
163
174
  oOverlay[sEventHandler]("mouseover", this._fnHoverTrue);
164
175
  oOverlay[sEventHandler]("focusin", this._fnHoverTrue);
176
+ oOverlay[sEventHandler]("mouseout", this._fnHoverFalse);
177
+ oOverlay[sEventHandler]("focusout", this._fnHoverFalse);
165
178
  }
166
179
 
167
- // Hover/focus events are handled by the ChangeVisualization (because it can affect multiple indicators at once)
168
180
  function handleBrowserEventsOnIndicator(oIndicator, sEventHandler) {
169
181
  oIndicator[sEventHandler]("click", this._onSelect, this);
170
182
  oIndicator[sEventHandler]("tap", this._onSelect, this);
171
183
  oIndicator[sEventHandler]("keydown", this._onKeyDown, this);
184
+ oIndicator[sEventHandler]("mouseover", this._fnHoverTrue);
185
+ oIndicator[sEventHandler]("focusin", this._fnHoverTrue);
186
+ oIndicator[sEventHandler]("mouseout", this._fnHoverFalse);
187
+ oIndicator[sEventHandler]("focusout", this._fnHoverFalse);
172
188
  }
173
189
 
174
190
  function centerVertically(oIndicator) {
175
- var oIndicatorDomRef = oIndicator.getDomRef();
176
- var iOverlayHeight = Element.getElementById(oIndicator.getOverlayId()).getDomRef().offsetHeight;
177
- var iIndicatorHeight = oIndicatorDomRef.offsetHeight;
191
+ const oIndicatorDomRef = oIndicator.getDomRef();
192
+ const iOverlayHeight = Element.getElementById(oIndicator.getOverlayId()).getDomRef().offsetHeight;
193
+ const iIndicatorHeight = oIndicatorDomRef.offsetHeight;
178
194
  // the indicator should be centered only if the element has a small enough height to improve the design and visibility
179
195
  if (iOverlayHeight < iIndicatorHeight * 5) {
180
196
  oIndicator.addStyleClass("sapUiRtaChangeIndicatorVerticallyCentered");
@@ -184,25 +200,25 @@ sap.ui.define([
184
200
  }
185
201
 
186
202
  function getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId) {
187
- var oAffectedElement = Element.getElementById(mChangeInformation.affectedElementId);
188
- var mDescriptionPayload = Object.keys(mChangeInformation.descriptionPayload || {}).reduce(function(mDescriptionPayload, sKey) {
189
- var vOriginalValue = mChangeInformation.descriptionPayload[sKey];
190
- var bIsBinding = FlUtils.isBinding(vOriginalValue);
191
- var vValue = bIsBinding
203
+ const oAffectedElement = Element.getElementById(mChangeInformation.affectedElementId);
204
+ const mDescriptionPayload = Object.keys(mChangeInformation.descriptionPayload || {}).reduce(function(mDescriptionPayload, sKey) {
205
+ const vOriginalValue = mChangeInformation.descriptionPayload[sKey];
206
+ const bIsBinding = FlUtils.isBinding(vOriginalValue);
207
+ const vValue = bIsBinding
192
208
  ? resolveBinding(vOriginalValue, oAffectedElement)
193
209
  : vOriginalValue;
194
210
  mDescriptionPayload[sKey] = vValue;
195
211
  return mDescriptionPayload;
196
212
  }, {});
197
213
 
198
- var mPropertyBag = { appComponent: FlUtils.getAppComponentForControl(oAffectedElement) };
199
- var oOverlay = Element.getElementById(sOverlayId);
200
- var sElementLabel = oOverlay.getDesignTimeMetadata().getLabel(oAffectedElement);
201
- var oCommandVisualization = getCommandVisualization(mChangeInformation);
202
- var oDescription = oCommandVisualization && oCommandVisualization.getDescription(mDescriptionPayload, sElementLabel, mPropertyBag) || {};
203
- var sCommandName = mChangeInformation.commandName;
204
- var sDescriptionText;
205
- var sDescriptionTooltip;
214
+ const mPropertyBag = { appComponent: FlUtils.getAppComponentForControl(oAffectedElement) };
215
+ const oOverlay = Element.getElementById(sOverlayId);
216
+ const sElementLabel = oOverlay.getDesignTimeMetadata().getLabel(oAffectedElement);
217
+ const oCommandVisualization = getCommandVisualization(mChangeInformation);
218
+ const oDescription = oCommandVisualization?.getDescription(mDescriptionPayload, sElementLabel, mPropertyBag) || {};
219
+ let sCommandName = mChangeInformation.commandName;
220
+ let sDescriptionText;
221
+ let sDescriptionTooltip;
206
222
 
207
223
  // 'Settings' with a custom description should overwrite the description from the CommandVisualization
208
224
  if (sCommandName === "settings" && mDescriptionPayload.description) {
@@ -217,8 +233,8 @@ sap.ui.define([
217
233
  sDescriptionText = oDescription.descriptionText;
218
234
  sDescriptionTooltip = oDescription.descriptionTooltip || "";
219
235
  } else {
220
- var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
221
- var sChangeTextKey = (
236
+ const sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
237
+ const sChangeTextKey = (
222
238
  `TXT_CHANGEVISUALIZATION_CHANGE_${
223
239
  sCommandName.toUpperCase()}`
224
240
  );
@@ -226,8 +242,8 @@ sap.ui.define([
226
242
  sDescriptionTooltip = oRtaResourceBundle.getText(sChangeTextKey, [sElementLabel]);
227
243
  }
228
244
  sDescriptionTooltip = sDescriptionText.length < sDescriptionTooltip.length ? sDescriptionTooltip : null;
229
- var sDetailButtonText = oDescription && oDescription.buttonText;
230
- var sIconTooltip = oRtaResourceBundle.getText(
245
+ const sDetailButtonText = oDescription && oDescription.buttonText;
246
+ const sIconTooltip = oRtaResourceBundle.getText(
231
247
  `TXT_CHANGEVISUALIZATION_OVERVIEW_${
232
248
  mChangeInformation.changeCategory.toUpperCase()}`
233
249
  );
@@ -241,9 +257,9 @@ sap.ui.define([
241
257
  }
242
258
 
243
259
  function getDates(mChangeInformation, oRtaResourceBundle) {
244
- var sCreationDate = mChangeInformation.change.getCreation();
245
- var oDate = new Date(sCreationDate);
246
- var sFallbackDate = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CREATED_IN_SESSION_DATE");
260
+ const sCreationDate = mChangeInformation.change.getCreation();
261
+ const oDate = new Date(sCreationDate);
262
+ const sFallbackDate = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CREATED_IN_SESSION_DATE");
247
263
 
248
264
  return {
249
265
  fullDate: sCreationDate ? DateFormat.getDateTimeInstance().format(oDate) : sFallbackDate,
@@ -252,9 +268,9 @@ sap.ui.define([
252
268
  }
253
269
 
254
270
  function formatChangesModelItem(sOverlayId, mChangeInformation) {
255
- var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
256
- var oTexts = getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId);
257
- var oDates = getDates(mChangeInformation, oRtaResourceBundle);
271
+ const oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
272
+ const oTexts = getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId);
273
+ const oDates = getDates(mChangeInformation, oRtaResourceBundle);
258
274
 
259
275
  return {
260
276
  id: mChangeInformation.id,
@@ -277,7 +293,7 @@ sap.ui.define([
277
293
  ChangeIndicator.prototype.setVisible = function(...aArgs) {
278
294
  const [bVisible] = aArgs;
279
295
  Control.prototype.setVisible.apply(this, aArgs);
280
- var oOverlay = Element.getElementById(this.getOverlayId());
296
+ const oOverlay = Element.getElementById(this.getOverlayId());
281
297
  // needed because the change indicator cleanup is only triggered on save and exit
282
298
  if (oOverlay) {
283
299
  if (bVisible && !this._bEventAttachedToElement) {
@@ -290,6 +306,10 @@ sap.ui.define([
290
306
  if (this.getAggregation("_popover")) {
291
307
  this.getAggregation("_popover").destroy();
292
308
  }
309
+ // Reset the render promise
310
+ this._oRenderPromise = new Promise((resolve) => {
311
+ this._fnRendered = resolve;
312
+ });
293
313
  }
294
314
  }
295
315
  return this;
@@ -312,7 +332,7 @@ sap.ui.define([
312
332
  // indicator is not rendered yet or that the old overlay and thus the nested indicator were destroyed
313
333
  // To properly render it, the indicator must temporarily be placed in the static area
314
334
  // Once it is rendered, it can move itself to the actual overlay dom ref (see onAfterRendering)
315
- var oDomRef = this.getDomRef();
335
+ const oDomRef = this.getDomRef();
316
336
  if (oDomRef) {
317
337
  oDomRef.parentNode.removeChild(oDomRef);
318
338
  }
@@ -323,7 +343,7 @@ sap.ui.define([
323
343
  };
324
344
 
325
345
  ChangeIndicator.prototype.onAfterRendering = function() {
326
- var oOverlay = Element.getElementById(this.getOverlayId());
346
+ const oOverlay = Element.getElementById(this.getOverlayId());
327
347
  if (oOverlay) {
328
348
  // Attach to the overlay
329
349
  oOverlay.getDomRef().appendChild(this.getDomRef());
@@ -337,11 +357,21 @@ sap.ui.define([
337
357
  this.focus();
338
358
  this._setHoverStyleClasses(true);
339
359
  }
360
+ // Resolve the rendering promise
361
+ this._fnRendered();
362
+ };
363
+
364
+ /**
365
+ * Waits for the indicator to be rendered.
366
+ * @returns {Promise} Resolves when the indicator is rendered
367
+ */
368
+ ChangeIndicator.prototype.waitForRendering = function() {
369
+ return this._oRenderPromise;
340
370
  };
341
371
 
342
372
  ChangeIndicator.prototype.exit = function() {
343
- var oDomRef = this.getDomRef();
344
- var oOverlay = Element.getElementById(this.getOverlayId());
373
+ const oDomRef = this.getDomRef();
374
+ const oOverlay = Element.getElementById(this.getOverlayId());
345
375
  if (oDomRef) {
346
376
  oDomRef.parentNode.removeChild(oDomRef);
347
377
  }
@@ -355,9 +385,15 @@ sap.ui.define([
355
385
  };
356
386
 
357
387
  ChangeIndicator.prototype.setChanges = function(aChanges) {
358
- var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
388
+ const oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
359
389
  this.setProperty("changes", aChanges);
360
- this._oDetailModel.setData((aChanges || []).reverse().map(formatChangesModelItem.bind(this, this.getOverlayId())));
390
+ const aSortedChanges = aChanges
391
+ ? aChanges.sort(
392
+ (a, b) => new Date(a.change.getCreation() || new Date()) - new Date(b.change.getCreation() || new Date())
393
+ ).reverse()
394
+ : [];
395
+ const aFormattedChanges = (aSortedChanges).map(formatChangesModelItem.bind(this, this.getOverlayId()));
396
+ this._oDetailModel.setData(aFormattedChanges);
361
397
  if (aChanges && aChanges.length === 1) {
362
398
  this.setTooltip(oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_INDICATOR_TOOLTIP_SING"));
363
399
  } else if (aChanges) {
@@ -393,14 +429,23 @@ sap.ui.define([
393
429
  this._setHoverStyleClasses(bAdd);
394
430
  };
395
431
 
396
- ChangeIndicator.prototype._setHoverStyleClasses = function(bAdd) {
397
- var oOverlay = Element.getElementById(this.getOverlayId());
432
+ ChangeIndicator.prototype._setHoverStyleClasses = function(bAdd, oEvent) {
433
+ if (oEvent) {
434
+ oEvent.stopPropagation();
435
+ oEvent.preventDefault();
436
+ }
437
+ const oOverlay = Element.getElementById(this.getOverlayId());
398
438
  if (oOverlay.getMetadata().getName() !== "sap.ui.dt.ElementOverlay") {
399
439
  return;
400
440
  }
401
- var sFunctionName = bAdd ? "addStyleClass" : "removeStyleClass";
441
+
442
+ const sFunctionName = bAdd ? "addStyleClass" : "removeStyleClass";
402
443
  oOverlay[sFunctionName]("sapUiRtaChangeIndicatorHovered");
403
444
  this[sFunctionName]("sapUiRtaHover");
445
+ if (this.getConnectedElementId()) {
446
+ const oConnectedElementOverlay = OverlayRegistry.getOverlay(this.getConnectedElementId());
447
+ oConnectedElementOverlay[sFunctionName]("sapUiRtaChangeIndicatorHovered");
448
+ }
404
449
  };
405
450
 
406
451
  ChangeIndicator.prototype._toggleDetailPopover = function() {
@@ -416,21 +461,21 @@ sap.ui.define([
416
461
  this.setAggregation("_popover", oPopover);
417
462
  oPopover.setModel(this._oDetailModel, "details");
418
463
  oPopover.openBy(this);
419
- this.fireDetailPopoverOpened();
464
+ this._setHoverStyleClasses(true);
420
465
  }.bind(this));
421
466
  } else {
422
467
  if (this.getAggregation("_popover").isOpen()) {
423
468
  return this.getAggregation("_popover").close();
424
469
  }
425
470
  this.getAggregation("_popover").openBy(this);
426
- this.fireDetailPopoverOpened();
471
+ this._setHoverStyleClasses(true);
427
472
  }
428
473
  return undefined;
429
474
  };
430
475
 
431
476
  ChangeIndicator.prototype._showDependentElements = function(oEvent) {
432
477
  this.getAggregation("_popover").close();
433
- var sChangeId = this.getChanges().length > 1
478
+ const sChangeId = this.getChanges().length > 1
434
479
  ? oEvent.getSource().getBindingContext("details").getObject().id
435
480
  : this.getChanges()[0].id;
436
481
  this.fireSelectChange({
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/base/util/includes",
9
8
  "sap/base/util/values",
10
9
  "sap/base/util/restricted/_omit",
11
10
  "sap/base/Log",
@@ -17,7 +16,6 @@ sap.ui.define([
17
16
  "sap/ui/fl/changeHandler/common/ChangeCategories",
18
17
  "sap/ui/rta/util/changeVisualization/ChangeStates"
19
18
  ], function(
20
- includes,
21
19
  values,
22
20
  _omit,
23
21
  Log,
@@ -39,10 +37,10 @@ sap.ui.define([
39
37
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
40
38
  * @author SAP SE
41
39
  * @since 1.86.0
42
- * @version 1.120.6
40
+ * @version 1.121.0
43
41
  * @private
44
42
  */
45
- var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
43
+ const ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
46
44
  metadata: {
47
45
  properties: {
48
46
  /**
@@ -113,8 +111,8 @@ sap.ui.define([
113
111
  * @returns {object} List of selectors with change indicator data.
114
112
  */
115
113
  ChangeIndicatorRegistry.prototype.getSelectorsWithRegisteredChanges = function() {
116
- var oChangeIndicators = {};
117
- var sPreviousAffectedElementId;
114
+ const oChangeIndicators = {};
115
+ let sPreviousAffectedElementId;
118
116
 
119
117
  function addSelector(sSelectorId, sAffectedElementId, oChangeIndicatorData, bDependent) {
120
118
  if (oChangeIndicators[sSelectorId] === undefined) {
@@ -145,10 +143,10 @@ sap.ui.define([
145
143
  };
146
144
 
147
145
  ChangeIndicatorRegistry.prototype.getRelevantChangesWithSelector = function() {
148
- var oSelectors = this.getSelectorsWithRegisteredChanges();
149
- var aRelevantChanges = [];
146
+ const oSelectors = this.getSelectorsWithRegisteredChanges();
147
+ let aRelevantChanges = [];
150
148
  Object.keys(oSelectors).forEach(function(sSelectorId) {
151
- var aRelevantChangesForSelector = oSelectors[sSelectorId].filter(function(oChange) {
149
+ const aRelevantChangesForSelector = oSelectors[sSelectorId].filter(function(oChange) {
152
150
  return !oChange.dependent;
153
151
  });
154
152
  aRelevantChanges = aRelevantChanges.concat(aRelevantChangesForSelector);
@@ -184,21 +182,21 @@ sap.ui.define([
184
182
  * @returns {Promise<undefined>} Resolves as soon as the change is registered
185
183
  */
186
184
  ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName, oVersionsModel) {
187
- var oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
185
+ const oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
188
186
  return getVisualizationInfo(oChange, oAppComponent).then(function(mChangeVisualizationInfo) {
189
- var aCategories = this.getChangeCategories();
190
- var sChangeCategory;
187
+ const aCategories = this.getChangeCategories();
188
+ let sChangeCategory;
191
189
  // For "settings", the control developer can choose one of the existing categories
192
- if (sCommandName === "settings" && includes(Object.keys(aCategories), mChangeVisualizationInfo.descriptionPayload.category)) {
190
+ if (sCommandName === "settings" && Object.keys(aCategories).includes(mChangeVisualizationInfo.descriptionPayload.category)) {
193
191
  sChangeCategory = mChangeVisualizationInfo.descriptionPayload.category;
194
192
  } else {
195
193
  sChangeCategory = Object.keys(aCategories).find(function(sChangeCategoryName) {
196
- return includes(aCategories[sChangeCategoryName], sCommandName);
194
+ return aCategories[sChangeCategoryName].includes(sCommandName);
197
195
  });
198
196
  sChangeCategory ||= ChangeCategories.OTHER;
199
197
  }
200
- var aChangeStates;
201
- var aDraftChangesList = [];
198
+ let aChangeStates;
199
+ let aDraftChangesList = [];
202
200
  if (oVersionsModel) {
203
201
  aDraftChangesList = oVersionsModel.getData().draftFilenames;
204
202
  }
@@ -228,7 +226,7 @@ sap.ui.define([
228
226
  }
229
227
  return aSelectorList
230
228
  .map(function(vSelector) {
231
- var oElement = typeof vSelector.getId === "function"
229
+ const oElement = typeof vSelector.getId === "function"
232
230
  ? vSelector
233
231
  : JsControlTreeModifier.bySelector(vSelector, oAppComponent);
234
232
  return oElement && oElement.getId();
@@ -238,13 +236,13 @@ sap.ui.define([
238
236
 
239
237
  return getInfoFromChangeHandler(oAppComponent, oChange)
240
238
  .then(function(oInfoFromChangeHandler) {
241
- var mVisualizationInfo = oInfoFromChangeHandler || {};
242
- var aChangeSelectors = oChange.getSelector && oChange.getSelector() && [oChange.getSelector()];
243
- var aAffectedElementSelectors = mVisualizationInfo.affectedControls || aChangeSelectors || [];
239
+ const mVisualizationInfo = oInfoFromChangeHandler || {};
240
+ const aChangeSelectors = oChange.getSelector && oChange.getSelector() && [oChange.getSelector()];
241
+ const aAffectedElementSelectors = mVisualizationInfo.affectedControls || aChangeSelectors || [];
244
242
  // If there is an original selector (e.g. control is inside a template),
245
243
  // the indicator should be displayed on the host control (change selector)
246
- var oChangeOriginalSelector = oChange.getOriginalSelector && oChange.getOriginalSelector();
247
- var aDisplayElementSelectors = oChangeOriginalSelector ? aChangeSelectors : aAffectedElementSelectors;
244
+ const oChangeOriginalSelector = oChange.getOriginalSelector && oChange.getOriginalSelector();
245
+ const aDisplayElementSelectors = oChangeOriginalSelector ? aChangeSelectors : aAffectedElementSelectors;
248
246
 
249
247
  return {
250
248
  affectedElementIds: getSelectorIds(aAffectedElementSelectors),
@@ -257,9 +255,9 @@ sap.ui.define([
257
255
  }
258
256
 
259
257
  function getInfoFromChangeHandler(oAppComponent, oChange) {
260
- var oSelector = oChange.getOriginalSelector && oChange.getOriginalSelector();
258
+ let oSelector = oChange.getOriginalSelector && oChange.getOriginalSelector();
261
259
  oSelector ||= oChange.getSelector && oChange.getSelector();
262
- var oControl = JsControlTreeModifier.bySelector(oSelector, oAppComponent);
260
+ const oControl = JsControlTreeModifier.bySelector(oSelector, oAppComponent);
263
261
  if (oControl) {
264
262
  return ChangesWriteAPI.getChangeHandler({
265
263
  changeType: oChange.getChangeType(),
@@ -295,6 +293,14 @@ sap.ui.define([
295
293
  this._oChangeIndicators[sSelectorId] = oChangeIndicator;
296
294
  };
297
295
 
296
+ /**
297
+ * Waits for the registered indicators to be rendered.
298
+ * @returns {Promise} Resolves when all registered indicators are rendered.
299
+ */
300
+ ChangeIndicatorRegistry.prototype.waitForIndicatorRendering = function() {
301
+ return Promise.all(this.getChangeIndicators().map((oIndicator) => oIndicator.waitForRendering()));
302
+ };
303
+
298
304
  /**
299
305
  * Resets the change and change indicator registries.
300
306
  */
@@ -320,7 +326,8 @@ sap.ui.define([
320
326
 
321
327
  /**
322
328
  * Removes changes with the updateRequired flag from the registry so the change can be re-registered and
323
- * the visualizationInfo is updated => if an element has an unstable id this updates the id information in the registry (e.g simple forms)
329
+ * the visualizationInfo is updated => if an element has an unstable id this updates the id information
330
+ * in the registry (e.g simple forms)
324
331
  */
325
332
  ChangeIndicatorRegistry.prototype.removeOutdatedRegisteredChanges = function() {
326
333
  this.getAllRegisteredChanges().forEach(function(oChange) {