@sapui5/sap.fe.core 1.102.0 → 1.103.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 (311) hide show
  1. package/package.json +5 -5
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +62 -26
  4. package/src/sap/fe/core/AppComponent.ts +56 -40
  5. package/src/sap/fe/core/AppStateHandler.js +10 -10
  6. package/src/sap/fe/core/AppStateHandler.ts +9 -9
  7. package/src/sap/fe/core/BaseController.js +11 -9
  8. package/src/sap/fe/core/BaseController.ts +15 -13
  9. package/src/sap/fe/core/CommonUtils.js +236 -109
  10. package/src/sap/fe/core/CommonUtils.ts +252 -136
  11. package/src/sap/fe/core/ExtensionAPI.js +24 -27
  12. package/src/sap/fe/core/ExtensionAPI.ts +36 -38
  13. package/src/sap/fe/core/PageController.js +4 -4
  14. package/src/sap/fe/core/PageController.ts +4 -5
  15. package/src/sap/fe/core/TemplateComponent.js +1 -1
  16. package/src/sap/fe/core/TemplateComponent.ts +6 -6
  17. package/src/sap/fe/core/TemplateModel.js +1 -1
  18. package/src/sap/fe/core/TemplateModel.ts +1 -1
  19. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
  20. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
  21. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +8 -8
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
  23. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
  24. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
  25. package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
  26. package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
  27. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
  28. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
  29. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +31 -26
  30. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
  31. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
  32. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
  33. package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
  34. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
  35. package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
  36. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
  37. package/src/sap/fe/core/controllerextensions/MassEdit.js +8 -8
  38. package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
  39. package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
  40. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
  41. package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
  42. package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
  43. package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
  44. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
  45. package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
  46. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  47. package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
  48. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  49. package/src/sap/fe/core/controllerextensions/Share.js +22 -22
  50. package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
  51. package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
  52. package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
  53. package/src/sap/fe/core/controllerextensions/ViewState.js +65 -62
  54. package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
  55. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
  56. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +6 -6
  58. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
  59. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
  60. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
  61. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
  62. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
  63. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +184 -137
  64. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
  65. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
  66. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
  67. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
  68. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
  69. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
  70. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
  71. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -44
  72. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
  73. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
  74. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
  75. package/src/sap/fe/core/controls/Any.js +9 -5
  76. package/src/sap/fe/core/controls/Any.ts +10 -4
  77. package/src/sap/fe/core/controls/CommandExecution.js +11 -25
  78. package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
  79. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  80. package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
  81. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
  82. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
  83. package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
  84. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
  85. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
  86. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
  87. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  88. package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
  89. package/src/sap/fe/core/controls/FileWrapper.js +2 -2
  90. package/src/sap/fe/core/controls/FileWrapper.ts +11 -11
  91. package/src/sap/fe/core/controls/FilterBar.js +6 -2
  92. package/src/sap/fe/core/controls/FilterBar.ts +13 -9
  93. package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
  94. package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
  95. package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
  96. package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
  97. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
  98. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
  99. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
  100. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
  101. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
  102. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +47 -47
  103. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
  104. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
  105. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
  106. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
  107. package/src/sap/fe/core/converters/ConverterContext.js +26 -33
  108. package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
  109. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  110. package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
  111. package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
  112. package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
  113. package/src/sap/fe/core/converters/MetaModelConverter.js +50 -32
  114. package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
  115. package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
  116. package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
  117. package/src/sap/fe/core/converters/annotations/DataField.js +54 -34
  118. package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
  119. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
  120. package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
  121. package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
  122. package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
  123. package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -26
  124. package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
  125. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
  126. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
  127. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
  128. package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
  129. package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
  130. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
  131. package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
  132. package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
  133. package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
  134. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
  135. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
  136. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
  137. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +64 -57
  138. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
  139. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
  140. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
  141. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
  142. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
  143. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
  144. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +73 -72
  145. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
  146. package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
  147. package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
  148. package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
  149. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
  150. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
  151. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
  152. package/src/sap/fe/core/converters/helpers/ID.js +46 -46
  153. package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
  154. package/src/sap/fe/core/converters/helpers/Key.js +7 -7
  155. package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
  156. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  157. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
  158. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
  159. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
  160. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
  161. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
  162. package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
  163. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
  164. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
  165. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
  166. package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
  167. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
  168. package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
  169. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
  170. package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
  171. package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
  172. package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
  173. package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
  174. package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
  175. package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
  176. package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
  177. package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
  178. package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
  179. package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
  180. package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
  181. package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
  182. package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
  183. package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
  184. package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
  185. package/src/sap/fe/core/helpers/ClassSupport.ts +14 -10
  186. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
  187. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
  188. package/src/sap/fe/core/helpers/EditState.js +1 -6
  189. package/src/sap/fe/core/helpers/EditState.ts +5 -10
  190. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
  191. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
  192. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  193. package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
  194. package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
  195. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
  196. package/src/sap/fe/core/helpers/MassEditHelper.js +281 -254
  197. package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
  198. package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
  199. package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
  200. package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
  201. package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
  202. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  203. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
  204. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
  205. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
  206. package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
  207. package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
  208. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  209. package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
  210. package/src/sap/fe/core/library.js +42 -3
  211. package/src/sap/fe/core/library.ts +38 -0
  212. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
  213. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
  214. package/src/sap/fe/core/messagebundle.properties +49 -35
  215. package/src/sap/fe/core/messagebundle_ar.properties +13 -5
  216. package/src/sap/fe/core/messagebundle_bg.properties +13 -5
  217. package/src/sap/fe/core/messagebundle_ca.properties +13 -5
  218. package/src/sap/fe/core/messagebundle_cs.properties +13 -5
  219. package/src/sap/fe/core/messagebundle_cy.properties +14 -6
  220. package/src/sap/fe/core/messagebundle_da.properties +13 -5
  221. package/src/sap/fe/core/messagebundle_de.properties +15 -7
  222. package/src/sap/fe/core/messagebundle_el.properties +14 -6
  223. package/src/sap/fe/core/messagebundle_en.properties +9 -1
  224. package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
  225. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
  226. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
  227. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
  228. package/src/sap/fe/core/messagebundle_es.properties +13 -5
  229. package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
  230. package/src/sap/fe/core/messagebundle_et.properties +13 -5
  231. package/src/sap/fe/core/messagebundle_fi.properties +14 -6
  232. package/src/sap/fe/core/messagebundle_fr.properties +14 -6
  233. package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
  234. package/src/sap/fe/core/messagebundle_hi.properties +14 -6
  235. package/src/sap/fe/core/messagebundle_hr.properties +14 -6
  236. package/src/sap/fe/core/messagebundle_hu.properties +13 -5
  237. package/src/sap/fe/core/messagebundle_id.properties +13 -5
  238. package/src/sap/fe/core/messagebundle_it.properties +33 -25
  239. package/src/sap/fe/core/messagebundle_iw.properties +13 -5
  240. package/src/sap/fe/core/messagebundle_ja.properties +14 -6
  241. package/src/sap/fe/core/messagebundle_kk.properties +13 -5
  242. package/src/sap/fe/core/messagebundle_ko.properties +13 -5
  243. package/src/sap/fe/core/messagebundle_lt.properties +13 -5
  244. package/src/sap/fe/core/messagebundle_lv.properties +14 -6
  245. package/src/sap/fe/core/messagebundle_ms.properties +13 -5
  246. package/src/sap/fe/core/messagebundle_nl.properties +13 -5
  247. package/src/sap/fe/core/messagebundle_no.properties +13 -5
  248. package/src/sap/fe/core/messagebundle_pl.properties +13 -5
  249. package/src/sap/fe/core/messagebundle_pt.properties +13 -5
  250. package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
  251. package/src/sap/fe/core/messagebundle_ro.properties +13 -5
  252. package/src/sap/fe/core/messagebundle_ru.properties +13 -5
  253. package/src/sap/fe/core/messagebundle_sh.properties +13 -5
  254. package/src/sap/fe/core/messagebundle_sk.properties +13 -5
  255. package/src/sap/fe/core/messagebundle_sl.properties +17 -9
  256. package/src/sap/fe/core/messagebundle_sv.properties +14 -6
  257. package/src/sap/fe/core/messagebundle_th.properties +13 -5
  258. package/src/sap/fe/core/messagebundle_tr.properties +13 -5
  259. package/src/sap/fe/core/messagebundle_uk.properties +13 -5
  260. package/src/sap/fe/core/messagebundle_vi.properties +13 -5
  261. package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
  262. package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
  263. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  264. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
  265. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
  266. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
  267. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  268. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
  269. package/src/sap/fe/core/services/NavigationServiceFactory.js +53 -44
  270. package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
  271. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  272. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
  273. package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
  274. package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
  275. package/src/sap/fe/core/services/ShellServicesFactory.js +72 -76
  276. package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -82
  277. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
  278. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
  279. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +20 -15
  280. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
  281. package/src/sap/fe/core/support/CommonHelper.js +3 -2
  282. package/src/sap/fe/core/support/CommonHelper.ts +9 -13
  283. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  284. package/src/sap/fe/core/support/Diagnostics.ts +5 -5
  285. package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
  286. package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
  287. package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
  288. package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
  289. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
  290. package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
  291. package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
  292. package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
  293. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  294. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
  295. package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
  296. package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
  297. package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
  298. package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
  299. package/src/sap/fe/core/templating/FilterHelper.js +10 -9
  300. package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
  301. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  302. package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
  303. package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
  304. package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
  305. package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
  306. package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
  307. package/src/sap/fe/core/templating/UIFormatters.js +148 -93
  308. package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
  309. package/src/sap/fe/core/type/Email.js +2 -2
  310. package/src/sap/fe/core/type/Email.ts +2 -2
  311. package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
