@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
@@ -1,37 +1,40 @@
1
1
  import Log from "sap/base/Log";
2
- import FlexibleColumnLayout from "sap/f/FlexibleColumnLayout";
2
+ import type FlexibleColumnLayout from "sap/f/FlexibleColumnLayout";
3
3
  import CommonUtils from "sap/fe/core/CommonUtils";
4
4
  import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
5
5
  import { send } from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
6
6
  import { Activity } from "sap/fe/core/controllerextensions/collaboration/CollaborationCommon";
7
- import draft, { SiblingInformation } from "sap/fe/core/controllerextensions/editFlow/draft";
7
+ import type { SiblingInformation } from "sap/fe/core/controllerextensions/editFlow/draft";
8
+ import draft from "sap/fe/core/controllerextensions/editFlow/draft";
8
9
  import { defineUI5Class, extensible, finalExtension, publicExtension } from "sap/fe/core/helpers/ClassSupport";
9
10
  import EditState from "sap/fe/core/helpers/EditState";
10
- import ModelHelper, { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
11
+ import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
12
+ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
11
13
  import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
12
14
  import FELibrary from "sap/fe/core/library";
13
- import PageController from "sap/fe/core/PageController";
14
- import { SemanticMapping } from "sap/fe/core/services/RoutingServiceFactory";
15
- import { standardActions, triggerConfiguredSurvey, triggerType } from "sap/fe/templates/Feedback";
16
- import NavContainer from "sap/m/NavContainer";
17
- import Control from "sap/ui/core/Control";
15
+ import type PageController from "sap/fe/core/PageController";
16
+ import type { SemanticMapping } from "sap/fe/core/services/RoutingServiceFactory";
17
+ import { StandardActions, triggerConfiguredSurvey, TriggerType } from "sap/fe/templates/Feedback";
18
+ import type NavContainer from "sap/m/NavContainer";
19
+ import type Control from "sap/ui/core/Control";
18
20
  import Core from "sap/ui/core/Core";
19
21
  import coreLibrary from "sap/ui/core/library";
20
22
  import Message from "sap/ui/core/message/Message";
21
23
  import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
22
24
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
23
- import Table from "sap/ui/mdc/Table";
24
- import Context from "sap/ui/model/odata/v4/Context";
25
+ import type Table from "sap/ui/mdc/Table";
26
+ import type Context from "sap/ui/model/odata/v4/Context";
25
27
  import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
26
- import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
27
- import ODataModel from "sap/ui/model/odata/v4/ODataModel";
28
- import { CoreEx } from "types/extension_types";
28
+ import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
29
+ import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
30
+ import type { CoreEx, V4Context } from "types/extension_types";
29
31
 
30
32
  const CreationMode = FELibrary.CreationMode,
31
33
  ProgrammingModel = FELibrary.ProgrammingModel,
32
34
  Constants = FELibrary.Constants,
33
35
  DraftStatus = FELibrary.DraftStatus,
34
36
  EditMode = FELibrary.EditMode,
37
+ StartupMode = FELibrary.StartupMode,
35
38
  MessageType = coreLibrary.MessageType;
36
39
 
37
40
  /**
@@ -58,15 +61,15 @@ class EditFlow extends ControllerExtension {
58
61
  * Creates a draft document for an existing active document.
59
62
  *
60
63
  * @memberof sap.fe.core.controllerextensions.EditFlow
61
- * @param {object} oContext Context of the active document
62
- * @returns {Promise} Promise resolves once the editable document is available
64
+ * @param oContext Context of the active document
65
+ * @returns Promise resolves once the editable document is available
63
66
  * @alias sap.fe.core.controllerextensions.EditFlow#editDocument
64
67
  * @public
65
68
  * @since 1.90.0
66
69
  */
67
70
  @publicExtension()
68
71
  @finalExtension()
69
- async editDocument(oContext: Context): Promise<void> {
72
+ async editDocument(oContext: V4Context): Promise<void> {
70
73
  const bDraftNavigation = true;
71
74
  const transactionHelper = this._getTransactionHelper();
72
75
  const oRootViewController = this._getRootViewController() as any;
@@ -124,9 +127,9 @@ class EditFlow extends ControllerExtension {
124
127
  * Updates the draft status and displays the error messages if there are errors during an update.
125
128
  *
126
129
  * @memberof sap.fe.core.controllerextensions.EditFlow
127
- * @param {object} oContext Context of the updated field
128
- * @param {object} oPromise Promise to determine when the update operation is completed. The promise should be resolved when the update operation is completed, so the draft status can be updated.
129
- * @returns {Promise} Promise resolves once draft status has been updated
130
+ * @param oContext Context of the updated field
131
+ * @param oPromise Promise to determine when the update operation is completed. The promise should be resolved when the update operation is completed, so the draft status can be updated.
132
+ * @returns Promise resolves once draft status has been updated
130
133
  * @alias sap.fe.core.controllerextensions.EditFlow#updateDocument
131
134
  * @public
132
135
  * @since 1.90.0
@@ -139,7 +142,7 @@ class EditFlow extends ControllerExtension {
139
142
  const bIsDraft = this._getProgrammingModel(oContext) === ProgrammingModel.Draft;
140
143
 
141
144
  this._getMessageHandler().removeTransitionMessages();
142
- return this._syncTask(() => {
145
+ return this._syncTask(async () => {
143
146
  if (originalBindingContext) {
144
147
  transactionHelper.handleDocumentModifications();
145
148
  if (!this._isFclEnabled()) {
@@ -152,45 +155,38 @@ class EditFlow extends ControllerExtension {
152
155
  }
153
156
  this._getMessageHandler().removeTransitionMessages();
154
157
 
155
- return oPromise
156
- .then(
157
- () => {
158
- // If a navigation happened while oPromise was being resolved, the binding context of the page changed
159
- // In that case, we shouldn't do anything
160
- const oBindingContext = this.getView().getBindingContext();
161
- if (bIsDraft && oBindingContext && oBindingContext === originalBindingContext) {
162
- const oMetaModel = oBindingContext.getModel().getMetaModel() as ODataMetaModel,
163
- sEntitySetName = (oMetaModel as any).getMetaContext(oBindingContext.getPath()).getObject("@sapui.name"),
164
- aSemanticKeys = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
165
- if (aSemanticKeys && aSemanticKeys.length) {
166
- const oCurrentSemanticMapping = this._getSemanticMapping(),
167
- sCurrentSemanticPath = oCurrentSemanticMapping && oCurrentSemanticMapping.semanticPath,
168
- sChangedPath = SemanticKeyHelper.getSemanticPath(oBindingContext, true);
169
- // sCurrentSemanticPath could be null if we have navigated via deep link then there are no semanticMappings to calculate it from
170
- if (sCurrentSemanticPath && sCurrentSemanticPath !== sChangedPath) {
171
- return this._handleNewContext(oBindingContext, true, false, true).then(() => {
172
- this._setDraftStatus(DraftStatus.Saved);
173
- });
174
- } else {
175
- this._setDraftStatus(DraftStatus.Saved);
176
- }
177
- } else {
178
- this._setDraftStatus(DraftStatus.Saved);
179
- }
180
- }
181
- },
182
- () => {
183
- if (bIsDraft && originalBindingContext) {
184
- this._setDraftStatus(DraftStatus.Clear);
158
+ try {
159
+ await oPromise;
160
+ // If a navigation happened while oPromise was being resolved, the binding context of the page changed
161
+ // In that case, we shouldn't do anything
162
+ const oBindingContext = this.getView().getBindingContext();
163
+ if (bIsDraft && oBindingContext && oBindingContext === originalBindingContext) {
164
+ const oMetaModel = oBindingContext.getModel().getMetaModel() as ODataMetaModel,
165
+ sEntitySetName = (oMetaModel as any).getMetaContext(oBindingContext.getPath()).getObject("@sapui.name"),
166
+ aSemanticKeys = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
167
+ if (aSemanticKeys && aSemanticKeys.length) {
168
+ const oCurrentSemanticMapping = this._getSemanticMapping(),
169
+ sCurrentSemanticPath = oCurrentSemanticMapping && oCurrentSemanticMapping.semanticPath,
170
+ sChangedPath = SemanticKeyHelper.getSemanticPath(oBindingContext, true);
171
+ // sCurrentSemanticPath could be null if we have navigated via deep link then there are no semanticMappings to calculate it from
172
+ if (sCurrentSemanticPath && sCurrentSemanticPath !== sChangedPath) {
173
+ await this._handleNewContext(oBindingContext, true, false, true);
174
+ this._setDraftStatus(DraftStatus.Saved);
175
+ } else {
176
+ this._setDraftStatus(DraftStatus.Saved);
185
177
  }
178
+ } else {
179
+ this._setDraftStatus(DraftStatus.Saved);
186
180
  }
187
- )
188
- .catch(function (oError: any) {
189
- Log.error("Error while updating the document", oError);
190
- })
191
- .finally(() => {
192
- this._getMessageHandler().showMessages();
193
- });
181
+ }
182
+ } catch (oError: any) {
183
+ Log.error("Error while updating the document", oError);
184
+ if (bIsDraft && originalBindingContext) {
185
+ this._setDraftStatus(DraftStatus.Clear);
186
+ }
187
+ } finally {
188
+ this._getMessageHandler().showMessages();
189
+ }
194
190
  });
195
191
  }
196
192
 
@@ -207,15 +203,15 @@ class EditFlow extends ControllerExtension {
207
203
  * Creates a new document.
208
204
  *
209
205
  * @memberof sap.fe.core.controllerextensions.EditFlow
210
- * @param {sap.ui.model.odata.v4.ODataListBinding|string} vListBinding ODataListBinding object or the binding path for a temporary list binding
211
- * @param {map} mInParameters Contains the following attributes:
212
- * @param {string} mInParameters.creationMode The creation mode using one of the following:
206
+ * @param vListBinding ODataListBinding object or the binding path for a temporary list binding
207
+ * @param mInParameters Contains the following attributes:
208
+ * @param mInParameters.creationMode The creation mode using one of the following:
213
209
  * NewPage - the created document is shown in a new page, depending on whether metadata 'Sync', 'Async' or 'Deferred' is used
214
210
  * Inline - The creation is done inline (in a table)
215
211
  * External - The creation is done in a different application specified via the parameter 'outbound'
216
- * @param {string} mInParameters.outbound The navigation target where the document is created in case of creationMode 'External'
217
- * @param {boolean} mInParameters.createAtEnd Specifies if the new entry should be created at the top or bottom of a table in case of creationMode 'Inline'
218
- * @returns {Promise} Promise resolves once the object has been created
212
+ * @param mInParameters.outbound The navigation target where the document is created in case of creationMode 'External'
213
+ * @param mInParameters.createAtEnd Specifies if the new entry should be created at the top or bottom of a table in case of creationMode 'Inline'
214
+ * @returns Promise resolves once the object has been created
219
215
  * @alias sap.fe.core.controllerextensions.EditFlow#createDocument
220
216
  * @public
221
217
  * @since 1.90.0
@@ -263,13 +259,13 @@ class EditFlow extends ControllerExtension {
263
259
  oTable.getBindingContext(),
264
260
  {
265
261
  data: oCreationRowObjects,
266
- customValidationFunction: (oTable.getCreationRow() as any).data("customValidationFunction")
262
+ customValidationFunction: oTable.getCreationRow().data("customValidationFunction")
267
263
  },
268
264
  this.base.getView()
269
265
  );
270
266
 
271
267
  // disableAddRowButtonForEmptyData is set to false in manifest converter (Table.ts) if customValidationFunction exists
272
- if ((oTable.getCreationRow() as any).data("disableAddRowButtonForEmptyData") === "true") {
268
+ if (oTable.getCreationRow().data("disableAddRowButtonForEmptyData") === "true") {
273
269
  const oInternalModelContext = oTable.getBindingContext("internal") as InternalModelContext;
274
270
  oInternalModelContext.setProperty("creationRowFieldValidity", {});
275
271
  }
@@ -279,10 +275,14 @@ class EditFlow extends ControllerExtension {
279
275
  oTable = this.getView().byId(mParameters.tableId) as Table;
280
276
  }
281
277
 
282
- /**
283
- * @param {sap.ui.model.odata.v4.ODataListBinding} oListBinding
284
- * @param {object} oCreationPromise
285
- */
278
+ if (oTable && oTable.isA("sap.ui.mdc.Table")) {
279
+ const fnFocusOrScroll =
280
+ mParameters.creationMode === CreationMode.Inline ? oTable.focusRow.bind(oTable) : oTable.scrollToIndex.bind(oTable);
281
+ oTable.getRowBinding().attachEventOnce("change", function () {
282
+ fnFocusOrScroll(mParameters.createAtEnd ? oTable.getRowBinding().getLength() : 0, true);
283
+ });
284
+ }
285
+
286
286
  const handleSideEffects = (oListBinding: any, oCreationPromise: Promise<Context>) => {
287
287
  oCreationPromise
288
288
  .then(function (oNewContext: any) {
@@ -295,8 +295,8 @@ class EditFlow extends ControllerExtension {
295
295
  // this is avoid a potential list refresh, there could be a side effect that refreshes the list binding
296
296
  // if list binding is refreshed, transient contexts might be lost
297
297
  if (!CommonUtils.hasTransientContext(oListBinding)) {
298
- const oAppComponent = CommonUtils.getAppComponent(this.getView());
299
- oAppComponent
298
+ const appComponent = CommonUtils.getAppComponent(this.getView());
299
+ appComponent
300
300
  .getSideEffectsService()
301
301
  .requestSideEffectsForNavigationProperty(oListBinding.getPath(), oBindingContext);
302
302
  }
@@ -307,10 +307,10 @@ class EditFlow extends ControllerExtension {
307
307
  };
308
308
 
309
309
  /**
310
- * @param {Array} aValidationMessages Error messages from custom validation function
310
+ * @param aValidationMessages Error messages from custom validation function
311
311
  */
312
312
  const createCustomValidationMessages = (aValidationMessages: any[]) => {
313
- const sCustomValidationFunction = oTable && (oTable.getCreationRow() as any).data("customValidationFunction");
313
+ const sCustomValidationFunction = oTable && oTable.getCreationRow().data("customValidationFunction");
314
314
  const mCustomValidity = oTable && oTable.getBindingContext("internal")?.getProperty("creationRowCustomValidity");
315
315
  const oMessageManager = Core.getMessageManager();
316
316
  const aCustomMessages: any[] = [];
@@ -331,7 +331,7 @@ class EditFlow extends ControllerExtension {
331
331
  // Handle Bound CustomValidation message
332
332
  if (oValidationMessage.messageTarget) {
333
333
  oFieldControl = Core.getControl(mCustomValidity[oValidationMessage.messageTarget].fieldId) as Control;
334
- sTarget = oFieldControl.getBindingContext()?.getPath() + "/" + oFieldControl.getBindingPath("value");
334
+ sTarget = `${oFieldControl.getBindingContext()?.getPath()}/${oFieldControl.getBindingPath("value")}`;
335
335
  // Add validation message if still not exists
336
336
  if (
337
337
  oMessageManager
@@ -379,8 +379,9 @@ class EditFlow extends ControllerExtension {
379
379
  });
380
380
  }
381
381
  };
382
-
383
- bShouldBusyLock && BusyLocker.lock(oLockObject);
382
+ if (bShouldBusyLock) {
383
+ BusyLocker.lock(oLockObject);
384
+ }
384
385
  return this._syncTask(oExecCustomValidation)
385
386
  .then((aValidationMessages: any) => {
386
387
  if (aValidationMessages.length > 0) {
@@ -424,12 +425,12 @@ class EditFlow extends ControllerExtension {
424
425
  // in the absence of NewAction or NewAction with parameters, creation is async
425
426
  sNewAction =
426
427
  sProgrammingModel === ProgrammingModel.Draft
427
- ? oMetaModel.getObject(sPath + "@com.sap.vocabularies.Common.v1.DraftRoot/NewAction")
428
+ ? oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`)
428
429
  : oMetaModel.getObject(
429
- sPath + "@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction"
430
+ `${sPath}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`
430
431
  );
431
432
  if (sNewAction) {
432
- const aParameters = oMetaModel.getObject("/" + sNewAction + "/@$ui5.overload/0/$Parameter") || [];
433
+ const aParameters = oMetaModel.getObject(`/${sNewAction}/@$ui5.overload/0/$Parameter`) || [];
433
434
  // binding parameter (eg: _it) is not considered
434
435
  if (aParameters.length > 1) {
435
436
  return CreationMode.Deferred;
@@ -448,7 +449,7 @@ class EditFlow extends ControllerExtension {
448
449
  return CreationMode.Async;
449
450
  }
450
451
  })
451
- .then((sCreationMode: any) => {
452
+ .then((resolvedCreationMode: any) => {
452
453
  let oCreation: any;
453
454
  let mArgs: any;
454
455
  const oCreationRow = mParameters.creationRow;
@@ -459,15 +460,15 @@ class EditFlow extends ControllerExtension {
459
460
  const oMetaModel = oModel.getMetaModel();
460
461
  const oRoutingListener = this._getRoutingListener();
461
462
 
462
- if (sCreationMode !== CreationMode.Deferred) {
463
- if (sCreationMode === CreationMode.CreationRow) {
463
+ if (resolvedCreationMode !== CreationMode.Deferred) {
464
+ if (resolvedCreationMode === CreationMode.CreationRow) {
464
465
  oCreationRowContext = oCreationRow.getBindingContext();
465
466
  sMetaPath = oMetaModel.getMetaPath(oCreationRowContext.getPath());
466
467
  // prefill data from creation row
467
468
  oPayload = oCreationRowContext.getObject();
468
469
  mParameters.data = {};
469
470
  Object.keys(oPayload).forEach(function (sPropertyPath: string) {
470
- const oProperty = oMetaModel.getObject(sMetaPath + "/" + sPropertyPath);
471
+ const oProperty = oMetaModel.getObject(`${sMetaPath}/${sPropertyPath}`);
471
472
  // ensure navigation properties are not part of the payload, deep create not supported
472
473
  if (oProperty && oProperty.$kind === "NavigationProperty") {
473
474
  return;
@@ -476,7 +477,7 @@ class EditFlow extends ControllerExtension {
476
477
  });
477
478
  oValidationCheck = this._checkForValidationErrors(/*oCreationRowContext*/);
478
479
  }
479
- if (sCreationMode === CreationMode.CreationRow || sCreationMode === CreationMode.Inline) {
480
+ if (resolvedCreationMode === CreationMode.CreationRow || resolvedCreationMode === CreationMode.Inline) {
480
481
  mParameters.keepTransientContextOnFailed = false; // currently not fully supported
481
482
  // busy handling shall be done locally only
482
483
  mParameters.busyMode = "Local";
@@ -503,7 +504,7 @@ class EditFlow extends ControllerExtension {
503
504
  }
504
505
 
505
506
  let oNavigation;
506
- switch (sCreationMode) {
507
+ switch (resolvedCreationMode) {
507
508
  case CreationMode.Deferred:
508
509
  oNavigation = oRoutingListener.navigateForwardToContext(oListBinding, {
509
510
  bDeferredContext: true,
@@ -528,12 +529,12 @@ class EditFlow extends ControllerExtension {
528
529
  }
529
530
  oNavigation = oCreation.then(function (oNewDocumentContext: any) {
530
531
  if (!oNewDocumentContext) {
531
- const oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
532
+ const coreResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
532
533
  return oRoutingListener.navigateToMessagePage(
533
- oResourceBundle.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),
534
+ coreResourceBundle.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),
534
535
  {
535
- title: oResourceBundle.getText("C_COMMON_SAPFE_ERROR"),
536
- description: oResourceBundle.getText("C_EDITFLOW_SAPFE_CREATION_FAILED_DESCRIPTION")
536
+ title: coreResourceBundle.getText("C_COMMON_SAPFE_ERROR"),
537
+ description: coreResourceBundle.getText("C_EDITFLOW_SAPFE_CREATION_FAILED_DESCRIPTION")
537
538
  }
538
539
  );
539
540
  } else {
@@ -574,7 +575,7 @@ class EditFlow extends ControllerExtension {
574
575
  });
575
576
  break;
576
577
  default:
577
- oNavigation = Promise.reject("Unhandled creationMode " + sCreationMode);
578
+ oNavigation = Promise.reject(`Unhandled creationMode ${resolvedCreationMode}`);
578
579
  break;
579
580
  }
580
581
 
@@ -618,14 +619,9 @@ class EditFlow extends ControllerExtension {
618
619
  });
619
620
  })
620
621
  .finally(function () {
621
- if (oTable && oTable.isA("sap.ui.mdc.Table")) {
622
- const fnFocusOrScroll =
623
- mParameters.creationMode === CreationMode.Inline ? oTable.focusRow.bind(oTable) : oTable.scrollToIndex.bind(oTable);
624
- oTable.getRowBinding().attachEventOnce("change", function () {
625
- fnFocusOrScroll(mParameters.createAtEnd ? oTable.getRowBinding().getLength() : 0, true);
626
- });
622
+ if (bShouldBusyLock) {
623
+ BusyLocker.unlock(oLockObject);
627
624
  }
628
- bShouldBusyLock && BusyLocker.unlock(oLockObject);
629
625
  });
630
626
  }
631
627
 
@@ -636,9 +632,10 @@ class EditFlow extends ControllerExtension {
636
632
  *
637
633
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
638
634
  * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
639
- * @param {object} mParameters Object containing the parameters passed to onBeforeSave
640
- * @param {sap.ui.model.odata.v4.Context} mParameters.context Page context that is going to be saved.
641
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Save' action is triggered. If rejected, the 'Save' action is not triggered and the user stays in edit mode.
635
+ *
636
+ * @param mParameters Object containing the parameters passed to onBeforeSave
637
+ * @param mParameters.context Page context that is going to be saved.
638
+ * @returns A promise to be returned by the overridden method. If resolved, the 'Save' action is triggered. If rejected, the 'Save' action is not triggered and the user stays in edit mode.
642
639
  * @memberof sap.fe.core.controllerextensions.EditFlow
643
640
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeSave
644
641
  * @public
@@ -658,10 +655,11 @@ class EditFlow extends ControllerExtension {
658
655
  *
659
656
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
660
657
  * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
661
- * @param {map} mParameters Object containing the parameters passed to onBeforeCreate
662
- * @param {string} mParameters.contextPath Path pointing to the context on which Create action is triggered
663
- * @param {Array} mParameters.createParameters Array of values that are filled in the Action Parameter Dialog
664
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Create' action is triggered. If rejected, the 'Create' action is not triggered.
658
+ *
659
+ * @param mParameters Object containing the parameters passed to onBeforeCreate
660
+ * @param mParameters.contextPath Path pointing to the context on which Create action is triggered
661
+ * @param mParameters.createParameters Array of values that are filled in the Action Parameter Dialog
662
+ * @returns A promise to be returned by the overridden method. If resolved, the 'Create' action is triggered. If rejected, the 'Create' action is not triggered.
665
663
  * @memberof sap.fe.core.controllerextensions.EditFlow
666
664
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeCreate
667
665
  * @public
@@ -681,9 +679,10 @@ class EditFlow extends ControllerExtension {
681
679
  *
682
680
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
683
681
  * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
684
- * @param {object} mParameters Object containing the parameters passed to onBeforeEdit
685
- * @param {sap.ui.model.odata.v4.Context} mParameters.context Page context that is going to be edited.
686
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Edit' action is triggered. If rejected, the 'Edit' action is not triggered and the user stays in display mode.
682
+ *
683
+ * @param mParameters Object containing the parameters passed to onBeforeEdit
684
+ * @param mParameters.context Page context that is going to be edited.
685
+ * @returns A promise to be returned by the overridden method. If resolved, the 'Edit' action is triggered. If rejected, the 'Edit' action is not triggered and the user stays in display mode.
687
686
  * @memberof sap.fe.core.controllerextensions.EditFlow
688
687
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeEdit
689
688
  * @public
@@ -703,9 +702,10 @@ class EditFlow extends ControllerExtension {
703
702
  *
704
703
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
705
704
  * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
706
- * @param {object} mParameters Object containing the parameters passed to onBeforeDiscard
707
- * @param {sap.ui.model.odata.v4.Context} mParameters.context Page context that is going to be discarded.
708
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Discard' action is triggered. If rejected, the 'Discard' action is not triggered and the user stays in edit mode.
705
+ *
706
+ * @param mParameters Object containing the parameters passed to onBeforeDiscard
707
+ * @param mParameters.context Page context that is going to be discarded.
708
+ * @returns A promise to be returned by the overridden method. If resolved, the 'Discard' action is triggered. If rejected, the 'Discard' action is not triggered and the user stays in edit mode.
709
709
  * @memberof sap.fe.core.controllerextensions.EditFlow
710
710
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDiscard
711
711
  * @public
@@ -725,9 +725,10 @@ class EditFlow extends ControllerExtension {
725
725
  *
726
726
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
727
727
  * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
728
- * @param {object} mParameters Object containing the parameters passed to onBeforeDelete
729
- * @param {Array} mParameters.contexts An array of contexts that are going to be deleted
730
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Delete' action is triggered. If rejected, the 'Delete' action is not triggered.
728
+ *
729
+ * @param mParameters Object containing the parameters passed to onBeforeDelete
730
+ * @param mParameters.contexts An array of contexts that are going to be deleted
731
+ * @returns A promise to be returned by the overridden method. If resolved, the 'Delete' action is triggered. If rejected, the 'Delete' action is not triggered.
731
732
  * @memberof sap.fe.core.controllerextensions.EditFlow
732
733
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDelete
733
734
  * @public
@@ -752,15 +753,15 @@ class EditFlow extends ControllerExtension {
752
753
  * Saves a new document after checking it.
753
754
  *
754
755
  * @memberof sap.fe.core.controllerextensions.EditFlow
755
- * @param {object} oContext Context of the editable document
756
- * @returns {Promise} Promise resolves once save is complete
756
+ * @param oContext Context of the editable document
757
+ * @returns Promise resolves once save is complete
757
758
  * @alias sap.fe.core.controllerextensions.EditFlow#saveDocument
758
759
  * @public
759
760
  * @since 1.90.0
760
761
  */
761
762
  @publicExtension()
762
763
  @finalExtension()
763
- async saveDocument(oContext: Context, mParameters: any): Promise<void> {
764
+ async saveDocument(oContext: V4Context, mParameters: any): Promise<void> {
764
765
  mParameters = mParameters || {};
765
766
  const bExecuteSideEffectsOnError = mParameters.bExecuteSideEffectsOnError || undefined;
766
767
  const bDraftNavigation = true;
@@ -802,7 +803,7 @@ class EditFlow extends ControllerExtension {
802
803
  this._removeStickySessionInternalProperties(sProgrammingModel);
803
804
 
804
805
  this._sendActivity(Activity.Activate, activeDocumentContext);
805
- this._triggerConfiguredSurvey(standardActions.save, triggerType.standardAction);
806
+ this._triggerConfiguredSurvey(StandardActions.save, TriggerType.standardAction);
806
807
 
807
808
  this._setEditMode(EditMode.Display, false);
808
809
  this._getMessageHandler().showMessageDialog();
@@ -828,7 +829,7 @@ class EditFlow extends ControllerExtension {
828
829
  }
829
830
  @publicExtension()
830
831
  @finalExtension()
831
- async toggleDraftActive(oContext: Context): Promise<void> {
832
+ async toggleDraftActive(oContext: V4Context): Promise<void> {
832
833
  const oContextData = oContext.getObject();
833
834
  let bEditable: boolean;
834
835
  const bIsDraft = oContext && this._getProgrammingModel(oContext) === ProgrammingModel.Draft;
@@ -863,7 +864,7 @@ class EditFlow extends ControllerExtension {
863
864
  const lastSemanticMapping = this._getSemanticMapping();
864
865
  if (lastSemanticMapping?.technicalPath === oContext.getPath()) {
865
866
  const targetPath = siblingInfo.pathMapping[siblingInfo.pathMapping.length - 1].newPath;
866
- siblingInfo.pathMapping.push({ oldPath: lastSemanticMapping!.semanticPath, newPath: targetPath });
867
+ siblingInfo.pathMapping.push({ oldPath: lastSemanticMapping.semanticPath, newPath: targetPath });
867
868
  }
868
869
  this._updatePathsInHistory(siblingInfo.pathMapping);
869
870
  }
@@ -873,7 +874,7 @@ class EditFlow extends ControllerExtension {
873
874
  return Promise.reject("Error in EditFlow.toggleDraftActive - Cannot find sibling");
874
875
  }
875
876
  } catch (oError) {
876
- return Promise.reject(("Error in EditFlow.toggleDraftActive:" + oError) as any);
877
+ return Promise.reject(`Error in EditFlow.toggleDraftActive:${oError}` as any);
877
878
  }
878
879
  }
879
880
 
@@ -886,17 +887,17 @@ class EditFlow extends ControllerExtension {
886
887
  *
887
888
  * @memberof sap.fe.core.controllerextensions.EditFlow
888
889
  * @param oContext Context of the editable document
889
- * @param {map} mParameters Can contain the following attributes:
890
- * @param {object} mParameters.control This is the control used to open the discard popover
891
- * @param {boolean} mParameters.skipDiscardPopover Optional, supresses the discard popover and allows custom handling
892
- * @returns {Promise} Promise resolves once editable document has been discarded
890
+ * @param mParameters Can contain the following attributes:
891
+ * @param mParameters.control This is the control used to open the discard popover
892
+ * @param mParameters.skipDiscardPopover Optional, supresses the discard popover and allows custom handling
893
+ * @returns Promise resolves once editable document has been discarded
893
894
  * @alias sap.fe.core.controllerextensions.EditFlow#cancelDocument
894
895
  * @public
895
896
  * @since 1.90.0
896
897
  */
897
898
  @publicExtension()
898
899
  @finalExtension()
899
- async cancelDocument(oContext: Context, mParameters: { control: object; skipDiscardPopover?: boolean }): Promise<any> {
900
+ async cancelDocument(oContext: V4Context, mParameters: { control: object; skipDiscardPopover?: boolean }): Promise<any> {
900
901
  const transactionHelper = this._getTransactionHelper();
901
902
  const oResourceBundle = this._getResourceBundle();
902
903
  const mInParameters: any = mParameters;
@@ -983,11 +984,11 @@ class EditFlow extends ControllerExtension {
983
984
  * Deletes the document.
984
985
  *
985
986
  * @memberof sap.fe.core.controllerextensions.EditFlow
986
- * @param {object} oContext Context of the document
987
- * @param {object} mInParameters Can contain the following attributes:
988
- * @param {string} mInParameters.title Title of the object being deleted
989
- * @param {string} mInParameters.description Description of the object being deleted
990
- * @returns {Promise} Promise resolves once document has been deleted
987
+ * @param oContext Context of the document
988
+ * @param mInParameters Can contain the following attributes:
989
+ * @param mInParameters.title Title of the object being deleted
990
+ * @param mInParameters.description Description of the object being deleted
991
+ * @returns Promise resolves once document has been deleted
991
992
  * @alias sap.fe.core.controllerextensions.EditFlow#deleteDocument
992
993
  * @public
993
994
  * @since 1.90.0
@@ -1014,11 +1015,18 @@ class EditFlow extends ControllerExtension {
1014
1015
  }
1015
1016
  this._sendActivity(Activity.Delete, oContext);
1016
1017
 
1017
- this._getRoutingListener().navigateBackFromContext(oContext);
1018
- // After delete is successfull, we need to dettch the setBackNavigation Methods
1018
+ // After delete is successfull, we need to detach the setBackNavigation Methods
1019
1019
  if (oAppComponent) {
1020
1020
  oAppComponent.getShellServices().setBackNavigation();
1021
1021
  }
1022
+
1023
+ if (oAppComponent?.getStartupMode() === StartupMode.Deeplink && !this._isFclEnabled()) {
1024
+ // In case the app has been launched with semantic keys, deleting the object we've landed on shall navigate back
1025
+ // to the app we came from (except for FCL, where we navigate to LR as usual)
1026
+ oAppComponent.getRouterProxy().exitFromApp();
1027
+ } else {
1028
+ this._getRoutingListener().navigateBackFromContext(oContext);
1029
+ }
1022
1030
  })
1023
1031
  .catch(function (oError: any) {
1024
1032
  Log.error("Error while deleting the document", oError);
@@ -1029,8 +1037,8 @@ class EditFlow extends ControllerExtension {
1029
1037
  * Submit the current set of changes and navigate back.
1030
1038
  *
1031
1039
  * @memberof sap.fe.core.controllerextensions.EditFlow
1032
- * @param {object} oContext Context of the document
1033
- * @returns {Promise} Promise resolves once the changes have been saved
1040
+ * @param oContext Context of the document
1041
+ * @returns Promise resolves once the changes have been saved
1034
1042
  * @alias sap.fe.core.controllerextensions.EditFlow#applyDocument
1035
1043
  * @public
1036
1044
  * @since 1.90.0
@@ -1063,23 +1071,23 @@ class EditFlow extends ControllerExtension {
1063
1071
  * Invokes an action (bound or unbound) and tracks the changes so that other pages can be refreshed and show the updated data upon navigation.
1064
1072
  *
1065
1073
  * @memberof sap.fe.core.controllerextensions.EditFlow
1066
- * @param {string} sActionName The name of the action to be called
1067
- * @param {object} mInParameters Contains the following attributes:
1068
- * @param {sap.ui.model.odata.v4.Context} mInParameters.contexts For a bound action, a context or an array with contexts for which the action is to be called must be provided
1069
- * @param {sap.ui.model.odata.v4.ODataModel} mInParameters.model For an unbound action, an instance of an OData V4 model must be provided
1070
- * @param {boolean} mInParameters.requiresNavigation Boolean value indicating whether navigation is required after the action has been executed. Navigation takes place to the context returned by the action
1071
- * @param {string} mInParameters.label A human-readable label for the action. This is needed in case the action has a parameter and a parameter dialog is shown to the user. The label will be used for the title of the dialog and for the confirmation button
1072
- * @param {string} mInParameters.invocationGrouping Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
1073
- * @param {object} mExtraParams PRIVATE
1074
- * @returns {Promise}
1074
+ * @param sActionName The name of the action to be called
1075
+ * @param mInParameters Contains the following attributes:
1076
+ * @param mInParameters.contexts For a bound action, a context or an array with contexts for which the action is to be called must be provided
1077
+ * @param mInParameters.model For an unbound action, an instance of an OData V4 model must be provided
1078
+ * @param mInParameters.requiresNavigation Boolean value indicating whether navigation is required after the action has been executed. Navigation takes place to the context returned by the action
1079
+ * @param mInParameters.label A human-readable label for the action. This is needed in case the action has a parameter and a parameter dialog is shown to the user. The label will be used for the title of the dialog and for the confirmation button
1080
+ * @param mInParameters.invocationGrouping Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
1081
+ * @param mExtraParams PRIVATE
1082
+ * @returns A promise once the action has been invoked
1075
1083
  * @alias sap.fe.core.controllerextensions.EditFlow#invokeAction
1076
1084
  * @public
1077
1085
  * @since 1.90.0
1078
1086
  * @final
1079
- **/
1087
+ */
1080
1088
  @publicExtension()
1081
1089
  @finalExtension()
1082
- invokeAction(
1090
+ async invokeAction(
1083
1091
  sActionName: string,
1084
1092
  mInParameters?: {
1085
1093
  contexts?: Context | Context[];
@@ -1104,7 +1112,11 @@ class EditFlow extends ControllerExtension {
1104
1112
  // Due to a mistake the invokeAction in the extensionAPI had a different API than this one.
1105
1113
  // The one from the extensionAPI doesn't exist anymore as we expose the full edit flow now but
1106
1114
  // due to compatibility reasons we still need to support the old signature
1107
- if ((mParameters.isA && mParameters.isA("sap.ui.model.odata.v4.Context")) || Array.isArray(mParameters) || arguments.length === 3) {
1115
+ if (
1116
+ (mParameters.isA && mParameters.isA("sap.ui.model.odata.v4.Context")) ||
1117
+ Array.isArray(mParameters) ||
1118
+ mExtraParams !== undefined
1119
+ ) {
1108
1120
  const contexts = mParameters;
1109
1121
  mParameters = mExtraParams || {};
1110
1122
  if (contexts) {
@@ -1181,7 +1193,7 @@ class EditFlow extends ControllerExtension {
1181
1193
  }
1182
1194
 
1183
1195
  if (!mParameters.contexts) {
1184
- return Promise.reject("Context not found for entity type " + sOverloadEntityType);
1196
+ throw new Error(`Context not found for entity type ${sOverloadEntityType}`);
1185
1197
  }
1186
1198
  }
1187
1199
  }
@@ -1193,92 +1205,88 @@ class EditFlow extends ControllerExtension {
1193
1205
  mParameters.bGetBoundContext = this._getBoundContext(oView, mParameters);
1194
1206
  // Need to know that the action is called from ObjectPage for changeSet Isolated workaround
1195
1207
  mParameters.bObjectPage = (oView.getViewData() as any).converterType === "ObjectPage";
1196
- return this._syncTask()
1197
- .then(transactionHelper.callAction.bind(transactionHelper, sActionName, mParameters, this.getView(), this._getMessageHandler()))
1198
- .then((oResponse: any) => {
1199
- // if the returned context for the bound action is different than the context on which action was called,
1200
- // refresh the corresponding list binding
1201
- if (mParameters.contexts) {
1202
- return this._refreshListIfRequired(
1203
- this._getActionResponseDataAndKeys(sActionName, oResponse),
1204
- mParameters.contexts[0]
1205
- ).then(function () {
1206
- return oResponse;
1207
- });
1208
- }
1209
- })
1210
- .then((oResponse: any) => {
1211
- this._sendActivity(Activity.Action, mParameters.contexts);
1212
- this._triggerConfiguredSurvey(sActionName, triggerType.action);
1213
1208
 
1214
- if (oCurrentActionCallBacks) {
1215
- oCurrentActionCallBacks.fResolver(oResponse);
1209
+ try {
1210
+ await this._syncTask();
1211
+ const oResponse = await transactionHelper.callAction.bind(
1212
+ transactionHelper,
1213
+ sActionName,
1214
+ mParameters,
1215
+ this.getView(),
1216
+ this._getMessageHandler()
1217
+ )();
1218
+ if (mParameters.contexts) {
1219
+ await this._refreshListIfRequired(this._getActionResponseDataAndKeys(sActionName, oResponse), mParameters.contexts[0]);
1220
+ }
1221
+ this._sendActivity(Activity.Action, mParameters.contexts);
1222
+ this._triggerConfiguredSurvey(sActionName, TriggerType.action);
1223
+
1224
+ if (oCurrentActionCallBacks) {
1225
+ oCurrentActionCallBacks.fResolver(oResponse);
1226
+ }
1227
+ /*
1228
+ We set the (upper) pages to dirty after an execution of an action
1229
+ TODO: get rid of this workaround
1230
+ This workaround is only needed as long as the model does not support the synchronization.
1231
+ Once this is supported we don't need to set the pages to dirty anymore as the context itself
1232
+ is already refreshed (it's just not reflected in the object page)
1233
+ we explicitly don't call this method from the list report but only call it from the object page
1234
+ as if it is called in the list report it's not needed - as we anyway will remove this logic
1235
+ we can live with this
1236
+ we need a context to set the upper pages to dirty - if there are more than one we use the
1237
+ first one as they are anyway siblings
1238
+ */
1239
+ if (mParameters.contexts) {
1240
+ if (!this._isFclEnabled()) {
1241
+ EditState.setEditStateDirty();
1216
1242
  }
1217
- /*
1218
- We set the (upper) pages to dirty after an execution of an action
1219
- TODO: get rid of this workaround
1220
- This workaround is only needed as long as the model does not support the synchronization.
1221
- Once this is supported we don't need to set the pages to dirty anymore as the context itself
1222
- is already refreshed (it's just not reflected in the object page)
1223
- we explicitly don't call this method from the list report but only call it from the object page
1224
- as if it is called in the list report it's not needed - as we anyway will remove this logic
1225
- we can live with this
1226
- we need a context to set the upper pages to dirty - if there are more than one we use the
1227
- first one as they are anyway siblings
1228
- */
1229
- if (mParameters.contexts) {
1230
- if (!this._isFclEnabled()) {
1231
- EditState.setEditStateDirty();
1232
- }
1233
- this._getInternalModel().setProperty("/sCustomAction", sActionName);
1243
+ this._getInternalModel().setProperty("/sCustomAction", sActionName);
1244
+ }
1245
+ if (mParameters.isNavigable) {
1246
+ let vContext = oResponse;
1247
+ if (Array.isArray(vContext) && vContext.length === 1) {
1248
+ vContext = vContext[0];
1234
1249
  }
1235
- if (mParameters.isNavigable) {
1236
- let vContext = oResponse;
1237
- if (Array.isArray(vContext) && vContext.length === 1) {
1238
- vContext = vContext[0];
1239
- }
1240
- if (vContext && !Array.isArray(vContext)) {
1241
- const oMetaModel = oView.getModel().getMetaModel() as ODataMetaModel;
1242
- const sContextMetaPath = oMetaModel.getMetaPath(vContext.getPath());
1243
- const oActionContext = Array.isArray(mParameters.contexts) ? mParameters.contexts[0] : mParameters.contexts;
1244
- const sActionContextMetaPath = oActionContext && oMetaModel.getMetaPath(oActionContext.getPath());
1245
- if (sContextMetaPath != undefined && sContextMetaPath === sActionContextMetaPath) {
1246
- if (oActionContext.getPath() !== vContext.getPath()) {
1247
- this._getRoutingListener().navigateForwardToContext(vContext, {
1248
- noHistoryEntry: false
1249
- });
1250
- } else {
1251
- Log.info("Navigation to the same context is not allowed");
1252
- }
1250
+ if (vContext && !Array.isArray(vContext)) {
1251
+ const oMetaModel = oView.getModel().getMetaModel() as ODataMetaModel;
1252
+ const sContextMetaPath = oMetaModel.getMetaPath(vContext.getPath());
1253
+ const oActionContext = Array.isArray(mParameters.contexts) ? mParameters.contexts[0] : mParameters.contexts;
1254
+ const sActionContextMetaPath = oActionContext && oMetaModel.getMetaPath(oActionContext.getPath());
1255
+ if (sContextMetaPath != undefined && sContextMetaPath === sActionContextMetaPath) {
1256
+ if (oActionContext.getPath() !== vContext.getPath()) {
1257
+ this._getRoutingListener().navigateForwardToContext(vContext, {
1258
+ noHistoryEntry: false
1259
+ });
1260
+ } else {
1261
+ Log.info("Navigation to the same context is not allowed");
1253
1262
  }
1254
1263
  }
1255
1264
  }
1256
- })
1257
- .catch(function (err: any) {
1258
- if (oCurrentActionCallBacks) {
1259
- oCurrentActionCallBacks.fRejector();
1260
- }
1261
- if (err == Constants.CancelActionDialog) {
1262
- return Promise.reject("Dialog cancelled.");
1263
- } else {
1264
- if (!(err && (err.canceled || (err.rejectedItems && err.rejectedItems[0].canceled)))) {
1265
- return Promise.reject("Error in EditFlow.invokeAction:" + err);
1266
- }
1267
- }
1268
- });
1265
+ }
1266
+ } catch (err: any) {
1267
+ if (oCurrentActionCallBacks) {
1268
+ oCurrentActionCallBacks.fRejector();
1269
+ }
1270
+ // FIXME: in most situations there is no handler for the rejected promises returned
1271
+ if (err === Constants.CancelActionDialog) {
1272
+ throw new Error("Dialog cancelled");
1273
+ } else if (!(err && (err.canceled || (err.rejectedItems && err.rejectedItems[0].canceled)))) {
1274
+ throw new Error(`Error in EditFlow.invokeAction:${err}`);
1275
+ }
1276
+ }
1269
1277
  }
1270
1278
 
1271
1279
  /**
1272
1280
  * Secured execution of the given function. Ensures that the function is only executed when certain conditions are fulfilled.
1273
1281
  *
1274
1282
  * @memberof sap.fe.core.controllerextensions.EditFlow
1275
- * @param {Function} fnFunction The function to be executed. Should return a promise that is settled after completion of the execution. If nothing is returned, immediate completion is assumed.
1276
- * @param {object} mParameters Definitions of the preconditions to be checked before execution
1277
- * @param {object} mParameters.busy Defines the busy indicator
1278
- * @param {boolean} mParameters.busy.set Triggers a busy indicator when the function is executed.
1279
- * @param {boolean} mParameters.busy.check Executes function only if application isn't busy.
1280
- * @param {boolean} mParameters.updatesDocument This operation updates the current document without using the bound model and context. As a result, the draft status is updated if a draft document exists, and the user has to confirm the cancellation of the editing process.
1281
- * @returns {Promise} A promise that is rejected if the execution is prohibited and resolved by the promise returned by the fnFunction.
1283
+ * @param fnFunction The function to be executed. Should return a promise that is settled after completion of the execution. If nothing is returned, immediate completion is assumed.
1284
+ * @param mParameters Definitions of the preconditions to be checked before execution
1285
+ * @param mParameters.busy Defines the busy indicator
1286
+ * @param mParameters.busy.set Triggers a busy indicator when the function is executed.
1287
+ * @param mParameters.busy.check Executes function only if application isn't busy.
1288
+ * @param mParameters.updatesDocument This operation updates the current document without using the bound model and context. As a result, the draft status is updated if a draft document exists, and the user has to confirm the cancellation of the editing process.
1289
+ * @returns A promise that is rejected if the execution is prohibited and resolved by the promise returned by the fnFunction.
1282
1290
  * @alias sap.fe.core.controllerextensions.EditFlow#securedExecution
1283
1291
  * @public
1284
1292
  * @experimental As of version 1.90.0
@@ -1339,7 +1347,7 @@ class EditFlow extends ControllerExtension {
1339
1347
  if (bBusySet) {
1340
1348
  BusyLocker.unlock(oLockObject);
1341
1349
  }
1342
- return this._getMessageHandler().showMessageDialog();
1350
+ this._getMessageHandler().showMessageDialog();
1343
1351
  });
1344
1352
  }
1345
1353
 
@@ -1353,8 +1361,8 @@ class EditFlow extends ControllerExtension {
1353
1361
  if (!(this.base.getView()?.getBindingContext("internal") as InternalModelContext)?.getProperty("skipPatchHandlers")) {
1354
1362
  // Create a promise that will be resolved or rejected when the path is completed
1355
1363
  const oPatchPromise = new Promise<void>((resolve, reject) => {
1356
- oEvent.getSource().attachEventOnce("patchCompleted", (oEvent: any) => {
1357
- const bSuccess = oEvent.getParameter("success");
1364
+ oEvent.getSource().attachEventOnce("patchCompleted", (patchCompletedEvent: any) => {
1365
+ const bSuccess = patchCompletedEvent.getParameter("success");
1358
1366
  if (bSuccess) {
1359
1367
  resolve();
1360
1368
  } else {
@@ -1455,7 +1463,6 @@ class EditFlow extends ControllerExtension {
1455
1463
  * @function
1456
1464
  * @name _createActionPromise
1457
1465
  * @memberof sap.fe.core.controllerextensions.EditFlow
1458
- *
1459
1466
  * @returns {Function} The resolver function which can be used to externally resolve the promise
1460
1467
  */
1461
1468
 
@@ -1480,7 +1487,7 @@ class EditFlow extends ControllerExtension {
1480
1487
  send(this.getView(), action, content);
1481
1488
  }
1482
1489
 
1483
- _triggerConfiguredSurvey(sActionName: string, triggerType: triggerType) {
1490
+ _triggerConfiguredSurvey(sActionName: string, triggerType: TriggerType) {
1484
1491
  triggerConfiguredSurvey(this.getView(), sActionName, triggerType);
1485
1492
  }
1486
1493
 
@@ -1488,9 +1495,9 @@ class EditFlow extends ControllerExtension {
1488
1495
  * @function
1489
1496
  * @name _getActionResponseDataAndKeys
1490
1497
  * @memberof sap.fe.core.controllerextensions.EditFlow
1491
- * @param {string} sActionName The name of the action that is executed
1492
- * @param {object} oResponse The bound action's response data or response context
1493
- * @returns {object} Object with data and names of the key fields of the response
1498
+ * @param sActionName The name of the action that is executed
1499
+ * @param oResponse The bound action's response data or response context
1500
+ * @returns Object with data and names of the key fields of the response
1494
1501
  */
1495
1502
  _getActionResponseDataAndKeys(sActionName: string, oResponse: object) {
1496
1503
  return (this.base.getView().getController() as PageController)._editFlow.getActionResponseDataAndKeys(sActionName, oResponse);
@@ -1580,7 +1587,7 @@ class EditFlow extends ControllerExtension {
1580
1587
  }
1581
1588
 
1582
1589
  _getBoundContext(view: any, params: any) {
1583
- const viewLevel = (view.getViewData() as any).viewLevel;
1590
+ const viewLevel = view.getViewData().viewLevel;
1584
1591
  const bRefreshAfterAction = viewLevel > 1 || (viewLevel === 1 && params.controlId);
1585
1592
  return !params.isNavigable || !!bRefreshAfterAction;
1586
1593
  }
@@ -1624,9 +1631,9 @@ class EditFlow extends ControllerExtension {
1624
1631
  * @function
1625
1632
  * @name _refreshListIfRequired
1626
1633
  * @memberof sap.fe.core.controllerextensions.EditFlow
1627
- * @param {object} oResponse The response of the bound action and the names of the key fields
1628
- * @param {sap.ui.model.odata.v4.Context} oContext The bound context on which the action was executed
1629
- * @returns {Promise} Always resolves to param oResponse
1634
+ * @param oResponse The response of the bound action and the names of the key fields
1635
+ * @param oContext The bound context on which the action was executed
1636
+ * @returns Always resolves to param oResponse
1630
1637
  */
1631
1638
  _refreshListIfRequired(oResponse: any, oContext: Context) {
1632
1639
  if (!oContext || !oResponse || !oResponse.oData) {
@@ -1736,7 +1743,7 @@ class EditFlow extends ControllerExtension {
1736
1743
  .getMetaContext(oActionBindingContext.getPath())
1737
1744
  .getObject("$Type") === sOverloadEntityType
1738
1745
  ) {
1739
- throw "context found - stop actions loop";
1746
+ throw new Error("context found - stop actions loop");
1740
1747
  }
1741
1748
  });
1742
1749
  return undefined;
@@ -1750,7 +1757,7 @@ class EditFlow extends ControllerExtension {
1750
1757
  try {
1751
1758
  aSubSections.forEach(function (oSubSection: any) {
1752
1759
  if (oActionBindingContext) {
1753
- throw "context found - stop SubSections loop";
1760
+ throw new Error("context found - stop SubSections loop");
1754
1761
  }
1755
1762
  if (oSubSection.getBindingContext() === null) {
1756
1763
  oSubSection.setBindingContext(undefined);
@@ -1786,7 +1793,7 @@ class EditFlow extends ControllerExtension {
1786
1793
  }
1787
1794
  }
1788
1795
 
1789
- _createSiblingInfo(currentContext: Context, newContext: Context): SiblingInformation {
1796
+ _createSiblingInfo(currentContext: V4Context, newContext: V4Context): SiblingInformation {
1790
1797
  return {
1791
1798
  targetContext: newContext,
1792
1799
  pathMapping: [
@@ -1810,21 +1817,22 @@ class EditFlow extends ControllerExtension {
1810
1817
  }
1811
1818
 
1812
1819
  /**
1813
- * This methods creates a sibling context for a sub-object page, and calculates a sibling path for
1820
+ * This methods creates a sibling context for a subobject page, and calculates a sibling path for
1814
1821
  * all intermediates paths between the OP and the sub-OP.
1815
1822
  *
1816
- * @param {object} rootCurrentContext The context for the root of the draft
1817
- * @param {object} rightmostCurrentContext The context of the sub-object
1818
- * @param {string} sProgrammingModel The programming model
1819
- * @param {boolean} doNotComputeIfRoot If true, we don't compute siblingInfo if the root and the rightmost contexts are the same
1820
- * @returns {Promise} Returns the siblingInformation object
1823
+ * @param rootCurrentContext The context for the root of the draft
1824
+ * @param rightmostCurrentContext The context of the subobject
1825
+ * @param sProgrammingModel The programming model
1826
+ * @param doNotComputeIfRoot If true, we don't compute siblingInfo if the root and the rightmost contexts are the same
1827
+ * @returns Returns the siblingInformation object
1821
1828
  */
1822
1829
  async _computeSiblingInformation(
1823
- rootCurrentContext: Context,
1824
- rightmostCurrentContext: Context,
1830
+ rootCurrentContext: V4Context,
1831
+ rightmostCurrentContext: V4Context | null | undefined,
1825
1832
  sProgrammingModel: string,
1826
1833
  doNotComputeIfRoot: boolean
1827
1834
  ): Promise<SiblingInformation | undefined> {
1835
+ rightmostCurrentContext = rightmostCurrentContext ?? rootCurrentContext;
1828
1836
  if (!rightmostCurrentContext.getPath().startsWith(rootCurrentContext.getPath())) {
1829
1837
  // Wrong usage !!
1830
1838
  Log.error("Cannot compute rightmost sibling context");
@@ -1841,7 +1849,7 @@ class EditFlow extends ControllerExtension {
1841
1849
  // If not in draft mode, we just recreate a context from the path of the rightmost context
1842
1850
  // No path mapping is needed
1843
1851
  return {
1844
- targetContext: model.bindContext(rightmostCurrentContext.getPath()).getBoundContext() as Context,
1852
+ targetContext: model.bindContext(rightmostCurrentContext.getPath()).getBoundContext(),
1845
1853
  pathMapping: []
1846
1854
  };
1847
1855
  }