@sapui5/sap.fe.core 1.102.2 → 1.104.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/package.json +6 -6
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +73 -30
  4. package/src/sap/fe/core/AppComponent.ts +65 -43
  5. package/src/sap/fe/core/AppStateHandler.js +82 -70
  6. package/src/sap/fe/core/AppStateHandler.ts +32 -37
  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 +227 -126
  10. package/src/sap/fe/core/CommonUtils.ts +240 -163
  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/BuildingBlock.js +181 -43
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
  23. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
  24. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
  25. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
  26. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
  27. package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
  28. package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
  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 +101 -74
  32. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
  33. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
  34. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
  35. package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
  36. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
  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 +9 -9
  40. package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
  41. package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
  42. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
  43. package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
  44. package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
  45. package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
  46. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
  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 +170 -139
  52. package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
  56. package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
  58. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
  59. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
  60. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
  61. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
  62. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
  63. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
  64. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
  65. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
  66. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
  67. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
  68. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
  69. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
  70. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
  71. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
  72. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
  73. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
  74. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
  75. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
  76. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
  77. package/src/sap/fe/core/controls/Any.js +9 -5
  78. package/src/sap/fe/core/controls/Any.ts +10 -4
  79. package/src/sap/fe/core/controls/CommandExecution.js +11 -25
  80. package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
  81. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  82. package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
  84. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
  86. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
  87. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
  88. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
  89. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  90. package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
  91. package/src/sap/fe/core/controls/FileWrapper.js +7 -2
  92. package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
  93. package/src/sap/fe/core/controls/FilterBar.js +6 -2
  94. package/src/sap/fe/core/controls/FilterBar.ts +13 -9
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
  97. package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
  98. package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
  99. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
  100. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
  101. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
  102. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
  103. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
  104. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
  105. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
  106. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
  107. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
  108. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
  109. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
  110. package/src/sap/fe/core/converters/ConverterContext.js +26 -33
  111. package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
  112. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  113. package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
  114. package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
  115. package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
  116. package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
  117. package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
  118. package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
  119. package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
  120. package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
  121. package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
  122. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
  123. package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
  124. package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
  125. package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
  126. package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
  127. package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
  128. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
  129. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
  130. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
  131. package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
  132. package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
  133. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
  134. package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
  135. package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
  136. package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
  137. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
  138. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
  139. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
  140. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
  141. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
  142. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
  143. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
  144. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
  145. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
  146. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
  147. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
  148. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
  149. package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
  150. package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
  151. package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
  152. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
  153. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
  154. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
  155. package/src/sap/fe/core/converters/helpers/ID.js +48 -46
  156. package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
  157. package/src/sap/fe/core/converters/helpers/Key.js +7 -7
  158. package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
  159. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  160. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
  161. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
  162. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
  163. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
  164. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
  165. package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
  166. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
  167. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
  168. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
  169. package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
  170. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
  171. package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
  172. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
  173. package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
  174. package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
  175. package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
  176. package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
  177. package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
  178. package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
  179. package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
  180. package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
  181. package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
  182. package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
  183. package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
  184. package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
  185. package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
  186. package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
  187. package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
  188. package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
  189. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
  190. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
  191. package/src/sap/fe/core/helpers/EditState.js +1 -6
  192. package/src/sap/fe/core/helpers/EditState.ts +5 -10
  193. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
  194. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
  195. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  196. package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
  197. package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
  198. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
  199. package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
  200. package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
  201. package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
  202. package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
  203. package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
  204. package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
  205. package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
  206. package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
  207. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  208. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
  209. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
  210. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
  211. package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
  212. package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
  213. package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
  214. package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
  215. package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
  216. package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
  217. package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
  218. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
  219. package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
  220. package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
  221. package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
  222. package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
  223. package/src/sap/fe/core/library.js +42 -3
  224. package/src/sap/fe/core/library.ts +38 -0
  225. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
  226. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
  227. package/src/sap/fe/core/messagebundle.properties +39 -63
  228. package/src/sap/fe/core/messagebundle_ar.properties +25 -39
  229. package/src/sap/fe/core/messagebundle_bg.properties +25 -39
  230. package/src/sap/fe/core/messagebundle_ca.properties +25 -39
  231. package/src/sap/fe/core/messagebundle_cs.properties +25 -39
  232. package/src/sap/fe/core/messagebundle_cy.properties +25 -39
  233. package/src/sap/fe/core/messagebundle_da.properties +25 -39
  234. package/src/sap/fe/core/messagebundle_de.properties +25 -39
  235. package/src/sap/fe/core/messagebundle_el.properties +26 -40
  236. package/src/sap/fe/core/messagebundle_en.properties +25 -39
  237. package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
  238. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
  239. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
  240. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
  241. package/src/sap/fe/core/messagebundle_es.properties +27 -41
  242. package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
  243. package/src/sap/fe/core/messagebundle_et.properties +25 -39
  244. package/src/sap/fe/core/messagebundle_fi.properties +25 -39
  245. package/src/sap/fe/core/messagebundle_fr.properties +26 -40
  246. package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
  247. package/src/sap/fe/core/messagebundle_hi.properties +25 -39
  248. package/src/sap/fe/core/messagebundle_hr.properties +25 -39
  249. package/src/sap/fe/core/messagebundle_hu.properties +25 -39
  250. package/src/sap/fe/core/messagebundle_id.properties +25 -39
  251. package/src/sap/fe/core/messagebundle_it.properties +41 -55
  252. package/src/sap/fe/core/messagebundle_iw.properties +25 -39
  253. package/src/sap/fe/core/messagebundle_ja.properties +25 -39
  254. package/src/sap/fe/core/messagebundle_kk.properties +25 -39
  255. package/src/sap/fe/core/messagebundle_ko.properties +30 -44
  256. package/src/sap/fe/core/messagebundle_lt.properties +25 -39
  257. package/src/sap/fe/core/messagebundle_lv.properties +25 -39
  258. package/src/sap/fe/core/messagebundle_ms.properties +25 -39
  259. package/src/sap/fe/core/messagebundle_nl.properties +27 -41
  260. package/src/sap/fe/core/messagebundle_no.properties +25 -39
  261. package/src/sap/fe/core/messagebundle_pl.properties +26 -40
  262. package/src/sap/fe/core/messagebundle_pt.properties +26 -40
  263. package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
  264. package/src/sap/fe/core/messagebundle_ro.properties +25 -39
  265. package/src/sap/fe/core/messagebundle_ru.properties +25 -39
  266. package/src/sap/fe/core/messagebundle_sh.properties +25 -39
  267. package/src/sap/fe/core/messagebundle_sk.properties +25 -39
  268. package/src/sap/fe/core/messagebundle_sl.properties +25 -39
  269. package/src/sap/fe/core/messagebundle_sv.properties +25 -39
  270. package/src/sap/fe/core/messagebundle_th.properties +25 -39
  271. package/src/sap/fe/core/messagebundle_tr.properties +25 -39
  272. package/src/sap/fe/core/messagebundle_uk.properties +25 -39
  273. package/src/sap/fe/core/messagebundle_vi.properties +25 -39
  274. package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
  275. package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
  276. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  277. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
  278. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
  279. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
  280. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  281. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
  282. package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
  283. package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
  284. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  285. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
  286. package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
  287. package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
  288. package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
  289. package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
  290. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
  291. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
  292. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
  293. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
  294. package/src/sap/fe/core/support/CommonHelper.js +3 -2
  295. package/src/sap/fe/core/support/CommonHelper.ts +9 -13
  296. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  297. package/src/sap/fe/core/support/Diagnostics.ts +5 -5
  298. package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
  299. package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
  300. package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
  301. package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
  302. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
  303. package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
  304. package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
  305. package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
  306. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  307. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
  308. package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
  309. package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
  310. package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
  311. package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
  312. package/src/sap/fe/core/templating/FilterHelper.js +16 -15
  313. package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
  314. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  315. package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
  316. package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
  317. package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
  318. package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
  319. package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
  320. package/src/sap/fe/core/templating/UIFormatters.js +152 -95
  321. package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
  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/helpers/BindingExpression.js +0 -1732
