@sapui5/sap.fe.core 1.131.0 → 1.133.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 (317) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/ActionRuntime.js +17 -23
  4. package/src/sap/fe/core/AppComponent.js +74 -36
  5. package/src/sap/fe/core/AppComponent.ts +70 -3
  6. package/src/sap/fe/core/AppStateHandler.js +44 -13
  7. package/src/sap/fe/core/AppStateHandler.ts +38 -0
  8. package/src/sap/fe/core/BaseController.js +3 -3
  9. package/src/sap/fe/core/CommonUtils.js +30 -37
  10. package/src/sap/fe/core/CommonUtils.ts +15 -13
  11. package/src/sap/fe/core/ExtensionAPI.js +29 -34
  12. package/src/sap/fe/core/ExtensionAPI.ts +3 -0
  13. package/src/sap/fe/core/InsightsFormattersExtension.js +2 -2
  14. package/src/sap/fe/core/PageController.js +40 -31
  15. package/src/sap/fe/core/PageController.ts +14 -1
  16. package/src/sap/fe/core/ResourceModel.js +4 -4
  17. package/src/sap/fe/core/ReuseComponent.js +27 -13
  18. package/src/sap/fe/core/ReuseComponent.ts +18 -0
  19. package/src/sap/fe/core/TemplateComponent.js +102 -89
  20. package/src/sap/fe/core/TemplateComponent.ts +20 -1
  21. package/src/sap/fe/core/TemplateModel.js +6 -7
  22. package/src/sap/fe/core/UIProvider.js +1 -1
  23. package/src/sap/fe/core/UIProvider.ts +2 -9
  24. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +63 -48
  25. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +56 -27
  26. package/src/sap/fe/core/buildingBlocks/IBuildingBlockOwnerComponent.js +9 -0
  27. package/src/sap/fe/core/buildingBlocks/IBuildingBlockOwnerComponent.ts +48 -0
  28. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +4 -6
  29. package/src/sap/fe/core/buildingBlocks/templating/AttributeModel.js +2 -2
  30. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockSupport.js +2 -3
  31. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.js +32 -18
  32. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.ts +30 -3
  33. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.js +9 -13
  34. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.ts +2 -1
  35. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlock.js +2 -2
  36. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.js +19 -25
  37. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.ts +1 -1
  38. package/src/sap/fe/core/controllerextensions/BaseControllerExtension.js +3 -4
  39. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.js +20 -24
  40. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.ts +10 -15
  41. package/src/sap/fe/core/controllerextensions/ContextSharing.js +3 -3
  42. package/src/sap/fe/core/controllerextensions/EditFlow.js +296 -246
  43. package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -175
  44. package/src/sap/fe/core/controllerextensions/Feedback.js +10 -11
  45. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +6 -6
  46. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +1 -0
  47. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -36
  48. package/src/sap/fe/core/controllerextensions/InternalRouting.js +57 -78
  49. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +42 -50
  50. package/src/sap/fe/core/controllerextensions/KPIManagement.js +12 -19
  51. package/src/sap/fe/core/controllerextensions/MessageHandler.js +23 -17
  52. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -7
  53. package/src/sap/fe/core/controllerextensions/PageReady.js +15 -21
  54. package/src/sap/fe/core/controllerextensions/Paginator.js +3 -3
  55. package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -3
  56. package/src/sap/fe/core/controllerextensions/Recommendations.js +23 -36
  57. package/src/sap/fe/core/controllerextensions/Recommendations.ts +1 -1
  58. package/src/sap/fe/core/controllerextensions/Routing.js +3 -3
  59. package/src/sap/fe/core/controllerextensions/Share.js +19 -28
  60. package/src/sap/fe/core/controllerextensions/SideEffects.js +68 -32
  61. package/src/sap/fe/core/controllerextensions/SideEffects.ts +58 -6
  62. package/src/sap/fe/core/controllerextensions/Telemetry.js +4 -5
  63. package/src/sap/fe/core/controllerextensions/ViewState.js +23 -24
  64. package/src/sap/fe/core/controllerextensions/ViewState.ts +6 -1
  65. package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.js +13 -10
  66. package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.ts +13 -8
  67. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
  68. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +15 -16
  69. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +3 -4
  70. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.js +288 -0
  71. package/src/sap/fe/core/controllerextensions/dialog/{OperationsDialog.block.tsx → OperationsDialog.tsx} +27 -29
  72. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js +41 -5
  73. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.tsx +61 -8
  74. package/src/sap/fe/core/controllerextensions/editFlow/ODataOperation.js +404 -0
  75. package/src/sap/fe/core/controllerextensions/editFlow/ODataOperation.ts +502 -0
  76. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +35 -43
  77. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +34 -14
  78. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +37 -27
  79. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +27 -15
  80. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +51 -39
  81. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +75 -34
  82. package/src/sap/fe/core/controllerextensions/editFlow/editFlowConstants.js +4 -4
  83. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +88 -427
  84. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +82 -620
  85. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +9 -5
  86. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +6 -5
  87. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +116 -79
  88. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +87 -13
  89. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js +4 -6
  90. package/src/sap/fe/core/controllerextensions/recommendations/Telemetry.js +5 -7
  91. package/src/sap/fe/core/controllerextensions/routing/ContextPathHelper.js +6 -7
  92. package/src/sap/fe/core/controllerextensions/routing/NavigationReason.js +4 -4
  93. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +58 -20
  94. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -4
  95. package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.js +1 -1
  96. package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.ts +1 -1
  97. package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributorMixin.js +9 -12
  98. package/src/sap/fe/core/controls/CommandExecution.js +2 -2
  99. package/src/sap/fe/core/controls/ComponentLoader.js +20 -21
  100. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.js +250 -0
  101. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/{DraftDataLossDialog.block.tsx → DraftDataLossDialog.tsx} +31 -19
  102. package/src/sap/fe/core/controls/FormElementWrapper.js +19 -21
  103. package/src/sap/fe/core/controls/HideFormGroupAutomatically.js +114 -0
  104. package/src/sap/fe/core/controls/HideFormGroupAutomatically.ts +115 -0
  105. package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.js +454 -0
  106. package/src/sap/fe/core/controls/Recommendations/{ConfirmRecommendationDialog.block.tsx → ConfirmRecommendationDialog.tsx} +5 -9
  107. package/src/sap/fe/core/converters/ConverterContext.js +17 -18
  108. package/src/sap/fe/core/converters/ConverterContext.ts +10 -15
  109. package/src/sap/fe/core/converters/ManifestSettings.js +29 -28
  110. package/src/sap/fe/core/converters/ManifestSettings.ts +22 -1
  111. package/src/sap/fe/core/converters/ManifestWrapper.js +26 -48
  112. package/src/sap/fe/core/converters/MetaModelConverter.js +21 -28
  113. package/src/sap/fe/core/converters/MetaModelConverter.ts +2 -0
  114. package/src/sap/fe/core/converters/TemplateConverter.js +17 -21
  115. package/src/sap/fe/core/converters/TemplateConverter.ts +5 -3
  116. package/src/sap/fe/core/converters/annotations/DataField.js +69 -66
  117. package/src/sap/fe/core/converters/annotations/DataField.ts +30 -0
  118. package/src/sap/fe/core/converters/common/AnnotationConverter.js +20 -23
  119. package/src/sap/fe/core/converters/controls/Common/Action.js +178 -43
  120. package/src/sap/fe/core/converters/controls/Common/Action.ts +202 -19
  121. package/src/sap/fe/core/converters/controls/Common/Chart.js +47 -22
  122. package/src/sap/fe/core/converters/controls/Common/Chart.ts +50 -5
  123. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +16 -23
  124. package/src/sap/fe/core/converters/controls/Common/Form.js +25 -38
  125. package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -0
  126. package/src/sap/fe/core/converters/controls/Common/KPI.js +32 -47
  127. package/src/sap/fe/core/converters/controls/Common/Table.js +464 -506
  128. package/src/sap/fe/core/converters/controls/Common/Table.ts +335 -219
  129. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +17 -28
  130. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +1 -2
  131. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +66 -90
  132. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +10 -1
  133. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +49 -73
  134. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +6 -10
  135. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +35 -50
  136. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +110 -60
  137. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +137 -41
  138. package/src/sap/fe/core/converters/helpers/Aggregation.js +19 -30
  139. package/src/sap/fe/core/converters/helpers/Aggregation.ts +5 -5
  140. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +11 -14
  141. package/src/sap/fe/core/converters/helpers/DataFieldHelper.js +14 -21
  142. package/src/sap/fe/core/converters/helpers/InsightsHelpers.js +4 -6
  143. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -7
  144. package/src/sap/fe/core/converters/helpers/Key.js +1 -1
  145. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +2 -3
  146. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +18 -52
  147. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -34
  148. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +103 -74
  149. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +111 -39
  150. package/src/sap/fe/core/converters/templates/ListReportConverter.js +28 -31
  151. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +17 -9
  152. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +61 -52
  153. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +60 -21
  154. package/src/sap/fe/core/definition/FEDefinition.js +104 -44
  155. package/src/sap/fe/core/designtime/AppComponent.designtime.js +37 -7
  156. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +42 -2
  157. package/src/sap/fe/core/formatters/CollaborationFormatter.js +4 -5
  158. package/src/sap/fe/core/formatters/FiscalFormat.js +24 -24
  159. package/src/sap/fe/core/formatters/ValueFormatter.js +4 -23
  160. package/src/sap/fe/core/formatters/ValueFormatter.ts +0 -18
  161. package/src/sap/fe/core/fpm/Component.js +12 -14
  162. package/src/sap/fe/core/fpm/manifest.json +1 -1
  163. package/src/sap/fe/core/helpers/AppStartupHelper.js +20 -15
  164. package/src/sap/fe/core/helpers/AppStartupHelper.ts +22 -13
  165. package/src/sap/fe/core/helpers/BindingHelper.js +3 -3
  166. package/src/sap/fe/core/helpers/BindingHelper.ts +1 -1
  167. package/src/sap/fe/core/helpers/DeleteHelper.js +55 -62
  168. package/src/sap/fe/core/helpers/DeleteHelper.ts +48 -51
  169. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +4 -7
  170. package/src/sap/fe/core/helpers/FPMHelper.js +4 -7
  171. package/src/sap/fe/core/helpers/HTTP503Handler.js +2 -1
  172. package/src/sap/fe/core/helpers/HTTP503Handler.ts +4 -3
  173. package/src/sap/fe/core/helpers/KeepAliveHelper.js +5 -5
  174. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +6 -6
  175. package/src/sap/fe/core/helpers/LoaderUtils.js +8 -3
  176. package/src/sap/fe/core/helpers/LoaderUtils.ts +15 -4
  177. package/src/sap/fe/core/helpers/MessageStrip.js +3 -4
  178. package/src/sap/fe/core/helpers/MetaModelFunction.js +26 -40
  179. package/src/sap/fe/core/helpers/MetaPath.js +9 -7
  180. package/src/sap/fe/core/helpers/MetaPath.ts +9 -3
  181. package/src/sap/fe/core/helpers/ModelHelper.js +33 -57
  182. package/src/sap/fe/core/helpers/ModelHelper.ts +3 -3
  183. package/src/sap/fe/core/helpers/PasteHelper.js +11 -19
  184. package/src/sap/fe/core/helpers/PromiseKeeper.js +1 -1
  185. package/src/sap/fe/core/helpers/RecommendationHelper.js +3 -4
  186. package/src/sap/fe/core/helpers/ResourceModelHelper.js +3 -5
  187. package/src/sap/fe/core/helpers/SizeHelper.js +3 -5
  188. package/src/sap/fe/core/helpers/StableIdHelper.js +13 -11
  189. package/src/sap/fe/core/helpers/StableIdHelper.ts +5 -1
  190. package/src/sap/fe/core/helpers/StandardRecommendationHelper.js +28 -38
  191. package/src/sap/fe/core/helpers/Synchronization.js +1 -1
  192. package/src/sap/fe/core/helpers/TitleHelper.js +19 -40
  193. package/src/sap/fe/core/helpers/TitleHelper.ts +5 -25
  194. package/src/sap/fe/core/helpers/TypeGuards.js +25 -18
  195. package/src/sap/fe/core/helpers/TypeGuards.ts +7 -0
  196. package/src/sap/fe/core/helpers/WebSocket.js +4 -4
  197. package/src/sap/fe/core/library.js +8 -7
  198. package/src/sap/fe/core/library.ts +2 -0
  199. package/src/sap/fe/core/manifestMerger/AddNewPage.js +9 -11
  200. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +14 -25
  201. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +15 -17
  202. package/src/sap/fe/core/messagebundle.properties +21 -0
  203. package/src/sap/fe/core/messagebundle_ar.properties +5 -1
  204. package/src/sap/fe/core/messagebundle_bg.properties +4 -0
  205. package/src/sap/fe/core/messagebundle_ca.properties +4 -0
  206. package/src/sap/fe/core/messagebundle_cnr.properties +4 -0
  207. package/src/sap/fe/core/messagebundle_cs.properties +8 -4
  208. package/src/sap/fe/core/messagebundle_cy.properties +4 -0
  209. package/src/sap/fe/core/messagebundle_da.properties +4 -0
  210. package/src/sap/fe/core/messagebundle_de.properties +4 -0
  211. package/src/sap/fe/core/messagebundle_el.properties +4 -0
  212. package/src/sap/fe/core/messagebundle_en.properties +4 -0
  213. package/src/sap/fe/core/messagebundle_en_GB.properties +4 -0
  214. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +4 -0
  215. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +249 -231
  216. package/src/sap/fe/core/messagebundle_es.properties +5 -1
  217. package/src/sap/fe/core/messagebundle_es_MX.properties +4 -0
  218. package/src/sap/fe/core/messagebundle_et.properties +4 -0
  219. package/src/sap/fe/core/messagebundle_fi.properties +4 -0
  220. package/src/sap/fe/core/messagebundle_fr.properties +6 -2
  221. package/src/sap/fe/core/messagebundle_fr_CA.properties +4 -0
  222. package/src/sap/fe/core/messagebundle_hi.properties +4 -0
  223. package/src/sap/fe/core/messagebundle_hr.properties +4 -0
  224. package/src/sap/fe/core/messagebundle_hu.properties +4 -0
  225. package/src/sap/fe/core/messagebundle_id.properties +4 -0
  226. package/src/sap/fe/core/messagebundle_it.properties +4 -0
  227. package/src/sap/fe/core/messagebundle_iw.properties +4 -0
  228. package/src/sap/fe/core/messagebundle_ja.properties +4 -0
  229. package/src/sap/fe/core/messagebundle_kk.properties +4 -0
  230. package/src/sap/fe/core/messagebundle_ko.properties +4 -0
  231. package/src/sap/fe/core/messagebundle_lt.properties +4 -0
  232. package/src/sap/fe/core/messagebundle_lv.properties +4 -0
  233. package/src/sap/fe/core/messagebundle_mk.properties +4 -0
  234. package/src/sap/fe/core/messagebundle_ms.properties +4 -0
  235. package/src/sap/fe/core/messagebundle_nl.properties +4 -0
  236. package/src/sap/fe/core/messagebundle_no.properties +4 -0
  237. package/src/sap/fe/core/messagebundle_pl.properties +4 -0
  238. package/src/sap/fe/core/messagebundle_pt.properties +4 -0
  239. package/src/sap/fe/core/messagebundle_pt_PT.properties +4 -0
  240. package/src/sap/fe/core/messagebundle_ro.properties +4 -0
  241. package/src/sap/fe/core/messagebundle_ru.properties +4 -0
  242. package/src/sap/fe/core/messagebundle_sh.properties +4 -0
  243. package/src/sap/fe/core/messagebundle_sk.properties +4 -0
  244. package/src/sap/fe/core/messagebundle_sl.properties +4 -0
  245. package/src/sap/fe/core/messagebundle_sr.properties +4 -0
  246. package/src/sap/fe/core/messagebundle_sv.properties +4 -0
  247. package/src/sap/fe/core/messagebundle_th.properties +4 -0
  248. package/src/sap/fe/core/messagebundle_tr.properties +5 -1
  249. package/src/sap/fe/core/messagebundle_uk.properties +4 -0
  250. package/src/sap/fe/core/messagebundle_vi.properties +4 -0
  251. package/src/sap/fe/core/messagebundle_zh_CN.properties +4 -0
  252. package/src/sap/fe/core/messagebundle_zh_TW.properties +4 -0
  253. package/src/sap/fe/core/operationsHelper.js +23 -27
  254. package/src/sap/fe/core/operationsHelper.ts +6 -7
  255. package/src/sap/fe/core/rootView/Fcl.controller.js +53 -40
  256. package/src/sap/fe/core/rootView/Fcl.controller.ts +42 -7
  257. package/src/sap/fe/core/rootView/NavContainer.controller.js +7 -10
  258. package/src/sap/fe/core/rootView/RootViewBaseController.js +22 -21
  259. package/src/sap/fe/core/rootView/RootViewBaseController.ts +10 -2
  260. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +3 -3
  261. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +4 -3
  262. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -0
  263. package/src/sap/fe/core/services/CollaborationManagerServiceFactory.js +12 -10
  264. package/src/sap/fe/core/services/CollaborationManagerServiceFactory.ts +6 -2
  265. package/src/sap/fe/core/services/CollaborativeToolsServiceFactory.js +8 -13
  266. package/src/sap/fe/core/services/ContextSharingServiceFactory.js +5 -7
  267. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +31 -8
  268. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +31 -5
  269. package/src/sap/fe/core/services/InlineEditServiceFactory.js +190 -0
  270. package/src/sap/fe/core/services/InlineEditServiceFactory.ts +226 -0
  271. package/src/sap/fe/core/services/NavigationServiceFactory.js +10 -15
  272. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +3 -3
  273. package/src/sap/fe/core/services/RoutingServiceFactory.js +76 -56
  274. package/src/sap/fe/core/services/RoutingServiceFactory.ts +47 -14
  275. package/src/sap/fe/core/services/ShellServicesFactory.js +32 -34
  276. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +75 -60
  277. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +58 -12
  278. package/src/sap/fe/core/services/TelemetryServiceFactory.js +8 -9
  279. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +13 -18
  280. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +3 -0
  281. package/src/sap/fe/core/services/ValueHelpHistoryServiceFactory.js +7 -9
  282. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.js +12 -16
  283. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.ts +1 -1
  284. package/src/sap/fe/core/services/valueHelpService/HistoryOptOutProvider.js +4 -7
  285. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +5 -6
  286. package/src/sap/fe/core/support/CommonHelper.js +2 -3
  287. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  288. package/src/sap/fe/core/templating/ActionHelper.js +3 -4
  289. package/src/sap/fe/core/templating/CommonFormatters.js +6 -8
  290. package/src/sap/fe/core/templating/CommonFormatters.ts +2 -2
  291. package/src/sap/fe/core/templating/CriticalityFormatters.js +53 -5
  292. package/src/sap/fe/core/templating/CriticalityFormatters.ts +129 -7
  293. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -11
  294. package/src/sap/fe/core/templating/DataFieldFormatters.ts +1 -1
  295. package/src/sap/fe/core/templating/DataModelPathHelper.js +33 -56
  296. package/src/sap/fe/core/templating/DisplayModeFormatter.js +4 -5
  297. package/src/sap/fe/core/templating/EntitySetHelper.js +11 -19
  298. package/src/sap/fe/core/templating/EntityTypeHelper.js +4 -5
  299. package/src/sap/fe/core/templating/FieldControlHelper.js +13 -20
  300. package/src/sap/fe/core/templating/FilterTemplating.js +6 -9
  301. package/src/sap/fe/core/templating/PropertyHelper.js +33 -63
  302. package/src/sap/fe/core/templating/PropertyHelper.ts +0 -1
  303. package/src/sap/fe/core/templating/SemanticObjectHelper.js +13 -21
  304. package/src/sap/fe/core/templating/UIFormatters.js +57 -78
  305. package/src/sap/fe/core/templating/UIFormatters.ts +2 -1
  306. package/src/sap/fe/core/type/Date.js +2 -2
  307. package/src/sap/fe/core/type/DateTimeWithTimezone.js +3 -3
  308. package/src/sap/fe/core/type/EDM.js +3 -5
  309. package/src/sap/fe/core/type/Email.js +17 -6
  310. package/src/sap/fe/core/type/Email.ts +23 -4
  311. package/src/sap/fe/core/type/FiscalDate.js +8 -9
  312. package/src/sap/fe/core/type/InputMask.js +3 -4
  313. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +0 -299
  314. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +0 -87
  315. package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +0 -43
  316. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.js +0 -251
  317. package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.block.js +0 -471
