@openui5/sap.ui.rta 1.131.1 → 1.132.1

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 (200) hide show
  1. package/.eslintrc.json +1 -2
  2. package/THIRDPARTY.txt +1 -1
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +2 -2
  5. package/src/sap/ui/rta/Client.js +2 -2
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +26 -10
  7. package/src/sap/ui/rta/Utils.js +2 -2
  8. package/src/sap/ui/rta/api/startAdaptation.js +1 -1
  9. package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
  10. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
  11. package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
  12. package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
  13. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
  14. package/src/sap/ui/rta/appVariant/Feature.js +1 -1
  15. package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
  16. package/src/sap/ui/rta/appVariant/Utils.js +1 -1
  17. package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
  18. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
  19. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saptrc.properties +27 -27
  20. package/src/sap/ui/rta/appVariant/manageApps/webapp/index.html +3 -3
  21. package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
  22. package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
  23. package/src/sap/ui/rta/command/AddIFrame.js +2 -2
  24. package/src/sap/ui/rta/command/AddProperty.js +2 -2
  25. package/src/sap/ui/rta/command/AddXML.js +2 -2
  26. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +2 -2
  27. package/src/sap/ui/rta/command/AnnotationCommand.js +79 -0
  28. package/src/sap/ui/rta/command/AppDescriptorCommand.js +2 -2
  29. package/src/sap/ui/rta/command/BaseCommand.js +2 -2
  30. package/src/sap/ui/rta/command/BindProperty.js +6 -8
  31. package/src/sap/ui/rta/command/Combine.js +2 -2
  32. package/src/sap/ui/rta/command/CommandFactory.js +3 -3
  33. package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
  34. package/src/sap/ui/rta/command/ControlVariantConfigure.js +9 -5
  35. package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
  36. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +8 -6
  37. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +14 -11
  38. package/src/sap/ui/rta/command/ControlVariantSwitch.js +6 -4
  39. package/src/sap/ui/rta/command/CreateContainer.js +2 -2
  40. package/src/sap/ui/rta/command/CustomAdd.js +2 -2
  41. package/src/sap/ui/rta/command/FlexCommand.js +2 -2
  42. package/src/sap/ui/rta/command/LREPSerializer.js +2 -2
  43. package/src/sap/ui/rta/command/LocalReset.js +2 -2
  44. package/src/sap/ui/rta/command/Move.js +2 -2
  45. package/src/sap/ui/rta/command/Property.js +2 -2
  46. package/src/sap/ui/rta/command/Remove.js +2 -2
  47. package/src/sap/ui/rta/command/Rename.js +2 -2
  48. package/src/sap/ui/rta/command/Resize.js +2 -2
  49. package/src/sap/ui/rta/command/Reveal.js +2 -2
  50. package/src/sap/ui/rta/command/Settings.js +2 -2
  51. package/src/sap/ui/rta/command/Split.js +2 -2
  52. package/src/sap/ui/rta/command/Stack.js +2 -2
  53. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
  54. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -2
  55. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
  56. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
  57. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +14 -2
  58. package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
  59. package/src/sap/ui/rta/enablement/elementActionTest.js +15 -16
  60. package/src/sap/ui/rta/library.js +3 -3
  61. package/src/sap/ui/rta/messagebundle.properties +18 -0
  62. package/src/sap/ui/rta/messagebundle_ar.properties +10 -0
  63. package/src/sap/ui/rta/messagebundle_bg.properties +13 -3
  64. package/src/sap/ui/rta/messagebundle_ca.properties +10 -0
  65. package/src/sap/ui/rta/messagebundle_cnr.properties +10 -0
  66. package/src/sap/ui/rta/messagebundle_cs.properties +10 -0
  67. package/src/sap/ui/rta/messagebundle_cy.properties +10 -0
  68. package/src/sap/ui/rta/messagebundle_da.properties +10 -0
  69. package/src/sap/ui/rta/messagebundle_de.properties +10 -0
  70. package/src/sap/ui/rta/messagebundle_el.properties +10 -0
  71. package/src/sap/ui/rta/messagebundle_en.properties +10 -0
  72. package/src/sap/ui/rta/messagebundle_en_GB.properties +10 -0
  73. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -0
  74. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +347 -325
  75. package/src/sap/ui/rta/messagebundle_es.properties +10 -0
  76. package/src/sap/ui/rta/messagebundle_es_MX.properties +18 -8
  77. package/src/sap/ui/rta/messagebundle_et.properties +10 -0
  78. package/src/sap/ui/rta/messagebundle_fi.properties +10 -0
  79. package/src/sap/ui/rta/messagebundle_fr.properties +10 -0
  80. package/src/sap/ui/rta/messagebundle_fr_CA.properties +10 -0
  81. package/src/sap/ui/rta/messagebundle_hi.properties +10 -0
  82. package/src/sap/ui/rta/messagebundle_hr.properties +10 -0
  83. package/src/sap/ui/rta/messagebundle_hu.properties +10 -0
  84. package/src/sap/ui/rta/messagebundle_id.properties +10 -0
  85. package/src/sap/ui/rta/messagebundle_it.properties +10 -0
  86. package/src/sap/ui/rta/messagebundle_iw.properties +10 -0
  87. package/src/sap/ui/rta/messagebundle_ja.properties +10 -0
  88. package/src/sap/ui/rta/messagebundle_kk.properties +10 -0
  89. package/src/sap/ui/rta/messagebundle_ko.properties +10 -0
  90. package/src/sap/ui/rta/messagebundle_lt.properties +10 -0
  91. package/src/sap/ui/rta/messagebundle_lv.properties +10 -0
  92. package/src/sap/ui/rta/messagebundle_mk.properties +10 -0
  93. package/src/sap/ui/rta/messagebundle_ms.properties +14 -4
  94. package/src/sap/ui/rta/messagebundle_nl.properties +10 -0
  95. package/src/sap/ui/rta/messagebundle_no.properties +10 -0
  96. package/src/sap/ui/rta/messagebundle_pl.properties +10 -0
  97. package/src/sap/ui/rta/messagebundle_pt.properties +10 -0
  98. package/src/sap/ui/rta/messagebundle_pt_PT.properties +10 -0
  99. package/src/sap/ui/rta/messagebundle_ro.properties +10 -0
  100. package/src/sap/ui/rta/messagebundle_ru.properties +10 -0
  101. package/src/sap/ui/rta/messagebundle_sh.properties +10 -0
  102. package/src/sap/ui/rta/messagebundle_sk.properties +10 -0
  103. package/src/sap/ui/rta/messagebundle_sl.properties +10 -0
  104. package/src/sap/ui/rta/messagebundle_sr.properties +10 -0
  105. package/src/sap/ui/rta/messagebundle_sv.properties +10 -0
  106. package/src/sap/ui/rta/messagebundle_th.properties +10 -0
  107. package/src/sap/ui/rta/messagebundle_tr.properties +10 -0
  108. package/src/sap/ui/rta/messagebundle_uk.properties +11 -1
  109. package/src/sap/ui/rta/messagebundle_vi.properties +10 -0
  110. package/src/sap/ui/rta/messagebundle_zh_CN.properties +10 -0
  111. package/src/sap/ui/rta/messagebundle_zh_TW.properties +10 -0
  112. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
  113. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  114. package/src/sap/ui/rta/plugin/Combine.js +2 -2
  115. package/src/sap/ui/rta/plugin/CompVariant.js +4 -2
  116. package/src/sap/ui/rta/plugin/ControlVariant.js +5 -23
  117. package/src/sap/ui/rta/plugin/CreateContainer.js +2 -2
  118. package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
  119. package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
  120. package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
  121. package/src/sap/ui/rta/plugin/Plugin.js +15 -13
  122. package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
  123. package/src/sap/ui/rta/plugin/Remove.js +2 -2
  124. package/src/sap/ui/rta/plugin/Rename.js +3 -3
  125. package/src/sap/ui/rta/plugin/RenameHandler.js +5 -9
  126. package/src/sap/ui/rta/plugin/Resize.js +3 -3
  127. package/src/sap/ui/rta/plugin/Selection.js +2 -2
  128. package/src/sap/ui/rta/plugin/Settings.js +2 -21
  129. package/src/sap/ui/rta/plugin/Split.js +2 -2
  130. package/src/sap/ui/rta/plugin/Stretch.js +7 -5
  131. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -126
  132. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +28 -31
  133. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +141 -172
  134. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +108 -137
  135. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
  136. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +96 -141
  137. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +112 -0
  138. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +183 -0
  139. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +109 -0
  140. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +239 -0
  141. package/src/sap/ui/rta/plugin/annotations/AnnotationTypes.js +15 -0
  142. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
  143. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +3 -3
  144. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -1
  145. package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
  146. package/src/sap/ui/rta/service/Action.js +2 -2
  147. package/src/sap/ui/rta/service/ControllerExtension.js +2 -2
  148. package/src/sap/ui/rta/service/Outline.js +2 -2
  149. package/src/sap/ui/rta/service/Property.js +2 -2
  150. package/src/sap/ui/rta/service/Receiver.js +1 -1
  151. package/src/sap/ui/rta/service/Selection.js +2 -2
  152. package/src/sap/ui/rta/service/SupportTools.js +2 -2
  153. package/src/sap/ui/rta/service/index.js +1 -1
  154. package/src/sap/ui/rta/themes/base/WhatsNew.less +5 -0
  155. package/src/sap/ui/rta/themes/base/library.source.less +1 -1
  156. package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
  157. package/src/sap/ui/rta/toolbar/Adaptation.js +2 -2
  158. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
  159. package/src/sap/ui/rta/toolbar/Base.js +2 -2
  160. package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
  161. package/src/sap/ui/rta/toolbar/Fiori.js +3 -4
  162. package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
  163. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
  164. package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
  165. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +1 -1
  166. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -2
  167. package/src/sap/ui/rta/toolbar/translation/Translation.js +3 -3
  168. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +2 -2
  169. package/src/sap/ui/rta/util/Animation.js +1 -1
  170. package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
  171. package/src/sap/ui/rta/util/PluginManager.js +16 -10
  172. package/src/sap/ui/rta/util/PopupManager.js +3 -3
  173. package/src/sap/ui/rta/util/ReloadManager.js +9 -9
  174. package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
  175. package/src/sap/ui/rta/util/ServiceManager.js +2 -2
  176. package/src/sap/ui/rta/util/adaptationStarter.js +17 -2
  177. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
  178. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +2 -2
  179. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +2 -2
  180. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +1 -1
  181. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +5 -3
  182. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
  183. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
  184. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
  185. package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
  186. package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
  187. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
  188. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
  189. package/src/sap/ui/rta/util/hasStableId.js +1 -1
  190. package/src/sap/ui/rta/util/showMessageBox.js +1 -1
  191. package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
  192. package/src/sap/ui/rta/util/validateStableIds.js +1 -1
  193. package/src/sap/ui/rta/util/validateText.js +1 -1
  194. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +2 -2
  195. package/src/sap/ui/rta/util/whatsNew/WhatsNewDialog.fragment.xml +5 -4
  196. package/src/sap/ui/rta/util/whatsNew/WhatsNewOverview.js +1 -1
  197. package/src/sap/ui/rta/util/whatsNew/WhatsNewOverviewDialog.fragment.xml +8 -2
  198. package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +1 -1
  199. package/src/sap/ui/rta/util/whatsNew/whatsNewContent/WhatsNewFeatures.js +1 -1
  200. package/src/sap/ui/rta/command/Annotation.js +0 -45
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * OpenUI5
3
- * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
3
+ * (c) Copyright 2009-2025 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
@@ -21,12 +21,12 @@ sap.ui.define([
21
21
  ) {
22
22
  "use strict";
23
23
 
24
- function _checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName) {
24
+ function checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName) {
25
25
  if (!oElement) {
26
26
  return false;
27
27
  }
28
- var mBindingInfo = oElement.getBindingInfo(sAggregationName, sModelName);
29
- var sPath = mBindingInfo && mBindingInfo.path;
28
+ const mBindingInfo = oElement.getBindingInfo(sAggregationName, sModelName);
29
+ let sPath = mBindingInfo && mBindingInfo.path;
30
30
  if (!sPath) {
31
31
  return false;
32
32
  }
@@ -36,8 +36,8 @@ sap.ui.define([
36
36
  return sPath.indexOf("/") === 0;
37
37
  }
38
38
 
39
- function _getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName) {
40
- var vBinding;
39
+ function getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName) {
40
+ let vBinding;
41
41
  if (bAbsoluteAggregationBinding) {
42
42
  vBinding = oElement.getBindingInfo(sAggregationName, sModelName);
43
43
  // check to be model binding otherwise return undefined
@@ -51,15 +51,16 @@ sap.ui.define([
51
51
  return vBinding;
52
52
  }
53
53
 
54
- function _getBindingContextPath(oElement, sAggregationName, sModelName) {
55
- var bAbsoluteAggregationBinding = _checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName);
56
- var vBinding = _getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName);
54
+ function getBindingContextPath(oElement, sAggregationName, sModelName) {
55
+ const bAbsoluteAggregationBinding = checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName);
56
+ const vBinding = getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName);
57
57
  if (vBinding) {
58
58
  return bAbsoluteAggregationBinding ? vBinding.path : vBinding.getPath();
59
59
  }
60
60
  }
61
- function _flattenProperties(aProperties) {
62
- var aFlattenedProperties = aProperties.reduce(function(aFlattened, oProperty) {
61
+
62
+ function flattenProperties(aProperties) {
63
+ const aFlattenedProperties = aProperties.reduce(function(aFlattened, oProperty) {
63
64
  if (Array.isArray(oProperty.properties)) {
64
65
  // only one level supported by our dialogs
65
66
  // Only take the leaves, but attach the parent property name/label to it
@@ -76,54 +77,50 @@ sap.ui.define([
76
77
  return aFlattenedProperties;
77
78
  }
78
79
 
79
- function _getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction) {
80
- var mPropertyBag = {
80
+ async function getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction) {
81
+ const aProperties = await mAction.delegateInfo.delegate.getPropertyInfo({
81
82
  element: oElement,
82
83
  aggregationName: sAggregationName,
83
84
  payload: mAction.delegateInfo.payload || {}
84
- };
85
- return mAction.delegateInfo.delegate.getPropertyInfo(mPropertyBag)
86
- .then(_flattenProperties.bind(null));
85
+ });
86
+ return flattenProperties(aProperties);
87
87
  }
88
88
 
89
- function getAllPropertiesFromDelegate(oElement, sAggregationName) {
90
- return DelegateMediatorAPI.getReadDelegateForControl({
89
+ async function getAllPropertiesFromDelegate(oElement, sAggregationName) {
90
+ const mDelegateInfo = await DelegateMediatorAPI.getReadDelegateForControl({
91
91
  control: oElement,
92
92
  modifier: JsControlTreeModifier
93
- }).then(function(mDelegateInfo) {
94
- if (mDelegateInfo && mDelegateInfo.instance) {
95
- return mDelegateInfo.instance.getPropertyInfo({
96
- element: oElement,
97
- aggregationName: sAggregationName,
98
- payload: mDelegateInfo.payload || {}
99
- });
100
- }
101
- return [];
102
93
  });
94
+ if (mDelegateInfo && mDelegateInfo.instance) {
95
+ return mDelegateInfo.instance.getPropertyInfo({
96
+ element: oElement,
97
+ aggregationName: sAggregationName,
98
+ payload: mDelegateInfo.payload || {}
99
+ });
100
+ }
101
+ return [];
103
102
  }
104
103
 
105
- function _getAllPropertiesFromModels(oElement, sAggregationName, mActions) {
106
- var mAddViaDelegate = mActions.addViaDelegate;
107
- var fnGetAllProperties;
104
+ async function getAllPropertiesFromModels(oElement, sAggregationName, mActions) {
105
+ const mAddViaDelegate = mActions.addViaDelegate;
106
+ let fnGetAllProperties;
108
107
  if (mAddViaDelegate) {
109
- fnGetAllProperties = _getAllPropertiesFromAddViaDelegateAction.bind(null, oElement, sAggregationName, mAddViaDelegate);
108
+ fnGetAllProperties = getAllPropertiesFromAddViaDelegateAction.bind(null, oElement, sAggregationName, mAddViaDelegate);
110
109
  } else {
111
110
  fnGetAllProperties = getAllPropertiesFromDelegate.bind(null, oElement, sAggregationName);
112
111
  }
113
- return fnGetAllProperties() // arguments bound before
114
- .then(function(aProperties) {
115
- return _checkForDuplicateProperties(aProperties);
116
- });
112
+ const aProperties = await fnGetAllProperties();
113
+ return checkForDuplicateProperties(aProperties);
117
114
  }
118
115
 
119
- function _filterUnsupportedProperties(aProperties) {
116
+ function filterUnsupportedProperties(aProperties) {
120
117
  return aProperties.filter(function(mProperty) {
121
118
  // see _enrichProperty
122
119
  return !(mProperty.unsupported || mProperty.hideFromReveal);
123
120
  });
124
121
  }
125
122
 
126
- function _oPropertyToAdditionalElementInfo(oProperty) {
123
+ function oPropertyToAdditionalElementInfo(oProperty) {
127
124
  return {
128
125
  selected: false,
129
126
  label: oProperty.label || oProperty.name,
@@ -139,9 +136,9 @@ sap.ui.define([
139
136
  };
140
137
  }
141
138
 
142
- function _elementToAdditionalElementInfo(mData) {
143
- var oElement = mData.element;
144
- var mAction = mData.action;
139
+ function elementToAdditionalElementInfo(mData) {
140
+ const oElement = mData.element;
141
+ const mAction = mData.action;
145
142
  return {
146
143
  selected: false,
147
144
  label: oElement.__label || ElementUtil.getLabelForElement(oElement, mAction.getLabel),
@@ -166,27 +163,25 @@ sap.ui.define([
166
163
  * @param {string} sModelName - model name
167
164
  *
168
165
  * @return {sap.ui.core.Element[]} - returns an array with found siblings elements
169
- *
170
- * @private
171
166
  */
172
- function _getRelevantElements(oElement, oRelevantContainer, sAggregationName, sModelName) {
167
+ function getRelevantElements(oElement, oRelevantContainer, sAggregationName, sModelName) {
173
168
  if (oRelevantContainer && oRelevantContainer !== oElement) {
174
- var sRelevantContainerBindingContext = _getBindingContextPath(oElement, sAggregationName, sModelName);
169
+ const sRelevantContainerBindingContext = getBindingContextPath(oElement, sAggregationName, sModelName);
175
170
 
176
171
  return ElementUtil
177
172
  .findAllSiblingsInContainer(oElement, oRelevantContainer)
178
173
  // We accept only siblings that are bound on the same model
179
174
  .filter(function(oSiblingElement) {
180
- return sRelevantContainerBindingContext === _getBindingContextPath(oSiblingElement, sAggregationName, sModelName);
175
+ return sRelevantContainerBindingContext === getBindingContextPath(oSiblingElement, sAggregationName, sModelName);
181
176
  });
182
177
  }
183
178
  return [oElement];
184
179
  }
185
180
 
186
- function _checkForDuplicateProperties(aProperties) {
181
+ function checkForDuplicateProperties(aProperties) {
187
182
  aProperties.forEach(function(oModelProperty, index, aProperties) {
188
183
  if (oModelProperty.duplicateName !== true) {
189
- for (var j = index + 1; j < aProperties.length - 1; j++) {
184
+ for (let j = index + 1; j < aProperties.length - 1; j++) {
190
185
  if (oModelProperty.label === aProperties[j].label) {
191
186
  oModelProperty.duplicateName = true;
192
187
  aProperties[j].duplicateName = true;
@@ -198,7 +193,7 @@ sap.ui.define([
198
193
  }
199
194
 
200
195
  // check for duplicate labels to later add the parent property name/label if available
201
- function _checkForDuplicateLabels(oInvisibleElement, aProperties) {
196
+ function checkForDuplicateLabels(oInvisibleElement, aProperties) {
202
197
  return aProperties.some(function(oModelProperty) {
203
198
  return oModelProperty.label === oInvisibleElement.__label;
204
199
  });
@@ -208,9 +203,8 @@ sap.ui.define([
208
203
  * Checks if array of paths is not empty
209
204
  * @param {string[]} aBindingPaths - Array of collected binding paths
210
205
  * @return {boolean} - true if it has binding(s)
211
- * @private
212
206
  */
213
- function _hasBindings(aBindingPaths) {
207
+ function hasBindings(aBindingPaths) {
214
208
  return Array.isArray(aBindingPaths) && aBindingPaths.length > 0;
215
209
  }
216
210
 
@@ -221,10 +215,8 @@ sap.ui.define([
221
215
  * @param {object[]} aProperties - Array of Fields
222
216
  *
223
217
  * @return {object|undefined} - returns first found Object with Field (Property) description, undefined if not found
224
- *
225
- * @private
226
218
  */
227
- function _findModelProperty(aControlsBindingPaths, aProperties) {
219
+ function findModelProperty(aControlsBindingPaths, aProperties) {
228
220
  return aProperties
229
221
  .sort(function(oProperty1, oProperty2) {
230
222
  // Temporary fix to avoid evaluating technical properties like RAP feature
@@ -247,7 +239,7 @@ sap.ui.define([
247
239
  .pop();
248
240
  }
249
241
 
250
- function _vBindingToPath(vBinding) {
242
+ function vBindingToPath(vBinding) {
251
243
  return (
252
244
  isPlainObject(vBinding)
253
245
  ? vBinding.parts[0].path // TODO what about complex bindings with multiple paths, this was not covered so far?
@@ -255,23 +247,23 @@ sap.ui.define([
255
247
  );
256
248
  }
257
249
 
258
- function _getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName) {
259
- var oModel = oElement.getModel(sModelName);
260
- var aRelevantElements = _getRelevantElements(oElement, mAction.relevantContainer, sAggregationName, sModelName);
261
- var aBindingPaths = [];
250
+ function getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName) {
251
+ const oModel = oElement.getModel(sModelName);
252
+ const aRelevantElements = getRelevantElements(oElement, mAction.relevantContainer, sAggregationName, sModelName);
253
+ let aBindingPaths = [];
262
254
 
263
255
  aRelevantElements.forEach(function(oElement) {
264
256
  aBindingPaths = aBindingPaths.concat(BindingsExtractor.getBindings({
265
257
  element: oElement,
266
258
  model: oModel,
267
259
  parent: oElement.getParent()
268
- }).map(_vBindingToPath));
260
+ }).map(vBindingToPath));
269
261
  });
270
262
  return aBindingPaths;
271
263
  }
272
264
 
273
- function _getRepresentedPropertiesFromDelegate(mAction, sAggregationName) {
274
- var mPropertyBag = {
265
+ function getRepresentedPropertiesFromDelegate(mAction, sAggregationName) {
266
+ const mPropertyBag = {
275
267
  element: mAction.relevantContainer,
276
268
  aggregationName: sAggregationName,
277
269
  payload: mAction.delegateInfo.payload || {}
@@ -279,30 +271,26 @@ sap.ui.define([
279
271
  return mAction.delegateInfo.delegate.getRepresentedProperties(mPropertyBag);
280
272
  }
281
273
 
282
- function _getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName) {
283
- return _getRepresentedPropertiesFromDelegate(mAction, sAggregationName)
284
- .then(function(aRepresentedProperties) {
285
- if (aRepresentedProperties === undefined) {
286
- // delegate skipped taking over => evaluate binding
287
- return _getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
288
- }
289
- var aBindingPaths = [];
290
- aRepresentedProperties.forEach(function(oRepresentedProperty) {
291
- aBindingPaths = aBindingPaths.concat(oRepresentedProperty.bindingPaths);
292
- });
293
- return aBindingPaths;
274
+ async function getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName) {
275
+ const aRepresentedProperties = await getRepresentedPropertiesFromDelegate(mAction, sAggregationName);
276
+ if (aRepresentedProperties === undefined) {
277
+ // delegate skipped taking over => evaluate binding
278
+ return getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
279
+ }
280
+ let aBindingPaths = [];
281
+ aRepresentedProperties.forEach(function(oRepresentedProperty) {
282
+ aBindingPaths = aBindingPaths.concat(oRepresentedProperty.bindingPaths);
294
283
  });
284
+ return aBindingPaths;
295
285
  }
296
286
 
297
- function _getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName) {
298
- return Promise.resolve().then(function() {
299
- var bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
287
+ function getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName) {
288
+ const bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
300
289
 
301
- if (bHasDelegateAndGetRepresentedProperties) {
302
- return _getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName);
303
- }
304
- return _getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
305
- });
290
+ if (bHasDelegateAndGetRepresentedProperties) {
291
+ return getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName);
292
+ }
293
+ return getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
306
294
  }
307
295
 
308
296
  /**
@@ -310,10 +298,8 @@ sap.ui.define([
310
298
  *
311
299
  * @param {sap.ui.core.Element} oInvisibleElement - Invisible Element
312
300
  * @param {object} mSomeItem - source of data enhancement process
313
- *
314
- * @private
315
301
  */
316
- function _enhanceInvisibleElement(oInvisibleElement, mSomeItem) {
302
+ function enhanceInvisibleElement(oInvisibleElement, mSomeItem) {
317
303
  oInvisibleElement.__originalLabel = mSomeItem.label;
318
304
 
319
305
  oInvisibleElement.__tooltip = mSomeItem.tooltip;
@@ -330,16 +316,16 @@ sap.ui.define([
330
316
  }
331
317
  }
332
318
 
333
- function _getRepresentedBindingPathsFromDelegateIfAvailable(mAction, sAggregationName) {
334
- var bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
319
+ function getRepresentedBindingPathsFromDelegateIfAvailable(mAction, sAggregationName) {
320
+ const bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
335
321
 
336
322
  if (bHasDelegateAndGetRepresentedProperties) {
337
- return _getRepresentedPropertiesFromDelegate(mAction, sAggregationName);
323
+ return getRepresentedPropertiesFromDelegate(mAction, sAggregationName);
338
324
  }
339
325
  }
340
326
 
341
- function _getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties) {
342
- var oRepresentedProperty;
327
+ function getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties) {
328
+ let oRepresentedProperty;
343
329
  aRepresentedProperties.some(function(oProperty) {
344
330
  if (oProperty.id === oInvisibleElement.getId()) {
345
331
  oRepresentedProperty = oProperty;
@@ -364,22 +350,20 @@ sap.ui.define([
364
350
  * @param {boolean} bHasAddViaDelegate - If AddViaDelegate action is available
365
351
  *
366
352
  * @return {boolean} - whether this field should be included
367
- *
368
- * @private
369
353
  */
370
- function _checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, bHasAddViaDelegate) {
371
- if (!_hasBindings(aBindingPaths)) {
354
+ function checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, bHasAddViaDelegate) {
355
+ if (!hasBindings(aBindingPaths)) {
372
356
  // include it if the field has no bindings (bindings can be added in runtime)
373
357
  return true;
374
358
  }
375
359
 
376
- var mModelProperty = _findModelProperty(aBindingPaths, aProperties);
360
+ const mModelProperty = findModelProperty(aBindingPaths, aProperties);
377
361
  if (mModelProperty) {
378
362
  if (mModelProperty.hideFromReveal) {
379
363
  return false;
380
364
  }
381
365
  if (bHasAddViaDelegate) {
382
- _enhanceInvisibleElement(oInvisibleElement, mModelProperty);
366
+ enhanceInvisibleElement(oInvisibleElement, mModelProperty);
383
367
  }
384
368
  return true;
385
369
  }
@@ -387,9 +371,9 @@ sap.ui.define([
387
371
  return !bHasAddViaDelegate;
388
372
  }
389
373
 
390
- function _enhanceByMetadata(oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties) {
374
+ function enhanceByMetadata(oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties) {
391
375
  const mAddViaDelegate = mActions.addViaDelegate;
392
- const sModelName = _getModelName(mAddViaDelegate);
376
+ const sModelName = getModelName(mAddViaDelegate);
393
377
  const oModel = oElement.getModel(sModelName);
394
378
  let bIncludeElement = true;
395
379
  let aBindingPaths = [];
@@ -397,9 +381,9 @@ sap.ui.define([
397
381
  const iDepth = mInvisibleElement.action.depthOfRelevantBindings;
398
382
 
399
383
  if (aRepresentedProperties) {
400
- aBindingPaths = _getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties);
384
+ aBindingPaths = getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties);
401
385
  // BCP: 1880498671
402
- } else if (_getBindingContextPath(oElement, sAggregationName, sModelName) === _getBindingContextPath(oInvisibleElement, sAggregationName, sModelName)) {
386
+ } else if (getBindingContextPath(oElement, sAggregationName, sModelName) === getBindingContextPath(oInvisibleElement, sAggregationName, sModelName)) {
403
387
  aBindingPaths = BindingsExtractor.collectBindingPaths(oInvisibleElement, oModel, null, iDepth).bindingPaths;
404
388
  } else if (mAddViaDelegate && BindingsExtractor.getBindings({
405
389
  element: oInvisibleElement,
@@ -409,20 +393,19 @@ sap.ui.define([
409
393
  }
410
394
 
411
395
  if (bIncludeElement) {
412
- oInvisibleElement.__duplicateName = _checkForDuplicateLabels(oInvisibleElement, aProperties);
413
- bIncludeElement = _checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, !!mAddViaDelegate);
396
+ oInvisibleElement.__duplicateName = checkForDuplicateLabels(oInvisibleElement, aProperties);
397
+ bIncludeElement = checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, !!mAddViaDelegate);
414
398
  }
415
399
  return bIncludeElement;
416
400
  }
417
401
 
418
- function _getModelName(mAddViaDelegate) {
402
+ function getModelName(mAddViaDelegate) {
419
403
  // ManagedObject jsdoc tells to use undefined for default model, therefore it
420
404
  // is necessary to return undefined if modelName or whole delegateInfo is missing
421
405
  return ObjectPath.get("delegateInfo.payload.modelName", mAddViaDelegate);
422
406
  }
423
407
 
424
- // API: depending on the available actions for the aggregation call one or both of these methods
425
- var oAnalyzer = {
408
+ const oAnalyzer = {
426
409
  /**
427
410
  * Filters available invisible elements whether they could be shown or not
428
411
  *
@@ -431,46 +414,39 @@ sap.ui.define([
431
414
  *
432
415
  * @return {Promise} - returns a Promise which resolves with a list of hidden controls are available to display
433
416
  */
434
- enhanceInvisibleElements(oElement, mActions) {
435
- var mRevealData = mActions.reveal;
436
- var mAddViaDelegate = mActions.addViaDelegate;
437
-
438
- var oDefaultAggregation = oElement.getMetadata().getAggregation();
439
- var sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mActions.aggregation;
440
-
441
- return Promise.all([
442
- _getAllPropertiesFromModels(oElement, sAggregationName, mActions),
443
- _getRepresentedBindingPathsFromDelegateIfAvailable(mAddViaDelegate, sAggregationName)
444
- ])
445
- .then(function(args) {
446
- var aProperties = args[0];
447
- var aRepresentedProperties = args[1];
448
- var aAllElementData = [];
449
- var aInvisibleElements = mRevealData.elements || [];
450
-
451
- aInvisibleElements.forEach(function(mInvisibleElement) {
452
- var oInvisibleElement = mInvisibleElement.element;
453
- var mRevealAction = mInvisibleElement.action;
454
-
455
- oInvisibleElement.__label = ElementUtil.getLabelForElement(oInvisibleElement, mRevealAction.getLabel);
456
-
457
- var bIncludeElement = _enhanceByMetadata(
458
- oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties
459
- );
460
-
461
- if (bIncludeElement) {
462
- aAllElementData.push({
463
- element: oInvisibleElement,
464
- action: mRevealAction,
465
- sourceAggregation: mInvisibleElement.sourceAggregation
466
- });
467
- }
468
- });
469
- return aAllElementData;
470
- })
471
- .then(function(aAllElementData) {
472
- return aAllElementData.map(_elementToAdditionalElementInfo);
417
+ async enhanceInvisibleElements(oElement, mActions) {
418
+ const mRevealData = mActions.reveal;
419
+ const mAddViaDelegate = mActions.addViaDelegate;
420
+
421
+ const oDefaultAggregation = oElement.getMetadata().getAggregation();
422
+ const sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mActions.aggregation;
423
+
424
+ const [aProperties, aRepresentedProperties] = await Promise.all([
425
+ getAllPropertiesFromModels(oElement, sAggregationName, mActions),
426
+ getRepresentedBindingPathsFromDelegateIfAvailable(mAddViaDelegate, sAggregationName)
427
+ ]);
428
+ const aAllElementData = [];
429
+ const aInvisibleElements = mRevealData.elements || [];
430
+
431
+ aInvisibleElements.forEach(function(mInvisibleElement) {
432
+ const oInvisibleElement = mInvisibleElement.element;
433
+ const mRevealAction = mInvisibleElement.action;
434
+
435
+ oInvisibleElement.__label = ElementUtil.getLabelForElement(oInvisibleElement, mRevealAction.getLabel);
436
+
437
+ const bIncludeElement = enhanceByMetadata(
438
+ oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties
439
+ );
440
+
441
+ if (bIncludeElement) {
442
+ aAllElementData.push({
443
+ element: oInvisibleElement,
444
+ action: mRevealAction,
445
+ sourceAggregation: mInvisibleElement.sourceAggregation
446
+ });
447
+ }
473
448
  });
449
+ return aAllElementData.map(elementToAdditionalElementInfo);
474
450
  },
475
451
 
476
452
  /**
@@ -481,37 +457,30 @@ sap.ui.define([
481
457
  *
482
458
  * @return {Promise} - returns a Promise which resolves with a list of available to display delegate properties
483
459
  */
484
- getUnrepresentedDelegateProperties(oElement, mAction) {
485
- var sModelName = _getModelName(mAction);
486
- var oDefaultAggregation = oElement.getMetadata().getAggregation();
487
- var sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mAction.action.aggregation;
488
- return Promise.all([
489
- _getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction),
490
- _getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName)
491
- ])
492
- .then(function(args) {
493
- var aAllProperties = args[0];
494
- var aRepresentedBindingPaths = args[1];
495
-
496
- var fnFilter = mAction.action.filter ? mAction.action.filter : function() {return true;};
497
-
498
- var aUnrepresentedProperties = _filterUnsupportedProperties(aAllProperties);
499
- aUnrepresentedProperties = aUnrepresentedProperties.filter(function(oModelProperty) {
500
- var bIsRepresented = false;
501
- if (aRepresentedBindingPaths) {
502
- bIsRepresented = aRepresentedBindingPaths.some(function(sBindingPath) {
503
- return sBindingPath === oModelProperty.bindingPath;
504
- });
505
- }
506
- return !bIsRepresented && fnFilter(mAction.relevantContainer, oModelProperty);
507
- });
460
+ async getUnrepresentedDelegateProperties(oElement, mAction) {
461
+ const sModelName = getModelName(mAction);
462
+ const oDefaultAggregation = oElement.getMetadata().getAggregation();
463
+ const sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mAction.action.aggregation;
464
+ const [aAllProperties, aRepresentedBindingPaths] = await Promise.all([
465
+ getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction),
466
+ getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName)
467
+ ]);
468
+ const fnFilter = mAction.action.filter ? mAction.action.filter : function() {return true;};
469
+
470
+ let aUnrepresentedProperties = filterUnsupportedProperties(aAllProperties);
471
+ aUnrepresentedProperties = aUnrepresentedProperties.filter(function(oModelProperty) {
472
+ let bIsRepresented = false;
473
+ if (aRepresentedBindingPaths) {
474
+ bIsRepresented = aRepresentedBindingPaths.some(function(sBindingPath) {
475
+ return sBindingPath === oModelProperty.bindingPath;
476
+ });
477
+ }
478
+ return !bIsRepresented && fnFilter(mAction.relevantContainer, oModelProperty);
479
+ });
508
480
 
509
- aUnrepresentedProperties = _checkForDuplicateProperties(aUnrepresentedProperties);
481
+ aUnrepresentedProperties = checkForDuplicateProperties(aUnrepresentedProperties);
510
482
 
511
- return aUnrepresentedProperties;
512
- }).then(function(aUnrepresentedProperties) {
513
- return aUnrepresentedProperties.map(_oPropertyToAdditionalElementInfo);
514
- });
483
+ return aUnrepresentedProperties.map(oPropertyToAdditionalElementInfo);
515
484
  }
516
485
  };
517
486
  return oAnalyzer;