@@ -13,6 +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 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,22 +120,20 @@ 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);
@@ -162,14 +161,13 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
162
161
  let oReturnType;
163
162
  const actionDefinition = oAction.getObject();
164
163
  if (!oAction || !oAction.getObject()) {
165
- return reject(new Error("Action " + sActionName + " not found"));
166
- }
167
- if (bShowActionParameterDialog || aActionParameters.length > 0) {
168
- aActionParameters = prepareActionParameters(oAction, aActionParameters);
169
- if (!aActionParameters || aActionParameters.length === 0) {
170
- bShowActionParameterDialog = false;
171
- }
164
+ return reject(new Error(`Action ${sActionName} not found`));
172
165
  }
166
+
167
+ aActionParameters = getActionParameters(oAction);
168
+
169
+ bShowActionParameterDialog = _showActionParameterDialog(bShowActionParameterDialog, aActionParameters);
170
+
173
171
  if (bShowActionParameterDialog) {
174
172
  fnDialog = showActionParameterDialog;
175
173
  } else if (bIsCriticalAction) {
@@ -189,7 +187,7 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
189
187
  if (mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions) {
190
188
  oMetaModel = oModel.getMetaModel();
191
189
  sMetaPath = oMetaModel.getMetaPath(aContexts[0].getPath());
192
- sMessagesPath = oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
190
+ sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
193
191
 
194
192
  if (sMessagesPath) {
195
193
  iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function (exp: any) {
@@ -208,12 +206,12 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
208
206
  mParameters.mBindingParameters = mParameters.mBindingParameters || {};
209
207
 
210
208
  if (
211
- oAction.getObject("$ReturnType/$Type/" + sMessagesPath) &&
209
+ oAction.getObject(`$ReturnType/$Type/${sMessagesPath}`) &&
212
210
  (!mParameters.mBindingParameters.$select ||
213
211
  mParameters.mBindingParameters.$select.split(",").indexOf(sMessagesPath) === -1)
214
212
  ) {
215
213
  mParameters.mBindingParameters.$select = mParameters.mBindingParameters.$select
216
- ? mParameters.mBindingParameters.$select + "," + sMessagesPath
214
+ ? `${mParameters.mBindingParameters.$select},${sMessagesPath}`
217
215
  : sMessagesPath;
218
216
  // Add side effects at entity level because $select stops these being returned by the action
219
217
  // Only if no other side effects were added for Messages
@@ -309,7 +307,7 @@ function confirmCriticalAction(
309
307
  let boundActionName = sActionName ? sActionName : null;
310
308
  boundActionName =
311
309
  boundActionName.indexOf(".") >= 0 ? boundActionName.split(".")[boundActionName.split(".").length - 1] : boundActionName;
312
- const suffixResourceKey = boundActionName && entitySetName ? entitySetName + "|" + boundActionName : "";
310
+ const suffixResourceKey = boundActionName && entitySetName ? `${entitySetName}|${boundActionName}` : "";
313
311
  const oResourceBundle = oParentControl.getController().oResourceBundle;
314
312
  const sConfirmationText = CommonUtils.getTranslatedText(
315
313
  "C_OPERATIONS_ACTION_CONFIRM_MESSAGE",
@@ -391,34 +389,33 @@ function showActionParameterDialog(
391
389
  return aResults;
392
390
  });
393
391
  };
394
- const _validateMessages = function (aActionParameters: any, aFieldInvalid: any, bClearTarget?: boolean) {
392
+ const _validateMessages = function (actionParameters: any, invalidFields: any, bClearTarget?: boolean) {
395
393
  const oMessageManager = Core.getMessageManager();
396
394
  const aMessages = oMessageManager.getMessageModel().getData();
397
395
 
398
- aFieldInvalid = aFieldInvalid || [];
396
+ invalidFields = invalidFields || [];
399
397
 
400
398
  if (!aMessages.length) {
401
- aFieldInvalid = [];
399
+ invalidFields = [];
402
400
  }
403
- aActionParameters.forEach(function (oActionParameters: any) {
401
+ actionParameters.forEach(function (oActionParameters: any) {
404
402
  const sParameter = oActionParameters.$Name;
405
403
  aMessages.forEach(function (oMessage: any) {
406
404
  const sParam = sParameter.replace("-inner", "");
407
405
  if (
408
406
  oMessage.controlIds.length > 0 &&
409
- (oMessage.getControlId().includes("APD_::" + sParameter) ||
410
- (oMessage.getControlId().includes("APD_::" + sParameter + "inner") &&
411
- aFieldInvalid.indexOf("APD_::" + sParam) < 0))
407
+ (oMessage.getControlId().includes(`APD_::${sParameter}`) ||
408
+ (oMessage.getControlId().includes(`APD_::${sParameter}inner`) && invalidFields.indexOf(`APD_::${sParam}`) < 0))
412
409
  ) {
413
410
  if (bClearTarget) {
414
411
  oMessageManager.removeMessages(oMessage);
415
412
  } else {
416
- aFieldInvalid.push("APD_::" + sParam);
413
+ invalidFields.push(`APD_::${sParam}`);
417
414
  }
418
415
  }
419
416
  // Handle messages related to input with invalid token
420
- if (oMessage.target.includes("APD_::" + sParameter)) {
421
- aFieldInvalid.push("APD_::" + sParam);
417
+ if (oMessage.target.includes(`APD_::${sParameter}`)) {
418
+ invalidFields.push(`APD_::${sParam}`);
422
419
  oMessage.target = bClearTarget ? "" : oMessage.target;
423
420
  if (bClearTarget) {
424
421
  oMessageManager.removeMessages(oMessage);
@@ -426,7 +423,7 @@ function showActionParameterDialog(
426
423
  }
427
424
  });
428
425
  });
429
- return aFieldInvalid;
426
+ return invalidFields;
430
427
  };
431
428
  const oController = {
432
429
  handleChange: function (oEvent: any) {
@@ -462,14 +459,14 @@ function showActionParameterDialog(
462
459
  }
463
460
  )
464
461
  )
465
- .then(function (oFragment: any) {
462
+ .then(function (createdFragment: any) {
466
463
  // TODO: move the dialog into the fragment and move the handlers to the oController
467
464
  let aContexts: any[];
468
465
  const aFunctionParams: any[] = [];
469
466
  let oOperationBinding: any;
470
467
  return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function () {
471
468
  // TODO: move the dialog into the fragment and move the handlers to the oController
472
- return Fragment.load({ definition: oFragment, controller: oController }).then(function (oDialogContent: any) {
469
+ return Fragment.load({ definition: createdFragment, controller: oController }).then(function (oDialogContent: any) {
473
470
  const oResourceBundle = oParentControl.getController().oResourceBundle;
474
471
  const oDialog = new Dialog(undefined, {
475
472
  title:
@@ -528,7 +525,7 @@ function showActionParameterDialog(
528
525
  if (aActionParameters[i].$isCollection) {
529
526
  const aMVFContent = oDialog
530
527
  .getModel("mvfview")
531
- .getProperty("/" + aActionParameters[i].$Name),
528
+ .getProperty(`/${aActionParameters[i].$Name}`),
532
529
  aKeyValues = [];
533
530
  for (const j in aMVFContent) {
534
531
  aKeyValues.push(aMVFContent[j].Key);
@@ -554,18 +551,33 @@ function showActionParameterDialog(
554
551
  !(!mParameters.control.isA("sap.ui.mdc.Table") && aContexts.length === 1) &&
555
552
  messages.length
556
553
  ) {
557
- 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
+ }
558
571
  }
559
572
  throw oError;
560
573
  });
561
574
  })
562
575
  .catch(function () {
563
576
  const oMessageManager = Core.getMessageManager();
564
- let messages = oMessageManager.getMessageModel().getData();
577
+ const messages = oMessageManager.getMessageModel().getData();
565
578
  const subtitleColumn = CommonUtils.getMessageColumn(mParameters.control);
566
- let errorContext = undefined;
567
- let errorTargetsInAPM = false;
568
- let bShowMessageBox = false;
579
+ let errorContext;
580
+ let errorTargetsInAPD = false;
569
581
  messages.forEach(function (message: any) {
570
582
  const messageTargets = message.getTargets();
571
583
  if (messageTargets && messageTargets.length === 1 && messageTargets[0].length) {
@@ -576,16 +588,31 @@ function showActionParameterDialog(
576
588
  ? errorContext.getObject()[subtitleColumn]
577
589
  : undefined;
578
590
  }
579
-
580
591
  if (
581
592
  message.getTarget().indexOf(mParameters.actionName) !== -1 &&
582
593
  message.getTarget().indexOf(mParameters.aActionParameters[0].$Name) !== -1 &&
583
- errorTargetsInAPM === false
594
+ errorTargetsInAPD === false
584
595
  ) {
585
- errorTargetsInAPM = true;
596
+ errorTargetsInAPD = true;
586
597
  }
587
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
+ }
588
613
 
614
+ const showErrorInAPD = oDialog.isOpen() && errorTargetsInAPD;
615
+ let bShowMessageBox = false;
589
616
  if (
590
617
  messages.length === 1 &&
591
618
  messages[0].getTarget() !== undefined &&
@@ -607,7 +634,7 @@ function showActionParameterDialog(
607
634
  messagePageNavigationCallback: function () {
608
635
  oDialog.close();
609
636
  },
610
- errorTargetsInAPM: errorTargetsInAPM,
637
+ showErrorInAPD: showErrorInAPD,
611
638
  bShowMessageBox: bShowMessageBox
612
639
  });
613
640
  if (oDialog && bHasEtagMessage && oDialog.isOpen()) {
@@ -641,14 +668,15 @@ function showActionParameterDialog(
641
668
  const oMetaModel = oDialog.getModel().getMetaModel(),
642
669
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
643
670
  sDefaultValuesFunction = oMetaModel.getObject(
644
- sActionPath + "@com.sap.vocabularies.Common.v1.DefaultValuesFunction"
671
+ `${sActionPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
645
672
  );
646
673
  return sDefaultValuesFunction;
647
674
  };
648
675
  const fnSetDefaultsAndOpenDialog = function (sBindingParameter?: any) {
649
676
  const sBoundFunctionName = getDefaultValuesFunction();
650
677
  const prefillParameter = function (sParamName: any, vParamDefaultValue: any) {
651
- return new Promise((resolve) => {
678
+ // eslint-disable-next-line promise/param-names
679
+ return new Promise((inResolve) => {
652
680
  // Case 1: There is a ParameterDefaultValue annotation
653
681
  if (vParamDefaultValue !== undefined) {
654
682
  if (aContexts.length > 0 && vParamDefaultValue.$Path) {
@@ -669,13 +697,13 @@ function showActionParameterDialog(
669
697
  if (aContexts.length > 1) {
670
698
  // For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
671
699
  let sPathForContext = vParamDefaultValue.$Path;
672
- if (sPathForContext.indexOf(sBindingParameter + "/") === 0) {
673
- sPathForContext = sPathForContext.replace(sBindingParameter + "/", "");
700
+ if (sPathForContext.indexOf(`${sBindingParameter}/`) === 0) {
701
+ sPathForContext = sPathForContext.replace(`${sBindingParameter}/`, "");
674
702
  }
675
703
  for (let i = 1; i < aContexts.length; i++) {
676
704
  if (aContexts[i].getProperty(sPathForContext) !== vParamValue) {
677
705
  // if the values from the contexts are not all the same, do not prefill
678
- resolve({
706
+ inResolve({
679
707
  paramName: sParamName,
680
708
  value: undefined,
681
709
  bNoPossibleValue: true
@@ -683,7 +711,7 @@ function showActionParameterDialog(
683
711
  }
684
712
  }
685
713
  }
686
- resolve({ paramName: sParamName, value: vParamValue });
714
+ inResolve({ paramName: sParamName, value: vParamValue });
687
715
  })
688
716
  .catch(function () {
689
717
  // Simply clear parameter default if an error has occurred
@@ -692,7 +720,7 @@ function showActionParameterDialog(
692
720
  sParamName,
693
721
  mParameters.actionName
694
722
  );
695
- resolve({
723
+ inResolve({
696
724
  paramName: sParamName,
697
725
  value: undefined,
698
726
  bLatePropertyError: true
@@ -700,18 +728,17 @@ function showActionParameterDialog(
700
728
  });
701
729
  } else {
702
730
  // Case 1.2: ParameterDefaultValue defines a fixed string value (i.e. vParamDefaultValue = 'someString')
703
- resolve({ paramName: sParamName, value: vParamDefaultValue });
731
+ inResolve({ paramName: sParamName, value: vParamDefaultValue });
704
732
  }
705
- } else {
733
+ } else if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
706
734
  // Case 2: There is no ParameterDefaultValue annotation (=> look into the FLP User Defaults)
707
- if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
708
- resolve({
709
- paramName: sParamName,
710
- value: (oParameterModel as any).oData[sParamName]
711
- });
712
- } else {
713
- resolve({ paramName: sParamName, value: undefined });
714
- }
735
+
736
+ inResolve({
737
+ paramName: sParamName,
738
+ value: (oParameterModel as any).oData[sParamName]
739
+ });
740
+ } else {
741
+ inResolve({ paramName: sParamName, value: undefined });
715
742
  }
716
743
  });
717
744
  };
@@ -719,7 +746,7 @@ function showActionParameterDialog(
719
746
  const getParameterDefaultValue = function (sParamName: any) {
720
747
  const oMetaModel = oDialog.getModel().getMetaModel(),
721
748
  sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
722
- sActionParameterAnnotationTarget = sActionPath + "/" + sParamName + "@",
749
+ sActionParameterAnnotationTarget = `${sActionPath}/${sParamName}@`,
723
750
  oParameterAnnotations = oMetaModel.getObject(sActionParameterAnnotationTarget),
724
751
  oParameterDefaultValue =
725
752
  oParameterAnnotations &&
@@ -766,8 +793,8 @@ function showActionParameterDialog(
766
793
 
767
794
  Promise.all([aPrefillParamPromises, aExecFunctionPromises, oExecFunctionFromManifestPromise])
768
795
  .then(function (aPromises: [any[], any[], any]) {
769
- const aCurrentParamDefaultValue: any = aPromises[0];
770
- const aFunctionParams = aPromises[1];
796
+ const currentParamDefaultValue: any = aPromises[0];
797
+ const functionParams = aPromises[1];
771
798
  const oFunctionParamsFromManifest = aPromises[2];
772
799
  let sDialogParamName;
773
800
  for (const i in aActionParameters) {
@@ -780,25 +807,22 @@ function showActionParameterDialog(
780
807
  aActionParameters[i].$Name,
781
808
  oFunctionParamsFromManifest[sDialogParamName]
782
809
  );
783
- } else if (
784
- aCurrentParamDefaultValue[i] &&
785
- aCurrentParamDefaultValue[i].value !== undefined
786
- ) {
810
+ } else if (currentParamDefaultValue[i] && currentParamDefaultValue[i].value !== undefined) {
787
811
  oOperationBinding.setParameter(
788
812
  aActionParameters[i].$Name,
789
- aCurrentParamDefaultValue[i].value
813
+ currentParamDefaultValue[i].value
790
814
  );
791
815
  // if the default value had not been previously determined due to different contexts, we do nothing else
792
- } else if (sBoundFunctionName && !aCurrentParamDefaultValue[i].bNoPossibleValue) {
816
+ } else if (sBoundFunctionName && !currentParamDefaultValue[i].bNoPossibleValue) {
793
817
  if (aContexts.length > 1) {
794
818
  // we check if the function retrieves the same param value for all the contexts:
795
819
  let j = 0;
796
820
  while (j < aContexts.length - 1) {
797
821
  if (
798
- aFunctionParams[j] &&
799
- aFunctionParams[j + 1] &&
800
- aFunctionParams[j].getObject(sDialogParamName) ===
801
- aFunctionParams[j + 1].getObject(sDialogParamName)
822
+ functionParams[j] &&
823
+ functionParams[j + 1] &&
824
+ functionParams[j].getObject(sDialogParamName) ===
825
+ functionParams[j + 1].getObject(sDialogParamName)
802
826
  ) {
803
827
  j++;
804
828
  } else {
@@ -809,22 +833,20 @@ function showActionParameterDialog(
809
833
  if (j === aContexts.length - 1) {
810
834
  oOperationBinding.setParameter(
811
835
  aActionParameters[i].$Name,
812
- aFunctionParams[j].getObject(sDialogParamName)
836
+ functionParams[j].getObject(sDialogParamName)
813
837
  );
814
838
  }
815
- } else {
839
+ } else if (functionParams[0] && functionParams[0].getObject(sDialogParamName)) {
816
840
  //Only one context, then the default param values are to be verified from the function:
817
841
 
818
- if (aFunctionParams[0] && aFunctionParams[0].getObject(sDialogParamName)) {
819
- oOperationBinding.setParameter(
820
- aActionParameters[i].$Name,
821
- aFunctionParams[0].getObject(sDialogParamName)
822
- );
823
- }
842
+ oOperationBinding.setParameter(
843
+ aActionParameters[i].$Name,
844
+ functionParams[0].getObject(sDialogParamName)
845
+ );
824
846
  }
825
847
  }
826
848
  }
827
- const bErrorFound = aCurrentParamDefaultValue.some(function (oValue: any) {
849
+ const bErrorFound = currentParamDefaultValue.some(function (oValue: any) {
828
850
  if (oValue.bLatePropertyError) {
829
851
  return oValue.bLatePropertyError;
830
852
  }
@@ -838,7 +860,9 @@ function showActionParameterDialog(
838
860
  MessageBox.warning(sText, { contentWidth: "25em" } as any);
839
861
  }
840
862
  })
841
- .catch();
863
+ .catch(function (oError: any) {
864
+ Log.error("Error while retrieving the parameter", oError);
865
+ });
842
866
  };
843
867
 
844
868
  if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
@@ -877,10 +901,10 @@ function showActionParameterDialog(
877
901
  const oMVFModel = new JSONModel({});
878
902
  oDialog.setModel(oMVFModel, "mvfview");
879
903
 
880
- let sActionPath = sActionName + "(...)";
904
+ let sActionPath = `${sActionName}(...)`;
881
905
  aContexts = mParameters.aContexts || [];
882
906
  if (!aContexts.length) {
883
- sActionPath = "/" + sActionPath;
907
+ sActionPath = `/${sActionPath}`;
884
908
  }
885
909
  oDialog.bindElement({
886
910
  path: sActionPath
@@ -900,17 +924,6 @@ function showActionParameterDialog(
900
924
  .catch(reject);
901
925
  });
902
926
  }
903
- function prepareActionParameters(oAction: any, aPredefinedParameters: any) {
904
- // check if parameters exist at all
905
- const aParameters = getActionParameters(oAction);
906
- aPredefinedParameters = aPredefinedParameters || [];
907
-
908
- if (aPredefinedParameters.length > 0) {
909
- // TODO: merge the predefined once with the real existing one
910
- }
911
-
912
- return aParameters;
913
- }
914
927
  function getActionParameters(oAction: any) {
915
928
  const aParameters = oAction.getObject("$Parameter") || [];
916
929
  if (aParameters && aParameters.length) {
@@ -922,7 +935,7 @@ function getActionParameters(oAction: any) {
922
935
  return aParameters;
923
936
  }
924
937
  function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBoundAction?: any) {
925
- const vActionCritical = oMetaModel.getObject(sPath + "@com.sap.vocabularies.Common.v1.IsActionCritical");
938
+ const vActionCritical = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.IsActionCritical`);
926
939
  let sCriticalPath = vActionCritical && vActionCritical.$Path;
927
940
  if (!sCriticalPath) {
928
941
  // the static value scenario for isActionCritical
@@ -1057,11 +1070,11 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1057
1070
  let oActionPromise;
1058
1071
  let i;
1059
1072
  let sGroupId: string;
1060
- const fnExecuteAction = function (oAction: any, index: any, oSideEffect: any) {
1073
+ const fnExecuteAction = function (actionContext: any, index: any, oSideEffect: any) {
1061
1074
  setActionParameterDefaultValue();
1062
1075
  // For invocation grouping "isolated" need batch group per action call
1063
- sGroupId = !bGrouped ? "$auto." + index : oAction.getUpdateGroupId();
1064
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1076
+ sGroupId = !bGrouped ? `$auto.${index}` : actionContext.getUpdateGroupId();
1077
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
1065
1078
  aActionPromises.push(oActionPromise);
1066
1079
  const oSideEffectsService = oAppComponent.getSideEffectsService();
1067
1080
  // trigger actions from side effects
@@ -1091,14 +1104,15 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1091
1104
  });
1092
1105
  }
1093
1106
  };
1094
- const fnExecuteSingleAction = function (oAction: any, index: any, oSideEffect: any) {
1095
- 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) => {
1096
1110
  let oLocalPromise;
1097
1111
  const aLocalPromise = [];
1098
1112
  setActionParameterDefaultValue();
1099
1113
  // For invocation grouping "isolated" need batch group per action call
1100
- sGroupId = "apiMode" + index;
1101
- oActionPromise = executeDependingOnSelectedContexts(oAction, mParameters, bGetBoundContext, sGroupId);
1114
+ sGroupId = `apiMode${index}`;
1115
+ oActionPromise = executeDependingOnSelectedContexts(actionContext, mParameters, bGetBoundContext, sGroupId);
1102
1116
  aActionPromises.push(oActionPromise);
1103
1117
  aLocalPromise.push(oActionPromise);
1104
1118
  const oSideEffectsService = oAppComponent.getSideEffectsService();
@@ -1133,16 +1147,15 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1133
1147
  oModel.submitBatch(sGroupId);
1134
1148
  Promise.all(aLocalPromise)
1135
1149
  .then(function () {
1136
- return resolve();
1150
+ return actionResolve();
1137
1151
  })
1138
1152
  .catch(function () {
1139
- return resolve();
1153
+ return actionResolve();
1140
1154
  });
1141
1155
  });
1142
- return oPromise;
1143
1156
  };
1144
1157
 
1145
- function fnExecuteSequentially(aContexts: any) {
1158
+ function fnExecuteSequentially(contextsToExecute: any) {
1146
1159
  // One action and its side effects are completed before the next action is executed
1147
1160
  (
1148
1161
  fnOnSubmitted ||
@@ -1150,9 +1163,9 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1150
1163
  /**/
1151
1164
  }
1152
1165
  )(aActionPromises);
1153
- function processOneAction(context: any, i: any) {
1154
- oAction = oModel.bindContext(sActionName + "(...)", context, mBindingParameters);
1155
- return fnExecuteSingleAction(oAction, i, {
1166
+ function processOneAction(context: any, actionIndex: any) {
1167
+ oAction = oModel.bindContext(`${sActionName}(...)`, context, mBindingParameters);
1168
+ return fnExecuteSingleAction(oAction, actionIndex, {
1156
1169
  context: context,
1157
1170
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
1158
1171
  triggerActions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.triggerActions
@@ -1161,7 +1174,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1161
1174
 
1162
1175
  let oActionAndSideEffectPromise = Promise.resolve();
1163
1176
  let j = 0;
1164
- aContexts.forEach(function (context: any) {
1177
+ contextsToExecute.forEach(function (context: any) {
1165
1178
  const id = ++j;
1166
1179
  oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function () {
1167
1180
  return processOneAction(context, id);
@@ -1171,7 +1184,9 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1171
1184
  .then(function () {
1172
1185
  fnHandleResults();
1173
1186
  })
1174
- .catch();
1187
+ .catch(function (oError: any) {
1188
+ Log.error(oError);
1189
+ });
1175
1190
  }
1176
1191
 
1177
1192
  if (!bGrouped) {
@@ -1181,7 +1196,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1181
1196
  fnExecuteSequentially(aContexts);
1182
1197
  } else {
1183
1198
  for (i = 0; i < aContexts.length; i++) {
1184
- oAction = oModel.bindContext(sActionName + "(...)", aContexts[i], mBindingParameters);
1199
+ oAction = oModel.bindContext(`${sActionName}(...)`, aContexts[i], mBindingParameters);
1185
1200
  fnExecuteAction(oAction, aContexts.length <= 1 ? null : i, {
1186
1201
  context: aContexts[i],
1187
1202
  pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
@@ -1246,7 +1261,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1246
1261
  )();
1247
1262
  });
1248
1263
  } else {
1249
- oAction = oModel.bindContext("/" + sActionName + "(...)");
1264
+ oAction = oModel.bindContext(`/${sActionName}(...)`);
1250
1265
  setActionParameterDefaultValue();
1251
1266
  const sGroupId = "actionImport";
1252
1267
  const oActionPromise = oAction.execute(
@@ -1275,7 +1290,21 @@ function _executeAction(oAppComponent: any, mParameters: any) {
1275
1290
  function _getPath(oActionContext: any, sActionName: any) {
1276
1291
  let sPath = oActionContext.getPath();
1277
1292
  sPath = oActionContext.getObject("$IsBound") ? sPath.split("@$ui5.overload")[0] : sPath.split("/0")[0];
1278
- 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;
1279
1308
  }
1280
1309
 
1281
1310
  /**
@@ -1292,7 +1321,8 @@ const operations = {
1292
1321
  callActionImport: callActionImport,
1293
1322
  callBoundFunction: callBoundFunction,
1294
1323
  callFunctionImport: callFunctionImport,
1295
- executeDependingOnSelectedContexts: executeDependingOnSelectedContexts
1324
+ executeDependingOnSelectedContexts: executeDependingOnSelectedContexts,
1325
+ showActionParameterDialog: _showActionParameterDialog
1296
1326
  };
1297
1327
 
1298
1328
  export default operations;