@@ -0,0 +1,502 @@
1
+ import type { ActionImport, ActionParameter, Action as EdmAction } from "@sap-ux/vocabularies-types";
2
+ import Log from "sap/base/Log";
3
+ import type { ShowActionDialogParameters } from "sap/fe/core/controllerextensions/editFlow/operations/facade";
4
+ import FELibrary from "sap/fe/core/library";
5
+ import Messaging from "sap/ui/core/Messaging";
6
+ import type Message from "sap/ui/core/message/Message";
7
+ import MessageType from "sap/ui/core/message/MessageType";
8
+ import type View from "sap/ui/core/mvc/View";
9
+ import type { default as ODataV4Context } from "sap/ui/model/odata/v4/Context";
10
+ import type ODataContextBinding from "sap/ui/model/odata/v4/ODataContextBinding";
11
+ import SubmitMode from "sap/ui/model/odata/v4/SubmitMode";
12
+ import ActionRuntime from "../../ActionRuntime";
13
+ import operationsHelper, { type StrictHandlingUtilities } from "../../operationsHelper";
14
+ import type { ActionSideEffectsType } from "../../services/SideEffectsServiceFactory";
15
+ import type MessageHandler from "../MessageHandler";
16
+ import messageHandling from "../messageHandler/messageHandling";
17
+
18
+ const Constants = FELibrary.Constants;
19
+
20
+ export type OperationResult = {
21
+ returnedContext?: ODataV4Context;
22
+ boundContext: ODataV4Context;
23
+ };
24
+
25
+ export default class ODataOperation {
26
+ private readonly enableStrictHandling: boolean = true;
27
+
28
+ private readonly firstIterationOperations: Promise<unknown>[] = [];
29
+
30
+ private operationParameters: ActionParameter[] = [];
31
+
32
+ private neverSubmitted = true;
33
+
34
+ private readonly apiGroupIdsToSubmit: Set<string> = new Set();
35
+
36
+ constructor(
37
+ private readonly operation: EdmAction | ActionImport,
38
+ private readonly parameters: ShowActionDialogParameters,
39
+ private readonly messageHandler: MessageHandler,
40
+ private readonly strictHandlingUtilities: StrictHandlingUtilities | undefined,
41
+ private readonly operationProperties: {
42
+ deferredSubmit?: boolean;
43
+ ignoreETag?: boolean;
44
+ replaceWithRVC?: boolean;
45
+ } = {}
46
+ ) {
47
+ this.enableStrictHandling = this.parameters.disableStrictHandling !== true && !(this.operation as EdmAction).isFunction;
48
+ this.defineOperationParameters();
49
+ }
50
+
51
+ /**
52
+ * Defines the parameters of the operation.
53
+ */
54
+ private defineOperationParameters(): void {
55
+ if (this.operation._type === "ActionImport") {
56
+ this.operationParameters = this.operation.action.parameters;
57
+ } else {
58
+ //Remove the binding parameters from the parameters list
59
+ this.operationParameters = this.operation.isBound ? this.operation.parameters.slice(1) : this.operation.parameters;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Executes the operation.
65
+ * @returns The promise of the operation
66
+ */
67
+ async execute(): Promise<PromiseSettledResult<OperationResult>[]> {
68
+ let result: PromiseSettledResult<OperationResult>[];
69
+ try {
70
+ if (this.parameters.aContexts.length) {
71
+ result = await (this.parameters.bGrouped === true ? this.executeChangeset() : this.executeSequentially());
72
+ } else {
73
+ result = await Promise.allSettled([this.executeImport()]);
74
+ }
75
+ } catch (error) {
76
+ Log.error("Error while executing operation " + this.parameters.actionName, error as string);
77
+ throw error;
78
+ } finally {
79
+ this.parameters.fnOnResponse?.();
80
+ }
81
+ return result;
82
+ }
83
+
84
+ /**
85
+ * Executes the import operation.
86
+ * @returns The promise of the operation
87
+ */
88
+ private async executeImport(): Promise<OperationResult> {
89
+ let sideEffectsContextBinding: ODataContextBinding | undefined;
90
+ const operationContext = this.parameters.model.bindContext(`/${this.parameters.actionName}(...)`);
91
+ this.setParametersValue(operationContext);
92
+ const groupId = this.parameters.groupId ?? "actionImport";
93
+ const promises = [this.invoke(operationContext, groupId, null)];
94
+
95
+ if (this.parameters.additionalSideEffect) {
96
+ // We always need a context to trigger side-effects, so we create a context binding with a dummy path and destroy it afterwards
97
+ sideEffectsContextBinding = this.parameters.model.bindContext("/unBoundAction");
98
+ const sideEffect = {
99
+ context: sideEffectsContextBinding.getBoundContext(),
100
+ pathExpressions: this.parameters.additionalSideEffect.pathExpressions,
101
+ triggerActions: this.parameters.additionalSideEffect.triggerActions
102
+ };
103
+ this.requestSideEffects(sideEffect, groupId, promises);
104
+ }
105
+ this.defaultSubmit(groupId);
106
+
107
+ const currentPromiseValues = await Promise.all(promises);
108
+ sideEffectsContextBinding?.destroy();
109
+ return currentPromiseValues[0];
110
+ }
111
+
112
+ /**
113
+ * Executes the operations on one changeset.
114
+ * @returns The promise of the operations
115
+ */
116
+ private async executeChangeset(): Promise<PromiseSettledResult<OperationResult>[]> {
117
+ const operationPromises = this.parameters.aContexts.map(async (context) =>
118
+ this.executeBoundOperation(context, this.parameters.groupId)
119
+ );
120
+ await Promise.allSettled(this.firstIterationOperations);
121
+ await this.manageStrictHandlingFails();
122
+ return Promise.allSettled(operationPromises);
123
+ }
124
+
125
+ /**
126
+ * Executes the operations sequentially.
127
+ * @returns The promise of the operations
128
+ */
129
+ private async executeSequentially(): Promise<PromiseSettledResult<OperationResult>[]> {
130
+ const operationPromises: Promise<OperationResult>[] = [];
131
+
132
+ // serialization: executeBoundOperation to be called for each entry only after the promise returned from the one before has been resolved
133
+ await this.parameters.aContexts.reduce(async (promise: Promise<void>, context: ODataV4Context, id: number): Promise<void> => {
134
+ await promise;
135
+ operationPromises.push(this.executeBoundOperation(context, this.parameters.groupId ?? `apiMode${id + 1}`));
136
+ await Promise.allSettled(this.firstIterationOperations);
137
+ }, Promise.resolve());
138
+ await this.manageStrictHandlingFails(true);
139
+ return Promise.allSettled(operationPromises);
140
+ }
141
+
142
+ /**
143
+ * Executes the bound operation.
144
+ * @param targetContext The target context
145
+ * @param groupId The groupId of the batch
146
+ * @returns The promise of the operation
147
+ */
148
+ private async executeBoundOperation(targetContext: ODataV4Context, groupId?: string): Promise<OperationResult> {
149
+ const operationContext = this.parameters.model.bindContext(
150
+ `${this.parameters.actionName}(...)`,
151
+ targetContext,
152
+ this.parameters.mBindingParameters
153
+ );
154
+
155
+ const promises: Promise<unknown>[] = [];
156
+ this.setParametersValue(operationContext);
157
+ const finalGroupId = groupId ?? operationContext.getUpdateGroupId();
158
+ const sideEffects = {
159
+ context: targetContext,
160
+ pathExpressions: this.parameters.additionalSideEffect?.pathExpressions,
161
+ triggerActions: this.parameters.additionalSideEffect?.triggerActions
162
+ };
163
+ //Has to be removed when the refactoring is done
164
+ this.parameters.requestSideEffects = this.requestSideEffects.bind(this, sideEffects, finalGroupId, promises);
165
+ const operationPromise = this.invoke(
166
+ operationContext,
167
+ finalGroupId,
168
+ this.parameters.aContexts.findIndex((context) => context === targetContext) + 1
169
+ );
170
+
171
+ promises.push(operationPromise);
172
+
173
+ this.requestSideEffects(sideEffects, finalGroupId, promises);
174
+ this.defaultSubmit(finalGroupId);
175
+ Promise.allSettled(promises);
176
+ return operationPromise;
177
+ }
178
+
179
+ /**
180
+ * Enhances the side effects of the operation
181
+ *
182
+ * When a new entity is created using a DataFieldForAction, a new
183
+ * oDataContextBinding is created to execute the action. By default, this
184
+ * oDataContextBinding is relative to the OdataListBinding of the table.
185
+ *
186
+ * Because of this dependency, when a SideEffects is executed on the
187
+ * context into the OdataListBinding where the oDataContextBinding was bound, this SideEffects is also triggered on this
188
+ * oDataContextBinding. We don't manage the lifecycle of the
189
+ * oDataContextBinding. It means even if the draft related to the action
190
+ * is removed, the odataContextBinding is still there, so if a SideEffects
191
+ * is executed on the source target into oDataContextBinding, an error from the back end will be
192
+ * received because we ask to refresh a property on an unknown entity.
193
+ *
194
+ * The SideEffects are requested only if the page is still open.
195
+ * This avoids generating issues with ghost oDataContextBinding linked to destroyed context.
196
+ * @param operationContextBinding The operation
197
+ * @param returnedContext The returned context of this operation
198
+ */
199
+ private enhanceSideEffects(operationContextBinding: ODataContextBinding, returnedContext: ODataV4Context | undefined): void {
200
+ if (returnedContext) {
201
+ const appComponent = this.parameters.appComponent;
202
+ const origin = operationContextBinding.requestSideEffects.bind(operationContextBinding);
203
+ operationContextBinding.requestSideEffects = async (...args: unknown[]): Promise<void> => {
204
+ if (
205
+ appComponent
206
+ .getRootViewController()
207
+ .getInstancedViews()
208
+ .find((pageView: View) => pageView.getBindingContext() === returnedContext)
209
+ ) {
210
+ return origin(...args);
211
+ }
212
+ return Promise.resolve();
213
+ };
214
+ }
215
+ }
216
+
217
+ /**
218
+ * Invokes the operation on the context.
219
+ * @param operationContextBinding The operation context binding
220
+ * @param groupId The groupId of the batch
221
+ * @param contextIndex The index of the context
222
+ * @returns The promise of the operation
223
+ */
224
+ private async invoke(
225
+ operationContextBinding: ODataContextBinding,
226
+ groupId: string,
227
+ contextIndex: number | null
228
+ ): Promise<OperationResult> {
229
+ let returnedContext;
230
+ let firstIterationResolve!: Function;
231
+ let firstIterationReject!: Function;
232
+ const strictHandlingPromise = new Promise<unknown>(function (resolve, reject) {
233
+ firstIterationResolve = resolve;
234
+ firstIterationReject = reject;
235
+ });
236
+ this.firstIterationOperations.push(strictHandlingPromise);
237
+ if (groupId && this.isAPIMode(groupId)) {
238
+ this.apiGroupIdsToSubmit.add(groupId);
239
+ }
240
+ try {
241
+ const contextLength = this.parameters.aContexts.length ? this.parameters.aContexts.length : null;
242
+ const operationInvoke = operationContextBinding.invoke(
243
+ groupId,
244
+ this.operationProperties.ignoreETag,
245
+ this.enableStrictHandling
246
+ ? operationsHelper.fnOnStrictHandlingFailed.bind(
247
+ this,
248
+ groupId,
249
+ this.parameters,
250
+ contextIndex,
251
+ operationContextBinding.getContext(),
252
+ contextLength,
253
+ this.messageHandler,
254
+ this.strictHandlingUtilities,
255
+ firstIterationResolve
256
+ )
257
+ : undefined,
258
+ this.operationProperties.replaceWithRVC
259
+ );
260
+ await Promise.race([operationInvoke, strictHandlingPromise]);
261
+
262
+ returnedContext = await operationInvoke;
263
+ this.enhanceSideEffects(operationContextBinding, returnedContext);
264
+ firstIterationResolve();
265
+ if (!this.parameters.bGrouped) {
266
+ //Has to be removed when the refactoring is done
267
+ this.update412TransitionMessages(operationContextBinding, groupId, true);
268
+ }
269
+ } catch (error) {
270
+ if (!this.parameters.bGrouped) {
271
+ this.update412TransitionMessages(operationContextBinding, groupId);
272
+ }
273
+ firstIterationReject(error);
274
+ throw Constants.ActionExecutionFailed;
275
+ }
276
+
277
+ return {
278
+ returnedContext,
279
+ boundContext: operationContextBinding.getBoundContext()
280
+ };
281
+ }
282
+
283
+ /**
284
+ * Submits the batch related to the groupId of the operation.
285
+ */
286
+ public submit(): void {
287
+ if (!this.neverSubmitted || this.apiGroupIdsToSubmit.size === 0) {
288
+ return;
289
+ }
290
+ for (const groupId of Array.from(this.apiGroupIdsToSubmit.values())) {
291
+ this.submitOnModel(groupId);
292
+ }
293
+ this.parameters.fnOnSubmitted?.();
294
+ }
295
+
296
+ /**
297
+ * Submits the batch at the model level related to the groupId of the operation.
298
+ * @param groupId The groupId of the batch
299
+ */
300
+ private submitOnModel(groupId: string): void {
301
+ this.parameters.model.submitBatch(groupId);
302
+ this.apiGroupIdsToSubmit.delete(groupId);
303
+ }
304
+
305
+ /**
306
+ * Is the SubmitMode of the groupId set to API.
307
+ * @param groupId The groupId of the batch
308
+ * @returns True if the SubmitMode is set to API, false otherwise
309
+ */
310
+ private isAPIMode(groupId?: string): boolean {
311
+ if (!groupId) {
312
+ return false;
313
+ }
314
+ if (groupId.startsWith("$auto") || groupId.startsWith("$direct") || groupId.startsWith("$single")) {
315
+ return false;
316
+ }
317
+ const submitMode = (
318
+ this.parameters.appComponent.getManifestEntry("sap.ui5")?.models[""]?.settings as
319
+ | { groupProperties?: Record<string, { submit: SubmitMode }> }
320
+ | undefined
321
+ )?.groupProperties?.[groupId]?.submit;
322
+
323
+ if (submitMode === undefined || [SubmitMode.Auto, SubmitMode.Direct].includes(submitMode)) {
324
+ return true;
325
+ }
326
+ return true;
327
+ }
328
+
329
+ /**
330
+ * Executes the submit of the operation if the submitMode is on API and deferredSubmit is not set to true
331
+ * The submitBatch is skipped if the groupId is $auto or $direct since done by the model.
332
+ * @param groupId The groupId of the batch
333
+ */
334
+ private defaultSubmit(groupId?: string): void {
335
+ const firstSubmit = this.neverSubmitted;
336
+ const isAPIMode = this.isAPIMode(groupId);
337
+ if (!isAPIMode) {
338
+ // The submitBatch is skipped if the groupId is $auto or $direct since done by the model
339
+ this.neverSubmitted = false;
340
+ } else if (this.operationProperties.deferredSubmit !== true && groupId) {
341
+ this.neverSubmitted = false;
342
+ this.submitOnModel(groupId);
343
+ }
344
+ if (firstSubmit && !this.neverSubmitted) {
345
+ //Trigger the callback only once
346
+ this.parameters.fnOnSubmitted?.();
347
+ }
348
+ }
349
+
350
+ /**
351
+ * Manages the strict handling fails.
352
+ * @param displayErrorOrWarning True, if the warning/error messages have to be displayed, false otherwise (default)
353
+ * @returns The promise of the strict handling
354
+ */
355
+ private async manageStrictHandlingFails(displayErrorOrWarning = false): Promise<void> {
356
+ if (this.strictHandlingUtilities && this.strictHandlingUtilities.strictHandlingPromises.length) {
357
+ try {
358
+ if (
359
+ (!messageHandling.hasTransitionErrorsOrWarnings() || displayErrorOrWarning) &&
360
+ this.strictHandlingUtilities.strictHandlingWarningMessages.length
361
+ ) {
362
+ await operationsHelper.renderMessageView(
363
+ this.parameters,
364
+ this.messageHandler,
365
+ this.strictHandlingUtilities.strictHandlingWarningMessages,
366
+ this.strictHandlingUtilities,
367
+ this.parameters.aContexts.length > 1
368
+ );
369
+ } else {
370
+ for (const shPromise of this.strictHandlingUtilities.strictHandlingPromises) {
371
+ shPromise.resolve(false);
372
+ }
373
+ const messageModel = Messaging.getMessageModel();
374
+ const messagesInModel = messageModel.getData();
375
+ messageModel.setData(messagesInModel.concat(this.strictHandlingUtilities.strictHandlingWarningMessages));
376
+ }
377
+ } catch {
378
+ Log.error("Re-triggering of strict handling operations failed");
379
+ }
380
+ }
381
+ }
382
+
383
+ /**
384
+ * Updates the strictHandling utilities with the failed and successful transition messages.
385
+ * @param operation The operation context binding
386
+ * @param groupId GroupId of the batch
387
+ * @param onlySuccessMessages To update only successful transition messages
388
+ */
389
+ private update412TransitionMessages(operation: ODataContextBinding, groupId: string, onlySuccessMessages = false): void {
390
+ //Has to be removed from here when the refactoring is done
391
+ if (this.enableStrictHandling && this.strictHandlingUtilities) {
392
+ const messages: Array<Message> = Messaging.getMessageModel().getData();
393
+ const { processedMessageIds, delaySuccessMessages, strictHandlingTransitionFails } = this.strictHandlingUtilities;
394
+ const unProcessedMessages = messages.reduce((acc: Message[], message) => {
395
+ if (!processedMessageIds.has(message.getId())) {
396
+ acc.push(message);
397
+ }
398
+ return acc;
399
+ }, []);
400
+
401
+ const newTransitionErrorMessagesId = unProcessedMessages
402
+ .filter(
403
+ (message) =>
404
+ message.getPersistent() === true &&
405
+ message.getType() !== MessageType.Success &&
406
+ !processedMessageIds.has(message.getId())
407
+ )
408
+ .map((message) => message.getId());
409
+
410
+ if (newTransitionErrorMessagesId.length) {
411
+ this.strictHandlingUtilities.processedMessageIds = new Set([
412
+ ...Array.from(processedMessageIds),
413
+ ...newTransitionErrorMessagesId
414
+ ]);
415
+ delaySuccessMessages.push(
416
+ ...Object.values(unProcessedMessages).filter((message) => message.getType() === MessageType.Success)
417
+ );
418
+ if (!onlySuccessMessages && this.parameters.internalModelContext) {
419
+ strictHandlingTransitionFails.push({
420
+ oAction: operation,
421
+ groupId
422
+ });
423
+ }
424
+ }
425
+ }
426
+ }
427
+
428
+ /**
429
+ * Sets the default values for the parameters of the operation.
430
+ * @param operationContextBinding The operation context binding
431
+ */
432
+ private setParametersValue(operationContextBinding: ODataContextBinding): void {
433
+ if (this.operationParameters.length) {
434
+ const defaultValues = this.parameters.defaultParametersValues ?? {};
435
+ for (const parameter of this.operationParameters) {
436
+ const name = parameter.name;
437
+ if (!defaultValues[name]) {
438
+ switch (parameter.type) {
439
+ case "Edm.String":
440
+ defaultValues[name] = "";
441
+ break;
442
+ case "Edm.Boolean":
443
+ defaultValues[name] = false;
444
+ break;
445
+ case "Edm.Byte":
446
+ case "Edm.Int16":
447
+ case "Edm.Int32":
448
+ case "Edm.Int64":
449
+ defaultValues[name] = 0;
450
+ break;
451
+ default:
452
+ break;
453
+ }
454
+ }
455
+ operationContextBinding.setParameter(name, defaultValues[name]);
456
+ }
457
+ }
458
+ }
459
+
460
+ /**
461
+ * Requests the side effects for the action.
462
+ * @param sideEffect The side effect to be executed
463
+ * @param groupId The groupId of the batch
464
+ * @param localPromise The promise of the invoked action
465
+ * @returns The promise of the side effect
466
+ */
467
+ private async requestSideEffects(
468
+ sideEffect: (ActionSideEffectsType & { context: ODataV4Context }) | undefined,
469
+ groupId: string,
470
+ localPromise?: Promise<unknown>[]
471
+ ): Promise<void> {
472
+ const sideEffectsService = this.parameters.appComponent.getSideEffectsService();
473
+ let promises: Promise<unknown>[] = localPromise ?? [];
474
+ // trigger actions from side effects
475
+ if (sideEffect) {
476
+ promises = promises.concat(
477
+ (sideEffect.triggerActions ?? []).map(async (action) =>
478
+ sideEffectsService.executeAction(action, sideEffect.context, groupId)
479
+ ),
480
+ sideEffect.pathExpressions
481
+ ? sideEffectsService.requestSideEffects(sideEffect.pathExpressions, sideEffect.context, groupId)
482
+ : []
483
+ );
484
+ if (sideEffect.pathExpressions) {
485
+ try {
486
+ await Promise.all(promises);
487
+ if (this.parameters.operationAvailableMap && this.parameters.internalModelContext) {
488
+ ActionRuntime.setActionEnablement(
489
+ this.parameters.internalModelContext,
490
+ JSON.parse(this.parameters.operationAvailableMap),
491
+ this.parameters.selectedItems,
492
+ "table"
493
+ );
494
+ }
495
+ return;
496
+ } catch (error: unknown) {
497
+ Log.error("Error while requesting side effects", error as string);
498
+ }
499
+ }
500
+ }
501
+ }
502
+ }