@sapui5/sap.fe.core 1.101.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 (339) 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 +66 -30
  4. package/src/sap/fe/core/AppComponent.ts +68 -51
  5. package/src/sap/fe/core/AppStateHandler.js +13 -13
  6. package/src/sap/fe/core/AppStateHandler.ts +18 -18
  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 +279 -188
  10. package/src/sap/fe/core/CommonUtils.ts +306 -215
  11. package/src/sap/fe/core/ExtensionAPI.js +25 -30
  12. package/src/sap/fe/core/ExtensionAPI.ts +37 -41
  13. package/src/sap/fe/core/PageController.js +12 -7
  14. package/src/sap/fe/core/PageController.ts +10 -5
  15. package/src/sap/fe/core/TemplateComponent.js +6 -6
  16. package/src/sap/fe/core/TemplateComponent.ts +11 -11
  17. package/src/sap/fe/core/TemplateModel.js +2 -2
  18. package/src/sap/fe/core/TemplateModel.ts +3 -3
  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 +306 -78
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +280 -70
  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/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
  26. package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
  27. package/src/sap/fe/core/controllerextensions/EditFlow.js +351 -229
  28. package/src/sap/fe/core/controllerextensions/EditFlow.ts +321 -246
  29. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
  30. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
  31. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +59 -34
  32. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +71 -45
  33. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +72 -72
  34. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +82 -80
  35. package/src/sap/fe/core/controllerextensions/InternalRouting.js +152 -131
  36. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +171 -152
  37. package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
  38. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
  39. package/src/sap/fe/core/controllerextensions/MassEdit.js +11 -10
  40. package/src/sap/fe/core/controllerextensions/MassEdit.ts +31 -37
  41. package/src/sap/fe/core/controllerextensions/MessageHandler.js +21 -13
  42. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +30 -15
  43. package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
  44. package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
  45. package/src/sap/fe/core/controllerextensions/Paginator.js +19 -11
  46. package/src/sap/fe/core/controllerextensions/Paginator.ts +22 -14
  47. package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
  48. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  49. package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
  50. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  51. package/src/sap/fe/core/controllerextensions/Share.js +39 -21
  52. package/src/sap/fe/core/controllerextensions/Share.ts +45 -26
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +47 -51
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +58 -62
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +75 -62
  56. package/src/sap/fe/core/controllerextensions/ViewState.ts +78 -63
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
  58. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +99 -0
  59. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
  60. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +58 -112
  61. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.js +2 -2
  62. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +7 -7
  63. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +262 -0
  64. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +20 -21
  65. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ManageDialog.fragment.xml +0 -0
  66. package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
  67. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1631 -0
  68. package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +270 -211
  69. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +772 -0
  70. package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +240 -100
  71. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1199 -0
  72. package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +364 -229
  73. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +188 -0
  74. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +185 -0
  75. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +626 -0
  76. package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +112 -69
  77. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +937 -0
  78. package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +72 -73
  79. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
  80. package/src/sap/fe/core/controls/Any.js +9 -5
  81. package/src/sap/fe/core/controls/Any.ts +10 -4
  82. package/src/sap/fe/core/controls/CommandExecution.js +21 -24
  83. package/src/sap/fe/core/controls/CommandExecution.ts +19 -24
  84. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  85. package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
  86. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +48 -43
  87. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +51 -46
  88. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  89. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +3 -2
  90. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +11 -3
  91. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +19 -9
  92. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +14 -8
  93. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  94. package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
  95. package/src/sap/fe/core/controls/FileWrapper.js +50 -3
  96. package/src/sap/fe/core/controls/FileWrapper.ts +45 -12
  97. package/src/sap/fe/core/controls/FilterBar.js +6 -2
  98. package/src/sap/fe/core/controls/FilterBar.ts +13 -9
  99. package/src/sap/fe/core/controls/FormElementWrapper.js +12 -2
  100. package/src/sap/fe/core/controls/FormElementWrapper.ts +14 -3
  101. package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
  102. package/src/sap/fe/core/controls/MassEditSelect.ts +41 -0
  103. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
  104. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
  105. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
  106. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
  107. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
  108. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +48 -48
  109. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +71 -76
  110. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +36 -65
  111. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
  112. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +551 -36
  113. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +605 -36
  114. package/src/sap/fe/core/converters/ConverterContext.js +26 -33
  115. package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
  116. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  117. package/src/sap/fe/core/converters/ManifestSettings.ts +17 -14
  118. package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
  119. package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
  120. package/src/sap/fe/core/converters/MetaModelConverter.js +56 -67
  121. package/src/sap/fe/core/converters/MetaModelConverter.ts +183 -193
  122. package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
  123. package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
  124. package/src/sap/fe/core/converters/annotations/DataField.js +73 -37
  125. package/src/sap/fe/core/converters/annotations/DataField.ts +121 -77
  126. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
  127. package/src/sap/fe/core/converters/controls/Common/Action.js +51 -49
  128. package/src/sap/fe/core/converters/controls/Common/Action.ts +58 -54
  129. package/src/sap/fe/core/converters/controls/Common/Chart.js +22 -15
  130. package/src/sap/fe/core/converters/controls/Common/Chart.ts +29 -27
  131. package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
  132. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
  133. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
  134. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
  135. package/src/sap/fe/core/converters/controls/Common/Form.js +30 -34
  136. package/src/sap/fe/core/converters/controls/Common/Form.ts +48 -58
  137. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
  138. package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
  139. package/src/sap/fe/core/converters/controls/Common/Table.js +318 -244
  140. package/src/sap/fe/core/converters/controls/Common/Table.ts +368 -297
  141. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +135 -125
  142. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +162 -148
  143. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +51 -45
  144. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +79 -67
  145. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
  146. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
  147. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
  148. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
  149. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
  150. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
  151. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +92 -89
  152. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +124 -120
  153. package/src/sap/fe/core/converters/helpers/Aggregation.js +11 -5
  154. package/src/sap/fe/core/converters/helpers/Aggregation.ts +25 -23
  155. package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -30
  156. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +31 -29
  157. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
  158. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
  159. package/src/sap/fe/core/converters/helpers/ID.js +46 -46
  160. package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
  161. package/src/sap/fe/core/converters/helpers/Key.js +7 -7
  162. package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
  163. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  164. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
  165. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
  166. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
  167. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
  168. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
  169. package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
  170. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
  171. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +56 -55
  172. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +65 -77
  173. package/src/sap/fe/core/designtime/AppComponent.designtime.js +6 -6
  174. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +10 -8
  175. package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
  176. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
  177. package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
  178. package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
  179. package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
  180. package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
  181. package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
  182. package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
  183. package/src/sap/fe/core/formatters/TableFormatter.js +83 -22
  184. package/src/sap/fe/core/formatters/TableFormatter.ts +80 -25
  185. package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
  186. package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
  187. package/src/sap/fe/core/fpm/Component.js +2 -2
  188. package/src/sap/fe/core/fpm/Component.ts +1 -1
  189. package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
  190. package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
  191. package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
  192. package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +388 -285
  193. package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
  194. package/src/sap/fe/core/helpers/ClassSupport.ts +15 -10
  195. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
  196. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
  197. package/src/sap/fe/core/helpers/EditState.js +1 -6
  198. package/src/sap/fe/core/helpers/EditState.ts +5 -10
  199. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
  200. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
  201. package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
  202. package/src/sap/fe/core/helpers/FPMHelper.ts +10 -9
  203. package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
  204. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
  205. package/src/sap/fe/core/helpers/MassEditHelper.js +532 -264
  206. package/src/sap/fe/core/helpers/MassEditHelper.ts +560 -289
  207. package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
  208. package/src/sap/fe/core/helpers/ModelHelper.ts +50 -58
  209. package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
  210. package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
  211. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  212. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
  213. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
  214. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
  215. package/src/sap/fe/core/helpers/StableIdHelper.js +16 -12
  216. package/src/sap/fe/core/helpers/StableIdHelper.ts +20 -16
  217. package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
  218. package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
  219. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  220. package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
  221. package/src/sap/fe/core/library.js +51 -3
  222. package/src/sap/fe/core/library.ts +47 -0
  223. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
  224. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
  225. package/src/sap/fe/core/messagebundle.properties +151 -197
  226. package/src/sap/fe/core/messagebundle_ar.properties +36 -63
  227. package/src/sap/fe/core/messagebundle_bg.properties +36 -63
  228. package/src/sap/fe/core/messagebundle_ca.properties +36 -63
  229. package/src/sap/fe/core/messagebundle_cs.properties +36 -63
  230. package/src/sap/fe/core/messagebundle_cy.properties +36 -63
  231. package/src/sap/fe/core/messagebundle_da.properties +37 -64
  232. package/src/sap/fe/core/messagebundle_de.properties +36 -63
  233. package/src/sap/fe/core/messagebundle_el.properties +38 -65
  234. package/src/sap/fe/core/messagebundle_en.properties +37 -64
  235. package/src/sap/fe/core/messagebundle_en_GB.properties +37 -64
  236. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +44 -73
  237. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -64
  238. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +52 -81
  239. package/src/sap/fe/core/messagebundle_es.properties +36 -63
  240. package/src/sap/fe/core/messagebundle_es_MX.properties +36 -63
  241. package/src/sap/fe/core/messagebundle_et.properties +36 -63
  242. package/src/sap/fe/core/messagebundle_fi.properties +36 -63
  243. package/src/sap/fe/core/messagebundle_fr.properties +39 -66
  244. package/src/sap/fe/core/messagebundle_fr_CA.properties +36 -63
  245. package/src/sap/fe/core/messagebundle_hi.properties +36 -63
  246. package/src/sap/fe/core/messagebundle_hr.properties +36 -63
  247. package/src/sap/fe/core/messagebundle_hu.properties +35 -62
  248. package/src/sap/fe/core/messagebundle_id.properties +37 -64
  249. package/src/sap/fe/core/messagebundle_it.properties +54 -81
  250. package/src/sap/fe/core/messagebundle_iw.properties +36 -63
  251. package/src/sap/fe/core/messagebundle_ja.properties +36 -63
  252. package/src/sap/fe/core/messagebundle_kk.properties +36 -63
  253. package/src/sap/fe/core/messagebundle_ko.properties +36 -63
  254. package/src/sap/fe/core/messagebundle_lt.properties +36 -63
  255. package/src/sap/fe/core/messagebundle_lv.properties +36 -63
  256. package/src/sap/fe/core/messagebundle_ms.properties +37 -64
  257. package/src/sap/fe/core/messagebundle_nl.properties +37 -64
  258. package/src/sap/fe/core/messagebundle_no.properties +36 -63
  259. package/src/sap/fe/core/messagebundle_pl.properties +37 -64
  260. package/src/sap/fe/core/messagebundle_pt.properties +37 -64
  261. package/src/sap/fe/core/messagebundle_pt_PT.properties +36 -63
  262. package/src/sap/fe/core/messagebundle_ro.properties +36 -63
  263. package/src/sap/fe/core/messagebundle_ru.properties +36 -63
  264. package/src/sap/fe/core/messagebundle_sh.properties +36 -63
  265. package/src/sap/fe/core/messagebundle_sk.properties +36 -63
  266. package/src/sap/fe/core/messagebundle_sl.properties +38 -65
  267. package/src/sap/fe/core/messagebundle_sv.properties +36 -63
  268. package/src/sap/fe/core/messagebundle_th.properties +36 -63
  269. package/src/sap/fe/core/messagebundle_tr.properties +36 -63
  270. package/src/sap/fe/core/messagebundle_uk.properties +37 -64
  271. package/src/sap/fe/core/messagebundle_vi.properties +37 -64
  272. package/src/sap/fe/core/messagebundle_zh_CN.properties +36 -63
  273. package/src/sap/fe/core/messagebundle_zh_TW.properties +37 -64
  274. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  275. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
  276. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
  277. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
  278. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +6 -3
  279. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +12 -10
  280. package/src/sap/fe/core/services/NavigationServiceFactory.js +54 -45
  281. package/src/sap/fe/core/services/NavigationServiceFactory.ts +61 -49
  282. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  283. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
  284. package/src/sap/fe/core/services/RoutingServiceFactory.js +63 -60
  285. package/src/sap/fe/core/services/RoutingServiceFactory.ts +76 -73
  286. package/src/sap/fe/core/services/ShellServicesFactory.js +102 -71
  287. package/src/sap/fe/core/services/ShellServicesFactory.ts +109 -78
  288. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
  289. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
  290. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +24 -18
  291. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +53 -50
  292. package/src/sap/fe/core/support/CommonHelper.js +3 -2
  293. package/src/sap/fe/core/support/CommonHelper.ts +9 -13
  294. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  295. package/src/sap/fe/core/support/Diagnostics.ts +5 -5
  296. package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
  297. package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
  298. package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
  299. package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
  300. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
  301. package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
  302. package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
  303. package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
  304. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  305. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +3 -4
  306. package/src/sap/fe/core/templating/EntitySetHelper.js +7 -15
  307. package/src/sap/fe/core/templating/EntitySetHelper.ts +14 -18
  308. package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
  309. package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
  310. package/src/sap/fe/core/templating/FilterHelper.js +12 -11
  311. package/src/sap/fe/core/templating/FilterHelper.ts +17 -16
  312. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  313. package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
  314. package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
  315. package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
  316. package/src/sap/fe/core/templating/PropertyHelper.js +79 -56
  317. package/src/sap/fe/core/templating/PropertyHelper.ts +41 -27
  318. package/src/sap/fe/core/templating/UIFormatters.js +163 -97
  319. package/src/sap/fe/core/templating/UIFormatters.ts +210 -129
  320. package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
  321. package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
  322. package/src/sap/fe/core/type/Email.js +2 -2
  323. package/src/sap/fe/core/type/Email.ts +2 -2
  324. package/src/sap/fe/core/AnnotationHelper.js +0 -331
  325. package/src/sap/fe/core/AnnotationHelper.ts +0 -321
  326. package/src/sap/fe/core/RouterProxy.js +0 -938
  327. package/src/sap/fe/core/TransactionHelper.js +0 -1577
  328. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -406
  329. package/src/sap/fe/core/actions/collaboration/Manage.js +0 -264
  330. package/src/sap/fe/core/actions/draft.js +0 -665
  331. package/src/sap/fe/core/actions/messageHandling.js +0 -579
  332. package/src/sap/fe/core/actions/nonDraft.js +0 -20
  333. package/src/sap/fe/core/actions/nonDraft.ts +0 -12
  334. package/src/sap/fe/core/actions/operations.js +0 -1096
  335. package/src/sap/fe/core/actions/sticky.js +0 -130
  336. package/src/sap/fe/core/actions/sticky.ts +0 -119
  337. package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
  338. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
  339. package/src/sap/fe/core/helpers/BindingExpression.js +0 -1729
