@sapui5/sap.fe.core 1.111.1 → 1.113.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/ActionRuntime-dbg.js +6 -5
  4. package/src/sap/fe/core/ActionRuntime.js +1 -1
  5. package/src/sap/fe/core/ActionRuntime.js.map +1 -1
  6. package/src/sap/fe/core/ActionRuntime.ts +12 -11
  7. package/src/sap/fe/core/AppComponent-dbg.js +35 -9
  8. package/src/sap/fe/core/AppComponent.js +1 -1
  9. package/src/sap/fe/core/AppComponent.js.map +1 -1
  10. package/src/sap/fe/core/AppComponent.ts +66 -9
  11. package/src/sap/fe/core/AppStateHandler-dbg.js +5 -2
  12. package/src/sap/fe/core/AppStateHandler.js +1 -1
  13. package/src/sap/fe/core/AppStateHandler.js.map +1 -1
  14. package/src/sap/fe/core/AppStateHandler.ts +10 -1
  15. package/src/sap/fe/core/BaseController-dbg.js +1 -1
  16. package/src/sap/fe/core/BaseController.ts +2 -1
  17. package/src/sap/fe/core/CommonUtils-dbg.js +202 -533
  18. package/src/sap/fe/core/CommonUtils.js +1 -1
  19. package/src/sap/fe/core/CommonUtils.js.map +1 -1
  20. package/src/sap/fe/core/CommonUtils.ts +260 -681
  21. package/src/sap/fe/core/ExtensionAPI-dbg.js +4 -1
  22. package/src/sap/fe/core/ExtensionAPI.js +1 -1
  23. package/src/sap/fe/core/ExtensionAPI.js.map +1 -1
  24. package/src/sap/fe/core/ExtensionAPI.ts +11 -1
  25. package/src/sap/fe/core/PageController-dbg.js +26 -31
  26. package/src/sap/fe/core/PageController.js +1 -1
  27. package/src/sap/fe/core/PageController.js.map +1 -1
  28. package/src/sap/fe/core/PageController.ts +17 -3
  29. package/src/sap/fe/core/ResourceModel-dbg.js +71 -0
  30. package/src/sap/fe/core/ResourceModel.js +6 -0
  31. package/src/sap/fe/core/ResourceModel.js.map +1 -0
  32. package/src/sap/fe/core/ResourceModel.ts +67 -0
  33. package/src/sap/fe/core/TemplateComponent-dbg.js +1 -1
  34. package/src/sap/fe/core/TemplateComponent.ts +1 -0
  35. package/src/sap/fe/core/TemplateModel-dbg.js +1 -1
  36. package/src/sap/fe/core/TemplateModel.ts +6 -1
  37. package/src/sap/fe/core/buildingBlocks/AttributeModel-dbg.js +5 -7
  38. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
  39. package/src/sap/fe/core/buildingBlocks/AttributeModel.js.map +1 -1
  40. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +6 -5
  41. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase-dbg.js +164 -0
  42. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +6 -0
  43. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js.map +1 -0
  44. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +170 -0
  45. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport-dbg.js +88 -0
  46. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js +6 -0
  47. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js.map +1 -0
  48. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.ts +142 -0
  49. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor-dbg.js +913 -0
  50. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js +21 -0
  51. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js.map +1 -0
  52. package/src/sap/fe/core/buildingBlocks/{BuildingBlockRuntime.ts → BuildingBlockTemplateProcessor.ts} +313 -373
  53. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock-dbg.js +79 -0
  54. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js +15 -0
  55. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js.map +1 -0
  56. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.ts +68 -0
  57. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment-dbg.js +162 -0
  58. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js +6 -0
  59. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js.map +1 -0
  60. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.ts +183 -0
  61. package/src/sap/fe/core/buildingBlocks/TraceInfo-dbg.js +4 -2
  62. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +1 -1
  63. package/src/sap/fe/core/buildingBlocks/TraceInfo.js.map +1 -1
  64. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +5 -3
  65. package/src/sap/fe/core/controllerextensions/EditFlow-dbg.js +936 -231
  66. package/src/sap/fe/core/controllerextensions/EditFlow.js +1 -1
  67. package/src/sap/fe/core/controllerextensions/EditFlow.js.map +1 -1
  68. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1023 -255
  69. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation-dbg.js +48 -98
  70. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +1 -1
  71. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js.map +1 -1
  72. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +95 -129
  73. package/src/sap/fe/core/controllerextensions/InternalRouting-dbg.js +14 -17
  74. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1 -1
  75. package/src/sap/fe/core/controllerextensions/InternalRouting.js.map +1 -1
  76. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +23 -17
  77. package/src/sap/fe/core/controllerextensions/KPIManagement-dbg.js +1 -1
  78. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -0
  79. package/src/sap/fe/core/controllerextensions/MassEdit-dbg.js +3 -3
  80. package/src/sap/fe/core/controllerextensions/MassEdit.js +1 -1
  81. package/src/sap/fe/core/controllerextensions/MassEdit.js.map +1 -1
  82. package/src/sap/fe/core/controllerextensions/MassEdit.ts +2 -2
  83. package/src/sap/fe/core/controllerextensions/MessageHandler-dbg.js +2 -1
  84. package/src/sap/fe/core/controllerextensions/MessageHandler.js.map +1 -1
  85. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +2 -0
  86. package/src/sap/fe/core/controllerextensions/PageReady-dbg.js +3 -5
  87. package/src/sap/fe/core/controllerextensions/PageReady.js +1 -1
  88. package/src/sap/fe/core/controllerextensions/PageReady.js.map +1 -1
  89. package/src/sap/fe/core/controllerextensions/PageReady.ts +26 -4
  90. package/src/sap/fe/core/controllerextensions/Paginator-dbg.js +2 -1
  91. package/src/sap/fe/core/controllerextensions/Paginator.js.map +1 -1
  92. package/src/sap/fe/core/controllerextensions/Paginator.ts +7 -0
  93. package/src/sap/fe/core/controllerextensions/Placeholder-dbg.js +1 -1
  94. package/src/sap/fe/core/controllerextensions/Placeholder.ts +8 -0
  95. package/src/sap/fe/core/controllerextensions/Share-dbg.js +8 -1
  96. package/src/sap/fe/core/controllerextensions/Share.js.map +1 -1
  97. package/src/sap/fe/core/controllerextensions/Share.ts +11 -0
  98. package/src/sap/fe/core/controllerextensions/SideEffects-dbg.js +14 -13
  99. package/src/sap/fe/core/controllerextensions/SideEffects.js +1 -1
  100. package/src/sap/fe/core/controllerextensions/SideEffects.js.map +1 -1
  101. package/src/sap/fe/core/controllerextensions/SideEffects.ts +27 -27
  102. package/src/sap/fe/core/controllerextensions/ViewState-dbg.js +17 -8
  103. package/src/sap/fe/core/controllerextensions/ViewState.js +1 -1
  104. package/src/sap/fe/core/controllerextensions/ViewState.js.map +1 -1
  105. package/src/sap/fe/core/controllerextensions/ViewState.ts +35 -14
  106. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase-dbg.js +6 -5
  107. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -1
  108. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js.map +1 -1
  109. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +7 -4
  110. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync-dbg.js +285 -82
  111. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +1 -1
  112. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js.map +1 -1
  113. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +326 -89
  114. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon-dbg.js +23 -2
  115. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +1 -1
  116. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js.map +1 -1
  117. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +32 -3
  118. package/src/sap/fe/core/controllerextensions/collaboration/Manage-dbg.js +4 -4
  119. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +1 -1
  120. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js.map +1 -1
  121. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +4 -5
  122. package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +17 -3
  123. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block-dbg.js +65 -34
  124. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +1 -1
  125. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js.map +1 -1
  126. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +33 -18
  127. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog-dbg.js +103 -0
  128. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js +6 -0
  129. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js.map +1 -0
  130. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.tsx +124 -0
  131. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper-dbg.js +78 -149
  132. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1 -1
  133. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js.map +1 -1
  134. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +85 -160
  135. package/src/sap/fe/core/controllerextensions/editFlow/draft-dbg.js +49 -49
  136. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -1
  137. package/src/sap/fe/core/controllerextensions/editFlow/draft.js.map +1 -1
  138. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +52 -63
  139. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js.map +1 -1
  140. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal-dbg.js +82 -0
  141. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js +6 -0
  142. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js.map +1 -0
  143. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.ts +123 -0
  144. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade-dbg.js +1508 -0
  145. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +6 -0
  146. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js.map +1 -0
  147. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +1993 -0
  148. package/src/sap/fe/core/controllerextensions/editFlow/operations-dbg.js +3 -1415
  149. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
  150. package/src/sap/fe/core/controllerextensions/editFlow/operations.js.map +1 -1
  151. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +2 -1921
  152. package/src/sap/fe/core/controllerextensions/editFlow/sticky-dbg.js +10 -18
  153. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -1
  154. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js.map +1 -1
  155. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +9 -22
  156. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling-dbg.js +53 -47
  157. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +1 -1
  158. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js.map +1 -1
  159. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +55 -61
  160. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher-dbg.js +12 -1
  161. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js.map +1 -1
  162. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +19 -0
  163. package/src/sap/fe/core/controllerextensions/routing/RouterProxy-dbg.js +78 -13
  164. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +1 -1
  165. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js.map +1 -1
  166. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +100 -13
  167. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -1
  168. package/src/sap/fe/core/controls/CommandExecution-dbg.js +16 -5
  169. package/src/sap/fe/core/controls/CommandExecution.js +1 -1
  170. package/src/sap/fe/core/controls/CommandExecution.js.map +1 -1
  171. package/src/sap/fe/core/controls/CommandExecution.ts +15 -3
  172. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler-dbg.js +3 -2
  173. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
  174. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js.map +1 -1
  175. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +4 -1
  176. package/src/sap/fe/core/controls/FilterBar-dbg.js +1 -1
  177. package/src/sap/fe/core/controls/FilterBar.ts +5 -0
  178. package/src/sap/fe/core/controls/FormElementWrapper-dbg.js +1 -1
  179. package/src/sap/fe/core/controls/FormElementWrapper.ts +3 -0
  180. package/src/sap/fe/core/controls/filterbar/FilterContainer-dbg.js +1 -1
  181. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +7 -0
  182. package/src/sap/fe/core/controls/filterbar/VisualFilter-dbg.js +1 -1
  183. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +4 -0
  184. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer-dbg.js +1 -1
  185. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +10 -0
  186. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils-dbg.js +4 -3
  187. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
  188. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js.map +1 -1
  189. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +3 -2
  190. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +0 -1
  191. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +2 -0
  192. package/src/sap/fe/core/controls/massEdit/MassEditHandlers-dbg.js +6 -1
  193. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +1 -1
  194. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js.map +1 -1
  195. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +5 -0
  196. package/src/sap/fe/core/converters/ConverterContext-dbg.js +3 -5
  197. package/src/sap/fe/core/converters/ConverterContext.js +1 -1
  198. package/src/sap/fe/core/converters/ConverterContext.js.map +1 -1
  199. package/src/sap/fe/core/converters/ConverterContext.ts +4 -6
  200. package/src/sap/fe/core/converters/ManifestSettings-dbg.js +1 -8
  201. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  202. package/src/sap/fe/core/converters/ManifestSettings.js.map +1 -1
  203. package/src/sap/fe/core/converters/ManifestSettings.ts +15 -6
  204. package/src/sap/fe/core/converters/ManifestWrapper-dbg.js +21 -3
  205. package/src/sap/fe/core/converters/ManifestWrapper.js +1 -1
  206. package/src/sap/fe/core/converters/ManifestWrapper.js.map +1 -1
  207. package/src/sap/fe/core/converters/ManifestWrapper.ts +23 -1
  208. package/src/sap/fe/core/converters/MetaModelConverter-dbg.js +67 -62
  209. package/src/sap/fe/core/converters/MetaModelConverter.js +1 -1
  210. package/src/sap/fe/core/converters/MetaModelConverter.js.map +1 -1
  211. package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -66
  212. package/src/sap/fe/core/converters/TemplateConverter-dbg.js +2 -1
  213. package/src/sap/fe/core/converters/TemplateConverter.js.map +1 -1
  214. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
  215. package/src/sap/fe/core/converters/annotations/DataField-dbg.js +81 -20
  216. package/src/sap/fe/core/converters/annotations/DataField.js +1 -1
  217. package/src/sap/fe/core/converters/annotations/DataField.js.map +1 -1
  218. package/src/sap/fe/core/converters/annotations/DataField.ts +76 -22
  219. package/src/sap/fe/core/converters/common/AnnotationConverter-dbg.js +1027 -956
  220. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1 -1
  221. package/src/sap/fe/core/converters/common/AnnotationConverter.js.map +1 -1
  222. package/src/sap/fe/core/converters/controls/Common/Action-dbg.js +13 -19
  223. package/src/sap/fe/core/converters/controls/Common/Action.js +1 -1
  224. package/src/sap/fe/core/converters/controls/Common/Action.js.map +1 -1
  225. package/src/sap/fe/core/converters/controls/Common/Action.ts +37 -40
  226. package/src/sap/fe/core/converters/controls/Common/Chart-dbg.js +95 -33
  227. package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -1
  228. package/src/sap/fe/core/converters/controls/Common/Chart.js.map +1 -1
  229. package/src/sap/fe/core/converters/controls/Common/Chart.ts +133 -49
  230. package/src/sap/fe/core/converters/controls/Common/DataVisualization-dbg.js +99 -62
  231. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -1
  232. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js.map +1 -1
  233. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +140 -75
  234. package/src/sap/fe/core/converters/controls/Common/Form-dbg.js +7 -6
  235. package/src/sap/fe/core/converters/controls/Common/Form.js +1 -1
  236. package/src/sap/fe/core/converters/controls/Common/Form.js.map +1 -1
  237. package/src/sap/fe/core/converters/controls/Common/Form.ts +8 -14
  238. package/src/sap/fe/core/converters/controls/Common/KPI-dbg.js +9 -9
  239. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  240. package/src/sap/fe/core/converters/controls/Common/KPI.js.map +1 -1
  241. package/src/sap/fe/core/converters/controls/Common/KPI.ts +17 -18
  242. package/src/sap/fe/core/converters/controls/Common/Table-dbg.js +143 -93
  243. package/src/sap/fe/core/converters/controls/Common/Table.js +1 -1
  244. package/src/sap/fe/core/converters/controls/Common/Table.js.map +1 -1
  245. package/src/sap/fe/core/converters/controls/Common/Table.ts +221 -177
  246. package/src/sap/fe/core/converters/controls/Common/table/StandardActions-dbg.js +23 -16
  247. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +1 -1
  248. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js.map +1 -1
  249. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -23
  250. package/src/sap/fe/core/converters/controls/ListReport/FilterBar-dbg.js +138 -75
  251. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +1 -1
  252. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js.map +1 -1
  253. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +223 -110
  254. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters-dbg.js +38 -28
  255. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -1
  256. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js.map +1 -1
  257. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +67 -47
  258. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar-dbg.js +1 -1
  259. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +1 -1
  260. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet-dbg.js +6 -6
  261. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +1 -1
  262. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js.map +1 -1
  263. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +5 -8
  264. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection-dbg.js +54 -24
  265. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -1
  266. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js.map +1 -1
  267. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +84 -37
  268. package/src/sap/fe/core/converters/helpers/Aggregation-dbg.js +12 -14
  269. package/src/sap/fe/core/converters/helpers/Aggregation.js +1 -1
  270. package/src/sap/fe/core/converters/helpers/Aggregation.js.map +1 -1
  271. package/src/sap/fe/core/converters/helpers/Aggregation.ts +16 -11
  272. package/src/sap/fe/core/converters/helpers/BindingHelper-dbg.js +8 -6
  273. package/src/sap/fe/core/converters/helpers/BindingHelper.js +1 -1
  274. package/src/sap/fe/core/converters/helpers/BindingHelper.js.map +1 -1
  275. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +8 -6
  276. package/src/sap/fe/core/converters/helpers/ConfigurableObject-dbg.js +7 -6
  277. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
  278. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js.map +1 -1
  279. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +19 -10
  280. package/src/sap/fe/core/converters/helpers/DataFieldHelper-dbg.js +1 -1
  281. package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +7 -2
  282. package/src/sap/fe/core/converters/helpers/ID-dbg.js +1 -1
  283. package/src/sap/fe/core/converters/helpers/ID.ts +2 -1
  284. package/src/sap/fe/core/converters/helpers/IssueManager-dbg.js +11 -9
  285. package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
  286. package/src/sap/fe/core/converters/helpers/IssueManager.js.map +1 -1
  287. package/src/sap/fe/core/converters/helpers/IssueManager.ts +10 -8
  288. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction-dbg.js +22 -20
  289. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -1
  290. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js.map +1 -1
  291. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +19 -16
  292. package/src/sap/fe/core/converters/templates/ListReportConverter-dbg.js +32 -35
  293. package/src/sap/fe/core/converters/templates/ListReportConverter.js +1 -1
  294. package/src/sap/fe/core/converters/templates/ListReportConverter.js.map +1 -1
  295. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +42 -37
  296. package/src/sap/fe/core/converters/templates/ObjectPageConverter-dbg.js +12 -5
  297. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -1
  298. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js.map +1 -1
  299. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -2
  300. package/src/sap/fe/core/formatters/FPMFormatter-dbg.js +1 -1
  301. package/src/sap/fe/core/formatters/FPMFormatter.ts +1 -1
  302. package/src/sap/fe/core/formatters/FiscalFormat-dbg.js +2 -2
  303. package/src/sap/fe/core/formatters/FiscalFormat.ts +6 -1
  304. package/src/sap/fe/core/formatters/TableFormatter-dbg.js +3 -7
  305. package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
  306. package/src/sap/fe/core/formatters/TableFormatter.js.map +1 -1
  307. package/src/sap/fe/core/formatters/TableFormatter.ts +2 -6
  308. package/src/sap/fe/core/formatters/ValueFormatter-dbg.js +9 -5
  309. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  310. package/src/sap/fe/core/formatters/ValueFormatter.js.map +1 -1
  311. package/src/sap/fe/core/formatters/ValueFormatter.ts +11 -4
  312. package/src/sap/fe/core/fpm/Component-dbg.js +1 -1
  313. package/src/sap/fe/core/fpm/Component.ts +1 -0
  314. package/src/sap/fe/core/fpm/manifest.json +1 -1
  315. package/src/sap/fe/core/helpers/AppStartupHelper-dbg.js +2 -2
  316. package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -1
  317. package/src/sap/fe/core/helpers/AppStartupHelper.js.map +1 -1
  318. package/src/sap/fe/core/helpers/AppStartupHelper.ts +1 -1
  319. package/src/sap/fe/core/helpers/BindingToolkit-dbg.js +7 -6
  320. package/src/sap/fe/core/helpers/BindingToolkit.js +1 -1
  321. package/src/sap/fe/core/helpers/BindingToolkit.js.map +1 -1
  322. package/src/sap/fe/core/helpers/BindingToolkit.ts +9 -9
  323. package/src/sap/fe/core/helpers/ClassSupport-dbg.js +1 -1
  324. package/src/sap/fe/core/helpers/ClassSupport.js.map +1 -1
  325. package/src/sap/fe/core/helpers/ClassSupport.ts +1 -0
  326. package/src/sap/fe/core/helpers/DeleteHelper-dbg.js +93 -62
  327. package/src/sap/fe/core/helpers/DeleteHelper.js +1 -1
  328. package/src/sap/fe/core/helpers/DeleteHelper.js.map +1 -1
  329. package/src/sap/fe/core/helpers/DeleteHelper.ts +140 -185
  330. package/src/sap/fe/core/helpers/MassEditHelper-dbg.js +23 -20
  331. package/src/sap/fe/core/helpers/MassEditHelper.js +1 -1
  332. package/src/sap/fe/core/helpers/MassEditHelper.js.map +1 -1
  333. package/src/sap/fe/core/helpers/MassEditHelper.ts +26 -28
  334. package/src/sap/fe/core/helpers/MessageStrip-dbg.js +9 -9
  335. package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
  336. package/src/sap/fe/core/helpers/MessageStrip.js.map +1 -1
  337. package/src/sap/fe/core/helpers/MessageStrip.ts +8 -8
  338. package/src/sap/fe/core/helpers/MetaModelFunction-dbg.js +517 -0
  339. package/src/sap/fe/core/helpers/MetaModelFunction.js +6 -0
  340. package/src/sap/fe/core/helpers/MetaModelFunction.js.map +1 -0
  341. package/src/sap/fe/core/helpers/MetaModelFunction.ts +610 -0
  342. package/src/sap/fe/core/helpers/ModelHelper-dbg.js +37 -73
  343. package/src/sap/fe/core/helpers/ModelHelper.js +1 -1
  344. package/src/sap/fe/core/helpers/ModelHelper.js.map +1 -1
  345. package/src/sap/fe/core/helpers/ModelHelper.ts +47 -74
  346. package/src/sap/fe/core/helpers/PasteHelper-dbg.js +5 -5
  347. package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
  348. package/src/sap/fe/core/helpers/PasteHelper.js.map +1 -1
  349. package/src/sap/fe/core/helpers/PasteHelper.ts +6 -10
  350. package/src/sap/fe/core/helpers/ResourceModelHelper-dbg.js +39 -0
  351. package/src/sap/fe/core/helpers/ResourceModelHelper.js +6 -0
  352. package/src/sap/fe/core/helpers/ResourceModelHelper.js.map +1 -0
  353. package/src/sap/fe/core/helpers/ResourceModelHelper.ts +35 -0
  354. package/src/sap/fe/core/helpers/SemanticDateOperators-dbg.js +132 -23
  355. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  356. package/src/sap/fe/core/helpers/SemanticDateOperators.js.map +1 -1
  357. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +109 -22
  358. package/src/sap/fe/core/helpers/SemanticKeyHelper-dbg.js +2 -2
  359. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  360. package/src/sap/fe/core/helpers/SemanticKeyHelper.js.map +1 -1
  361. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
  362. package/src/sap/fe/core/helpers/SizeHelper-dbg.js +53 -0
  363. package/src/sap/fe/core/helpers/SizeHelper.js +6 -0
  364. package/src/sap/fe/core/helpers/SizeHelper.js.map +1 -0
  365. package/src/sap/fe/core/helpers/SizeHelper.ts +51 -0
  366. package/src/sap/fe/core/helpers/StableIdHelper-dbg.js +29 -25
  367. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
  368. package/src/sap/fe/core/helpers/StableIdHelper.js.map +1 -1
  369. package/src/sap/fe/core/helpers/StableIdHelper.ts +26 -24
  370. package/src/sap/fe/core/helpers/Synchronization-dbg.js +1 -1
  371. package/src/sap/fe/core/helpers/Synchronization.ts +2 -0
  372. package/src/sap/fe/core/helpers/TypeGuards-dbg.js +151 -1
  373. package/src/sap/fe/core/helpers/TypeGuards.js +1 -1
  374. package/src/sap/fe/core/helpers/TypeGuards.js.map +1 -1
  375. package/src/sap/fe/core/helpers/TypeGuards.ts +162 -1
  376. package/src/sap/fe/core/jsx-runtime/ViewLoader-dbg.js +2 -1
  377. package/src/sap/fe/core/jsx-runtime/ViewLoader.js.map +1 -1
  378. package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +6 -2
  379. package/src/sap/fe/core/jsx-runtime/jsx-control-dbg.js +1 -1
  380. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +3 -1
  381. package/src/sap/fe/core/jsx-runtime/useMDXComponents-dbg.js +3 -3
  382. package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +1 -1
  383. package/src/sap/fe/core/jsx-runtime/useMDXComponents.js.map +1 -1
  384. package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +1 -1
  385. package/src/sap/fe/core/library-dbg.js +2 -2
  386. package/src/sap/fe/core/library-preload.js +156 -140
  387. package/src/sap/fe/core/library-preload.js.map +1 -1
  388. package/src/sap/fe/core/library.js +1 -1
  389. package/src/sap/fe/core/library.ts +7 -0
  390. package/src/sap/fe/core/manifest.json +1 -1
  391. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration-dbg.js +67 -15
  392. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  393. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js.map +1 -1
  394. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -14
  395. package/src/sap/fe/core/messagebundle.properties +35 -0
  396. package/src/sap/fe/core/messagebundle_ar.properties +15 -12
  397. package/src/sap/fe/core/messagebundle_bg.properties +20 -17
  398. package/src/sap/fe/core/messagebundle_ca.properties +12 -9
  399. package/src/sap/fe/core/messagebundle_cs.properties +12 -9
  400. package/src/sap/fe/core/messagebundle_cy.properties +12 -9
  401. package/src/sap/fe/core/messagebundle_da.properties +12 -9
  402. package/src/sap/fe/core/messagebundle_de.properties +13 -10
  403. package/src/sap/fe/core/messagebundle_el.properties +14 -11
  404. package/src/sap/fe/core/messagebundle_en.properties +4 -1
  405. package/src/sap/fe/core/messagebundle_en_GB.properties +4 -1
  406. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
  407. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +21 -0
  408. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +23 -3
  409. package/src/sap/fe/core/messagebundle_es.properties +12 -9
  410. package/src/sap/fe/core/messagebundle_es_MX.properties +12 -9
  411. package/src/sap/fe/core/messagebundle_et.properties +12 -9
  412. package/src/sap/fe/core/messagebundle_fi.properties +12 -9
  413. package/src/sap/fe/core/messagebundle_fr.properties +12 -9
  414. package/src/sap/fe/core/messagebundle_fr_CA.properties +13 -10
  415. package/src/sap/fe/core/messagebundle_hi.properties +12 -9
  416. package/src/sap/fe/core/messagebundle_hr.properties +12 -9
  417. package/src/sap/fe/core/messagebundle_hu.properties +12 -9
  418. package/src/sap/fe/core/messagebundle_id.properties +13 -10
  419. package/src/sap/fe/core/messagebundle_it.properties +12 -9
  420. package/src/sap/fe/core/messagebundle_iw.properties +12 -9
  421. package/src/sap/fe/core/messagebundle_ja.properties +13 -10
  422. package/src/sap/fe/core/messagebundle_kk.properties +12 -9
  423. package/src/sap/fe/core/messagebundle_ko.properties +12 -9
  424. package/src/sap/fe/core/messagebundle_lt.properties +12 -9
  425. package/src/sap/fe/core/messagebundle_lv.properties +12 -9
  426. package/src/sap/fe/core/messagebundle_ms.properties +13 -10
  427. package/src/sap/fe/core/messagebundle_nl.properties +13 -10
  428. package/src/sap/fe/core/messagebundle_no.properties +12 -9
  429. package/src/sap/fe/core/messagebundle_pl.properties +12 -9
  430. package/src/sap/fe/core/messagebundle_pt.properties +12 -9
  431. package/src/sap/fe/core/messagebundle_pt_PT.properties +12 -9
  432. package/src/sap/fe/core/messagebundle_ro.properties +16 -13
  433. package/src/sap/fe/core/messagebundle_ru.properties +13 -10
  434. package/src/sap/fe/core/messagebundle_sh.properties +12 -9
  435. package/src/sap/fe/core/messagebundle_sk.properties +12 -9
  436. package/src/sap/fe/core/messagebundle_sl.properties +12 -9
  437. package/src/sap/fe/core/messagebundle_sv.properties +12 -9
  438. package/src/sap/fe/core/messagebundle_th.properties +12 -9
  439. package/src/sap/fe/core/messagebundle_tr.properties +12 -9
  440. package/src/sap/fe/core/messagebundle_uk.properties +12 -9
  441. package/src/sap/fe/core/messagebundle_vi.properties +13 -10
  442. package/src/sap/fe/core/messagebundle_zh_CN.properties +12 -9
  443. package/src/sap/fe/core/messagebundle_zh_TW.properties +12 -9
  444. package/src/sap/fe/core/operationsHelper-dbg.js +70 -44
  445. package/src/sap/fe/core/operationsHelper.js +1 -1
  446. package/src/sap/fe/core/operationsHelper.js.map +1 -1
  447. package/src/sap/fe/core/operationsHelper.ts +88 -63
  448. package/src/sap/fe/core/rootView/Fcl-dbg.controller.js +1 -1
  449. package/src/sap/fe/core/rootView/Fcl.controller.ts +10 -0
  450. package/src/sap/fe/core/rootView/NavContainer-dbg.controller.js +2 -2
  451. package/src/sap/fe/core/rootView/NavContainer.controller.js +1 -1
  452. package/src/sap/fe/core/rootView/NavContainer.controller.js.map +1 -1
  453. package/src/sap/fe/core/rootView/NavContainer.controller.ts +5 -3
  454. package/src/sap/fe/core/rootView/RootViewBaseController-dbg.js +10 -5
  455. package/src/sap/fe/core/rootView/RootViewBaseController.js +1 -1
  456. package/src/sap/fe/core/rootView/RootViewBaseController.js.map +1 -1
  457. package/src/sap/fe/core/rootView/RootViewBaseController.ts +22 -8
  458. package/src/sap/fe/core/services/AsyncComponentServiceFactory-dbg.js +1 -1
  459. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  460. package/src/sap/fe/core/services/CacheHandlerServiceFactory-dbg.js +1 -1
  461. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js.map +1 -1
  462. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +15 -1
  463. package/src/sap/fe/core/services/EnvironmentServiceFactory-dbg.js +1 -1
  464. package/src/sap/fe/core/services/EnvironmentServiceFactory.js.map +1 -1
  465. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +4 -1
  466. package/src/sap/fe/core/services/NavigationServiceFactory-dbg.js +9 -1
  467. package/src/sap/fe/core/services/NavigationServiceFactory.js.map +1 -1
  468. package/src/sap/fe/core/services/NavigationServiceFactory.ts +19 -1
  469. package/src/sap/fe/core/services/ResourceModelServiceFactory-dbg.js +2 -2
  470. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
  471. package/src/sap/fe/core/services/ResourceModelServiceFactory.js.map +1 -1
  472. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +10 -3
  473. package/src/sap/fe/core/services/RoutingServiceFactory-dbg.js +9 -3
  474. package/src/sap/fe/core/services/RoutingServiceFactory.js +1 -1
  475. package/src/sap/fe/core/services/RoutingServiceFactory.js.map +1 -1
  476. package/src/sap/fe/core/services/RoutingServiceFactory.ts +35 -3
  477. package/src/sap/fe/core/services/ShellServicesFactory-dbg.js +7 -1
  478. package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
  479. package/src/sap/fe/core/services/ShellServicesFactory.js.map +1 -1
  480. package/src/sap/fe/core/services/ShellServicesFactory.ts +24 -2
  481. package/src/sap/fe/core/services/SideEffectsServiceFactory-dbg.js +448 -279
  482. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +1 -1
  483. package/src/sap/fe/core/services/SideEffectsServiceFactory.js.map +1 -1
  484. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +497 -333
  485. package/src/sap/fe/core/services/TemplatedViewServiceFactory-dbg.js +26 -6
  486. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +1 -1
  487. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js.map +1 -1
  488. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +54 -13
  489. package/src/sap/fe/core/support/Diagnostics-dbg.js +1 -1
  490. package/src/sap/fe/core/support/Diagnostics.ts +5 -0
  491. package/src/sap/fe/core/templating/CommonFormatters-dbg.js +4 -3
  492. package/src/sap/fe/core/templating/CommonFormatters.js +1 -1
  493. package/src/sap/fe/core/templating/CommonFormatters.js.map +1 -1
  494. package/src/sap/fe/core/templating/CommonFormatters.ts +2 -2
  495. package/src/sap/fe/core/templating/DataModelPathHelper-dbg.js +195 -95
  496. package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -1
  497. package/src/sap/fe/core/templating/DataModelPathHelper.js.map +1 -1
  498. package/src/sap/fe/core/templating/DataModelPathHelper.ts +210 -96
  499. package/src/sap/fe/core/templating/DisplayModeFormatter-dbg.js +5 -5
  500. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  501. package/src/sap/fe/core/templating/DisplayModeFormatter.js.map +1 -1
  502. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -2
  503. package/src/sap/fe/core/templating/EntitySetHelper-dbg.js +19 -29
  504. package/src/sap/fe/core/templating/EntitySetHelper.js +1 -1
  505. package/src/sap/fe/core/templating/EntitySetHelper.js.map +1 -1
  506. package/src/sap/fe/core/templating/EntitySetHelper.ts +14 -26
  507. package/src/sap/fe/core/templating/EntityTypeHelper-dbg.js +48 -0
  508. package/src/sap/fe/core/templating/EntityTypeHelper.js +6 -0
  509. package/src/sap/fe/core/templating/EntityTypeHelper.js.map +1 -0
  510. package/src/sap/fe/core/templating/EntityTypeHelper.ts +37 -0
  511. package/src/sap/fe/core/templating/FilterHelper-dbg.js +3 -3
  512. package/src/sap/fe/core/templating/FilterHelper.js +1 -1
  513. package/src/sap/fe/core/templating/FilterHelper.js.map +1 -1
  514. package/src/sap/fe/core/templating/FilterHelper.ts +5 -3
  515. package/src/sap/fe/core/templating/FilterTemplating-dbg.js +7 -8
  516. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  517. package/src/sap/fe/core/templating/FilterTemplating.js.map +1 -1
  518. package/src/sap/fe/core/templating/FilterTemplating.ts +5 -8
  519. package/src/sap/fe/core/templating/PropertyFormatters-dbg.js +1 -6
  520. package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
  521. package/src/sap/fe/core/templating/PropertyFormatters.js.map +1 -1
  522. package/src/sap/fe/core/templating/PropertyFormatters.ts +0 -5
  523. package/src/sap/fe/core/templating/PropertyHelper-dbg.js +13 -46
  524. package/src/sap/fe/core/templating/PropertyHelper.js +1 -1
  525. package/src/sap/fe/core/templating/PropertyHelper.js.map +1 -1
  526. package/src/sap/fe/core/templating/PropertyHelper.ts +14 -43
  527. package/src/sap/fe/core/templating/UIFormatters-dbg.js +32 -26
  528. package/src/sap/fe/core/templating/UIFormatters.js +1 -1
  529. package/src/sap/fe/core/templating/UIFormatters.js.map +1 -1
  530. package/src/sap/fe/core/templating/UIFormatters.ts +47 -32
  531. package/src/sap/fe/core/type/DateTimeWithTimezone-dbg.js +1 -1
  532. package/src/sap/fe/core/type/DateTimeWithTimezone.ts +2 -0
  533. package/src/sap/fe/core/type/FiscalDate-dbg.js +2 -2
  534. package/src/sap/fe/core/type/FiscalDate.js.map +1 -1
  535. package/src/sap/fe/core/type/FiscalDate.ts +2 -1
  536. package/src/sap/fe/core/type/TypeUtil-dbg.js +5 -10
  537. package/src/sap/fe/core/type/TypeUtil.js +1 -1
  538. package/src/sap/fe/core/type/TypeUtil.js.map +1 -1
  539. package/src/sap/fe/core/type/TypeUtil.ts +3 -6
  540. package/src/sap/fe/core/buildingBlocks/BuildingBlock-dbg.js +0 -410
  541. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +0 -15
  542. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js.map +0 -1
  543. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +0 -536
  544. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment-dbg.js +0 -44
  545. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js +0 -6
  546. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js.map +0 -1
  547. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.ts +0 -14
  548. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime-dbg.js +0 -948
  549. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +0 -19
  550. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js.map +0 -1
  551. package/src/sap/fe/core/controllerextensions/InternalEditFlow-dbg.js +0 -711
  552. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +0 -6
  553. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js.map +0 -1
  554. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +0 -863
  555. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +0 -91
  556. package/src/sap/fe/core/controls/ConditionalWrapper-dbg.js +0 -151
  557. package/src/sap/fe/core/controls/ConditionalWrapper.js +0 -6
  558. package/src/sap/fe/core/controls/ConditionalWrapper.js.map +0 -1
  559. package/src/sap/fe/core/controls/ConditionalWrapper.ts +0 -88
  560. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper-dbg.js +0 -330
  561. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +0 -6
  562. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js.map +0 -1
  563. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +0 -292
  564. package/src/sap/fe/core/controls/CustomQuickViewPage-dbg.js +0 -126
  565. package/src/sap/fe/core/controls/CustomQuickViewPage.js +0 -6
  566. package/src/sap/fe/core/controls/CustomQuickViewPage.js.map +0 -1
  567. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +0 -105
  568. package/src/sap/fe/core/controls/FieldWrapper-dbg.js +0 -194
  569. package/src/sap/fe/core/controls/FieldWrapper.js +0 -6
  570. package/src/sap/fe/core/controls/FieldWrapper.js.map +0 -1
  571. package/src/sap/fe/core/controls/FieldWrapper.ts +0 -121
  572. package/src/sap/fe/core/controls/FileWrapper-dbg.js +0 -280
  573. package/src/sap/fe/core/controls/FileWrapper.js +0 -6
  574. package/src/sap/fe/core/controls/FileWrapper.js.map +0 -1
  575. package/src/sap/fe/core/controls/FileWrapper.ts +0 -202
  576. package/src/sap/fe/core/helpers/SideEffectsHelper-dbg.js +0 -141
  577. package/src/sap/fe/core/helpers/SideEffectsHelper.js +0 -6
  578. package/src/sap/fe/core/helpers/SideEffectsHelper.js.map +0 -1
  579. package/src/sap/fe/core/helpers/SideEffectsHelper.ts +0 -129