@@ -13,7 +13,7 @@ import Fragment from "sap/ui/core/Fragment";
13
13
  import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
14
14
  import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
15
15
  import JSONModel from "sap/ui/model/json/JSONModel";
16
- import Context from "sap/ui/model/odata/v4/Context";
16
+ // import type Context from "sap/ui/model/odata/v4/Context";
17
17
 
18
18
  const Constants = FELibrary.Constants,
19
19
  InvocationGrouping = FELibrary.InvocationGrouping;
@@ -26,22 +26,22 @@ const Action = (MessageBox as any).Action;
26
26
  * @static
27
27
  * @name sap.fe.core.actions.operations.callBoundAction
28
28
  * @memberof sap.fe.core.actions.operations
29
- * @param {string} sActionName The name of the action to be called
30
- * @param {sap.ui.model.odata.v4.Context} contexts Either one context or an array with contexts for which the action is to be be called
31
- * @param {sap.ui.model.odata.v4.Model} oModel OData Model
32
- * @param {object} oAppComponent The AppComponent
33
- * @param {map} [mParameters] Optional, can contain the following attributes:
34
- * @param {map} [mParameters.actionParameters] A map of parameters to be sent for every action call
35
- * @param {map} [mParameters.mBindingParameters] A map of binding parameters that would be part of $select and $expand coming from side effects for bound actions
36
- * @param {Array} [mParameters.additionalSideEffect] Array of property paths to be requested in addition to actual target properties of the side effect
37
- * @param {boolean} [mParameters.showActionParameterDialog] If set and if parameters exist the user retrieves a dialog to fill in parameters, if actionParameters are passed they are shown to the user
38
- * @param {string} [mParameters.label] A human-readable label for the action
39
- * @param {string} [mParameters.invocationGrouping] Mode how actions are to be called: Changeset to put all action calls into one changeset, Isolated to put them into separate changesets, defaults to Isolated
40
- * @param {Function} [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
41
- * @param {map} [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
42
- * @param {sap.ui.core.Element} [mParameters.parentControl] If specified the dialogs are added as dependent of the parent control
43
- * @param {boolean} [mParameters.bGetBoundContext] If specified the action promise returns the bound context
44
- * @returns {Promise} Promise resolves with an array of response objects (TODO: to be changed)
29
+ * @param sActionName The name of the action to be called
30
+ * @param contexts Either one context or an array with contexts for which the action is to be be called
31
+ * @param oModel OData Model
32
+ * @param oAppComponent The AppComponent
33
+ * @param [mParameters] Optional, can contain the following attributes:
34
+ * @param [mParameters.actionParameters] A map of parameters to be sent for every action call
35
+ * @param [mParameters.mBindingParameters] A map of binding parameters that would be part of $select and $expand coming from side effects for bound actions
36
+ * @param [mParameters.additionalSideEffect] Array of property paths to be requested in addition to actual target properties of the side effect
37
+ * @param [mParameters.showActionParameterDialog] If set and if parameters exist the user retrieves a dialog to fill in parameters, if actionParameters are passed they are shown to the user
38
+ * @param [mParameters.label] A human-readable label for the action
39
+ * @param [mParameters.invocationGrouping] Mode how actions are to be called: Changeset to put all action calls into one changeset, Isolated to put them into separate changesets, defaults to Isolated
40
+ * @param [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
41
+ * @param [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
42
+ * @param [mParameters.parentControl] If specified the dialogs are added as dependent of the parent control
43
+ * @param [mParameters.bGetBoundContext] If specified the action promise returns the bound context
44
+ * @returns Promise resolves with an array of response objects (TODO: to be changed)
45
45
  * @private
46
46
  * @ui5-restricted
47
47
  */
@@ -58,8 +58,8 @@ function callBoundAction(sActionName: string, contexts: any, oModel: any, oAppCo
58
58
  contexts = [contexts];
59
59
  }
60
60
  const oMetaModel = oModel.getMetaModel(),
61
- sActionPath = oMetaModel.getMetaPath(contexts[0].getPath()) + "/" + sActionName,
62
- oBoundAction = oMetaModel.createBindingContext(sActionPath + "/@$ui5.overload/0");
61
+ sActionPath = `${oMetaModel.getMetaPath(contexts[0].getPath())}/${sActionName}`,
62
+ oBoundAction = oMetaModel.createBindingContext(`${sActionPath}/@$ui5.overload/0`);
63
63
  mParameters.aContexts = contexts;
64
64
  mParameters.isCriticalAction = getIsActionCritical(oMetaModel, sActionPath, contexts, oBoundAction);
65
65
  return callAction(sActionName, oModel, oBoundAction, oAppComponent, mParameters);
@@ -71,16 +71,16 @@ function callBoundAction(sActionName: string, contexts: any, oModel: any, oAppCo
71
71
  * @static
72
72
  * @name sap.fe.core.actions.operations.callActionImport
73
73
  * @memberof sap.fe.core.actions.operations
74
- * @param {string} sActionName The name of the action import to be called
75
- * @param {sap.ui.model.odata.v4.ODataModel} oModel An instance of an OData v4 model
76
- * @param {object} oAppComponent The AppComponent
77
- * @param {map} [mParameters] Optional, can contain the following attributes:
78
- * @param {map} [mParameters.actionParameters] A map of parameters to be sent with the action import
79
- * @param {string} [mParameters.label] A human-readable label for the action
80
- * @param {boolean} [mParameters.showActionParameterDialog] If set and if parameters exist the user retrieves a dialog to fill in parameters, if actionParameters are passed they are shown to the user
81
- * @param {Function} [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
82
- * @param {map} [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
83
- * @returns {Promise} Promise resolves with an array of response objects (TODO: to be changed)
74
+ * @param sActionName The name of the action import to be called
75
+ * @param oModel An instance of an OData v4 model
76
+ * @param oAppComponent The AppComponent
77
+ * @param [mParameters] Optional, can contain the following attributes:
78
+ * @param [mParameters.actionParameters] A map of parameters to be sent with the action import
79
+ * @param [mParameters.label] A human-readable label for the action
80
+ * @param [mParameters.showActionParameterDialog] If set and if parameters exist the user retrieves a dialog to fill in parameters, if actionParameters are passed they are shown to the user
81
+ * @param [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
82
+ * @param [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
83
+ * @returns Promise resolves with an array of response objects (TODO: to be changed)
84
84
  * @private
85
85
  * @ui5-restricted
86
86
  */
@@ -89,9 +89,9 @@ function callActionImport(sActionName: string, oModel: any, oAppComponent: objec
89
89
  return Promise.reject("Action expects a model/context for execution");
90
90
  }
91
91
  const oMetaModel = oModel.getMetaModel(),
92
- sActionPath = oModel.bindContext("/" + sActionName).getPath(),
93
- oActionImport = oMetaModel.createBindingContext("/" + oMetaModel.createBindingContext(sActionPath).getObject("$Action") + "/0");
94
- mParameters.isCriticalAction = getIsActionCritical(oMetaModel, sActionPath + "/@$ui5.overload");
92
+ sActionPath = oModel.bindContext(`/${sActionName}`).getPath(),
93
+ oActionImport = oMetaModel.createBindingContext(`/${oMetaModel.createBindingContext(sActionPath).getObject("$Action")}/0`);
94
+ mParameters.isCriticalAction = getIsActionCritical(oMetaModel, `${sActionPath}/@$ui5.overload`);
95
95
  return callAction(sActionName, oModel, oActionImport, oAppComponent, mParameters);
96
96
  }
97
97
  function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
@@ -99,7 +99,7 @@ function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
99
99
  return Promise.reject("Bound functions always requires a context");
100
100
  }
101
101
  const oMetaModel = oModel.getMetaModel(),
102
- sFunctionPath = oMetaModel.getMetaPath(context.getPath()) + "/" + sFunctionName,
102
+ sFunctionPath = `${oMetaModel.getMetaPath(context.getPath())}/${sFunctionName}`,
103
103
  oBoundFunction = oMetaModel.createBindingContext(sFunctionPath);
104
104
  return _executeFunction(sFunctionName, oModel, oBoundFunction, context);
105
105
  }
@@ -110,9 +110,9 @@ function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
110
110
  * @static
111
111
  * @name sap.fe.core.actions.operations.callFunctionImport
112
112
  * @memberof sap.fe.core.actions.operations
113
- * @param {string} sFunctionName The name of the function to be called
114
- * @param {sap.ui.model.odata.v4.ODataModel} oModel An instance of an OData v4 model
115
- * @returns {Promise} Promise resolves
113
+ * @param sFunctionName The name of the function to be called
114
+ * @param oModel An instance of an OData v4 model
115
+ * @returns Promise resolves
116
116
  * @private
117
117
  */
118
118
  function callFunctionImport(sFunctionName: string, oModel: any) {
@@ -120,22 +120,20 @@ function callFunctionImport(sFunctionName: string, oModel: any) {
120
120
  return Promise.resolve();
121
121
  }
122
122
  const oMetaModel = oModel.getMetaModel(),
123
- sFunctionPath = oModel.bindContext("/" + sFunctionName).getPath(),
124
- oFunctionImport = oMetaModel.createBindingContext(
125
- "/" + oMetaModel.createBindingContext(sFunctionPath).getObject("$Function") + "/0"
126
- );
123
+ sFunctionPath = oModel.bindContext(`/${sFunctionName}`).getPath(),
124
+ oFunctionImport = oMetaModel.createBindingContext(`/${oMetaModel.createBindingContext(sFunctionPath).getObject("$Function")}/0`);
127
125
  return _executeFunction(sFunctionName, oModel, oFunctionImport);
128
126
  }
129
127
  function _executeFunction(sFunctionName: any, oModel: any, oFunction: any, context?: any) {
130
128
  let sGroupId;
131
129
  if (!oFunction || !oFunction.getObject()) {
132
- return Promise.reject(new Error("Function " + sFunctionName + " not found"));
130
+ return Promise.reject(new Error(`Function ${sFunctionName} not found`));
133
131
  }
134
132
  if (context) {
135
- oFunction = oModel.bindContext(sFunctionName + "(...)", context);
133
+ oFunction = oModel.bindContext(`${sFunctionName}(...)`, context);
136
134
  sGroupId = "functionGroup";
137
135
  } else {
138
- oFunction = oModel.bindContext("/" + sFunctionName + "(...)");
136
+ oFunction = oModel.bindContext(`/${sFunctionName}(...)`);
139
137
  sGroupId = "functionImport";
140
138
  }
141
139
  const oFunctionPromise = oFunction.execute(sGroupId);
@@ -161,16 +159,15 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
161
159
  let iMessageSideEffect;
162
160
  let bIsSameEntity;
163
161
  let oReturnType;
164
- let bStaticAction;
162
+ const actionDefinition = oAction.getObject();
165
163
  if (!oAction || !oAction.getObject()) {
166
- return reject(new Error("Action " + sActionName + " not found"));
167
- }
168
- if (bShowActionParameterDialog || aActionParameters.length > 0) {
169
- aActionParameters = prepareActionParameters(oAction, aActionParameters);
170
- if (!aActionParameters || aActionParameters.length === 0) {
171
- bShowActionParameterDialog = false;
172
- }
164
+ return reject(new Error(`Action ${sActionName} not found`));
173
165
  }
166
+
167
+ aActionParameters = getActionParameters(oAction);
168
+
169
+ bShowActionParameterDialog = _showActionParameterDialog(bShowActionParameterDialog, aActionParameters);
170
+
174
171
  if (bShowActionParameterDialog) {
175
172
  fnDialog = showActionParameterDialog;
176
173
  } else if (bIsCriticalAction) {
@@ -190,7 +187,7 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
190
187
  if (mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions) {
191
188
  oMetaModel = oModel.getMetaModel();
192
189
  sMetaPath = oMetaModel.getMetaPath(aContexts[0].getPath());
193
- sMessagesPath = oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
190
+ sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
194
191
 
195
192
  if (sMessagesPath) {
196
193
  iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function (exp: any) {
@@ -209,13 +206,18 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
209
206
  mParameters.mBindingParameters = mParameters.mBindingParameters || {};
210
207
 
211
208
  if (
212
- oAction.getObject("$ReturnType/$Type/" + sMessagesPath) &&
209
+ oAction.getObject(`$ReturnType/$Type/${sMessagesPath}`) &&
213
210
  (!mParameters.mBindingParameters.$select ||
214
211
  mParameters.mBindingParameters.$select.split(",").indexOf(sMessagesPath) === -1)
215
212
  ) {
216
213
  mParameters.mBindingParameters.$select = mParameters.mBindingParameters.$select
217
- ? mParameters.mBindingParameters.$select + "," + sMessagesPath
214
+ ? `${mParameters.mBindingParameters.$select},${sMessagesPath}`
218
215
  : sMessagesPath;
216
+ // Add side effects at entity level because $select stops these being returned by the action
217
+ // Only if no other side effects were added for Messages
218
+ if (iMessageSideEffect === -1) {
219
+ mParameters.additionalSideEffect.pathExpressions.push("*");
220
+ }
219
221
 
220
222
  if (mParameters.additionalSideEffect.triggerActions.length === 0 && iMessageSideEffect > -1) {
221
223
  // no trigger action therefore no need to request messages again
@@ -264,13 +266,18 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
264
266
  mActionExecutionParameters.internalModelContext &&
265
267
  mActionExecutionParameters.operationAvailableMap &&
266
268
  mActionExecutionParameters.aContexts &&
267
- mActionExecutionParameters.aContexts.length
269
+ mActionExecutionParameters.aContexts.length &&
270
+ actionDefinition.$IsBound
268
271
  ) {
269
- const selectedContext = mActionExecutionParameters.aContexts.filter((oContext: Context) => {
270
- const binding = oContext.getBinding();
271
- return !binding.isA("sap.ui.model.odata.v4.ODataListBinding");
272
+ //check for skipping static actions
273
+ const isStatic = (actionDefinition.$Parameter || []).some((aParameter: any) => {
274
+ return (
275
+ actionDefinition.$EntitySetPath &&
276
+ actionDefinition.$EntitySetPath === aParameter.$Name &&
277
+ aParameter.$isCollection
278
+ );
272
279
  });
273
- if (selectedContext && selectedContext.length) {
280
+ if (!isStatic) {
274
281
  CommonUtils.setActionEnablement(
275
282
  mActionExecutionParameters.internalModelContext,
276
283
  JSON.parse(mActionExecutionParameters.operationAvailableMap),
@@ -300,7 +307,7 @@ function confirmCriticalAction(
300
307
  let boundActionName = sActionName ? sActionName : null;
301
308
  boundActionName =
302
309
  boundActionName.indexOf(".") >= 0 ? boundActionName.split(".")[boundActionName.split(".").length - 1] : boundActionName;
303
- const suffixResourceKey = boundActionName && entitySetName ? entitySetName + "|" + boundActionName : "";
310
+ const suffixResourceKey = boundActionName && entitySetName ? `${entitySetName}|${boundActionName}` : "";
304
311
  const oResourceBundle = oParentControl.getController().oResourceBundle;
305
312
  const sConfirmationText = CommonUtils.getTranslatedText(
306
313
  "C_OPERATIONS_ACTION_CONFIRM_MESSAGE",
@@ -382,34 +389,33 @@ function showActionParameterDialog(
382
389
  return aResults;
383
390
  });
384
391
  };
385
- const _validateMessages = function (aActionParameters: any, aFieldInvalid: any, bClearTarget?: boolean) {
392
+ const _validateMessages = function (actionParameters: any, invalidFields: any, bClearTarget?: boolean) {
386
393
  const oMessageManager = Core.getMessageManager();
387
394
  const aMessages = oMessageManager.getMessageModel().getData();
388
395
 
389
- aFieldInvalid = aFieldInvalid || [];
396
+ invalidFields = invalidFields || [];
390
397
 
391
398
  if (!aMessages.length) {
392
- aFieldInvalid = [];
399
+ invalidFields = [];
393
400
  }
394
- aActionParameters.forEach(function (oActionParameters: any) {
401
+ actionParameters.forEach(function (oActionParameters: any) {
395
402
  const sParameter = oActionParameters.$Name;
396
403
  aMessages.forEach(function (oMessage: any) {
397
404
  const sParam = sParameter.replace("-inner", "");
398
405
  if (
399
406
  oMessage.controlIds.length > 0 &&
400
- (oMessage.getControlId().includes("APD_::" + sParameter) ||
401
- (oMessage.getControlId().includes("APD_::" + sParameter + "inner") &&
402
- aFieldInvalid.indexOf("APD_::" + sParam) < 0))
407
+ (oMessage.getControlId().includes(`APD_::${sParameter}`) ||
408
+ (oMessage.getControlId().includes(`APD_::${sParameter}inner`) && invalidFields.indexOf(`APD_::${sParam}`) < 0))
403
409
  ) {
404
410
  if (bClearTarget) {
405
411
  oMessageManager.removeMessages(oMessage);
406
412
  } else {
407
- aFieldInvalid.push("APD_::" + sParam);
413
+ invalidFields.push(`APD_::${sParam}`);
408
414
  }
409
415
  }
410
416
  // Handle messages related to input with invalid token
411
- if (oMessage.target.includes("APD_::" + sParameter)) {
412
- aFieldInvalid.push("APD_::" + sParam);
417
+ if (oMessage.target.includes(`APD_::${sParameter}`)) {
418
+ invalidFields.push(`APD_::${sParam}`);
413
419
  oMessage.target = bClearTarget ? "" : oMessage.target;
414
420
  if (bClearTarget) {
415
421
  oMessageManager.removeMessages(oMessage);
@@ -417,7 +423,7 @@ function showActionParameterDialog(
417
423
  }
418
424
  });
419
425
  });
420
- return aFieldInvalid;
426
+ return invalidFields;
421
427
  };
422
428
  const oController = {
423
429
  handleChange: function (oEvent: any) {
@@ -453,14 +459,14 @@ function showActionParameterDialog(
453
459
  }
454
460
  )
455
461
  )
456
- .then(function (oFragment: any) {
462
+ .then(function (createdFragment: any) {
457
463
  // TODO: move the dialog into the fragment and move the handlers to the oController
458
464
  let aContexts: any[];
459
465
  const aFunctionParams: any[] = [];
460
466
  let oOperationBinding: any;
461
467
  return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function () {
462
468
  // TODO: move the dialog into the fragment and move the handlers to the oController
463
- return Fragment.load({ definition: oFragment, controller: oController }).then(function (oDialogContent: any) {
469
+ return Fragment.load({ definition: createdFragment, controller: oController }).then(function (oDialogContent: any) {
464
470
  const oResourceBundle = oParentControl.getController().oResourceBundle;
465
471
  const oDialog = new Dialog(undefined, {
466
472
  title:
@@ -519,7 +525,7 @@ function showActionParameterDialog(
519
525
  if (aActionParameters[i].$isCollection) {
520
526
  const aMVFContent = oDialog
521
527
  .getModel("mvfview")
522
- .getProperty("/" + aActionParameters[i].$Name),
528
+ .getProperty(`/${aActionParameters[i].$Name}`),
523
529
  aKeyValues = [];
524
530
  for (const j in aMVFContent) {
525
531
  aKeyValues.push(aMVFContent[j].Key);
@@ -545,17 +551,33 @@ function showActionParameterDialog(
545
551
  !(!mParameters.control.isA("sap.ui.mdc.Table") && aContexts.length === 1) &&
546
552
  messages.length
547
553
  ) {
548
- oDialog.close();
554
+ let errorTargetsInAPD = false;
555
+
556
+ messages.forEach(function (message: any) {
557
+ if (
558
+ message.getTarget().indexOf(mParameters.actionName) !== -1 &&
559
+ message
560
+ .getTarget()
561
+ .indexOf(mParameters.aActionParameters[0].$Name) !== -1 &&
562
+ errorTargetsInAPD === false
563
+ ) {
564
+ errorTargetsInAPD = true;
565
+ }
566
+ });
567
+ if (!errorTargetsInAPD) {
568
+ oDialog.close();
569
+ oDialog.destroy();
570
+ }
549
571
  }
550
572
  throw oError;
551
573
  });
552
574
  })
553
575
  .catch(function () {
554
576
  const oMessageManager = Core.getMessageManager();
555
- let messages = oMessageManager.getMessageModel().getData();
577
+ const messages = oMessageManager.getMessageModel().getData();
556
578
  const subtitleColumn = CommonUtils.getMessageColumn(mParameters.control);
557
- let errorContext = undefined;
558
- let errorTargetsInAPM = false;
579
+ let errorContext;
580
+ let errorTargetsInAPD = false;
559
581
  messages.forEach(function (message: any) {
560
582
  const messageTargets = message.getTargets();
561
583
  if (messageTargets && messageTargets.length === 1 && messageTargets[0].length) {
@@ -566,19 +588,43 @@ function showActionParameterDialog(
566
588
  ? errorContext.getObject()[subtitleColumn]
567
589
  : undefined;
568
590
  }
569
-
570
591
  if (
571
592
  message.getTarget().indexOf(mParameters.actionName) !== -1 &&
572
593
  message.getTarget().indexOf(mParameters.aActionParameters[0].$Name) !== -1 &&
573
- errorTargetsInAPM === false
594
+ errorTargetsInAPD === false
574
595
  ) {
575
- errorTargetsInAPM = true;
596
+ errorTargetsInAPD = true;
576
597
  }
577
598
  });
599
+ if (oDialog.isOpen()) {
600
+ if (!mParameters.bGrouped) {
601
+ //isolated
602
+ if (aContexts.length > 1 || !errorTargetsInAPD) {
603
+ // does not matter if error is in APD or not, if there are multiple contexts selected or if the error is not the APD, we close it.
604
+ oDialog.close();
605
+ oDialog.destroy();
606
+ }
607
+ } else if (mParameters.bGrouped && !errorTargetsInAPD) {
608
+ //changeset
609
+ oDialog.close();
610
+ oDialog.destroy();
611
+ }
612
+ }
613
+
614
+ const showErrorInAPD = oDialog.isOpen() && errorTargetsInAPD;
615
+ let bShowMessageBox = false;
616
+ if (
617
+ messages.length === 1 &&
618
+ messages[0].getTarget() !== undefined &&
619
+ messages[0].getTarget() !== ""
620
+ ) {
621
+ bShowMessageBox = true;
622
+ }
578
623
 
579
624
  const bHasEtagMessage = messageHandling.modifyETagMessagesOnly(
580
625
  oMessageManager,
581
- oResourceBundle
626
+ oResourceBundle,
627
+ undefined
582
628
  );
583
629
 
584
630
  messageHandler.showMessages({
@@ -588,7 +634,8 @@ function showActionParameterDialog(
588
634
  messagePageNavigationCallback: function () {
589
635
  oDialog.close();
590
636
  },
591
- errorTargetsInAPM: errorTargetsInAPM
637
+ showErrorInAPD: showErrorInAPD,
638
+ bShowMessageBox: bShowMessageBox
592
639
  });
593
640
  if (oDialog && bHasEtagMessage && oDialog.isOpen()) {
594
641
  oDialog.close(); //close the action parameter dialog after refresh of the context after etag mismatch
@@ -621,14 +668,15 @@ function showActionParameterDialog(
621
668
  const oMetaModel = oDialog.getModel().getMetaModel(),
622
669
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
623
670
  sDefaultValuesFunction = oMetaModel.getObject(
624
- sActionPath + "@com.sap.vocabularies.Common.v1.DefaultValuesFunction"
671
+ `${sActionPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
625
672
  );
626
673
  return sDefaultValuesFunction;
627
674
  };
628
675
  const fnSetDefaultsAndOpenDialog = function (sBindingParameter?: any) {
629
676
  const sBoundFunctionName = getDefaultValuesFunction();
630
677
  const prefillParameter = function (sParamName: any, vParamDefaultValue: any) {
631
- return new Promise((resolve) => {
678
+ // eslint-disable-next-line promise/param-names
679
+ return new Promise((inResolve) => {
632
680
  // Case 1: There is a ParameterDefaultValue annotation
633
681
  if (vParamDefaultValue !== undefined) {
634
682
  if (aContexts.length > 0 && vParamDefaultValue.$Path) {
@@ -649,13 +697,13 @@ function showActionParameterDialog(
649
697
  if (aContexts.length > 1) {
650
698
  // For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
651
699
  let sPathForContext = vParamDefaultValue.$Path;
652
- if (sPathForContext.indexOf(sBindingParameter + "/") === 0) {
653
- sPathForContext = sPathForContext.replace(sBindingParameter + "/", "");
700
+ if (sPathForContext.indexOf(`${sBindingParameter}/`) === 0) {
701
+ sPathForContext = sPathForContext.replace(`${sBindingParameter}/`, "");
654
702
  }
655
703
  for (let i = 1; i < aContexts.length; i++) {
656
704
  if (aContexts[i].getProperty(sPathForContext) !== vParamValue) {
657
705
  // if the values from the contexts are not all the same, do not prefill
658
- resolve({
706
+ inResolve({
659
707
  paramName: sParamName,
660
708
  value: undefined,
661
709
  bNoPossibleValue: true
@@ -663,7 +711,7 @@ function showActionParameterDialog(
663
711
  }
664
712
  }
665
713
  }
666
- resolve({ paramName: sParamName, value: vParamValue });
714
+ inResolve({ paramName: sParamName, value: vParamValue });
667
715
  })
668
716
  .catch(function () {
669
717
  // Simply clear parameter default if an error has occurred
@@ -672,7 +720,7 @@ function showActionParameterDialog(
672
720
  sParamName,
673
721
  mParameters.actionName
674
722
  );
675
- resolve({
723
+ inResolve({
676
724
  paramName: sParamName,
677
725
  value: undefined,
678
726
  bLatePropertyError: true
@@ -680,18 +728,17 @@ function showActionParameterDialog(
680
728
  });
681
729
  } else {
682
730
  // Case 1.2: ParameterDefaultValue defines a fixed string value (i.e. vParamDefaultValue = 'someString')
683
- resolve({ paramName: sParamName, value: vParamDefaultValue });
731
+ inResolve({ paramName: sParamName, value: vParamDefaultValue });
684
732
  }
685
- } else {
733
+ } else if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
686
734
  // Case 2: There is no ParameterDefaultValue annotation (=> look into the FLP User Defaults)
687
- if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
688
- resolve({
689
- paramName: sParamName,
690
- value: (oParameterModel as any).oData[sParamName]
691
- });
692
- } else {
693
- resolve({ paramName: sParamName, value: undefined });
694
- }
735
+
736
+ inResolve({
737
+ paramName: sParamName,
738
+ value: (oParameterModel as any).oData[sParamName]
739
+ });
740
+ } else {
741
+ inResolve({ paramName: sParamName, value: undefined });
695
742
  }
696
743
  });
697
744
  };
@@ -699,7 +746,7 @@ function showActionParameterDialog(
699
746
  const getParameterDefaultValue = function (sParamName: any) {
700
747
  const oMetaModel = oDialog.getModel().getMetaModel(),
701
748
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
702
- sActionParameterAnnotationTarget = sActionPath + "/" + sParamName + "@",
749
+ sActionParameterAnnotationTarget = `${sActionPath}/${sParamName}@`,
703
750
  oParameterAnnotations = oMetaModel.getObject(sActionParameterAnnotationTarget),
704
751
  oParameterDefaultValue =
705
752
  oParameterAnnotations &&
@@ -746,8 +793,8 @@ function showActionParameterDialog(
746
793
 
747
794
  Promise.all([aPrefillParamPromises, aExecFunctionPromises, oExecFunctionFromManifestPromise])
748
795
  .then(function (aPromises: [any[], any[], any]) {
749
- const aCurrentParamDefaultValue: any = aPromises[0];
750
- const aFunctionParams = aPromises[1];
796
+ const currentParamDefaultValue: any = aPromises[0];
797
+ const functionParams = aPromises[1];
751
798
  const oFunctionParamsFromManifest = aPromises[2];
752
799
  let sDialogParamName;
753
800
  for (const i in aActionParameters) {
@@ -760,25 +807,22 @@ function showActionParameterDialog(
760
807
  aActionParameters[i].$Name,
761
808
  oFunctionParamsFromManifest[sDialogParamName]
762
809
  );
763
- } else if (
764
- aCurrentParamDefaultValue[i] &&
765
- aCurrentParamDefaultValue[i].value !== undefined
766
- ) {
810
+ } else if (currentParamDefaultValue[i] && currentParamDefaultValue[i].value !== undefined) {
767
811
  oOperationBinding.setParameter(
768
812
  aActionParameters[i].$Name,
769
- aCurrentParamDefaultValue[i].value
813
+ currentParamDefaultValue[i].value
770
814
  );
771
815
  // if the default value had not been previously determined due to different contexts, we do nothing else
772
- } else if (sBoundFunctionName && !aCurrentParamDefaultValue[i].bNoPossibleValue) {
816
+ } else if (sBoundFunctionName && !currentParamDefaultValue[i].bNoPossibleValue) {
773
817
  if (aContexts.length > 1) {
774
818
  // we check if the function retrieves the same param value for all the contexts:
775
819
  let j = 0;
776
820
  while (j < aContexts.length - 1) {
777
821
  if (
778
- aFunctionParams[j] &&
779
- aFunctionParams[j + 1] &&
780
- aFunctionParams[j].getObject(sDialogParamName) ===
781
- aFunctionParams[j + 1].getObject(sDialogParamName)
822
+ functionParams[j] &&
823
+ functionParams[j + 1] &&
824
+ functionParams[j].getObject(sDialogParamName) ===
825
+ functionParams[j + 1].getObject(sDialogParamName)
782
826
  ) {
783
827
  j++;
784
828
  } else {
@@ -789,22 +833,20 @@ function showActionParameterDialog(
789
833
  if (j === aContexts.length - 1) {
790
834
  oOperationBinding.setParameter(
791
835
  aActionParameters[i].$Name,
792
- aFunctionParams[j].getObject(sDialogParamName)
836
+ functionParams[j].getObject(sDialogParamName)
793
837
  );
794
838
  }
795
- } else {
839
+ } else if (functionParams[0] && functionParams[0].getObject(sDialogParamName)) {
796
840
  //Only one context, then the default param values are to be verified from the function:
797
841
 
798
- if (aFunctionParams[0] && aFunctionParams[0].getObject(sDialogParamName)) {
799
- oOperationBinding.setParameter(
800
- aActionParameters[i].$Name,
801
- aFunctionParams[0].getObject(sDialogParamName)
802
- );
803
- }
842
+ oOperationBinding.setParameter(
843
+ aActionParameters[i].$Name,
844
+ functionParams[0].getObject(sDialogParamName)
845
+ );
804
846
  }
805
847
  }
806
848
  }
807
- const bErrorFound = aCurrentParamDefaultValue.some(function (oValue: any) {
849
+ const bErrorFound = currentParamDefaultValue.some(function (oValue: any) {
808
850
  if (oValue.bLatePropertyError) {
809
851
  return oValue.bLatePropertyError;
810
852
  }
@@ -818,7 +860,9 @@ function showActionParameterDialog(
818
860
  MessageBox.warning(sText, { contentWidth: "25em" } as any);
819
861
  }
820
862
  })
821
- .catch();
863
+ .catch(function (oError: any) {
864
+ Log.error("Error while retrieving the parameter", oError);
865
+ });
822
866
  };
823
867
 
824
868
  if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
@@ -857,10 +901,10 @@ function showActionParameterDialog(
857
901
  const oMVFModel = new JSONModel({});
858
902
  oDialog.setModel(oMVFModel, "mvfview");
859
903
 
860
- let sActionPath = sActionName + "(...)";
904
+ let sActionPath = `${sActionName}(...)`;
861
905
  aContexts = mParameters.aContexts || [];
862
906
  if (!aContexts.length) {
863
- sActionPath = "/" + sActionPath;
907
+ sActionPath = `/${sActionPath}`;
864
908
  }
865
909
  oDialog.bindElement({
866
910
  path: sActionPath
@@ -880,17 +924,6 @@ function showActionParameterDialog(
880
924
  .catch(reject);
881
925
  });
882
926
  }
883
- function prepareActionParameters(oAction: any, aPredefinedParameters: any) {
884
- // check if parameters exist at all
885
- const aParameters = getActionParameters(oAction);
886
- aPredefinedParameters = aPredefinedParameters || [];
887
-
888
- if (aPredefinedParameters.length > 0) {
889
- // TODO: merge the predefined once with the real existing one
890
- }
891
-
892
- return aParameters;
893
- }
894
927
  function getActionParameters(oAction: any) {
895
928
  const aParameters = oAction.getObject("$Parameter") || [];
896
929
  if (aParameters && aParameters.length) {
@@ -902,7 +935,7 @@ function getActionParameters(oAction: any) {
902
935
  return aParameters;
903
936
  }
904
937
  function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBoundAction?: any) {
905
- const vActionCritical = oMetaModel.getObject(sPath + "@com.sap.vocabularies.Common.v1.IsActionCritical");
938
+ const vActionCritical = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.IsActionCritical`);
906
939
  let sCriticalPath = vActionCritical && vActionCritical.$Path;
907
940
  if (!sCriticalPath) {
908
941
  // the static value scenario for isActionCritical
@@ -929,8 +962,22 @@ function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBound
929
962
  }
930
963
 
931
964
  function executeDependingOnSelectedContexts(oAction: any, mParameters: any, bGetBoundContext: boolean, sGroupId: string) {
932
- let oActionPromise;
933
- if (mParameters.internalModelContext && mParameters.internalModelContext.getObject().numberOfSelectedContexts > 1) {
965
+ let oActionPromise,
966
+ bEnableStrictHandling = true;
967
+ if (bGetBoundContext) {
968
+ const sPath = oAction.getBoundContext().getPath();
969
+ const sMetaPath = oAction.getModel().getMetaModel().getMetaPath(sPath);
970
+ const oProperty = oAction.getModel().getMetaModel().getObject(sMetaPath);
971
+ if (oProperty && oProperty[0]?.$kind !== "Action") {
972
+ //do not enable the strict handling if its not an action
973
+ bEnableStrictHandling = false;
974
+ }
975
+ }
976
+
977
+ if (
978
+ (mParameters.internalModelContext && mParameters.internalModelContext.getObject().numberOfSelectedContexts > 1) ||
979
+ !bEnableStrictHandling
980
+ ) {
934
981
  oActionPromise = bGetBoundContext
935
982
  ? oAction.execute(sGroupId).then(function () {
936
983
  return oAction.getBoundContext();
@@ -1023,11 +1070,11 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1023
1070
  let oActionPromise;
1024
1071
  let i;
1025
1072
  let sGroupId: string;
1026
- const fnExecuteAction = function (oAction: any, index: any, oSideEffect: any) {
1073
+ const fnExecuteAction = function (actionContext: any, index: any, oSideEffect: any) {
1027
1074
  setActionParameterDefaultValue();
1028
1075
  // For invocation grouping "isolated" need batch group per action call
1029
- sGroupId = !bGrouped ? "$auto." + index : oAction.getUpdateGroupId();
1030
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1076
+ sGroupId = !bGrouped ? `$auto.${index}` : actionContext.getUpdateGroupId();
1077
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
1031
1078
  aActionPromises.push(oActionPromise);
1032
1079
  const oSideEffectsService = oAppComponent.getSideEffectsService();
1033
1080
  // trigger actions from side effects
@@ -1057,14 +1104,15 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1057
1104
  });
1058
1105
  }
1059
1106
  };
1060
- const fnExecuteSingleAction = function (oAction: any, index: any, oSideEffect: any) {
1061
- const oPromise = new Promise<void>((resolve) => {
1107
+ const fnExecuteSingleAction = function (actionContext: any, index: any, oSideEffect: any) {
1108
+ // eslint-disable-next-line promise/param-names
1109
+ return new Promise<void>((actionResolve) => {
1062
1110
  let oLocalPromise;
1063
1111
  const aLocalPromise = [];
1064
1112
  setActionParameterDefaultValue();
1065
1113
  // For invocation grouping "isolated" need batch group per action call
1066
- sGroupId = "apiMode" + index;
1067
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1114
+ sGroupId = `apiMode${index}`;
1115
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
1068
1116
  aActionPromises.push(oActionPromise);
1069
1117
  aLocalPromise.push(oActionPromise);
1070
1118
  const oSideEffectsService = oAppComponent.getSideEffectsService();
@@ -1099,16 +1147,15 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1099
1147
  oModel.submitBatch(sGroupId);
1100
1148
  Promise.all(aLocalPromise)
1101
1149
  .then(function () {
1102
- return resolve();
1150
+ return actionResolve();
1103
1151
  })
1104
1152
  .catch(function () {
1105
- return resolve();
1153
+ return actionResolve();
1106
1154
  });
1107
1155
  });
1108
- return oPromise;
1109
1156
  };
1110
1157
 
1111
- function fnExecuteSequentially(aContexts: any) {
1158
+ function fnExecuteSequentially(contextsToExecute: any) {
1112
1159
  // One action and its side effects are completed before the next action is executed
1113
1160
  (
1114
1161
  fnOnSubmitted ||
@@ -1116,9 +1163,9 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1116
1163
  /**/
1117
1164
  }
1118
1165
  )(aActionPromises);
1119
- function processOneAction(context: any, i: any) {
1120
- oAction = oModel.bindContext(sActionName + "(...)", context, mBindingParameters);
1121
- return fnExecuteSingleAction(oAction, i, {
1166
+ function processOneAction(context: any, actionIndex: any) {
1167
+ oAction = oModel.bindContext(`${sActionName}(...)`, context, mBindingParameters);
1168
+ return fnExecuteSingleAction(oAction, actionIndex, {
1122
1169
  context: context,
1123
1170
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
1124
1171
  triggerActions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.triggerActions
@@ -1127,7 +1174,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1127
1174
 
1128
1175
  let oActionAndSideEffectPromise = Promise.resolve();
1129
1176
  let j = 0;
1130
- aContexts.forEach(function (context: any) {
1177
+ contextsToExecute.forEach(function (context: any) {
1131
1178
  const id = ++j;
1132
1179
  oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function () {
1133
1180
  return processOneAction(context, id);
@@ -1137,7 +1184,9 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1137
1184
  .then(function () {
1138
1185
  fnHandleResults();
1139
1186
  })
1140
- .catch();
1187
+ .catch(function (oError: any) {
1188
+ Log.error(oError);
1189
+ });
1141
1190
  }
1142
1191
 
1143
1192
  if (!bGrouped) {
@@ -1147,7 +1196,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1147
1196
  fnExecuteSequentially(aContexts);
1148
1197
  } else {
1149
1198
  for (i = 0; i < aContexts.length; i++) {
1150
- oAction = oModel.bindContext(sActionName + "(...)", aContexts[i], mBindingParameters);
1199
+ oAction = oModel.bindContext(`${sActionName}(...)`, aContexts[i], mBindingParameters);
1151
1200
  fnExecuteAction(oAction, aContexts.length <= 1 ? null : i, {
1152
1201
  context: aContexts[i],
1153
1202
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
@@ -1212,7 +1261,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1212
1261
  )();
1213
1262
  });
1214
1263
  } else {
1215
- oAction = oModel.bindContext("/" + sActionName + "(...)");
1264
+ oAction = oModel.bindContext(`/${sActionName}(...)`);
1216
1265
  setActionParameterDefaultValue();
1217
1266
  const sGroupId = "actionImport";
1218
1267
  const oActionPromise = oAction.execute(
@@ -1241,7 +1290,21 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1241
1290
  function _getPath(oActionContext: any, sActionName: any) {
1242
1291
  let sPath = oActionContext.getPath();
1243
1292
  sPath = oActionContext.getObject("$IsBound") ? sPath.split("@$ui5.overload")[0] : sPath.split("/0")[0];
1244
- return sPath.split("/" + sActionName)[0];
1293
+ return sPath.split(`/${sActionName}`)[0];
1294
+ }
1295
+
1296
+ function _showActionParameterDialog(showDialog: boolean, actionParameters: Record<string, any>[]): boolean {
1297
+ if (showDialog || actionParameters.length > 0) {
1298
+ if (
1299
+ !actionParameters ||
1300
+ actionParameters.length === 0 ||
1301
+ (actionParameters.length === 1 && actionParameters[0].$Name === "ResultIsActiveEntity")
1302
+ ) {
1303
+ showDialog = false;
1304
+ }
1305
+ }
1306
+
1307
+ return showDialog;
1245
1308
  }
1246
1309
 
1247
1310
  /**
@@ -1258,7 +1321,8 @@ const operations = {
1258
1321
  callActionImport: callActionImport,
1259
1322
  callBoundFunction: callBoundFunction,
1260
1323
  callFunctionImport: callFunctionImport,
1261
- executeDependingOnSelectedContexts: executeDependingOnSelectedContexts
1324
+ executeDependingOnSelectedContexts: executeDependingOnSelectedContexts,
1325
+ showActionParameterDialog: _showActionParameterDialog
1262
1326
  };
1263
1327
 
1264
1328
  export default operations;