@@ -1,18 +1,19 @@
1
- import MessageBox from "sap/m/MessageBox";
2
- import Dialog from "sap/m/Dialog";
3
- import JSONModel from "sap/ui/model/json/JSONModel";
4
- import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
5
- import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
6
- import Fragment from "sap/ui/core/Fragment";
7
- import messageHandling from "sap/fe/core/actions/messageHandling";
8
- import BusyLocker from "sap/fe/core/BusyLocker";
9
- import CommonUtils from "sap/fe/core/CommonUtils";
10
1
  import Log from "sap/base/Log";
11
- import FELibrary from "sap/fe/core/library";
2
+ import CommonUtils from "sap/fe/core/CommonUtils";
3
+ import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
4
+ import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
12
5
  import FPMHelper from "sap/fe/core/helpers/FPMHelper";
13
- import Button from "sap/m/Button";
14
6
  import { generate } from "sap/fe/core/helpers/StableIdHelper";
7
+ import FELibrary from "sap/fe/core/library";
8
+ import Button from "sap/m/Button";
9
+ import Dialog from "sap/m/Dialog";
10
+ import MessageBox from "sap/m/MessageBox";
15
11
  import Core from "sap/ui/core/Core";
12
+ import Fragment from "sap/ui/core/Fragment";
13
+ import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
14
+ import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
15
+ import JSONModel from "sap/ui/model/json/JSONModel";
16
+ // import type Context from "sap/ui/model/odata/v4/Context";
16
17
 
17
18
  const Constants = FELibrary.Constants,
18
19
  InvocationGrouping = FELibrary.InvocationGrouping;
@@ -25,22 +26,22 @@ const Action = (MessageBox as any).Action;
25
26
  * @static
26
27
  * @name sap.fe.core.actions.operations.callBoundAction
27
28
  * @memberof sap.fe.core.actions.operations