@@ -1,1921 +1,2 @@
1
- import type ResourceBundle from "sap/base/i18n/ResourceBundle";
2
- import Log from "sap/base/Log";
3
- import ActionRuntime from "sap/fe/core/ActionRuntime";
4
- import CommonUtils from "sap/fe/core/CommonUtils";
5
- import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
6
- import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
7
- import FPMHelper from "sap/fe/core/helpers/FPMHelper";
8
- import { generate } from "sap/fe/core/helpers/StableIdHelper";
9
- import FELibrary from "sap/fe/core/library";
10
- import Button from "sap/m/Button";
11
- import Dialog from "sap/m/Dialog";
12
- import type Label from "sap/m/Label";
13
- import MessageBox from "sap/m/MessageBox";
14
- import type Event from "sap/ui/base/Event";
15
- import type Control from "sap/ui/core/Control";
16
- import Core from "sap/ui/core/Core";
17
- import Fragment from "sap/ui/core/Fragment";
18
- import { MessageType } from "sap/ui/core/library";
19
- import Message from "sap/ui/core/message/Message";
20
- import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
21
- import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
22
- import type Field from "sap/ui/mdc/Field";
23
- import type MultiValueFieldItem from "sap/ui/mdc/field/MultiValueFieldItem";
24
- import type MultiValueField from "sap/ui/mdc/MultiValueField";
25
- import type Context from "sap/ui/model/Context";
26
- import JSONModel from "sap/ui/model/json/JSONModel";
27
- import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
28
- import type AppComponent from "../../AppComponent";
29
- import operationsHelper, { type StrictHandlingUtilities } from "../../operationsHelper";
30
- import type MessageHandler from "../MessageHandler";
31
-
32
- const Constants = FELibrary.Constants,
33
- InvocationGrouping = FELibrary.InvocationGrouping;
34
- const Action = (MessageBox as any).Action;
35
-
36
- /**
37
- * Calls a bound action for one or multiple contexts.
38
- *
39
- * @function
40
- * @static
41
- * @name sap.fe.core.actions.operations.callBoundAction
42
- * @memberof sap.fe.core.actions.operations
43
- * @param sActionName The name of the action to be called
44
- * @param contexts Either one context or an array with contexts for which the action is to be be called
45
- * @param oModel OData Model
46
- * @param oAppComponent The AppComponent
47
- * @param [mParameters] Optional, can contain the following attributes:
48
- * @param [mParameters.parameterValues] A map of action parameter names and provided values
49
- * @param [mParameters.mBindingParameters] A map of binding parameters that would be part of $select and $expand coming from side effects for bound actions
50
- * @param [mParameters.additionalSideEffect] Array of property paths to be requested in addition to actual target properties of the side effect
51
- * @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
52
- * @param [mParameters.label] A human-readable label for the action
53
- * @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
54
- * @param [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
55
- * @param [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
56
- * @param [mParameters.parentControl] If specified, the dialogs are added as dependent of the parent control
57
- * @param [mParameters.bGetBoundContext] If specified, the action promise returns the bound context
58
- * @param [strictHandlingUtilities] Optional, utility flags and messages for strictHandling
59
- * @returns Promise resolves with an array of response objects (TODO: to be changed)
60
- * @private
61
- * @ui5-restricted
62
- */
63
- function callBoundAction(
64
- sActionName: string,
65
- contexts: any,
66
- oModel: any,
67
- oAppComponent: AppComponent,
68
- mParameters: any,
69
- strictHandlingUtilities?: StrictHandlingUtilities
70
- ) {
71
- if (!strictHandlingUtilities) {
72
- strictHandlingUtilities = {
73
- is412Executed: false,
74
- strictHandlingTransitionFails: [],
75
- strictHandlingPromises: [],
76
- strictHandlingWarningMessages: [],
77
- delaySuccessMessages: [],
78
- processedMessageIds: []
79
- };
80
- }
81
- if (!contexts || contexts.length === 0) {
82
- //In Freestyle apps bound actions can have no context
83
- return Promise.reject("Bound actions always requires at least one context");
84
- }
85
- // this method either accepts single context or an array of contexts
86
- // TODO: Refactor to an unambiguos API
87
- const isCalledWithArray = Array.isArray(contexts);
88
-
89
- // in case of single context wrap into an array for called methods (esp. callAction)
90
- mParameters.aContexts = isCalledWithArray ? contexts : [contexts];
91
-
92
- const oMetaModel = oModel.getMetaModel(),
93
- // Analyzing metaModelPath for action only from first context seems weird, but probably works in all existing szenarios - if several contexts are passed, they probably
94
- // belong to the same metamodelpath. TODO: Check, whether this can be improved / szenarios with different metaModelPaths might exist
95
- sActionPath = `${oMetaModel.getMetaPath(mParameters.aContexts[0].getPath())}/${sActionName}`,
96
- oBoundAction = oMetaModel.createBindingContext(`${sActionPath}/@$ui5.overload/0`);
97
- mParameters.isCriticalAction = getIsActionCritical(oMetaModel, sActionPath, mParameters.aContexts, oBoundAction);
98
-
99
- // Promise returned by callAction currently is rejected in case of execution for multiple contexts partly failing. This should be changed (some failing contexts do not mean
100
- // that function did not fulfill its task), but as this is a bigger refactoring, for the time being we need to deal with that at the calling place (i.e. here)
101
- // => provide the same handler (mapping back from array to single result/error if needed) for resolved/rejected case
102
- const extractSingleResult = function (result: any) {
103
- // single action could be resolved or rejected
104
- if (result[0].status === "fulfilled") {
105
- return result[0].value;
106
- } else {
107
- // In case of dialog cancellation, no array is returned => throw the result.
108
- // Ideally, differentiating should not be needed here => TODO: Find better solution when separating dialog handling (single object with single result) from backend
109
- // execution (potentially multiple objects)
110
- throw result[0].reason || result;
111
- }
112
- };
113
-
114
- return callAction(sActionName, oModel, oBoundAction, oAppComponent, mParameters, strictHandlingUtilities).then(
115
- (result: any) => {
116
- if (isCalledWithArray) {
117
- return result;
118
- } else {
119
- return extractSingleResult(result);
120
- }
121
- },
122
- (result: any) => {
123
- if (isCalledWithArray) {
124
- throw result;
125
- } else {
126
- return extractSingleResult(result);
127
- }
128
- }
129
- );
130
- }
131
- /**
132
- * Calls an action import.
133
- *
134
- * @function
135
- * @static
136
- * @name sap.fe.core.actions.operations.callActionImport
137
- * @memberof sap.fe.core.actions.operations
138
- * @param sActionName The name of the action import to be called
139
- * @param oModel An instance of an OData V4 model
140
- * @param oAppComponent The AppComponent
141
- * @param [mParameters] Optional, can contain the following attributes:
142
- * @param [mParameters.parameterValues] A map of action parameter names and provided values
143
- * @param [mParameters.label] A human-readable label for the action
144
- * @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
145
- * @param [mParameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
146
- * @param [mParameters.defaultParameters] Can contain default parameters from FLP user defaults
147
- * @param [strictHandlingUtilities] Optional, utility flags and messages for strictHandling
148
- * @returns Promise resolves with an array of response objects (TODO: to be changed)
149
- * @private
150
- * @ui5-restricted
151
- */
152
- function callActionImport(
153
- sActionName: string,
154
- oModel: any,
155
- oAppComponent: AppComponent,
156
- mParameters: any,
157
- strictHandlingUtilities?: StrictHandlingUtilities
158
- ) {
159
- if (!oModel) {
160
- return Promise.reject("Action expects a model/context for execution");
161
- }
162
- const oMetaModel = oModel.getMetaModel(),
163
- sActionPath = oModel.bindContext(`/${sActionName}`).getPath(),
164
- oActionImport = oMetaModel.createBindingContext(`/${oMetaModel.createBindingContext(sActionPath).getObject("$Action")}/0`);
165
- mParameters.isCriticalAction = getIsActionCritical(oMetaModel, `${sActionPath}/@$ui5.overload`);
166
- return callAction(sActionName, oModel, oActionImport, oAppComponent, mParameters, strictHandlingUtilities);
167
- }
168
- function callBoundFunction(sFunctionName: string, context: any, oModel: any) {
169
- if (!context) {
170
- return Promise.reject("Bound functions always requires a context");
171
- }
172
- const oMetaModel = oModel.getMetaModel(),
173
- sFunctionPath = `${oMetaModel.getMetaPath(context.getPath())}/${sFunctionName}`,
174
- oBoundFunction = oMetaModel.createBindingContext(sFunctionPath);
175
- return _executeFunction(sFunctionName, oModel, oBoundFunction, context);
176
- }
177
- /**
178
- * Calls a function import.
179
- *
180
- * @function
181
- * @static
182
- * @name sap.fe.core.actions.operations.callFunctionImport
183
- * @memberof sap.fe.core.actions.operations
184
- * @param sFunctionName The name of the function to be called
185
- * @param oModel An instance of an OData v4 model
186
- * @returns Promise resolves
187
- * @private
188
- */
189
- function callFunctionImport(sFunctionName: string, oModel: any) {
190
- if (!sFunctionName) {
191
- return Promise.resolve();
192
- }
193
- const oMetaModel = oModel.getMetaModel(),
194
- sFunctionPath = oModel.bindContext(`/${sFunctionName}`).getPath(),
195
- oFunctionImport = oMetaModel.createBindingContext(`/${oMetaModel.createBindingContext(sFunctionPath).getObject("$Function")}/0`);
196
- return _executeFunction(sFunctionName, oModel, oFunctionImport);
197
- }
198
- function _executeFunction(sFunctionName: any, oModel: any, oFunction: any, context?: any) {
199
- let sGroupId;
200
- if (!oFunction || !oFunction.getObject()) {
201
- return Promise.reject(new Error(`Function ${sFunctionName} not found`));
202
- }
203
- if (context) {
204
- oFunction = oModel.bindContext(`${sFunctionName}(...)`, context);
205
- sGroupId = "functionGroup";
206
- } else {
207
- oFunction = oModel.bindContext(`/${sFunctionName}(...)`);
208
- sGroupId = "functionImport";
209
- }
210
- const oFunctionPromise = oFunction.execute(sGroupId);
211
- oModel.submitBatch(sGroupId);
212
- return oFunctionPromise.then(function () {
213
- return oFunction.getBoundContext();
214
- });
215
- }
216
- function callAction(
217
- sActionName: any,
218
- oModel: any,
219
- oAction: any,
220
- oAppComponent: AppComponent,
221
- mParameters: any,
222
- strictHandlingUtilities?: StrictHandlingUtilities
223
- ) {
224
- return new Promise(async function (resolve: (value: any) => void, reject: (reason?: any) => void) {
225
- let mActionExecutionParameters: any = {};
226
- let fnDialog;
227
- let oActionPromise;
228
- //let failedActionPromise: any;
229
- const sActionLabel = mParameters.label;
230
- const bSkipParameterDialog = mParameters.skipParameterDialog;
231
- const aContexts = mParameters.aContexts;
232
- const bIsCreateAction = mParameters.bIsCreateAction;
233
- const bIsCriticalAction = mParameters.isCriticalAction;
234
- let oMetaModel;
235
- let sMetaPath;
236
- let sMessagesPath: any;
237
- let iMessageSideEffect;
238
- let bIsSameEntity;
239
- let oReturnType;
240
- let bValuesProvidedForAllParameters;
241
- const actionDefinition = oAction.getObject();
242
- if (!oAction || !oAction.getObject()) {
243
- return reject(new Error(`Action ${sActionName} not found`));
244
- }
245
-
246
- // Get the parameters of the action
247
- const aActionParameters = getActionParameters(oAction);
248
-
249
- // Check if the action has parameters and would need a parameter dialog
250
- // The parameter ResultIsActiveEntity is always hidden in the dialog! Hence if
251
- // this is the only parameter, this is treated as no parameter here because the
252
- // dialog would be empty!
253
- // FIXME: Should only ignore this if this is a 'create' action, otherwise it is just some normal parameter that happens to have this name
254
- const bActionNeedsParameterDialog =
255
- aActionParameters.length > 0 && !(aActionParameters.length === 1 && aActionParameters[0].$Name === "ResultIsActiveEntity");
256
-
257
- // Provided values for the action parameters from invokeAction call
258
- const aParameterValues = mParameters.parameterValues;
259
-
260
- // Determine startup parameters if provided
261
- const oComponentData = oAppComponent.getComponentData();
262
- const oStartupParameters = (oComponentData && oComponentData.startupParameters) || {};
263
-
264
- // In case an action parameter is needed, and we shall skip the dialog, check if values are provided for all parameters
265
- if (bActionNeedsParameterDialog && bSkipParameterDialog) {
266
- bValuesProvidedForAllParameters = _valuesProvidedForAllParameters(
267
- bIsCreateAction,
268
- aActionParameters,
269
- aParameterValues,
270
- oStartupParameters
271
- );
272
- }
273
-
274
- // Depending on the previously determined data, either set a dialog or leave it empty which
275
- // will lead to direct execution of the action without a dialog
276
- fnDialog = null;
277
- if (bActionNeedsParameterDialog) {
278
- if (!(bSkipParameterDialog && bValuesProvidedForAllParameters)) {
279
- fnDialog = showActionParameterDialog;
280
- }
281
- } else if (bIsCriticalAction) {
282
- fnDialog = confirmCriticalAction;
283
- }
284
-
285
- mActionExecutionParameters = {
286
- fnOnSubmitted: mParameters.onSubmitted,
287
- fnOnResponse: mParameters.onResponse,
288
- actionName: sActionName,
289
- model: oModel,
290
- aActionParameters: aActionParameters,
291
- bGetBoundContext: mParameters.bGetBoundContext,
292
- defaultValuesExtensionFunction: mParameters.defaultValuesExtensionFunction,
293
- label: mParameters.label,
294
- selectedItems: mParameters.selectedItems
295
- };
296
- if (oAction.getObject("$IsBound")) {
297
- if (mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions) {
298
- oMetaModel = oModel.getMetaModel();
299
- sMetaPath = oMetaModel.getMetaPath(aContexts[0].getPath());
300
- sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
301
-
302
- if (sMessagesPath) {
303
- iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function (exp: any) {
304
- return typeof exp === "string" && exp === sMessagesPath;
305
- });
306
-
307
- // Add SAP_Messages by default if not annotated by side effects, action does not return a collection and
308
- // the return type is the same as the bound type
309
- oReturnType = oAction.getObject("$ReturnType");
310
- bIsSameEntity =
311
- oReturnType && !oReturnType.$isCollection && oAction.getModel().getObject(sMetaPath).$Type === oReturnType.$Type;
312
-
313
- if (iMessageSideEffect > -1 || bIsSameEntity) {
314
- // the message path is annotated as side effect. As there's no binding for it and the model does currently not allow
315
- // to add it at a later point of time we have to take care it's part of the $select of the POST, therefore moving it.
316
- mParameters.mBindingParameters = mParameters.mBindingParameters || {};
317
-
318
- if (
319
- oAction.getObject(`$ReturnType/$Type/${sMessagesPath}`) &&
320
- (!mParameters.mBindingParameters.$select ||
321
- mParameters.mBindingParameters.$select.split(",").indexOf(sMessagesPath) === -1)
322
- ) {
323
- mParameters.mBindingParameters.$select = mParameters.mBindingParameters.$select
324
- ? `${mParameters.mBindingParameters.$select},${sMessagesPath}`
325
- : sMessagesPath;
326
- // Add side effects at entity level because $select stops these being returned by the action
327
- // Only if no other side effects were added for Messages
328
- if (iMessageSideEffect === -1) {
329
- mParameters.additionalSideEffect.pathExpressions.push("*");
330
- }
331
-
332
- if (mParameters.additionalSideEffect.triggerActions.length === 0 && iMessageSideEffect > -1) {
333
- // no trigger action therefore no need to request messages again
334
- mParameters.additionalSideEffect.pathExpressions.splice(iMessageSideEffect, 1);
335
- }
336
- }
337
- }
338
- }
339
- }
340
-
341
- mActionExecutionParameters.aContexts = aContexts;
342
- mActionExecutionParameters.mBindingParameters = mParameters.mBindingParameters;
343
- mActionExecutionParameters.additionalSideEffect = mParameters.additionalSideEffect;
344
- mActionExecutionParameters.bGrouped = mParameters.invocationGrouping === InvocationGrouping.ChangeSet;
345
- mActionExecutionParameters.internalModelContext = mParameters.internalModelContext;
346
- mActionExecutionParameters.operationAvailableMap = mParameters.operationAvailableMap;
347
- mActionExecutionParameters.isCreateAction = bIsCreateAction;
348
- mActionExecutionParameters.bObjectPage = mParameters.bObjectPage;
349
- if (mParameters.controlId) {
350
- mActionExecutionParameters.control = mParameters.parentControl.byId(mParameters.controlId);
351
- } else {
352
- mActionExecutionParameters.control = mParameters.parentControl;
353
- }
354
- }
355
- if (bIsCreateAction) {
356
- mActionExecutionParameters.bIsCreateAction = bIsCreateAction;
357
- }
358
- //check for skipping static actions
359
- const isStatic = (actionDefinition.$Parameter || []).some((aParameter: any) => {
360
- return (
361
- ((actionDefinition.$EntitySetPath && actionDefinition.$EntitySetPath === aParameter.$Name) || actionDefinition.$IsBound) &&
362
- aParameter.$isCollection
363
- );
364
- });
365
- mActionExecutionParameters.isStatic = isStatic;
366
- if (fnDialog) {
367
- oActionPromise = fnDialog(
368
- sActionName,
369
- oAppComponent,
370
- sActionLabel,
371
- mActionExecutionParameters,
372
- aActionParameters,
373
- aParameterValues,
374
- oAction,
375
- mParameters.parentControl,
376
- mParameters.entitySetName,
377
- mParameters.messageHandler,
378
- strictHandlingUtilities
379
- );
380
- return oActionPromise
381
- .then(function (oOperationResult: any) {
382
- afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
383
- resolve(oOperationResult);
384
- })
385
- .catch(function (oOperationResult: any) {
386
- reject(oOperationResult);
387
- });
388
- } else {
389
- // Take over all provided parameter values and call the action.
390
- // This shall only happen if values are provided for all the parameters, otherwise the parameter dialog shall be shown which is ensured earlier
391
- if (aParameterValues) {
392
- for (const i in mActionExecutionParameters.aActionParameters) {
393
- mActionExecutionParameters.aActionParameters[i].value = aParameterValues?.find(
394
- (element: any) => element.name === mActionExecutionParameters.aActionParameters[i].$Name
395
- )?.value;
396
- }
397
- } else {
398
- for (const i in mActionExecutionParameters.aActionParameters) {
399
- mActionExecutionParameters.aActionParameters[i].value =
400
- oStartupParameters[mActionExecutionParameters.aActionParameters[i].$Name]?.[0];
401
- }
402
- }
403
- let oOperationResult: any;
404
- try {
405
- oOperationResult = await _executeAction(
406
- oAppComponent,
407
- mActionExecutionParameters,
408
- mParameters.parentControl,
409
- mParameters.messageHandler,
410
- strictHandlingUtilities
411
- );
412
-
413
- const messages = Core.getMessageManager().getMessageModel().getData();
414
- if (
415
- strictHandlingUtilities &&
416
- strictHandlingUtilities.is412Executed &&
417
- strictHandlingUtilities.strictHandlingTransitionFails.length
418
- ) {
419
- strictHandlingUtilities.delaySuccessMessages = strictHandlingUtilities.delaySuccessMessages.concat(messages);
420
- }
421
- afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
422
- resolve(oOperationResult);
423
- } catch {
424
- reject(oOperationResult);
425
- } finally {
426
- if (
427
- strictHandlingUtilities &&
428
- strictHandlingUtilities.is412Executed &&
429
- strictHandlingUtilities.strictHandlingTransitionFails.length
430
- ) {
431
- try {
432
- const strictHandlingFails = strictHandlingUtilities.strictHandlingTransitionFails;
433
- const aFailedContexts = [] as any;
434
- strictHandlingFails.forEach(function (fail: any) {
435
- aFailedContexts.push(fail.oAction.getContext());
436
- });
437
- mActionExecutionParameters.aContexts = aFailedContexts;
438
- const oFailedOperationResult = await _executeAction(
439
- oAppComponent,
440
- mActionExecutionParameters,
441
- mParameters.parentControl,
442
- mParameters.messageHandler,
443
- strictHandlingUtilities
444
- );
445
- strictHandlingUtilities.strictHandlingTransitionFails = [];
446
- Core.getMessageManager().addMessages(strictHandlingUtilities.delaySuccessMessages);
447
- afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
448
- resolve(oFailedOperationResult);
449
- } catch (oFailedOperationResult) {
450
- reject(oFailedOperationResult);
451
- }
452
- }
453
- mParameters?.messageHandler?.showMessageDialog({ control: mActionExecutionParameters?.control });
454
- if (strictHandlingUtilities) {
455
- strictHandlingUtilities = {
456
- is412Executed: false,
457
- strictHandlingTransitionFails: [],
458
- strictHandlingPromises: [],
459
- strictHandlingWarningMessages: [],
460
- delaySuccessMessages: [],
461
- processedMessageIds: []
462
- };
463
- }
464
- }
465
- }
466
- });
467
- }
468
- function confirmCriticalAction(
469
- sActionName: any,
470
- oAppComponent: AppComponent,
471
- sActionLabel: any,
472
- mParameters: any,
473
- aActionParameters: any,
474
- aParameterValues: any,
475
- oActionContext: any,
476
- oParentControl: any,
477
- entitySetName: any,
478
- messageHandler: any
479
- ) {
480
- return new Promise<void>((resolve, reject) => {
481
- let boundActionName = sActionName ? sActionName : null;
482
- boundActionName =
483
- boundActionName.indexOf(".") >= 0 ? boundActionName.split(".")[boundActionName.split(".").length - 1] : boundActionName;
484
- const suffixResourceKey = boundActionName && entitySetName ? `${entitySetName}|${boundActionName}` : "";
485
- const oResourceBundle = oParentControl.getController().oResourceBundle;
486
- const sConfirmationText = CommonUtils.getTranslatedText(
487
- "C_OPERATIONS_ACTION_CONFIRM_MESSAGE",
488
- oResourceBundle,
489
- undefined,
490
- suffixResourceKey
491
- );
492
-
493
- MessageBox.confirm(sConfirmationText, {
494
- onClose: async function (sAction: any) {
495
- if (sAction === Action.OK) {
496
- try {
497
- const oOperation = await _executeAction(oAppComponent, mParameters, oParentControl, messageHandler);
498
- resolve(oOperation);
499
- } catch (oError: any) {
500
- try {
501
- await messageHandler.showMessageDialog();
502
- reject(oError);
503
- } catch (e) {
504
- reject(oError);
505
- }
506
- }
507
- } else {
508
- resolve();
509
- }
510
- }
511
- });
512
- });
513
- }
514
-
515
- async function executeAPMAction(
516
- oAppComponent: AppComponent,
517
- mParameters: any,
518
- oParentControl: any,
519
- messageHandler: MessageHandler,
520
- aContexts: any,
521
- oDialog: any,
522
- after412: boolean,
523
- strictHandlingUtilities?: StrictHandlingUtilities
524
- ) {
525
- const aResult = await _executeAction(oAppComponent, mParameters, oParentControl, messageHandler, strictHandlingUtilities);
526
- // If some entries were successful, and others have failed, the overall process is still successful. However, this was treated as rejection
527
- // before, and this currently is still kept, as long as dialog handling is mixed with backend process handling.
528
- // TODO: Refactor to only reject in case of overall process error.
529
- // For the time being: map to old logic to reject if at least one entry has failed
530
- // This check is only done for bound actions => aContexts not empty
531
- if (mParameters.aContexts?.length) {
532
- if (aResult?.some((oSingleResult: any) => oSingleResult.status === "rejected")) {
533
- throw aResult;
534
- }
535
- }
536
-
537
- const messages = Core.getMessageManager().getMessageModel().getData();
538
- if (strictHandlingUtilities && strictHandlingUtilities.is412Executed && strictHandlingUtilities.strictHandlingTransitionFails.length) {
539
- if (!after412) {
540
- strictHandlingUtilities.delaySuccessMessages = strictHandlingUtilities.delaySuccessMessages.concat(messages);
541
- } else {
542
- Core.getMessageManager().addMessages(strictHandlingUtilities.delaySuccessMessages);
543
- if (messages.length) {
544
- // BOUND TRANSITION AS PART OF SAP_MESSAGE
545
- messageHandler.showMessageDialog({
546
- onBeforeShowMessage: function (aMessages: any, showMessageParametersIn: any) {
547
- return actionParameterShowMessageCallback(mParameters, aContexts, oDialog, aMessages, showMessageParametersIn);
548
- },
549
- control: mParameters.control
550
- });
551
- }
552
- }
553
- } else if (messages.length) {
554
- // BOUND TRANSITION AS PART OF SAP_MESSAGE
555
- messageHandler.showMessageDialog({
556
- isActionParameterDialogOpen: mParameters?.oDialog.isOpen(),
557
- onBeforeShowMessage: function (aMessages: any, showMessageParametersIn: any) {
558
- return actionParameterShowMessageCallback(mParameters, aContexts, oDialog, aMessages, showMessageParametersIn);
559
- },
560
- control: mParameters.control
561
- });
562
- }
563
-
564
- return aResult;
565
- }
566
-
567
- function afterActionResolution(mParameters: any, mActionExecutionParameters: any, actionDefinition: any) {
568
- if (
569
- mActionExecutionParameters.internalModelContext &&
570
- mActionExecutionParameters.operationAvailableMap &&
571
- mActionExecutionParameters.aContexts &&
572
- mActionExecutionParameters.aContexts.length &&
573
- actionDefinition.$IsBound
574
- ) {
575
- //check for skipping static actions
576
- const isStatic = mActionExecutionParameters.isStatic;
577
- if (!isStatic) {
578
- ActionRuntime.setActionEnablement(
579
- mActionExecutionParameters.internalModelContext,
580
- JSON.parse(mActionExecutionParameters.operationAvailableMap),
581
- mParameters.selectedItems,
582
- "table"
583
- );
584
- } else if (mActionExecutionParameters.control) {
585
- const oControl = mActionExecutionParameters.control;
586
- if (oControl.isA("sap.ui.mdc.Table")) {
587
- const aSelectedContexts = oControl.getSelectedContexts();
588
- ActionRuntime.setActionEnablement(
589
- mActionExecutionParameters.internalModelContext,
590
- JSON.parse(mActionExecutionParameters.operationAvailableMap),
591
- aSelectedContexts,
592
- "table"
593
- );
594
- }
595
- }
596
- }
597
- }
598
-
599
- function actionParameterShowMessageCallback(
600
- mParameters: any,
601
- aContexts: any,
602
- oDialog: any,
603
- messages: any,
604
- showMessageParametersIn: { showMessageBox: boolean; showMessageDialog: boolean }
605
- ): { fnGetMessageSubtitle: Function | undefined; showMessageBox: boolean; showMessageDialog: boolean; filteredMessages: any[] } {
606
- let showMessageBox = showMessageParametersIn.showMessageBox,
607
- showMessageDialog = showMessageParametersIn.showMessageDialog;
608
- const oControl = mParameters.control;
609
- const unboundMessages = messages.filter(function (message: any) {
610
- return message.getTarget() === "";
611
- });
612
- const APDmessages = messages.filter(function (message: any) {
613
- return (
614
- message.getTarget &&
615
- message.getTarget().indexOf(mParameters.actionName) !== -1 &&
616
- mParameters.aActionParameters.some(function (actionParam: any) {
617
- return message.getTarget().indexOf(actionParam.$Name) !== -1;
618
- })
619
- );
620
- });
621
- APDmessages.forEach(function (APDMessage: any) {
622
- APDMessage.isAPDTarget = true;
623
- });
624
-
625
- const errorTargetsInAPD = APDmessages.length ? true : false;
626
- if (oDialog.isOpen() && aContexts.length !== 0 && !mParameters.isStatic) {
627
- if (!mParameters.bGrouped) {
628
- //isolated
629
- if (aContexts.length > 1 || !errorTargetsInAPD) {
630
- // 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.
631
- // TODO: Dilaog handling should not be part of message handling. Refactor accordingly - dialog should not be needed inside this method - neither
632
- // to ask whether it's open, nor to close/destroy it!
633
- oDialog.close();
634
- oDialog.destroy();
635
- }
636
- } else if (!errorTargetsInAPD) {
637
- //changeset
638
- oDialog.close();
639
- oDialog.destroy();
640
- }
641
- }
642
- let filteredMessages: any[] = [];
643
- const bIsAPDOpen = oDialog.isOpen();
644
- if (messages.length === 1 && messages[0].getTarget && messages[0].getTarget() !== undefined && messages[0].getTarget() !== "") {
645
- if ((oControl && oControl.getModel("ui").getProperty("/isEditable") === false) || !oControl) {
646
- // OP edit or LR
647
- showMessageBox = !errorTargetsInAPD;
648
- showMessageDialog = false;
649
- } else if (oControl && oControl.getModel("ui").getProperty("/isEditable") === true) {
650
- showMessageBox = false;
651
- showMessageDialog = false;
652
- }
653
- } else if (oControl) {
654
- if (oControl.getModel("ui").getProperty("/isEditable") === false) {
655
- if (bIsAPDOpen && errorTargetsInAPD) {
656
- showMessageDialog = false;
657
- }
658
- } else if (oControl.getModel("ui").getProperty("/isEditable") === true) {
659
- if (!bIsAPDOpen && errorTargetsInAPD) {
660
- showMessageDialog = true;
661
- filteredMessages = unboundMessages.concat(APDmessages);
662
- } else if (!bIsAPDOpen && unboundMessages.length === 0) {
663
- // error targets in APD => there is atleast one bound message. If there are unbound messages, dialog must be shown.
664
- // for draft entity, we already closed the APD
665
- showMessageDialog = false;
666
- }
667
- }
668
- }
669
-
670
- return {
671
- showMessageBox: showMessageBox,
672
- showMessageDialog: showMessageDialog,
673
- filteredMessages: filteredMessages.length ? filteredMessages : messages,
674
- fnGetMessageSubtitle:
675
- oControl && oControl.isA("sap.ui.mdc.Table") && messageHandling.setMessageSubtitle.bind({}, oControl, aContexts)
676
- };
677
- }
678
-
679
- /*
680
- * Currently, this method is responsible for showing the dialog and executing the action. The promise returned is pending while waiting for user input, as well as while the
681
- * back-end request is running. The promise is rejected when the user cancels the dialog and also when the back-end request fails.
682
- * TODO: Refactoring: Separate dialog handling from backend processing. Dialog handling should return a Promise resolving to parameters to be provided to backend. If dialog is
683
- * cancelled, that promise can be rejected. Method responsible for backend processing need to deal with multiple contexts - i.e. it should either return an array of Promises or
684
- * a Promise resolving to an array. In the latter case, that Promise should be resolved also when some or even all contexts failed in backend - the overall process still was
685
- * successful.
686
- *
687
- */
688
-
689
- // this type is meant to describe the meta information for one ActionParameter (i.e. its object in metaModel)
690
- type ActionParameter = {
691
- $Name: string;
692
- $isCollection: boolean;
693
- // currently runtime information is written into the metamodel:
694
- // - in the press handler of the action button on the parameter dialog, the value of each parameter is added
695
- // - in setActionParameterDefaultValue, this information is used and transferred to the context (in ODataModel) created for the action execution
696
- // this is quite odd, and it would make much more sense to take the value from actionParameterInfos
697
- // - however, setActionParameterDefaultValue (or rather the surrounding _executeAction) is also called from other places
698
- // => for the time being, adding value here to avoid ts errors, subject to refactoring
699
- // in case of Field, the value is string, in case of MultiValueField, it's MultiValueFieldItem[]
700
- value: string | MultiValueFieldItem[];
701
- };
702
-
703
- function showActionParameterDialog(
704
- sActionName: any,
705
- oAppComponent: AppComponent,
706
- sActionLabel: any,
707
- mParameters: any,
708
- aActionParameters: ActionParameter[],
709
- aParameterValues: any,
710
- oActionContext: any,
711
- oParentControl: any,
712
- entitySetName: any,
713
- messageHandler: any,
714
- strictHandlingUtilities?: StrictHandlingUtilities
715
- ) {
716
- const sPath = _getPath(oActionContext, sActionName),
717
- metaModel = oActionContext.getModel().oModel.getMetaModel(),
718
- entitySetContext = metaModel.createBindingContext(sPath),
719
- sActionNamePath = oActionContext.getObject("$IsBound")
720
- ? oActionContext.getPath().split("/@$ui5.overload/0")[0]
721
- : oActionContext.getPath().split("/0")[0],
722
- actionNameContext = metaModel.createBindingContext(sActionNamePath),
723
- bIsCreateAction = mParameters.isCreateAction,
724
- sFragmentName = "sap/fe/core/controls/ActionParameterDialog";
725
- return new Promise(async function (resolve, reject) {
726
- type ActionParameterInfo = {
727
- parameter: ActionParameter;
728
- field: Field | MultiValueField;
729
- isMultiValue: boolean;
730
- value?: string | MultiValueFieldItem[];
731
- validationPromise?: Promise<string | MultiValueFieldItem[]>;
732
- };
733
- let actionParameterInfos: ActionParameterInfo[]; // to be filled after fragment (for action parameter dialog) is loaded. Actually only needed during dialog processing, i.e. could be moved into the controller and directly initialized there, but only after moving all handlers (esp. press handler for action button) to controller.
734
-
735
- const messageManager = Core.getMessageManager();
736
-
737
- // in case of missing mandaotory parameter, message currently differs per parameter, as it superfluously contains the label as parameter. Possiblky this could be removed in future, in that case, interface could be simplified to ActionParameterInfo[], string
738
- const _addMessageForActionParameter = (messageParameters: { actionParameterInfo: ActionParameterInfo; message: string }[]) => {
739
- messageManager.addMessages(
740
- messageParameters.map((messageParameter) => {
741
- const binding = messageParameter.actionParameterInfo.field.getBinding(
742
- messageParameter.actionParameterInfo.isMultiValue ? "items" : "value"
743
- );
744
- return new Message({
745
- message: messageParameter.message,
746
- type: "Error",
747
- processor: binding?.getModel(),
748
- persistent: true,
749
- target: binding?.getResolvedPath()
750
- });
751
- })
752
- );
753
- };
754
-
755
- const _removeMessagesForActionParamter = (parameter: ActionParameter) => {
756
- const allMessages = messageManager.getMessageModel().getData();
757
- const controlId = generate(["APD_", parameter.$Name]);
758
- // also remove messages assigned to inner controls, but avoid removing messages for different paramters (with name being substring of another parameter name)
759
- const relevantMessages = allMessages.filter((msg: Message) =>
760
- msg.getControlIds().some((id: string) => controlId.split("-").includes(id))
761
- );
762
- messageManager.removeMessages(relevantMessages);
763
- };
764
-
765
- const _validateProperties = async function (oResourceBundle: ResourceBundle) {
766
- const requiredParameterInfos = actionParameterInfos.filter((actionParameterInfo) => actionParameterInfo.field.getRequired());
767
- await Promise.allSettled(requiredParameterInfos.map((actionParameterInfo) => actionParameterInfo.validationPromise));
768
- /* Hint: The boolean false is a valid value */
769
- const emptyRequiredFields = requiredParameterInfos.filter((requiredParameterInfo) => {
770
- if(requiredParameterInfo.isMultiValue) {
771
- return requiredParameterInfo.value === undefined || !requiredParameterInfo.value.length
772
- } else {
773
- const fieldValue = (requiredParameterInfo.field as Field).getValue();
774
- return fieldValue === undefined || fieldValue === null || fieldValue === ""
775
- }
776
- });
777
-
778
- // message contains label per field for historical reason (originally, it was shown in additional popup, now it's directly added to the field)
779
- // if this was not the case (and hopefully, in future this might be subject to change), interface of _addMessageForActionParameter could be simplified to just pass emptyRequiredFields and a constant message here
780
- _addMessageForActionParameter(
781
- emptyRequiredFields.map((actionParameterInfo) => ({
782
- actionParameterInfo: actionParameterInfo,
783
- message: CommonUtils.getTranslatedText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_MISSING_MANDATORY_MSG", oResourceBundle, [
784
- (actionParameterInfo.field.getParent()?.getAggregation("label") as Label).getText()
785
- ])
786
- }))
787
- );
788
-
789
- /* Check value state of all parameter */
790
- const firstInvalidActionParameter = actionParameterInfos.find(
791
- // unfortunately, _addMessageForActionParameter sets valueState only asynchroneously, thus checking emptyRequiredFields additionally
792
- (actionParameterInfo) =>
793
- actionParameterInfo.field.getValueState() === "Error" || emptyRequiredFields.includes(actionParameterInfo)
794
- );
795
-
796
- if (firstInvalidActionParameter) {
797
- firstInvalidActionParameter.field.focus();
798
- return false;
799
- } else {
800
- return true;
801
- }
802
- };
803
-
804
- const oController = {
805
- handleChange: async function (oEvent: Event) {
806
- const field = oEvent.getSource();
807
- const actionParameterInfo = actionParameterInfos.find(
808
- (actionParameterInfo) => actionParameterInfo.field === field
809
- ) as ActionParameterInfo;
810
- // field value is being changed, thus existing messages related to that field are not valid anymore
811
- _removeMessagesForActionParamter(actionParameterInfo.parameter);
812
- // adapt info. Promise is resolved to value or rejected with exception containing message
813
- actionParameterInfo.validationPromise = oEvent.getParameter("promise") as Promise<string>;
814
- try {
815
- actionParameterInfo.value = await actionParameterInfo.validationPromise;
816
- } catch (error) {
817
- delete actionParameterInfo.value;
818
- _addMessageForActionParameter([
819
- {
820
- actionParameterInfo: actionParameterInfo,
821
- message: (error as { message: string }).message
822
- }
823
- ]);
824
- }
825
- }
826
- };
827
-
828
- const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
829
- const oParameterModel = new JSONModel({
830
- $displayMode: {}
831
- });
832
-
833
- try {
834
- const createdFragment = await XMLPreprocessor.process(
835
- oFragment,
836
- { name: sFragmentName },
837
- {
838
- bindingContexts: {
839
- action: oActionContext,
840
- actionName: actionNameContext,
841
- entitySet: entitySetContext
842
- },
843
- models: {
844
- action: oActionContext.getModel(),
845
- actionName: actionNameContext.getModel(),
846
- entitySet: entitySetContext.getModel(),
847
- metaModel: entitySetContext.getModel()
848
- }
849
- }
850
- );
851
- // TODO: move the dialog into the fragment and move the handlers to the oController
852
- const aContexts: any[] = mParameters.aContexts || [];
853
- const aFunctionParams: any[] = [];
854
- // eslint-disable-next-line prefer-const
855
- let oOperationBinding: any;
856
- await CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true);
857
- const oDialogContent = (await Fragment.load({
858
- definition: createdFragment,
859
- controller: oController
860
- })) as Control;
861
-
862
- actionParameterInfos = aActionParameters.map((actionParameter) => {
863
- const field = Core.byId(generate(["APD_", actionParameter.$Name])) as Field | MultiValueField;
864
- const isMultiValue = field.isA("sap.ui.mdc.MultiValueField");
865
- return {
866
- parameter: actionParameter,
867
- field: field,
868
- isMultiValue: isMultiValue
869
- };
870
- });
871
-
872
- const oResourceBundle = oParentControl.getController().oResourceBundle;
873
- let actionResult = {
874
- dialogCancelled: true, // to be set to false in case of successful action exection
875
- result: undefined
876
- };
877
- const oDialog = new Dialog(generate(["fe", "APD_", sActionName]), {
878
- title: sActionLabel || CommonUtils.getTranslatedText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE", oResourceBundle),
879
- content: [oDialogContent],
880
- escapeHandler: function () {
881
- // escape handler is meant to possibly suppress or postpone closing the dialog on escape (by calling "reject" on the provided object, or "resolve" only when
882
- // done with all tasks to happen before dialog can be closed). It's not intended to explicetly close the dialog here (that happens automatically when no
883
- // escapeHandler is provided or the resolve-callback is called) or for own wrap up tasks (like removing validition messages - this should happen in the
884
- // afterClose).
885
- // TODO: Move wrap up tasks to afterClose, and remove this method completely. Take care to also adapt end button press handler accordingly.
886
- // Currently only still needed to differentiate closing dialog after successful execution (uses resolve) from user cancellation (using reject)
887
- oDialog.close();
888
- // reject(Constants.CancelActionDialog);
889
- },
890
- beginButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Ok"]), {
891
- text: bIsCreateAction
892
- ? CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle)
893
- : _getActionParameterActionName(oResourceBundle, sActionLabel, sActionName, entitySetName),
894
- type: "Emphasized",
895
- press: async function () {
896
- try {
897
- if (!(await _validateProperties(oResourceBundle))) {
898
- return;
899
- }
900
-
901
- BusyLocker.lock(oDialog);
902
-
903
- try {
904
- // TODO: due to using the search and value helps on the action dialog transient messages could appear
905
- // we need an UX design for those to show them to the user - for now remove them before continuing
906
- messageHandler.removeTransitionMessages();
907
- // move parameter values from Dialog (SimpleForm) to mParameters.actionParameters so that they are available in the operation bindings for all contexts
908
- let vParameterValue;
909
- const oParameterContext = oOperationBinding && oOperationBinding.getParameterContext();
910
- for (const i in aActionParameters) {
911
- if (aActionParameters[i].$isCollection) {
912
- const aMVFContent = oDialog.getModel("mvfview").getProperty(`/${aActionParameters[i].$Name}`),
913
- aKeyValues = [];
914
- for (const j in aMVFContent) {
915
- aKeyValues.push(aMVFContent[j].Key);
916
- }
917
- vParameterValue = aKeyValues;
918
- } else {
919
- vParameterValue = oParameterContext.getProperty(aActionParameters[i].$Name);
920
- }
921
- aActionParameters[i].value = vParameterValue; // writing the current value (ueser input!) into the metamodel => should be refactored to use ActionParameterInfos instead. Used in setActionParameterDefaultValue
922
- vParameterValue = undefined;
923
- }
924
- mParameters.label = sActionLabel;
925
- try {
926
- const aResult = await executeAPMAction(
927
- oAppComponent,
928
- mParameters,
929
- oParentControl,
930
- messageHandler,
931
- aContexts,
932
- oDialog,
933
- false,
934
- strictHandlingUtilities
935
- );
936
- actionResult = {
937
- dialogCancelled: false,
938
- result: aResult
939
- };
940
- oDialog.close();
941
- // resolve(aResult);
942
- } catch (oError: any) {
943
- const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
944
- if (
945
- strictHandlingUtilities &&
946
- strictHandlingUtilities.is412Executed &&
947
- strictHandlingUtilities.strictHandlingTransitionFails.length
948
- ) {
949
- strictHandlingUtilities.delaySuccessMessages =
950
- strictHandlingUtilities.delaySuccessMessages.concat(messages);
951
- }
952
- throw oError;
953
- } finally {
954
- if (
955
- strictHandlingUtilities &&
956
- strictHandlingUtilities.is412Executed &&
957
- strictHandlingUtilities.strictHandlingTransitionFails.length
958
- ) {
959
- try {
960
- const strictHandlingFails = strictHandlingUtilities.strictHandlingTransitionFails;
961
- const aFailedContexts = [] as any;
962
- strictHandlingFails.forEach(function (fail: any) {
963
- aFailedContexts.push(fail.oAction.getContext());
964
- });
965
- mParameters.aContexts = aFailedContexts;
966
- const aResult = await executeAPMAction(
967
- oAppComponent,
968
- mParameters,
969
- oParentControl,
970
- messageHandler,
971
- aContexts,
972
- oDialog,
973
- true,
974
- strictHandlingUtilities
975
- );
976
-
977
- strictHandlingUtilities.strictHandlingTransitionFails = [];
978
- actionResult = {
979
- dialogCancelled: false,
980
- result: aResult
981
- };
982
- // resolve(aResult);
983
- } catch {
984
- if (
985
- strictHandlingUtilities &&
986
- strictHandlingUtilities.is412Executed &&
987
- strictHandlingUtilities.strictHandlingTransitionFails.length
988
- ) {
989
- Core.getMessageManager().addMessages(strictHandlingUtilities.delaySuccessMessages);
990
- }
991
- await messageHandler.showMessageDialog({
992
- isActionParameterDialogOpen: oDialog.isOpen(),
993
- onBeforeShowMessage: function (aMessages: any, showMessageParametersIn: any) {
994
- return actionParameterShowMessageCallback(
995
- mParameters,
996
- aContexts,
997
- oDialog,
998
- aMessages,
999
- showMessageParametersIn
1000
- );
1001
- }
1002
- });
1003
- }
1004
- }
1005
- if (BusyLocker.isLocked(oDialog)) {
1006
- BusyLocker.unlock(oDialog);
1007
- }
1008
- }
1009
- } catch (oError: any) {
1010
- let showMessageDialog = true;
1011
- await messageHandler.showMessages({
1012
- context: mParameters.aContexts[0],
1013
- isActionParameterDialogOpen: oDialog.isOpen(),
1014
- messagePageNavigationCallback: function () {
1015
- oDialog.close();
1016
- },
1017
- onBeforeShowMessage: function (aMessages: any, showMessageParametersIn: any) {
1018
- // Why is this implemented as callback? Apparently, all needed information is available beforehand
1019
- // TODO: refactor accordingly
1020
- const showMessageParameters = actionParameterShowMessageCallback(
1021
- mParameters,
1022
- aContexts,
1023
- oDialog,
1024
- aMessages,
1025
- showMessageParametersIn
1026
- );
1027
- showMessageDialog = showMessageParameters.showMessageDialog;
1028
- return showMessageParameters;
1029
- },
1030
- aSelectedContexts: mParameters.aContexts,
1031
- sActionName: sActionLabel,
1032
- control: mParameters.control
1033
- });
1034
-
1035
- // In case of backend validation error(s?), message shall not be shown in message dialog but next to the field on parameter dialog, which should
1036
- // stay open in this case => in this case, we must not resolve or reject the promise controlling the parameter dialog.
1037
- // In all other cases (e.g. other backend errors or user cancellation), the promise controlling the parameter dialog needs to be rejected to allow
1038
- // callers to react. (Example: If creation in backend after navigation to transient context fails, back navigation needs to be triggered)
1039
- // TODO: Refactor to separate dialog handling from backend request istead of taking decision based on message handling
1040
- if (showMessageDialog) {
1041
- if (oDialog.isOpen()) {
1042
- // do nothing, do not reject promise here
1043
- // We do not close the APM dialog if user enters a wrong value in of the fields that results in an error from the backend.
1044
- // The user can close the message dialog and the APM dialog would still be open on which he could enter a new value and trigger the action again.
1045
- // Earlier we were rejecting the promise on error here, and the call stack was destroyed as the promise was rejected and returned to EditFlow invoke action.
1046
- // But since the APM dialog was still open, a new promise was resolved in case the user retried the action and the object was created, but the navigation to object page was not taking place.
1047
- } else {
1048
- reject(oError);
1049
- }
1050
- }
1051
- }
1052
- } finally {
1053
- if (strictHandlingUtilities) {
1054
- strictHandlingUtilities = {
1055
- is412Executed: false,
1056
- strictHandlingTransitionFails: [],
1057
- strictHandlingPromises: [],
1058
- strictHandlingWarningMessages: [],
1059
- delaySuccessMessages: [],
1060
- processedMessageIds: []
1061
- };
1062
- }
1063
- if (BusyLocker.isLocked(oDialog)) {
1064
- BusyLocker.unlock(oDialog);
1065
- }
1066
- }
1067
- }
1068
- }),
1069
- endButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Cancel"]), {
1070
- text: CommonUtils.getTranslatedText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL", oResourceBundle),
1071
- press: function () {
1072
- // TODO: cancel button should just close the dialog (similar to using escape). All wrap up tasks should be moved to afterClose.
1073
- oDialog.close();
1074
- // reject(Constants.CancelActionDialog);
1075
- }
1076
- }),
1077
- // TODO: beforeOpen is just an event, i.e. not waiting for the Promise to be resolved. Check if tasks of this function need to be done before opening the dialog
1078
- // - if yes, they need to be moved outside.
1079
- // Assumption: Sometimes dialog can be seen without any fields for a short time - maybe this is caused by this asynchronity
1080
- beforeOpen: async function (oEvent: any) {
1081
- // clone event for actionWrapper as oEvent.oSource gets lost during processing of beforeOpen event handler
1082
- const oCloneEvent = Object.assign({}, oEvent);
1083
-
1084
- messageHandler.removeTransitionMessages();
1085
- const getDefaultValuesFunction = function () {
1086
- const oMetaModel = oDialog.getModel().getMetaModel() as ODataMetaModel,
1087
- sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
1088
- sDefaultValuesFunction = oMetaModel.getObject(
1089
- `${sActionPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
1090
- );
1091
- return sDefaultValuesFunction;
1092
- };
1093
- const fnSetDefaultsAndOpenDialog = async function (sBindingParameter?: any) {
1094
- const sBoundFunctionName = getDefaultValuesFunction();
1095
- const prefillParameter = async function (sParamName: any, vParamDefaultValue: any) {
1096
- // Case 1: There is a ParameterDefaultValue annotation
1097
- if (vParamDefaultValue !== undefined) {
1098
- if (aContexts.length > 0 && vParamDefaultValue.$Path) {
1099
- try {
1100
- let vParamValue = await CommonUtils.requestSingletonProperty(
1101
- vParamDefaultValue.$Path,
1102
- oOperationBinding.getModel()
1103
- );
1104
- if (vParamValue === null) {
1105
- vParamValue = await oOperationBinding
1106
- .getParameterContext()
1107
- .requestProperty(vParamDefaultValue.$Path);
1108
- }
1109
- if (aContexts.length > 1) {
1110
- // For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
1111
- let sPathForContext = vParamDefaultValue.$Path;
1112
- if (sPathForContext.indexOf(`${sBindingParameter}/`) === 0) {
1113
- sPathForContext = sPathForContext.replace(`${sBindingParameter}/`, "");
1114
- }
1115
- for (let i = 1; i < aContexts.length; i++) {
1116
- if (aContexts[i].getProperty(sPathForContext) !== vParamValue) {
1117
- // if the values from the contexts are not all the same, do not prefill
1118
- return {
1119
- paramName: sParamName,
1120
- value: undefined,
1121
- bNoPossibleValue: true
1122
- };
1123
- }
1124
- }
1125
- }
1126
- return { paramName: sParamName, value: vParamValue };
1127
- } catch (oError) {
1128
- Log.error("Error while reading default action parameter", sParamName, mParameters.actionName);
1129
- return {
1130
- paramName: sParamName,
1131
- value: undefined,
1132
- bLatePropertyError: true
1133
- };
1134
- }
1135
- } else {
1136
- // Case 1.2: ParameterDefaultValue defines a fixed string value (i.e. vParamDefaultValue = 'someString')
1137
- return { paramName: sParamName, value: vParamDefaultValue };
1138
- }
1139
- } else if (oParameterModel && (oParameterModel as any).oData[sParamName]) {
1140
- // Case 2: There is no ParameterDefaultValue annotation (=> look into the FLP User Defaults)
1141
-
1142
- return {
1143
- paramName: sParamName,
1144
- value: (oParameterModel as any).oData[sParamName]
1145
- };
1146
- } else {
1147
- return { paramName: sParamName, value: undefined };
1148
- }
1149
- };
1150
-
1151
- const getParameterDefaultValue = function (sParamName: any) {
1152
- const oMetaModel = oDialog.getModel().getMetaModel() as ODataMetaModel,
1153
- sActionParameterAnnotationPath = CommonUtils.getParameterPath(oActionContext.getPath(), sParamName) + "@",
1154
- oParameterAnnotations = oMetaModel.getObject(sActionParameterAnnotationPath),
1155
- oParameterDefaultValue =
1156
- oParameterAnnotations && oParameterAnnotations["@com.sap.vocabularies.UI.v1.ParameterDefaultValue"]; // either { $Path: 'somePath' } or 'someString'
1157
- return oParameterDefaultValue;
1158
- };
1159
-
1160
- const aCurrentParamDefaultValue = [];
1161
- let sParamName, vParameterDefaultValue;
1162
- for (const i in aActionParameters) {
1163
- sParamName = aActionParameters[i].$Name;
1164
- vParameterDefaultValue = getParameterDefaultValue(sParamName);
1165
- aCurrentParamDefaultValue.push(prefillParameter(sParamName, vParameterDefaultValue));
1166
- }
1167
-
1168
- if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
1169
- if (sBoundFunctionName && sBoundFunctionName.length > 0 && typeof sBoundFunctionName === "string") {
1170
- for (const i in aContexts) {
1171
- aFunctionParams.push(callBoundFunction(sBoundFunctionName, aContexts[i], mParameters.model));
1172
- }
1173
- }
1174
- }
1175
-
1176
- const aPrefillParamPromises = Promise.all(aCurrentParamDefaultValue);
1177
- let aExecFunctionPromises: Promise<any[]> = Promise.resolve([]);
1178
- let oExecFunctionFromManifestPromise;
1179
- if (aFunctionParams && aFunctionParams.length > 0) {
1180
- aExecFunctionPromises = Promise.all(aFunctionParams);
1181
- }
1182
- if (mParameters.defaultValuesExtensionFunction) {
1183
- const sModule = mParameters.defaultValuesExtensionFunction
1184
- .substring(0, mParameters.defaultValuesExtensionFunction.lastIndexOf(".") || -1)
1185
- .replace(/\./gi, "/"),
1186
- sFunctionName = mParameters.defaultValuesExtensionFunction.substring(
1187
- mParameters.defaultValuesExtensionFunction.lastIndexOf(".") + 1,
1188
- mParameters.defaultValuesExtensionFunction.length
1189
- );
1190
- oExecFunctionFromManifestPromise = FPMHelper.actionWrapper(oCloneEvent, sModule, sFunctionName, {
1191
- contexts: aContexts
1192
- });
1193
- }
1194
-
1195
- try {
1196
- const aPromises = await Promise.all([
1197
- aPrefillParamPromises,
1198
- aExecFunctionPromises,
1199
- oExecFunctionFromManifestPromise
1200
- ]);
1201
- const currentParamDefaultValue: any = aPromises[0];
1202
- const functionParams = aPromises[1];
1203
- const oFunctionParamsFromManifest = aPromises[2];
1204
- let sDialogParamName: string;
1205
-
1206
- // Fill the dialog with the earlier determined parameter values from the different sources
1207
- for (const i in aActionParameters) {
1208
- sDialogParamName = aActionParameters[i].$Name;
1209
- // Parameter values provided in the call of invokeAction overrule other sources
1210
- const vParameterProvidedValue = aParameterValues?.find(
1211
- (element: any) => element.name === aActionParameters[i].$Name
1212
- )?.value;
1213
- if (vParameterProvidedValue) {
1214
- oOperationBinding.setParameter(aActionParameters[i].$Name, vParameterProvidedValue);
1215
- } else if (oFunctionParamsFromManifest && oFunctionParamsFromManifest.hasOwnProperty(sDialogParamName)) {
1216
- oOperationBinding.setParameter(
1217
- aActionParameters[i].$Name,
1218
- oFunctionParamsFromManifest[sDialogParamName]
1219
- );
1220
- } else if (currentParamDefaultValue[i] && currentParamDefaultValue[i].value !== undefined) {
1221
- oOperationBinding.setParameter(aActionParameters[i].$Name, currentParamDefaultValue[i].value);
1222
- // if the default value had not been previously determined due to different contexts, we do nothing else
1223
- } else if (sBoundFunctionName && !currentParamDefaultValue[i].bNoPossibleValue) {
1224
- if (aContexts.length > 1) {
1225
- // we check if the function retrieves the same param value for all the contexts:
1226
- let j = 0;
1227
- while (j < aContexts.length - 1) {
1228
- if (
1229
- functionParams[j] &&
1230
- functionParams[j + 1] &&
1231
- functionParams[j].getObject(sDialogParamName) ===
1232
- functionParams[j + 1].getObject(sDialogParamName)
1233
- ) {
1234
- j++;
1235
- } else {
1236
- break;
1237
- }
1238
- }
1239
- //param values are all the same:
1240
- if (j === aContexts.length - 1) {
1241
- oOperationBinding.setParameter(
1242
- aActionParameters[i].$Name,
1243
- functionParams[j].getObject(sDialogParamName)
1244
- );
1245
- }
1246
- } else if (functionParams[0] && functionParams[0].getObject(sDialogParamName)) {
1247
- //Only one context, then the default param values are to be verified from the function:
1248
-
1249
- oOperationBinding.setParameter(
1250
- aActionParameters[i].$Name,
1251
- functionParams[0].getObject(sDialogParamName)
1252
- );
1253
- }
1254
- }
1255
- }
1256
- const bErrorFound = currentParamDefaultValue.some(function (oValue: any) {
1257
- if (oValue.bLatePropertyError) {
1258
- return oValue.bLatePropertyError;
1259
- }
1260
- });
1261
- // If at least one Default Property is a Late Property and an eTag error was raised.
1262
- if (bErrorFound) {
1263
- const sText = CommonUtils.getTranslatedText("C_APP_COMPONENT_SAPFE_ETAG_LATE_PROPERTY", oResourceBundle);
1264
- MessageBox.warning(sText, { contentWidth: "25em" } as any);
1265
- }
1266
- } catch (oError: any) {
1267
- Log.error("Error while retrieving the parameter", oError);
1268
- }
1269
- };
1270
- const fnAsyncBeforeOpen = async function () {
1271
- if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
1272
- const aParameters = oActionContext.getObject("$Parameter");
1273
- const sBindingParameter = aParameters[0] && aParameters[0].$Name;
1274
-
1275
- try {
1276
- const oContextObject = await aContexts[0].requestObject();
1277
- if (oContextObject) {
1278
- oOperationBinding.setParameter(sBindingParameter, oContextObject);
1279
- }
1280
- await fnSetDefaultsAndOpenDialog(sBindingParameter);
1281
- } catch (oError: any) {
1282
- Log.error("Error while retrieving the parameter", oError);
1283
- }
1284
- } else {
1285
- await fnSetDefaultsAndOpenDialog();
1286
- }
1287
- };
1288
-
1289
- await fnAsyncBeforeOpen();
1290
-
1291
- // adding defaulted values only here after they are not set to the fields
1292
- for (const actionParameterInfo of actionParameterInfos) {
1293
- const value = actionParameterInfo.isMultiValue
1294
- ? (actionParameterInfo.field as MultiValueField).getItems()
1295
- : (actionParameterInfo.field as Field).getValue();
1296
- actionParameterInfo.value = value;
1297
- actionParameterInfo.validationPromise = Promise.resolve(value);
1298
- }
1299
- },
1300
- afterClose: function () {
1301
- // when the dialog is cancelled, messages need to be removed in case the same action should be executed again
1302
- aActionParameters.forEach(_removeMessagesForActionParamter);
1303
- oDialog.destroy();
1304
- if (actionResult.dialogCancelled) {
1305
- reject(Constants.CancelActionDialog);
1306
- } else {
1307
- resolve(actionResult.result);
1308
- }
1309
- }
1310
- });
1311
- mParameters.oDialog = oDialog;
1312
- oDialog.setModel(oActionContext.getModel().oModel);
1313
- oDialog.setModel(oParameterModel, "paramsModel");
1314
- oDialog.bindElement({
1315
- path: "/",
1316
- model: "paramsModel"
1317
- });
1318
-
1319
-
1320
- // empty model to add elements dynamically depending on number of MVF fields defined on the dialog
1321
- const oMVFModel = new JSONModel({});
1322
- oDialog.setModel(oMVFModel, "mvfview");
1323
-
1324
- /* Event needed for removing messages of valid changed field */
1325
- for (const actionParameterInfo of actionParameterInfos) {
1326
- if (actionParameterInfo.isMultiValue) {
1327
- actionParameterInfo?.field?.getBinding("items")?.attachChange(() => {
1328
- _removeMessagesForActionParamter(actionParameterInfo.parameter);
1329
- });
1330
- } else {
1331
- actionParameterInfo?.field?.getBinding("value")?.attachChange(() => {
1332
- _removeMessagesForActionParamter(actionParameterInfo.parameter);
1333
- });
1334
- }
1335
- }
1336
-
1337
- let sActionPath = `${sActionName}(...)`;
1338
- if (!aContexts.length) {
1339
- sActionPath = `/${sActionPath}`;
1340
- }
1341
- oDialog.bindElement({
1342
- path: sActionPath
1343
- });
1344
- if (oParentControl) {
1345
- // if there is a parent control specified add the dialog as dependent
1346
- oParentControl.addDependent(oDialog);
1347
- }
1348
- if (aContexts.length > 0) {
1349
- oDialog.setBindingContext(aContexts[0]); // use context of first selected line item
1350
- }
1351
- oOperationBinding = oDialog.getObjectBinding();
1352
- oDialog.open();
1353
- } catch (oError: any) {
1354
- reject(oError);
1355
- }
1356
- });
1357
- }
1358
- function getActionParameters(oAction: any) {
1359
- const aParameters = oAction.getObject("$Parameter") || [];
1360
- if (aParameters && aParameters.length) {
1361
- if (oAction.getObject("$IsBound")) {
1362
- //in case of bound actions, ignore the first parameter and consider the rest
1363
- return aParameters.slice(1, aParameters.length) || [];
1364
- }
1365
- }
1366
- return aParameters;
1367
- }
1368
- function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBoundAction?: any) {
1369
- const vActionCritical = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.IsActionCritical`);
1370
- let sCriticalPath = vActionCritical && vActionCritical.$Path;
1371
- if (!sCriticalPath) {
1372
- // the static value scenario for isActionCritical
1373
- return !!vActionCritical;
1374
- }
1375
- const aBindingParams = oBoundAction && oBoundAction.getObject("$Parameter"),
1376
- aPaths = sCriticalPath && sCriticalPath.split("/"),
1377
- bCondition =
1378
- aBindingParams && aBindingParams.length && typeof aBindingParams === "object" && sCriticalPath && contexts && contexts.length;
1379
- if (bCondition) {
1380
- //in case binding patameters are there in path need to remove eg: - _it/isVerified => need to remove _it and the path should be isVerified
1381
- aBindingParams.filter(function (oParams: any) {
1382
- const index = aPaths && aPaths.indexOf(oParams.$Name);
1383
- if (index > -1) {
1384
- aPaths.splice(index, 1);
1385
- }
1386
- });
1387
- sCriticalPath = aPaths.join("/");
1388
- return contexts[0].getObject(sCriticalPath);
1389
- } else if (sCriticalPath) {
1390
- //if scenario is path based return the path value
1391
- return contexts[0].getObject(sCriticalPath);
1392
- }
1393
- }
1394
-
1395
- function _getActionParameterActionName(oResourceBundle: ResourceBundle, sActionLabel: string, sActionName: string, sEntitySetName: string) {
1396
- let boundActionName: any = sActionName ? sActionName : null;
1397
- const aActionName = boundActionName.split(".");
1398
- boundActionName = boundActionName.indexOf(".") >= 0 ? aActionName[aActionName.length - 1] : boundActionName;
1399
- const suffixResourceKey = boundActionName && sEntitySetName ? `${sEntitySetName}|${boundActionName}` : "";
1400
- const sKey = "ACTION_PARAMETER_DIALOG_ACTION_NAME";
1401
- const bResourceKeyExists =
1402
- oResourceBundle && CommonUtils.checkIfResourceKeyExists((oResourceBundle as any).aCustomBundles, `${sKey}|${suffixResourceKey}`);
1403
- if (sActionLabel) {
1404
- if (bResourceKeyExists) {
1405
- return CommonUtils.getTranslatedText(sKey, oResourceBundle, undefined, suffixResourceKey);
1406
- } else if (
1407
- oResourceBundle &&
1408
- CommonUtils.checkIfResourceKeyExists((oResourceBundle as any).aCustomBundles, `${sKey}|${sEntitySetName}`)
1409
- ) {
1410
- return CommonUtils.getTranslatedText(sKey, oResourceBundle, undefined, `${sEntitySetName}`);
1411
- } else if (oResourceBundle && CommonUtils.checkIfResourceKeyExists((oResourceBundle as any).aCustomBundles, `${sKey}`)) {
1412
- return CommonUtils.getTranslatedText(sKey, oResourceBundle);
1413
- } else {
1414
- return sActionLabel;
1415
- }
1416
- } else {
1417
- return CommonUtils.getTranslatedText("C_COMMON_DIALOG_OK", oResourceBundle);
1418
- }
1419
- }
1420
-
1421
- function handle412FailedTransitions(
1422
- mParameters: any,
1423
- oAction: any,
1424
- sGroupId: string,
1425
- current_context_index: number | null,
1426
- iContextLength: number | null,
1427
- messageHandler: MessageHandler | undefined,
1428
- oResourceBundle: ResourceBundle,
1429
- strictHandlingUtilities: StrictHandlingUtilities
1430
- ) {
1431
- let strictHandlingFails: any;
1432
- const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
1433
- const transitionMessages = messages.filter(function (message: any) {
1434
- const isDuplicate = strictHandlingUtilities.processedMessageIds.find(function (id: string) {
1435
- return message.id === id;
1436
- });
1437
- if (!isDuplicate) {
1438
- strictHandlingUtilities.processedMessageIds.push(message.id);
1439
- if (message.type === MessageType.Success) {
1440
- strictHandlingUtilities.delaySuccessMessages.push(message);
1441
- }
1442
- }
1443
- return message.persistent === true && message.type !== MessageType.Success && !isDuplicate;
1444
- });
1445
- if (transitionMessages.length) {
1446
- if (mParameters.internalModelContext) {
1447
- strictHandlingFails = strictHandlingUtilities.strictHandlingTransitionFails;
1448
- strictHandlingFails.push({
1449
- oAction: oAction,
1450
- groupId: sGroupId
1451
- });
1452
- strictHandlingUtilities.strictHandlingTransitionFails = strictHandlingFails;
1453
- }
1454
- }
1455
-
1456
- if (
1457
- current_context_index === iContextLength &&
1458
- strictHandlingUtilities &&
1459
- strictHandlingUtilities.strictHandlingWarningMessages.length
1460
- ) {
1461
- operationsHelper.renderMessageView(
1462
- mParameters,
1463
- oResourceBundle,
1464
- messageHandler,
1465
- strictHandlingUtilities.strictHandlingWarningMessages,
1466
- strictHandlingUtilities,
1467
- true
1468
- );
1469
- }
1470
- }
1471
-
1472
- function executeDependingOnSelectedContexts(
1473
- oAction: any,
1474
- mParameters: any,
1475
- bGetBoundContext: boolean,
1476
- sGroupId: string,
1477
- oResourceBundle: ResourceBundle,
1478
- messageHandler: MessageHandler | undefined,
1479
- iContextLength: number | null,
1480
- current_context_index: number | null,
1481
- strictHandlingUtilities?: StrictHandlingUtilities
1482
- ) {
1483
- let oActionPromise,
1484
- bEnableStrictHandling = true;
1485
- if (bGetBoundContext) {
1486
- const sPath = oAction.getBoundContext().getPath();
1487
- const sMetaPath = oAction.getModel().getMetaModel().getMetaPath(sPath);
1488
- const oProperty = oAction.getModel().getMetaModel().getObject(sMetaPath);
1489
- if (oProperty && oProperty[0]?.$kind !== "Action") {
1490
- //do not enable the strict handling if its not an action
1491
- bEnableStrictHandling = false;
1492
- }
1493
- }
1494
-
1495
- if (!bEnableStrictHandling) {
1496
- oActionPromise = bGetBoundContext
1497
- ? oAction.execute(sGroupId).then(function () {
1498
- return oAction.getBoundContext();
1499
- })
1500
- : oAction.execute(sGroupId);
1501
- } else {
1502
- oActionPromise = bGetBoundContext
1503
- ? oAction
1504
- .execute(
1505
- sGroupId,
1506
- undefined,
1507
- (operationsHelper as any).fnOnStrictHandlingFailed.bind(
1508
- operations,
1509
- sGroupId,
1510
- mParameters,
1511
- oResourceBundle,
1512
- current_context_index,
1513
- oAction.getContext(),
1514
- iContextLength,
1515
- messageHandler,
1516
- strictHandlingUtilities
1517
- )
1518
- )
1519
- .then(function () {
1520
- if (strictHandlingUtilities) {
1521
- handle412FailedTransitions(
1522
- mParameters,
1523
- oAction,
1524
- sGroupId,
1525
- current_context_index,
1526
- iContextLength,
1527
- messageHandler,
1528
- oResourceBundle,
1529
- strictHandlingUtilities
1530
- );
1531
- }
1532
- return Promise.resolve(oAction.getBoundContext());
1533
- })
1534
- .catch(function () {
1535
- if (strictHandlingUtilities) {
1536
- handle412FailedTransitions(
1537
- mParameters,
1538
- oAction,
1539
- sGroupId,
1540
- current_context_index,
1541
- iContextLength,
1542
- messageHandler,
1543
- oResourceBundle,
1544
- strictHandlingUtilities
1545
- );
1546
- }
1547
- return Promise.reject();
1548
- })
1549
- : oAction
1550
- .execute(
1551
- sGroupId,
1552
- undefined,
1553
- (operationsHelper as any).fnOnStrictHandlingFailed.bind(
1554
- operations,
1555
- sGroupId,
1556
- mParameters,
1557
- oResourceBundle,
1558
- current_context_index,
1559
- oAction.getContext(),
1560
- iContextLength,
1561
- messageHandler,
1562
- strictHandlingUtilities
1563
- )
1564
- )
1565
- .then(function (result: any) {
1566
- if (strictHandlingUtilities) {
1567
- handle412FailedTransitions(
1568
- mParameters,
1569
- oAction,
1570
- sGroupId,
1571
- current_context_index,
1572
- iContextLength,
1573
- messageHandler,
1574
- oResourceBundle,
1575
- strictHandlingUtilities
1576
- );
1577
- }
1578
- return Promise.resolve(result);
1579
- })
1580
- .catch(function () {
1581
- if (strictHandlingUtilities) {
1582
- handle412FailedTransitions(
1583
- mParameters,
1584
- oAction,
1585
- sGroupId,
1586
- current_context_index,
1587
- iContextLength,
1588
- messageHandler,
1589
- oResourceBundle,
1590
- strictHandlingUtilities
1591
- );
1592
- }
1593
- return Promise.reject();
1594
- });
1595
- }
1596
-
1597
- return oActionPromise.catch(() => {
1598
- throw Constants.ActionExecutionFailed;
1599
- });
1600
- }
1601
- function _executeAction(
1602
- oAppComponent: any,
1603
- mParameters: any,
1604
- oParentControl?: any,
1605
- messageHandler?: MessageHandler,
1606
- strictHandlingUtilities?: StrictHandlingUtilities
1607
- ) {
1608
- const aContexts = mParameters.aContexts || [];
1609
- const oModel = mParameters.model;
1610
- const aActionParameters = mParameters.aActionParameters || [];
1611
- const sActionName = mParameters.actionName;
1612
- const fnOnSubmitted = mParameters.fnOnSubmitted;
1613
- const fnOnResponse = mParameters.fnOnResponse;
1614
- const oResourceBundle = oParentControl && oParentControl.isA("sap.ui.core.mvc.View") && oParentControl.getController().oResourceBundle;
1615
- let oAction: any;
1616
-
1617
- function setActionParameterDefaultValue() {
1618
- if (aActionParameters && aActionParameters.length) {
1619
- for (let j = 0; j < aActionParameters.length; j++) {
1620
- if (!aActionParameters[j].value) {
1621
- switch (aActionParameters[j].$Type) {
1622
- case "Edm.String":
1623
- aActionParameters[j].value = "";
1624
- break;
1625
- case "Edm.Boolean":
1626
- aActionParameters[j].value = false;
1627
- break;
1628
- case "Edm.Byte":
1629
- case "Edm.Int16":
1630
- case "Edm.Int32":
1631
- case "Edm.Int64":
1632
- aActionParameters[j].value = 0;
1633
- break;
1634
- // tbc
1635
- default:
1636
- break;
1637
- }
1638
- }
1639
- oAction.setParameter(aActionParameters[j].$Name, aActionParameters[j].value);
1640
- }
1641
- }
1642
- }
1643
- if (aContexts.length) {
1644
- // TODO: refactor to direct use of Promise.allSettled
1645
- return new Promise(function (resolve: (value: any) => void) {
1646
- const mBindingParameters = mParameters.mBindingParameters;
1647
- const bGrouped = mParameters.bGrouped;
1648
- const bGetBoundContext = mParameters.bGetBoundContext;
1649
- const aActionPromises: any[] = [];
1650
- let oActionPromise;
1651
- let i;
1652
- let sGroupId: string;
1653
- const fnExecuteAction = function (actionContext: any, current_context_index: any, oSideEffect: any, iContextLength: any) {
1654
- setActionParameterDefaultValue();
1655
- // For invocation grouping "isolated" need batch group per action call
1656
- sGroupId = !bGrouped ? `$auto.${current_context_index}` : actionContext.getUpdateGroupId();
1657
- mParameters.requestSideEffects = fnRequestSideEffects.bind(operations, oAppComponent, oSideEffect, mParameters);
1658
- oActionPromise = executeDependingOnSelectedContexts(
1659
- actionContext,
1660
- mParameters,
1661
- bGetBoundContext,
1662
- sGroupId,
1663
- oResourceBundle,
1664
- messageHandler,
1665
- iContextLength,
1666
- current_context_index,
1667
- strictHandlingUtilities
1668
- );
1669
- aActionPromises.push(oActionPromise);
1670
- fnRequestSideEffects(oAppComponent, oSideEffect, mParameters, sGroupId);
1671
- };
1672
- const fnExecuteSingleAction = function (actionContext: any, current_context_index: any, oSideEffect: any, iContextLength: any) {
1673
- const aLocalPromise: any = [];
1674
- setActionParameterDefaultValue();
1675
- // For invocation grouping "isolated" need batch group per action call
1676
- sGroupId = `apiMode${current_context_index}`;
1677
- mParameters.requestSideEffects = fnRequestSideEffects.bind(
1678
- operations,
1679
- oAppComponent,
1680
- oSideEffect,
1681
- mParameters,
1682
- sGroupId,
1683
- aLocalPromise
1684
- );
1685
- oActionPromise = executeDependingOnSelectedContexts(
1686
- actionContext,
1687
- mParameters,
1688
- bGetBoundContext,
1689
- sGroupId,
1690
- oResourceBundle,
1691
- messageHandler,
1692
- iContextLength,
1693
- current_context_index,
1694
- strictHandlingUtilities
1695
- );
1696
- aActionPromises.push(oActionPromise);
1697
- aLocalPromise.push(oActionPromise);
1698
- fnRequestSideEffects(oAppComponent, oSideEffect, mParameters, sGroupId, aLocalPromise);
1699
- oModel.submitBatch(sGroupId);
1700
- return Promise.allSettled(aLocalPromise);
1701
- };
1702
-
1703
- async function fnExecuteSequentially(contextsToExecute: Context[]) {
1704
- // One action and its side effects are completed before the next action is executed
1705
- (
1706
- fnOnSubmitted ||
1707
- function noop() {
1708
- /**/
1709
- }
1710
- )(aActionPromises);
1711
- function processOneAction(context: any, actionIndex: any, iContextLength: any) {
1712
- oAction = oModel.bindContext(`${sActionName}(...)`, context, mBindingParameters);
1713
- return fnExecuteSingleAction(
1714
- oAction,
1715
- actionIndex,
1716
- {
1717
- context: context,
1718
- pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
1719
- triggerActions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.triggerActions
1720
- },
1721
- iContextLength
1722
- );
1723
- }
1724
-
1725
- // serialization: processOneAction to be called for each entry in contextsToExecute only after the promise returned from the one before has been resolved
1726
- await contextsToExecute.reduce(async (promise: Promise<void>, context: Context, id: number): Promise<void> => {
1727
- await promise;
1728
- await processOneAction(context, id + 1, aContexts.length);
1729
- }, Promise.resolve());
1730
-
1731
- fnHandleResults();
1732
- }
1733
-
1734
- if (!bGrouped) {
1735
- // For invocation grouping "isolated", ensure that each action and matching side effects
1736
- // are processed before the next set is submitted. Workaround until JSON batch is available.
1737
- // Allow also for List Report.
1738
- fnExecuteSequentially(aContexts);
1739
- } else {
1740
- for (i = 0; i < aContexts.length; i++) {
1741
- oAction = oModel.bindContext(`${sActionName}(...)`, aContexts[i], mBindingParameters);
1742
- fnExecuteAction(
1743
- oAction,
1744
- aContexts.length <= 1 ? null : i,
1745
- {
1746
- context: aContexts[i],
1747
- pathExpressions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.pathExpressions,
1748
- triggerActions: mParameters.additionalSideEffect && mParameters.additionalSideEffect.triggerActions
1749
- },
1750
- aContexts.length
1751
- );
1752
- }
1753
- (
1754
- fnOnSubmitted ||
1755
- function noop() {
1756
- /**/
1757
- }
1758
- )(aActionPromises);
1759
- fnHandleResults();
1760
- }
1761
-
1762
- function fnHandleResults() {
1763
- // Promise.allSettled will never be rejected. However, eslint requires either catch or return - thus we return the resulting Promise although no one will use it.
1764
- return Promise.allSettled(aActionPromises).then(resolve);
1765
- }
1766
- }).finally(function () {
1767
- (
1768
- fnOnResponse ||
1769
- function noop() {
1770
- /**/
1771
- }
1772
- )();
1773
- });
1774
- } else {
1775
- oAction = oModel.bindContext(`/${sActionName}(...)`);
1776
- setActionParameterDefaultValue();
1777
- const sGroupId = "actionImport";
1778
- const oActionPromise = oAction.execute(
1779
- sGroupId,
1780
- undefined,
1781
- (operationsHelper as any).fnOnStrictHandlingFailed.bind(
1782
- operations,
1783
- sGroupId,
1784
- { label: mParameters.label, model: oModel },
1785
- oResourceBundle,
1786
- null,
1787
- null,
1788
- null,
1789
- messageHandler,
1790
- strictHandlingUtilities
1791
- )
1792
- );
1793
- oModel.submitBatch(sGroupId);
1794
- // trigger onSubmitted "event"
1795
- (
1796
- fnOnSubmitted ||
1797
- function noop() {
1798
- /**/
1799
- }
1800
- )(oActionPromise);
1801
- return oActionPromise
1802
- .then(function (currentPromiseValue: unknown) {
1803
- // Here we ensure that we return the response we got from an unbound action to the
1804
- // caller BCP : 2270139279
1805
- if (currentPromiseValue) {
1806
- return currentPromiseValue;
1807
- } else {
1808
- return oAction.getBoundContext?.()?.getObject();
1809
- }
1810
- })
1811
- .catch(function (oError: any) {
1812
- Log.error("Error while executing action " + sActionName, oError);
1813
- throw oError;
1814
- })
1815
- .finally(function () {
1816
- (
1817
- fnOnResponse ||
1818
- function noop() {
1819
- /**/
1820
- }
1821
- )();
1822
- });
1823
- }
1824
- }
1825
- function _getPath(oActionContext: any, sActionName: any) {
1826
- let sPath = oActionContext.getPath();
1827
- sPath = oActionContext.getObject("$IsBound") ? sPath.split("@$ui5.overload")[0] : sPath.split("/0")[0];
1828
- return sPath.split(`/${sActionName}`)[0];
1829
- }
1830
-
1831
- function _valuesProvidedForAllParameters(
1832
- isCreateAction: boolean,
1833
- actionParameters: Record<string, any>[],
1834
- parameterValues?: Record<string, any>[],
1835
- startupParameters?: any
1836
- ): boolean {
1837
- if (parameterValues) {
1838
- // If showDialog is false but there are parameters from the invokeAction call, we need to check that values have been
1839
- // provided for all of them
1840
- for (const actionParameter of actionParameters) {
1841
- if (
1842
- actionParameter.$Name !== "ResultIsActiveEntity" &&
1843
- !parameterValues?.find((element: any) => element.name === actionParameter.$Name)
1844
- ) {
1845
- // At least for one parameter no value has been provided, so we can't skip the dialog
1846
- return false;
1847
- }
1848
- }
1849
- } else if (isCreateAction && startupParameters) {
1850
- // If parameters have been provided during application launch, we need to check if the set is complete
1851
- // If not, the parameter dialog still needs to be shown.
1852
- for (const actionParameter of actionParameters) {
1853
- if (!startupParameters[actionParameter.$Name]) {
1854
- // At least for one parameter no value has been provided, so we can't skip the dialog
1855
- return false;
1856
- }
1857
- }
1858
- }
1859
- return true;
1860
- }
1861
-
1862
- function fnRequestSideEffects(oAppComponent: any, oSideEffect: any, mParameters: any, sGroupId: any, aLocalPromise?: any) {
1863
- const oSideEffectsService = oAppComponent.getSideEffectsService();
1864
- let oLocalPromise;
1865
- // trigger actions from side effects
1866
- if (oSideEffect && oSideEffect.triggerActions && oSideEffect.triggerActions.length) {
1867
- oSideEffect.triggerActions.forEach(function (sTriggerAction: any) {
1868
- if (sTriggerAction) {
1869
- oLocalPromise = oSideEffectsService.executeAction(sTriggerAction, oSideEffect.context, sGroupId);
1870
- if (aLocalPromise) {
1871
- aLocalPromise.push(oLocalPromise);
1872
- }
1873
- }
1874
- });
1875
- }
1876
- // request side effects for this action
1877
- // as we move the messages request to POST $select we need to be prepared for an empty array
1878
- if (oSideEffect && oSideEffect.pathExpressions && oSideEffect.pathExpressions.length > 0) {
1879
- oLocalPromise = oSideEffectsService.requestSideEffects(oSideEffect.pathExpressions, oSideEffect.context, sGroupId);
1880
- if (aLocalPromise) {
1881
- aLocalPromise.push(oLocalPromise);
1882
- }
1883
- oLocalPromise
1884
- .then(function () {
1885
- if (mParameters.operationAvailableMap && mParameters.internalModelContext) {
1886
- ActionRuntime.setActionEnablement(
1887
- mParameters.internalModelContext,
1888
- JSON.parse(mParameters.operationAvailableMap),
1889
- mParameters.selectedItems,
1890
- "table"
1891
- );
1892
- }
1893
- })
1894
- .catch(function (oError: any) {
1895
- Log.error("Error while requesting side effects", oError);
1896
- });
1897
- }
1898
- }
1899
-
1900
- /**
1901
- * Static functions to call OData actions (bound/import) and functions (bound/import)
1902
- *
1903
- * @namespace
1904
- * @alias sap.fe.core.actions.operations
1905
- * @private
1906
- * @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
1907
- * @since 1.56.0
1908
- */
1909
- const operations = {
1910
- callBoundAction: callBoundAction,
1911
- callActionImport: callActionImport,
1912
- callBoundFunction: callBoundFunction,
1913
- callFunctionImport: callFunctionImport,
1914
- executeDependingOnSelectedContexts: executeDependingOnSelectedContexts,
1915
- valuesProvidedForAllParameters: _valuesProvidedForAllParameters,
1916
- getActionParameterActionName: _getActionParameterActionName,
1917
- actionParameterShowMessageCallback: actionParameterShowMessageCallback,
1918
- afterActionResolution: afterActionResolution
1919
- };
1920
-
1921
- export default operations;
1
+ import facade from "./operations/facade";
2
+ export default facade;