28
- * @param {string} sActionName The name of the action to be called
29
- * @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
30
- * @param {sap.ui.model.odata.v4.Model} oModel OData Model
31
- * @param {object} oAppComponent The AppComponent
32
- * @param {map} [mParameters] Optional, can contain the following attributes:
33
- * @param {map} [mParameters.actionParameters] A map of parameters to be sent for every action call
34
- * @param {map} [mParameters.mBindingParameters] A map of binding parameters that would be part of $select and $expand coming from side effects for bound actions
35
- * @param {Array} [mParameters.additionalSideEffect] Array of property paths to be requested in addition to actual target properties of the side effect
36
- * @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
37
- * @param {string} [mParameters.label] A human-readable label for the action
38
- * @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
39
- * @param {Function} [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
40
- * @param {map} [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
41
- * @param {sap.ui.core.Element} [mParameters.parentControl] If specified the dialogs are added as dependent of the parent control
42
- * @param {boolean} [mParameters.bGetBoundContext] If specified the action promise returns the bound context
43
- * @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)
44
45
  * @private
45
46
  * @ui5-restricted
46
47
  */
@@ -57,8 +58,8 @@ function callBoundAction(sActionName: string, contexts: any, oModel: any, oAppCo
57
58
  contexts = [contexts];
58
59
  }
59
60
  const oMetaModel = oModel.getMetaModel(),
60
- sActionPath = oMetaModel.getMetaPath(contexts[0].getPath()) + "/" + sActionName,
61
- oBoundAction = oMetaModel.createBindingContext(sActionPath + "/@$ui5.overload/0");
61
+ sActionPath = `${oMetaModel.getMetaPath(contexts[0].getPath())}/${sActionName}`,
62
+ oBoundAction = oMetaModel.createBindingContext(`${sActionPath}/@$ui5.overload/0`);
62
63
  mParameters.aContexts = contexts;
63
64
  mParameters.isCriticalAction = getIsActionCritical(oMetaModel, sActionPath, contexts, oBoundAction);
64
65
  return callAction(sActionName, oModel, oBoundAction, oAppComponent, mParameters);
@@ -70,16 +71,16 @@ function callBoundAction(sActionName: string, contexts: any, oModel: any, oAppCo
70
71
  * @static
71
72
  * @name sap.fe.core.actions.operations.callActionImport
72
73
  * @memberof sap.fe.core.actions.operations
73
- * @param {string} sActionName The name of the action import to be called
74
- * @param {sap.ui.model.odata.v4.ODataModel} oModel An instance of an OData v4 model
75
- * @param {object} oAppComponent The AppComponent
76
- * @param {map} [mParameters] Optional, can contain the following attributes:
77
- * @param {map} [mParameters.actionParameters] A map of parameters to be sent with the action import
78
- * @param {string} [mParameters.label] A human-readable label for the action
79
- * @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
80
- * @param {Function} [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
81
- * @param {map} [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
82
- * @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)
83
84
  * @private
84
85
  * @ui5-restricted
85
86
  */
@@ -88,9 +89,9 @@ function callActionImport(sActionName: string, oModel: any, oAppComponent: objec
88
89
  return Promise.reject("Action expects a model/context for execution");
89
90
  }
90
91
  const oMetaModel = oModel.getMetaModel(),
91
- sActionPath = oModel.bindContext("/" + sActionName).getPath(),
92
- oActionImport = oMetaModel.createBindingContext("/" + oMetaModel.createBindingContext(sActionPath).getObject("$Action") + "/0");
93
- 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`);
94
95
  return callAction(sActionName, oModel, oActionImport, oAppComponent, mParameters);
95
96
  }
96
97
  function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
@@ -98,7 +99,7 @@ function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
98
99
  return Promise.reject("Bound functions always requires a context");
99
100
  }
100
101
  const oMetaModel = oModel.getMetaModel(),
101
- sFunctionPath = oMetaModel.getMetaPath(context.getPath()) + "/" + sFunctionName,
102
+ sFunctionPath = `${oMetaModel.getMetaPath(context.getPath())}/${sFunctionName}`,
102
103
  oBoundFunction = oMetaModel.createBindingContext(sFunctionPath);
103
104
  return _executeFunction(sFunctionName, oModel, oBoundFunction, context);
104
105
  }
@@ -109,9 +110,9 @@ function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
109
110
  * @static
110
111
  * @name sap.fe.core.actions.operations.callFunctionImport
111
112
  * @memberof sap.fe.core.actions.operations
112
- * @param {string} sFunctionName The name of the function to be called
113
- * @param {sap.ui.model.odata.v4.ODataModel} oModel An instance of an OData v4 model
114
- * @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
115
116
  * @private
116
117
  */
117
118
  function callFunctionImport(sFunctionName: string, oModel: any) {
@@ -119,32 +120,30 @@ function callFunctionImport(sFunctionName: string, oModel: any) {
119
120
  return Promise.resolve();
120
121
  }
121
122
  const oMetaModel = oModel.getMetaModel(),
122
- sFunctionPath = oModel.bindContext("/" + sFunctionName).getPath(),
123
- oFunctionImport = oMetaModel.createBindingContext(
124
- "/" + oMetaModel.createBindingContext(sFunctionPath).getObject("$Function") + "/0"
125
- );
123
+ sFunctionPath = oModel.bindContext(`/${sFunctionName}`).getPath(),
124
+ oFunctionImport = oMetaModel.createBindingContext(`/${oMetaModel.createBindingContext(sFunctionPath).getObject("$Function")}/0`);
126
125
  return _executeFunction(sFunctionName, oModel, oFunctionImport);
127
126
  }
128
127
  function _executeFunction(sFunctionName: any, oModel: any, oFunction: any, context?: any) {
129
128
  let sGroupId;
130
129
  if (!oFunction || !oFunction.getObject()) {
131
- return Promise.reject(new Error("Function " + sFunctionName + " not found"));
130
+ return Promise.reject(new Error(`Function ${sFunctionName} not found`));
132
131
  }
133
132
  if (context) {
134
- oFunction = oModel.bindContext(sFunctionName + "(...)", context);
133
+ oFunction = oModel.bindContext(`${sFunctionName}(...)`, context);
135
134
  sGroupId = "functionGroup";
136
135
  } else {
137
- oFunction = oModel.bindContext("/" + sFunctionName + "(...)");
136
+ oFunction = oModel.bindContext(`/${sFunctionName}(...)`);
138
137
  sGroupId = "functionImport";
139
138
  }
140
139
  const oFunctionPromise = oFunction.execute(sGroupId);
141
140
  oModel.submitBatch(sGroupId);
142
- return oFunctionPromise.then(function() {
141
+ return oFunctionPromise.then(function () {
143
142
  return oFunction.getBoundContext();
144
143
  });
145
144
  }
146
145
  function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent: any, mParameters: any) {
147
- return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
146
+ return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
148
147
  let aActionParameters = mParameters.actionParameters || [];
149
148
  let mActionExecutionParameters: any = {};
150
149
  let fnDialog;
@@ -158,15 +157,17 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
158
157
  let sMetaPath;
159
158
  let sMessagesPath: any;
160
159
  let iMessageSideEffect;
160
+ let bIsSameEntity;
161
+ let oReturnType;
162
+ const actionDefinition = oAction.getObject();
161
163
  if (!oAction || !oAction.getObject()) {
162
- return reject(new Error("Action " + sActionName + " not found"));
163
- }
164
- if (bShowActionParameterDialog || aActionParameters.length > 0) {
165
- aActionParameters = prepareActionParameters(oAction, aActionParameters);
166
- if (!aActionParameters || aActionParameters.length === 0) {
167
- bShowActionParameterDialog = false;
168
- }
164
+ return reject(new Error(`Action ${sActionName} not found`));
169
165
  }
166
+
167
+ aActionParameters = getActionParameters(oAction);
168
+
169
+ bShowActionParameterDialog = _showActionParameterDialog(bShowActionParameterDialog, aActionParameters);
170
+
170
171
  if (bShowActionParameterDialog) {
171
172
  fnDialog = showActionParameterDialog;
172
173
  } else if (bIsCriticalAction) {
@@ -186,28 +187,39 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
186
187
  if (mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions) {
187
188
  oMetaModel = oModel.getMetaModel();
188
189
  sMetaPath = oMetaModel.getMetaPath(aContexts[0].getPath());
189
- sMessagesPath = oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
190
+ sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
190
191
 
191
192
  if (sMessagesPath) {
192
- iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function(exp: any) {
193
- return exp.$PropertyPath === sMessagesPath;
193
+ iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function (exp: any) {
194
+ return typeof exp === "string" && exp === sMessagesPath;
194
195
  });
195
196
 
196
- if (iMessageSideEffect > -1) {
197
+ // Add SAP_Messages by default if not annotated by side effects, action does not return a collection and
198
+ // the return type is the same as the bound type
199
+ oReturnType = oAction.getObject("$ReturnType");
200
+ bIsSameEntity =
201
+ oReturnType && !oReturnType.$isCollection && oAction.getModel().getObject(sMetaPath).$Type === oReturnType.$Type;
202
+
203
+ if (iMessageSideEffect > -1 || bIsSameEntity) {
197
204
  // the message path is annotated as side effect. As there's no binding for it and the model does currently not allow
198
- // to add it at a later point of time we have to take care it's part of the $select of the POST, therefore moving it
205
+ // to add it at a later point of time we have to take care it's part of the $select of the POST, therefore moving it.
199
206
  mParameters.mBindingParameters = mParameters.mBindingParameters || {};
200
207
 
201
208
  if (
202
- oAction.getObject("$ReturnType/$Type/" + sMessagesPath) &&
209
+ oAction.getObject(`$ReturnType/$Type/${sMessagesPath}`) &&
203
210
  (!mParameters.mBindingParameters.$select ||
204
211
  mParameters.mBindingParameters.$select.split(",").indexOf(sMessagesPath) === -1)
205
212
  ) {
206
213
  mParameters.mBindingParameters.$select = mParameters.mBindingParameters.$select
207
- ? mParameters.mBindingParameters.$select + "," + sMessagesPath
214
+ ? `${mParameters.mBindingParameters.$select},${sMessagesPath}`
208
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
+ }
209
221
 
210
- if (mParameters.additionalSideEffect.triggerActions.length === 0) {
222
+ if (mParameters.additionalSideEffect.triggerActions.length === 0 && iMessageSideEffect > -1) {
211
223
  // no trigger action therefore no need to request messages again
212
224
  mParameters.additionalSideEffect.pathExpressions.splice(iMessageSideEffect, 1);
213
225
  }
@@ -224,6 +236,11 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
224
236
  mActionExecutionParameters.internalModelContext = mParameters.internalModelContext;
225
237
  mActionExecutionParameters.operationAvailableMap = mParameters.operationAvailableMap;
226
238
  mActionExecutionParameters.bObjectPage = mParameters.bObjectPage;
239
+ if (mParameters.controlId) {
240
+ mActionExecutionParameters.control = mParameters.parentControl.byId(mParameters.controlId);
241
+ } else {
242
+ mActionExecutionParameters.control = mParameters.parentControl;
243
+ }
227
244
  }
228
245
  if (bIsCreateAction) {
229
246
  mActionExecutionParameters.bIsCreateAction = bIsCreateAction;
@@ -244,10 +261,33 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
244
261
  oActionPromise = _executeAction(oAppComponent, mActionExecutionParameters);
245
262
  }
246
263
  return oActionPromise
247
- .then(function(oOperationResult: any) {
264
+ .then(function (oOperationResult: any) {
265
+ if (
266
+ mActionExecutionParameters.internalModelContext &&
267
+ mActionExecutionParameters.operationAvailableMap &&
268
+ mActionExecutionParameters.aContexts &&
269
+ mActionExecutionParameters.aContexts.length &&
270
+ actionDefinition.$IsBound
271
+ ) {
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
+ );
279
+ });
280
+ if (!isStatic) {
281
+ CommonUtils.setActionEnablement(
282
+ mActionExecutionParameters.internalModelContext,
283
+ JSON.parse(mActionExecutionParameters.operationAvailableMap),
284
+ mActionExecutionParameters.aContexts
285
+ );
286
+ }
287
+ }
248
288
  resolve(oOperationResult);
249
289
  })
250
- .catch(function(oOperationResult: any) {
290
+ .catch(function (oOperationResult: any) {
251
291
  reject(oOperationResult);
252
292
  });
253
293
  });
@@ -267,7 +307,7 @@ function confirmCriticalAction(
267
307
  let boundActionName = sActionName ? sActionName : null;
268
308
  boundActionName =
269
309
  boundActionName.indexOf(".") >= 0 ? boundActionName.split(".")[boundActionName.split(".").length - 1] : boundActionName;
270
- const suffixResourceKey = boundActionName && entitySetName ? entitySetName + "|" + boundActionName : "";
310
+ const suffixResourceKey = boundActionName && entitySetName ? `${entitySetName}|${boundActionName}` : "";
271
311
  const oResourceBundle = oParentControl.getController().oResourceBundle;
272
312
  const sConfirmationText = CommonUtils.getTranslatedText(
273
313
  "C_OPERATIONS_ACTION_CONFIRM_MESSAGE",
@@ -277,19 +317,19 @@ function confirmCriticalAction(
277
317
  );
278
318
 
279
319
  MessageBox.confirm(sConfirmationText, {
280
- onClose: function(sAction: any) {
320
+ onClose: function (sAction: any) {
281
321
  if (sAction === Action.OK) {
282
322
  return _executeAction(oAppComponent, mParameters)
283
- .then(function(oOperation: any) {
323
+ .then(function (oOperation: any) {
284
324
  resolve(oOperation);
285
325
  })
286
- .catch(function(oError: any) {
326
+ .catch(function (oError: any) {
287
327
  messageHandler
288
328
  .showMessageDialog()
289
- .then(function() {
329
+ .then(function () {
290
330
  reject(oError);
291
331
  })
292
- .catch(function() {
332
+ .catch(function () {
293
333
  reject(oError);
294
334
  });
295
335
  });
@@ -319,7 +359,7 @@ function showActionParameterDialog(
319
359
  : oActionContext.getPath().split("/0")[0],
320
360
  actionNameContext = metaModel.createBindingContext(sActionNamePath),
321
361
  sFragmentName = "sap/fe/core/controls/ActionParameterDialog";
322
- return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
362
+ return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
323
363
  const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
324
364
  const oParameterModel = new JSONModel({
325
365
  $displayMode: {}
@@ -327,56 +367,55 @@ function showActionParameterDialog(
327
367
  let aFieldInvalid: any[] = [];
328
368
  let aFormElements: any[] = [];
329
369
  const mFieldValueMap: any = {};
330
- const validateRequiredProperties = function() {
370
+ const validateRequiredProperties = function () {
331
371
  return Promise.all(
332
372
  aFormElements
333
- .filter(function(oFormElement: any) {
373
+ .filter(function (oFormElement: any) {
334
374
  const oField = oFormElement.getFields()[0];
335
375
  return oField.getRequired() && oField.getValueState() !== "Error";
336
376
  })
337
- .map(function(oFormElement: any) {
377
+ .map(function (oFormElement: any) {
338
378
  const value = oFormElement.getFields()[0].isA("sap.ui.mdc.MultiValueField")
339
379
  ? oFormElement.getFields()[0].getItems()
340
380
  : oFormElement.getFields()[0].getValue();
341
- if (value === undefined || value === null || value === "") {
381
+ if (value === undefined || value === null || value === "" || (Array.isArray(value) && !value.length)) {
342
382
  return oFormElement.getLabel().getText();
343
383
  }
344
384
  })
345
- ).then(function(aResults: any[]) {
346
- aResults = aResults.filter(function(result: any) {
385
+ ).then(function (aResults: any[]) {
386
+ aResults = aResults.filter(function (result: any) {
347
387
  return result !== undefined;
348
388
  });
349
389
  return aResults;
350
390
  });
351
391
  };
352
- const _validateMessages = function(aActionParameters: any, aFieldInvalid: any, bClearTarget?: boolean) {
392
+ const _validateMessages = function (actionParameters: any, invalidFields: any, bClearTarget?: boolean) {
353
393
  const oMessageManager = Core.getMessageManager();
354
394
  const aMessages = oMessageManager.getMessageModel().getData();
355
395
 
356
- aFieldInvalid = aFieldInvalid || [];
396
+ invalidFields = invalidFields || [];
357
397
 
358
398
  if (!aMessages.length) {
359
- aFieldInvalid = [];
399
+ invalidFields = [];
360
400
  }
361
- aActionParameters.forEach(function(oActionParameters: any) {
401
+ actionParameters.forEach(function (oActionParameters: any) {
362
402
  const sParameter = oActionParameters.$Name;
363
- aMessages.forEach(function(oMessage: any) {
403
+ aMessages.forEach(function (oMessage: any) {
364
404
  const sParam = sParameter.replace("-inner", "");
365
405
  if (
366
406
  oMessage.controlIds.length > 0 &&
367
- (oMessage.getControlId().includes("APD_::" + sParameter) ||
368
- (oMessage.getControlId().includes("APD_::" + sParameter + "inner") &&
369
- aFieldInvalid.indexOf("APD_::" + sParam) < 0))
407
+ (oMessage.getControlId().includes(`APD_::${sParameter}`) ||
408
+ (oMessage.getControlId().includes(`APD_::${sParameter}inner`) && invalidFields.indexOf(`APD_::${sParam}`) < 0))
370
409
  ) {
371
410
  if (bClearTarget) {
372
411
  oMessageManager.removeMessages(oMessage);
373
412
  } else {
374
- aFieldInvalid.push("APD_::" + sParam);
413
+ invalidFields.push(`APD_::${sParam}`);
375
414
  }
376
415
  }
377
416
  // Handle messages related to input with invalid token
378
- if (oMessage.target.includes("APD_::" + sParameter)) {
379
- aFieldInvalid.push("APD_::" + sParam);
417
+ if (oMessage.target.includes(`APD_::${sParameter}`)) {
418
+ invalidFields.push(`APD_::${sParam}`);
380
419
  oMessage.target = bClearTarget ? "" : oMessage.target;
381
420
  if (bClearTarget) {
382
421
  oMessageManager.removeMessages(oMessage);
@@ -384,16 +423,16 @@ function showActionParameterDialog(
384
423
  }
385
424
  });
386
425
  });
387
- return aFieldInvalid;
426
+ return invalidFields;
388
427
  };
389
428
  const oController = {
390
- handleChange: function(oEvent: any) {
429
+ handleChange: function (oEvent: any) {
391
430
  messageHandler.removeTransitionMessages();
392
431
  const oField = oEvent.getSource();
393
432
  const sFieldId = oEvent.getParameter("id");
394
433
  const oFieldPromise = oEvent.getParameter("promise");
395
434
  if (oFieldPromise) {
396
- mFieldValueMap[sFieldId] = oFieldPromise.then(function() {
435
+ mFieldValueMap[sFieldId] = oFieldPromise.then(function () {
397
436
  return oField.getValue();
398
437
  });
399
438
  }
@@ -420,21 +459,21 @@ function showActionParameterDialog(
420
459
  }
421
460
  )
422
461
  )
423
- .then(function(oFragment: any) {
462
+ .then(function (createdFragment: any) {
424
463
  // TODO: move the dialog into the fragment and move the handlers to the oController
425
464
  let aContexts: any[];
426
465
  const aFunctionParams: any[] = [];
427
466
  let oOperationBinding: any;
428
- return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function() {
467
+ return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function () {
429
468
  // TODO: move the dialog into the fragment and move the handlers to the oController
430
- return Fragment.load({ definition: oFragment, controller: oController }).then(function(oDialogContent: any) {
469
+ return Fragment.load({ definition: createdFragment, controller: oController }).then(function (oDialogContent: any) {
431
470
  const oResourceBundle = oParentControl.getController().oResourceBundle;
432
471
  const oDialog = new Dialog(undefined, {
433
472
  title:
434
473
  sActionLabel ||
435
474
  CommonUtils.getTranslatedText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE", oResourceBundle),
436
475
  content: [oDialogContent],
437
- escapeHandler: function() {
476
+ escapeHandler: function () {
438
477
  oDialog.close();
439
478
  messageHandler.removeTransitionMessages();
440
479
  reject();
@@ -442,9 +481,9 @@ function showActionParameterDialog(
442
481
  beginButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Ok"]), {
443
482
  text: sActionLabel || CommonUtils.getTranslatedText("C_COMMON_DIALOG_OK", oResourceBundle),
444
483
  type: "Emphasized",
445
- press: function() {
484
+ press: function () {
446
485
  validateRequiredProperties()
447
- .then(function(aEmptyMandatoryFields: any[]) {
486
+ .then(function (aEmptyMandatoryFields: any[]) {
448
487
  if (aEmptyMandatoryFields.length) {
449
488
  const oMessages = [];
450
489
  for (let i = 0; i < aEmptyMandatoryFields.length; i++) {
@@ -471,11 +510,11 @@ function showActionParameterDialog(
471
510
  }
472
511
  BusyLocker.lock(oDialog);
473
512
  return Promise.all(
474
- Object.keys(mFieldValueMap).map(function(sKey: string) {
513
+ Object.keys(mFieldValueMap).map(function (sKey: string) {
475
514
  return mFieldValueMap[sKey];
476
515
  })
477
516
  )
478
- .then(function() {
517
+ .then(function () {
479
518
  // TODO: due to using the search and value helps on the action dialog transient messages could appear
480
519
  // we need an UX design for those to show them to the user - for now remove them before continuing
481
520
  messageHandler.removeTransitionMessages();
@@ -486,7 +525,7 @@ function showActionParameterDialog(
486
525
  if (aActionParameters[i].$isCollection) {
487
526
  const aMVFContent = oDialog
488
527
  .getModel("mvfview")
489
- .getProperty("/" + aActionParameters[i].$Name),
528
+ .getProperty(`/${aActionParameters[i].$Name}`),
490
529
  aKeyValues = [];
491
530
  for (const j in aMVFContent) {
492
531
  aKeyValues.push(aMVFContent[j].Key);
@@ -500,68 +539,144 @@ function showActionParameterDialog(
500
539
  }
501
540
  mParameters.label = sActionLabel;
502
541
  return _executeAction(oAppComponent, mParameters)
503
- .then(function(oOperation: any) {
542
+ .then(function (oOperation: any) {
504
543
  oDialog.close();
505
544
  resolve(oOperation);
506
545
  })
507
- .catch(function(oError: any) {
546
+ .catch(function (oError: any) {
547
+ let messages = messageHandling.getMessages();
548
+ messages = messages.concat(messageHandling.getMessages(true, true));
549
+ if (
550
+ !mParameters.bGrouped &&
551
+ !(!mParameters.control.isA("sap.ui.mdc.Table") && aContexts.length === 1) &&
552
+ messages.length
553
+ ) {
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
+ }
571
+ }
508
572
  throw oError;
509
573
  });
510
574
  })
511
- .catch(function() {
575
+ .catch(function () {
512
576
  const oMessageManager = Core.getMessageManager();
577
+ const messages = oMessageManager.getMessageModel().getData();
578
+ const subtitleColumn = CommonUtils.getMessageColumn(mParameters.control);
579
+ let errorContext;
580
+ let errorTargetsInAPD = false;
581
+ messages.forEach(function (message: any) {
582
+ const messageTargets = message.getTargets();
583
+ if (messageTargets && messageTargets.length === 1 && messageTargets[0].length) {
584
+ errorContext = aContexts.find(function (oContext: any) {
585
+ return message.getTarget().indexOf(oContext.getPath()) !== -1;
586
+ });
587
+ message.additionalText = errorContext
588
+ ? errorContext.getObject()[subtitleColumn]
589
+ : undefined;
590
+ }
591
+ if (
592
+ message.getTarget().indexOf(mParameters.actionName) !== -1 &&
593
+ message.getTarget().indexOf(mParameters.aActionParameters[0].$Name) !== -1 &&
594
+ errorTargetsInAPD === false
595
+ ) {
596
+ errorTargetsInAPD = true;
597
+ }
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
+ }
623
+
513
624
  const bHasEtagMessage = messageHandling.modifyETagMessagesOnly(
514
625
  oMessageManager,
515
- oResourceBundle
626
+ oResourceBundle,
627
+ undefined
516
628
  );
517
629
 
518
630
  messageHandler.showMessages({
519
631
  bHasEtagMessage: bHasEtagMessage,
520
632
  context: mParameters.aContexts[0],
521
- isActionParameterDialogOpen: true,
522
- messagePageNavigationCallback: function() {
633
+ isActionParameterDialogOpen: oDialog.isOpen(),
634
+ messagePageNavigationCallback: function () {
523
635
  oDialog.close();
524
- }
636
+ },
637
+ showErrorInAPD: showErrorInAPD,
638
+ bShowMessageBox: bShowMessageBox
525
639
  });
526
- if (oDialog && bHasEtagMessage) {
640
+ if (oDialog && bHasEtagMessage && oDialog.isOpen()) {
527
641
  oDialog.close(); //close the action parameter dialog after refresh of the context after etag mismatch
528
642
  }
529
643
  })
530
- .finally(function() {
644
+ .finally(function () {
531
645
  BusyLocker.unlock(oDialog);
532
646
  });
533
647
  })
534
- .catch(function() {
648
+ .catch(function () {
535
649
  return messageHandler.showMessageDialog();
536
650
  });
537
651
  }
538
652
  }),
539
653
  endButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Cancel"]), {
540
654
  text: CommonUtils.getTranslatedText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL", oResourceBundle),
541
- press: function() {
655
+ press: function () {
542
656
  _validateMessages(aActionParameters, aFieldInvalid, true);
543
657
  oDialog.close();
544
658
  messageHandler.removeTransitionMessages();
545
659
  reject(Constants.CancelActionDialog);
546
660
  }
547
661
  }),
548
- beforeOpen: function(oEvent: any) {
662
+ beforeOpen: function (oEvent: any) {
549
663
  // clone event for actionWrapper as oEvent.oSource gets lost during processing of beforeOpen event handler
550
664
  const oCloneEvent = Object.assign({}, oEvent);
551
665
 
552
666
  messageHandler.removeTransitionMessages();
553
- const getDefaultValuesFunction = function() {
667
+ const getDefaultValuesFunction = function () {
554
668
  const oMetaModel = oDialog.getModel().getMetaModel(),
555
669
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
556
670
  sDefaultValuesFunction = oMetaModel.getObject(
557
- sActionPath + "@com.sap.vocabularies.Common.v1.DefaultValuesFunction"
671
+ `${sActionPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
558
672
  );
559
673
  return sDefaultValuesFunction;
560
674
  };
561
- const fnSetDefaultsAndOpenDialog = function(sBindingParameter?: any) {
675
+ const fnSetDefaultsAndOpenDialog = function (sBindingParameter?: any) {
562
676
  const sBoundFunctionName = getDefaultValuesFunction();
563
- const prefillParameter = function(sParamName: any, vParamDefaultValue: any) {
564
- return new Promise(resolve => {
677
+ const prefillParameter = function (sParamName: any, vParamDefaultValue: any) {
678
+ // eslint-disable-next-line promise/param-names
679
+ return new Promise((inResolve) => {
565
680
  // Case 1: There is a ParameterDefaultValue annotation
566
681
  if (vParamDefaultValue !== undefined) {
567
682
  if (aContexts.length > 0 && vParamDefaultValue.$Path) {
@@ -570,7 +685,7 @@ function showActionParameterDialog(
570
685
  oOperationBinding.getModel()
571
686
  );
572
687
  oPromise
573
- .then(function(oValue: any) {
688
+ .then(function (oValue: any) {
574
689
  if (oValue === null) {
575
690
  return oOperationBinding
576
691
  .getParameterContext()
@@ -578,17 +693,17 @@ function showActionParameterDialog(
578
693
  }
579
694
  return oValue;
580
695
  })
581
- .then(function(vParamValue: any) {
696
+ .then(function (vParamValue: any) {
582
697
  if (aContexts.length > 1) {
583
698
  // For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
584
699
  let sPathForContext = vParamDefaultValue.$Path;
585
- if (sPathForContext.indexOf(sBindingParameter + "/") === 0) {
586
- sPathForContext = sPathForContext.replace(sBindingParameter + "/", "");
700
+ if (sPathForContext.indexOf(`${sBindingParameter}/`) === 0) {
701
+ sPathForContext = sPathForContext.replace(`${sBindingParameter}/`, "");
587
702
  }
588
703
  for (let i = 1; i < aContexts.length; i++) {
589
704
  if (aContexts[i].getProperty(sPathForContext) !== vParamValue) {
590
705
  // if the values from the contexts are not all the same, do not prefill
591
- resolve({
706
+ inResolve({
592
707
  paramName: sParamName,
593
708
  value: undefined,
594
709
  bNoPossibleValue: true
@@ -596,16 +711,16 @@ function showActionParameterDialog(
596
711
  }
597
712
  }
598
713
  }
599
- resolve({ paramName: sParamName, value: vParamValue });
714
+ inResolve({ paramName: sParamName, value: vParamValue });
600
715
  })
601
- .catch(function() {
716
+ .catch(function () {
602
717
  // Simply clear parameter default if an error has occurred
603
718
  Log.error(
604
719
  "Error while reading default action parameter",
605
720
  sParamName,
606
721
  mParameters.actionName
607
722
  );
608
- resolve({
723
+ inResolve({
609
724
  paramName: sParamName,
610
725
  value: undefined,
611
726
  bLatePropertyError: true
@@ -613,26 +728,25 @@ function showActionParameterDialog(
613
728
  });
614
729
  } else {
615
730
  // Case 1.2: ParameterDefaultValue defines a fixed string value (i.e. vParamDefaultValue = 'someString')
616
- resolve({ paramName: sParamName, value: vParamDefaultValue });
731
+ inResolve({ paramName: sParamName, value: vParamDefaultValue });
617
732
  }
618
- } else {
733
+ } else if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
619
734
  // Case 2: There is no ParameterDefaultValue annotation (=> look into the FLP User Defaults)
620
- if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
621
- resolve({
622
- paramName: sParamName,
623
- value: (oParameterModel as any).oData[sParamName]
624
- });
625
- } else {
626
- resolve({ paramName: sParamName, value: undefined });
627
- }
735
+
736
+ inResolve({
737
+ paramName: sParamName,
738
+ value: (oParameterModel as any).oData[sParamName]
739
+ });
740
+ } else {
741
+ inResolve({ paramName: sParamName, value: undefined });
628
742
  }
629
743
  });
630
744
  };
631
745
 
632
- const getParameterDefaultValue = function(sParamName: any) {
746
+ const getParameterDefaultValue = function (sParamName: any) {
633
747
  const oMetaModel = oDialog.getModel().getMetaModel(),
634
748
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
635
- sActionParameterAnnotationTarget = sActionPath + "/" + sParamName + "@",
749
+ sActionParameterAnnotationTarget = `${sActionPath}/${sParamName}@`,
636
750
  oParameterAnnotations = oMetaModel.getObject(sActionParameterAnnotationTarget),
637
751
  oParameterDefaultValue =
638
752
  oParameterAnnotations &&
@@ -678,9 +792,9 @@ function showActionParameterDialog(
678
792
  }
679
793
 
680
794
  Promise.all([aPrefillParamPromises, aExecFunctionPromises, oExecFunctionFromManifestPromise])
681
- .then(function(aPromises: [any[], any[], any]) {
682
- const aCurrentParamDefaultValue: any = aPromises[0];
683
- const aFunctionParams = aPromises[1];
795
+ .then(function (aPromises: [any[], any[], any]) {
796
+ const currentParamDefaultValue: any = aPromises[0];
797
+ const functionParams = aPromises[1];
684
798
  const oFunctionParamsFromManifest = aPromises[2];
685
799
  let sDialogParamName;
686
800
  for (const i in aActionParameters) {
@@ -693,25 +807,22 @@ function showActionParameterDialog(
693
807
  aActionParameters[i].$Name,
694
808
  oFunctionParamsFromManifest[sDialogParamName]
695
809
  );
696
- } else if (
697
- aCurrentParamDefaultValue[i] &&
698
- aCurrentParamDefaultValue[i].value !== undefined
699
- ) {
810
+ } else if (currentParamDefaultValue[i] && currentParamDefaultValue[i].value !== undefined) {
700
811
  oOperationBinding.setParameter(
701
812
  aActionParameters[i].$Name,
702
- aCurrentParamDefaultValue[i].value
813
+ currentParamDefaultValue[i].value
703
814
  );
704
815
  // if the default value had not been previously determined due to different contexts, we do nothing else
705
- } else if (sBoundFunctionName && !aCurrentParamDefaultValue[i].bNoPossibleValue) {
816
+ } else if (sBoundFunctionName && !currentParamDefaultValue[i].bNoPossibleValue) {
706
817
  if (aContexts.length > 1) {
707
818
  // we check if the function retrieves the same param value for all the contexts:
708
819
  let j = 0;
709
820
  while (j < aContexts.length - 1) {
710
821
  if (
711
- aFunctionParams[j] &&
712
- aFunctionParams[j + 1] &&
713
- aFunctionParams[j].getObject(sDialogParamName) ===
714
- aFunctionParams[j + 1].getObject(sDialogParamName)
822
+ functionParams[j] &&
823
+ functionParams[j + 1] &&
824
+ functionParams[j].getObject(sDialogParamName) ===
825
+ functionParams[j + 1].getObject(sDialogParamName)
715
826
  ) {
716
827
  j++;
717
828
  } else {
@@ -722,22 +833,20 @@ function showActionParameterDialog(
722
833
  if (j === aContexts.length - 1) {
723
834
  oOperationBinding.setParameter(
724
835
  aActionParameters[i].$Name,
725
- aFunctionParams[j].getObject(sDialogParamName)
836
+ functionParams[j].getObject(sDialogParamName)
726
837
  );
727
838
  }
728
- } else {
839
+ } else if (functionParams[0] && functionParams[0].getObject(sDialogParamName)) {
729
840
  //Only one context, then the default param values are to be verified from the function:
730
841
 
731
- if (aFunctionParams[0] && aFunctionParams[0].getObject(sDialogParamName)) {
732
- oOperationBinding.setParameter(
733
- aActionParameters[i].$Name,
734
- aFunctionParams[0].getObject(sDialogParamName)
735
- );
736
- }
842
+ oOperationBinding.setParameter(
843
+ aActionParameters[i].$Name,
844
+ functionParams[0].getObject(sDialogParamName)
845
+ );
737
846
  }
738
847
  }
739
848
  }
740
- const bErrorFound = aCurrentParamDefaultValue.some(function(oValue: any) {
849
+ const bErrorFound = currentParamDefaultValue.some(function (oValue: any) {
741
850
  if (oValue.bLatePropertyError) {
742
851
  return oValue.bLatePropertyError;
743
852
  }
@@ -751,7 +860,9 @@ function showActionParameterDialog(
751
860
  MessageBox.warning(sText, { contentWidth: "25em" } as any);
752
861
  }
753
862
  })
754
- .catch();
863
+ .catch(function (oError: any) {
864
+ Log.error("Error while retrieving the parameter", oError);
865
+ });
755
866
  };
756
867
 
757
868
  if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
@@ -759,20 +870,20 @@ function showActionParameterDialog(
759
870
  sBindingParameter = aParameters[0] && aParameters[0].$Name;
760
871
  aContexts[0]
761
872
  .requestObject()
762
- .then(function(oContextObject: any) {
873
+ .then(function (oContextObject: any) {
763
874
  if (oContextObject) {
764
875
  oOperationBinding.setParameter(sBindingParameter, oContextObject);
765
876
  }
766
877
  fnSetDefaultsAndOpenDialog(sBindingParameter);
767
878
  })
768
- .catch(function(oError: any) {
879
+ .catch(function (oError: any) {
769
880
  Log.error("Error while retrieving the parameter", oError);
770
881
  });
771
882
  } else {
772
883
  fnSetDefaultsAndOpenDialog();
773
884
  }
774
885
  },
775
- afterClose: function() {
886
+ afterClose: function () {
776
887
  oDialog.destroy();
777
888
  }
778
889
  });
@@ -790,10 +901,10 @@ function showActionParameterDialog(
790
901
  const oMVFModel = new JSONModel({});
791
902
  oDialog.setModel(oMVFModel, "mvfview");
792
903
 
793
- let sActionPath = sActionName + "(...)";
904
+ let sActionPath = `${sActionName}(...)`;
794
905
  aContexts = mParameters.aContexts || [];
795
906
  if (!aContexts.length) {
796
- sActionPath = "/" + sActionPath;
907
+ sActionPath = `/${sActionPath}`;
797
908
  }
798
909
  oDialog.bindElement({
799
910
  path: sActionPath
@@ -813,17 +924,6 @@ function showActionParameterDialog(
813
924
  .catch(reject);
814
925
  });
815
926
  }
816
- function prepareActionParameters(oAction: any, aPredefinedParameters: any) {
817
- // check if parameters exist at all
818
- const aParameters = getActionParameters(oAction);
819
- aPredefinedParameters = aPredefinedParameters || [];
820
-
821
- if (aPredefinedParameters.length > 0) {
822
- // TODO: merge the predefined once with the real existing one
823
- }
824
-
825
- return aParameters;
826
- }
827
927
  function getActionParameters(oAction: any) {
828
928
  const aParameters = oAction.getObject("$Parameter") || [];
829
929
  if (aParameters && aParameters.length) {
@@ -835,7 +935,7 @@ function getActionParameters(oAction: any) {
835
935
  return aParameters;
836
936
  }
837
937
  function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBoundAction?: any) {
838
- const vActionCritical = oMetaModel.getObject(sPath + "@com.sap.vocabularies.Common.v1.IsActionCritical");
938
+ const vActionCritical = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.IsActionCritical`);
839
939
  let sCriticalPath = vActionCritical && vActionCritical.$Path;
840
940
  if (!sCriticalPath) {
841
941
  // the static value scenario for isActionCritical
@@ -847,7 +947,7 @@ function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBound
847
947
  aBindingParams && aBindingParams.length && typeof aBindingParams === "object" && sCriticalPath && contexts && contexts.length;
848
948
  if (bCondition) {
849
949
  //in case binding patameters are there in path need to remove eg: - _it/isVerified => need to remove _it and the path should be isVerified
850
- aBindingParams.filter(function(oParams: any) {
950
+ aBindingParams.filter(function (oParams: any) {
851
951
  const index = aPaths && aPaths.indexOf(oParams.$Name);
852
952
  if (index > -1) {
853
953
  aPaths.splice(index, 1);
@@ -862,10 +962,24 @@ function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBound
862
962
  }
863
963
 
864
964
  function executeDependingOnSelectedContexts(oAction: any, mParameters: any, bGetBoundContext: boolean, sGroupId: string) {
865
- let oActionPromise;
866
- 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
+ ) {
867
981
  oActionPromise = bGetBoundContext
868
- ? oAction.execute(sGroupId).then(function() {
982
+ ? oAction.execute(sGroupId).then(function () {
869
983
  return oAction.getBoundContext();
870
984
  })
871
985
  : oAction.execute(sGroupId);
@@ -877,7 +991,7 @@ function executeDependingOnSelectedContexts(oAction: any, mParameters: any, bGet
877
991
  undefined,
878
992
  CommonUtils.fnOnStrictHandlingFailed.bind(operations, sGroupId, mParameters.label, mParameters.model)
879
993
  )
880
- .then(function() {
994
+ .then(function () {
881
995
  return oAction.getBoundContext();
882
996
  })
883
997
  : oAction.execute(
@@ -899,18 +1013,21 @@ function _executeAction(oAppComponent: any, mParameters: any) {
899
1013
  const fnOnResponse = mParameters.fnOnResponse;
900
1014
  const bIsCreateAction = mParameters.bIsCreateAction;
901
1015
  let oAction: any;
1016
+ // let contextIndex = 0;
1017
+ // let aMessages: any[] = [];
902
1018
 
903
1019
  function fnDifferentiate(promise: any) {
904
1020
  return promise.then(
905
- function(response: any) {
906
- const aMessages = messageHandling.getMessages();
1021
+ function (response: any) {
1022
+ let aMessages = messageHandling.getMessages();
1023
+ aMessages = aMessages.concat(messageHandling.getMessages(true, true));
907
1024
  // Action Dialog must remain open if there are response error-messages, because in the java stack the dialog would be closed immediately.
908
1025
  if (aMessages.length > iExistingMessages && aMessages[aMessages.length - 1].type === "Error") {
909
1026
  return { response: response, status: "rejected" };
910
1027
  }
911
1028
  return { response: response, status: "resolved" };
912
1029
  },
913
- function(response: any) {
1030
+ function (response: any) {
914
1031
  return { response: response, status: "rejected" };
915
1032
  }
916
1033
  );
@@ -944,7 +1061,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
944
1061
  }
945
1062
 
946
1063
  if (aContexts.length) {
947
- return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
1064
+ return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
948
1065
  const mBindingParameters = mParameters.mBindingParameters;
949
1066
  const bGrouped = mParameters.bGrouped;
950
1067
  const bReturnAsArray = mParameters.bReturnAsArray;
@@ -953,16 +1070,16 @@ function _executeAction(oAppComponent: any, mParameters: any) {
953
1070
  let oActionPromise;
954
1071
  let i;
955
1072
  let sGroupId: string;
956
- const fnExecuteAction = function(oAction: any, index: any, oSideEffect: any) {
1073
+ const fnExecuteAction = function (actionContext: any, index: any, oSideEffect: any) {
957
1074
  setActionParameterDefaultValue();
958
1075
  // For invocation grouping "isolated" need batch group per action call
959
- sGroupId = !bGrouped ? "$auto." + index : oAction.getUpdateGroupId();
960
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1076
+ sGroupId = !bGrouped ? `$auto.${index}` : actionContext.getUpdateGroupId();
1077
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
961
1078
  aActionPromises.push(oActionPromise);
962
1079
  const oSideEffectsService = oAppComponent.getSideEffectsService();
963
1080
  // trigger actions from side effects
964
1081
  if (oSideEffect && oSideEffect.triggerActions && oSideEffect.triggerActions.length) {
965
- oSideEffect.triggerActions.forEach(function(sTriggerAction: any) {
1082
+ oSideEffect.triggerActions.forEach(function (sTriggerAction: any) {
966
1083
  if (sTriggerAction) {
967
1084
  oSideEffectsService.executeAction(sTriggerAction, oSideEffect.context, sGroupId);
968
1085
  }
@@ -973,7 +1090,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
973
1090
  if (oSideEffect && oSideEffect.pathExpressions && oSideEffect.pathExpressions.length > 0) {
974
1091
  oSideEffectsService
975
1092
  .requestSideEffects(oSideEffect.pathExpressions, oSideEffect.context, sGroupId)
976
- .then(function() {
1093
+ .then(function () {
977
1094
  if (mParameters.operationAvailableMap && mParameters.internalModelContext) {
978
1095
  CommonUtils.setActionEnablement(
979
1096
  mParameters.internalModelContext,
@@ -982,25 +1099,26 @@ function _executeAction(oAppComponent: any, mParameters: any) {
982
1099
  );
983
1100
  }
984
1101
  })
985
- .catch(function(oError: any) {
1102
+ .catch(function (oError: any) {
986
1103
  Log.error("Error while requesting side effects", oError);
987
1104
  });
988
1105
  }
989
1106
  };
990
- const fnExecuteSingleAction = function(oAction: any, index: any, oSideEffect: any) {
991
- 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) => {
992
1110
  let oLocalPromise;
993
1111
  const aLocalPromise = [];
994
1112
  setActionParameterDefaultValue();
995
1113
  // For invocation grouping "isolated" need batch group per action call
996
- sGroupId = "apiMode" + index;
997
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1114
+ sGroupId = `apiMode${index}`;
1115
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
998
1116
  aActionPromises.push(oActionPromise);
999
1117
  aLocalPromise.push(oActionPromise);
1000
1118
  const oSideEffectsService = oAppComponent.getSideEffectsService();
1001
1119
  // trigger actions from side effects
1002
1120
  if (oSideEffect && oSideEffect.triggerActions && oSideEffect.triggerActions.length) {
1003
- oSideEffect.triggerActions.forEach(function(sTriggerAction: any) {
1121
+ oSideEffect.triggerActions.forEach(function (sTriggerAction: any) {
1004
1122
  if (sTriggerAction) {
1005
1123
  oLocalPromise = oSideEffectsService.executeAction(sTriggerAction, oSideEffect.context, sGroupId);
1006
1124
  aLocalPromise.push(oLocalPromise);
@@ -1013,7 +1131,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1013
1131
  oLocalPromise = oSideEffectsService.requestSideEffects(oSideEffect.pathExpressions, oSideEffect.context, sGroupId);
1014
1132
  aLocalPromise.push(oLocalPromise);
1015
1133
  oLocalPromise
1016
- .then(function() {
1134
+ .then(function () {
1017
1135
  if (mParameters.operationAvailableMap && mParameters.internalModelContext) {
1018
1136
  CommonUtils.setActionEnablement(
1019
1137
  mParameters.internalModelContext,
@@ -1022,23 +1140,22 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1022
1140
  );
1023
1141
  }
1024
1142
  })
1025
- .catch(function(oError: any) {
1143
+ .catch(function (oError: any) {
1026
1144
  Log.error("Error while requesting side effects", oError);
1027
1145
  });
1028
1146
  }
1029
1147
  oModel.submitBatch(sGroupId);
1030
1148
  Promise.all(aLocalPromise)
1031
- .then(function() {
1032
- return resolve();
1149
+ .then(function () {
1150
+ return actionResolve();
1033
1151
  })
1034
- .catch(function() {
1035
- return resolve();
1152
+ .catch(function () {
1153
+ return actionResolve();
1036
1154
  });
1037
1155
  });
1038
- return oPromise;
1039
1156
  };
1040
1157
 
1041
- function fnExecuteSequentially(aContexts: any) {
1158
+ function fnExecuteSequentially(contextsToExecute: any) {
1042
1159
  // One action and its side effects are completed before the next action is executed
1043
1160
  (
1044
1161
  fnOnSubmitted ||
@@ -1046,9 +1163,9 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1046
1163
  /**/
1047
1164
  }
1048
1165
  )(aActionPromises);
1049
- function processOneAction(context: any, i: any) {
1050
- oAction = oModel.bindContext(sActionName + "(...)", context, mBindingParameters);
1051
- return fnExecuteSingleAction(oAction, i, {
1166
+ function processOneAction(context: any, actionIndex: any) {
1167
+ oAction = oModel.bindContext(`${sActionName}(...)`, context, mBindingParameters);
1168
+ return fnExecuteSingleAction(oAction, actionIndex, {
1052
1169
  context: context,
1053
1170
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
1054
1171
  triggerActions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.triggerActions
@@ -1057,26 +1174,29 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1057
1174
 
1058
1175
  let oActionAndSideEffectPromise = Promise.resolve();
1059
1176
  let j = 0;
1060
- aContexts.forEach(function(context: any) {
1177
+ contextsToExecute.forEach(function (context: any) {
1061
1178
  const id = ++j;
1062
- oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function() {
1179
+ oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function () {
1063
1180
  return processOneAction(context, id);
1064
1181
  });
1065
1182
  });
1066
1183
  oActionAndSideEffectPromise
1067
- .then(function() {
1184
+ .then(function () {
1068
1185
  fnHandleResults();
1069
1186
  })
1070
- .catch();
1187
+ .catch(function (oError: any) {
1188
+ Log.error(oError);
1189
+ });
1071
1190
  }
1072
1191
 
1073
- if (mParameters.bObjectPage && !bGrouped) {
1074
- // For invocation grouping "isolated" called from ObjectPage, ensure that each action and matching side effects
1192
+ if (!bGrouped) {
1193
+ // For invocation grouping "isolated", ensure that each action and matching side effects
1075
1194
  // are processed before the next set is submitted. Workaround until JSON batch is available.
1195
+ // Allow also for List Report.
1076
1196
  fnExecuteSequentially(aContexts);
1077
1197
  } else {
1078
1198
  for (i = 0; i < aContexts.length; i++) {
1079
- oAction = oModel.bindContext(sActionName + "(...)", aContexts[i], mBindingParameters);
1199
+ oAction = oModel.bindContext(`${sActionName}(...)`, aContexts[i], mBindingParameters);
1080
1200
  fnExecuteAction(oAction, aContexts.length <= 1 ? null : i, {
1081
1201
  context: aContexts[i],
1082
1202
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
@@ -1094,7 +1214,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1094
1214
 
1095
1215
  function fnHandleResults() {
1096
1216
  Promise.all(aActionPromises.map(fnDifferentiate))
1097
- .then(function(results: any[]) {
1217
+ .then(function (results: any[]) {
1098
1218
  const aRejectedItems = [];
1099
1219
  const aResolvedItems = [];
1100
1220
  let iResultCount;
@@ -1132,7 +1252,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1132
1252
  })
1133
1253
  .catch(reject);
1134
1254
  }
1135
- }).finally(function() {
1255
+ }).finally(function () {
1136
1256
  (
1137
1257
  fnOnResponse ||
1138
1258
  function noop() {
@@ -1141,7 +1261,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1141
1261
  )();
1142
1262
  });
1143
1263
  } else {
1144
- oAction = oModel.bindContext("/" + sActionName + "(...)");
1264
+ oAction = oModel.bindContext(`/${sActionName}(...)`);
1145
1265
  setActionParameterDefaultValue();
1146
1266
  const sGroupId = "actionImport";
1147
1267
  const oActionPromise = oAction.execute(
@@ -1157,7 +1277,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1157
1277
  /**/
1158
1278
  }
1159
1279
  )(oActionPromise);
1160
- return oActionPromise.finally(function() {
1280
+ return oActionPromise.finally(function () {
1161
1281
  (
1162
1282
  fnOnResponse ||
1163
1283
  function noop() {
@@ -1170,7 +1290,21 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1170
1290
  function _getPath(oActionContext: any, sActionName: any) {
1171
1291
  let sPath = oActionContext.getPath();
1172
1292
  sPath = oActionContext.getObject("$IsBound") ? sPath.split("@$ui5.overload")[0] : sPath.split("/0")[0];
1173
- 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;
1174
1308
  }
1175
1309
 
1176
1310
  /**
@@ -1187,7 +1321,8 @@ const operations = {
1187
1321
  callActionImport: callActionImport,
1188
1322
  callBoundFunction: callBoundFunction,
1189
1323
  callFunctionImport: callFunctionImport,
1190
- executeDependingOnSelectedContexts: executeDependingOnSelectedContexts
1324
+ executeDependingOnSelectedContexts: executeDependingOnSelectedContexts,
1325
+ showActionParameterDialog: _showActionParameterDialog
1191
1326
  };
1192
1327
 
1193
1328
  export default operations;