@sapui5/sap.fe.core 1.127.2 → 1.129.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 (393) 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 +3 -9
  4. package/src/sap/fe/core/ActionRuntime.ts +3 -7
  5. package/src/sap/fe/core/AppComponent.js +9 -19
  6. package/src/sap/fe/core/AppComponent.ts +2 -12
  7. package/src/sap/fe/core/AppStateHandler.js +3 -11
  8. package/src/sap/fe/core/AppStateHandler.ts +0 -7
  9. package/src/sap/fe/core/BaseController.js +4 -8
  10. package/src/sap/fe/core/BaseController.ts +0 -5
  11. package/src/sap/fe/core/CommonUtils.js +1 -9
  12. package/src/sap/fe/core/CommonUtils.ts +4 -8
  13. package/src/sap/fe/core/ExtensionAPI.js +10 -25
  14. package/src/sap/fe/core/ExtensionAPI.ts +4 -19
  15. package/src/sap/fe/core/InsightsFormattersExtension.js +5 -3
  16. package/src/sap/fe/core/PageController.js +7 -10
  17. package/src/sap/fe/core/PageController.ts +0 -3
  18. package/src/sap/fe/core/ResourceModel.js +3 -5
  19. package/src/sap/fe/core/ResourceModel.ts +0 -2
  20. package/src/sap/fe/core/ReuseComponent.js +8 -14
  21. package/src/sap/fe/core/ReuseComponent.ts +0 -6
  22. package/src/sap/fe/core/TemplateComponent.js +37 -9
  23. package/src/sap/fe/core/TemplateComponent.ts +3 -2
  24. package/src/sap/fe/core/TemplateModel.js +5 -5
  25. package/src/sap/fe/core/TemplateModel.ts +0 -1
  26. package/src/sap/fe/core/UIProvider.js +1 -1
  27. package/src/sap/fe/core/UIProvider.ts +44 -1
  28. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +7 -12
  29. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +0 -5
  30. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +61 -65
  31. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +60 -63
  32. package/src/sap/fe/core/buildingBlocks/templating/AttributeModel.js +3 -3
  33. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockFormatter.js +1 -1
  34. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockSupport.js +21 -5
  35. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockSupport.ts +0 -4
  36. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.js +6 -18
  37. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.ts +3 -20
  38. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.js +5 -11
  39. package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.ts +0 -6
  40. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlock.js +3 -3
  41. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.js +11 -10
  42. package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.ts +0 -1
  43. package/src/sap/fe/core/controllerextensions/BaseControllerExtension.js +5 -7
  44. package/src/sap/fe/core/controllerextensions/BaseControllerExtension.ts +0 -1
  45. package/src/sap/fe/core/controllerextensions/BusyLocker.js +1 -1
  46. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.js +3 -10
  47. package/src/sap/fe/core/controllerextensions/CollaborativeDraft.ts +0 -7
  48. package/src/sap/fe/core/controllerextensions/ContextSharing.js +5 -8
  49. package/src/sap/fe/core/controllerextensions/ContextSharing.ts +0 -2
  50. package/src/sap/fe/core/controllerextensions/EditFlow.js +225 -155
  51. package/src/sap/fe/core/controllerextensions/EditFlow.ts +248 -164
  52. package/src/sap/fe/core/controllerextensions/Feedback.js +1 -3
  53. package/src/sap/fe/core/controllerextensions/Feedback.ts +0 -2
  54. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +4 -7
  55. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +0 -3
  56. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -25
  57. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +2 -21
  58. package/src/sap/fe/core/controllerextensions/InternalRouting.js +22 -34
  59. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +25 -31
  60. package/src/sap/fe/core/controllerextensions/KPIManagement.js +8 -21
  61. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +4 -15
  62. package/src/sap/fe/core/controllerextensions/MessageHandler.js +68 -31
  63. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +78 -32
  64. package/src/sap/fe/core/controllerextensions/PageReady.js +4 -4
  65. package/src/sap/fe/core/controllerextensions/Paginator.js +4 -8
  66. package/src/sap/fe/core/controllerextensions/Paginator.ts +0 -4
  67. package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -4
  68. package/src/sap/fe/core/controllerextensions/Recommendations.js +15 -24
  69. package/src/sap/fe/core/controllerextensions/Recommendations.ts +13 -20
  70. package/src/sap/fe/core/controllerextensions/Routing.js +4 -10
  71. package/src/sap/fe/core/controllerextensions/Routing.ts +0 -6
  72. package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
  73. package/src/sap/fe/core/controllerextensions/Share.js +17 -11
  74. package/src/sap/fe/core/controllerextensions/Share.ts +10 -5
  75. package/src/sap/fe/core/controllerextensions/SideEffects.js +49 -45
  76. package/src/sap/fe/core/controllerextensions/SideEffects.ts +54 -41
  77. package/src/sap/fe/core/controllerextensions/Telemetry.js +4 -4
  78. package/src/sap/fe/core/controllerextensions/ViewState.js +10 -34
  79. package/src/sap/fe/core/controllerextensions/ViewState.ts +3 -49
  80. package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.js +6 -8
  81. package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.ts +0 -1
  82. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -2
  83. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +0 -1
  84. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +4 -3
  85. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +1 -1
  86. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +16 -12
  87. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +4 -1
  88. package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js +1 -1
  89. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +126 -74
  90. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +158 -91
  91. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -22
  92. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +0 -20
  93. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +10 -20
  94. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +11 -17
  95. package/src/sap/fe/core/controllerextensions/editFlow/editFlowConstants.js +1 -1
  96. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +191 -767
  97. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +277 -1024
  98. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
  99. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -6
  100. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +0 -5
  101. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +381 -250
  102. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +467 -301
  103. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js +2 -6
  104. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +0 -5
  105. package/src/sap/fe/core/controllerextensions/recommendations/Telemetry.js +2 -6
  106. package/src/sap/fe/core/controllerextensions/recommendations/Telemetry.ts +4 -6
  107. package/src/sap/fe/core/controllerextensions/routing/ContextPathHelper.js +1 -6
  108. package/src/sap/fe/core/controllerextensions/routing/ContextPathHelper.ts +0 -4
  109. package/src/sap/fe/core/controllerextensions/routing/NavigationReason.js +1 -1
  110. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +4 -41
  111. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +1 -37
  112. package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.js +1 -1
  113. package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.ts +0 -1
  114. package/src/sap/fe/core/controls/Any.js +1 -2
  115. package/src/sap/fe/core/controls/Any.ts +0 -1
  116. package/src/sap/fe/core/controls/AnyElement.js +1 -2
  117. package/src/sap/fe/core/controls/AnyElement.ts +0 -1
  118. package/src/sap/fe/core/controls/CommandExecution.js +3 -3
  119. package/src/sap/fe/core/controls/ComponentLoader.js +23 -10
  120. package/src/sap/fe/core/controls/ComponentLoader.ts +0 -1
  121. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.js +10 -13
  122. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.tsx +0 -6
  123. package/src/sap/fe/core/controls/EventDelegateHook.js +8 -9
  124. package/src/sap/fe/core/controls/FormElementWrapper.js +7 -7
  125. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -1
  126. package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.block.js +140 -24
  127. package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.block.tsx +141 -10
  128. package/src/sap/fe/core/converters/ConverterContext.js +8 -30
  129. package/src/sap/fe/core/converters/ConverterContext.ts +7 -29
  130. package/src/sap/fe/core/converters/ManifestSettings.js +37 -1
  131. package/src/sap/fe/core/converters/ManifestSettings.ts +12 -3
  132. package/src/sap/fe/core/converters/ManifestWrapper.js +12 -40
  133. package/src/sap/fe/core/converters/ManifestWrapper.ts +13 -46
  134. package/src/sap/fe/core/converters/MetaModelConverter.js +44 -48
  135. package/src/sap/fe/core/converters/MetaModelConverter.ts +50 -48
  136. package/src/sap/fe/core/converters/TemplateConverter.js +3 -2
  137. package/src/sap/fe/core/converters/TemplateConverter.ts +0 -1
  138. package/src/sap/fe/core/converters/annotations/DataField.js +1 -28
  139. package/src/sap/fe/core/converters/annotations/DataField.ts +0 -26
  140. package/src/sap/fe/core/converters/common/AnnotationConverter.js +24 -19
  141. package/src/sap/fe/core/converters/controls/Common/Action.js +13 -26
  142. package/src/sap/fe/core/converters/controls/Common/Action.ts +13 -31
  143. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -6
  144. package/src/sap/fe/core/converters/controls/Common/Chart.ts +0 -5
  145. package/src/sap/fe/core/converters/controls/Common/Criticality.js +2 -4
  146. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +1 -2
  147. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -5
  148. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +0 -4
  149. package/src/sap/fe/core/converters/controls/Common/Form.js +3 -2
  150. package/src/sap/fe/core/converters/controls/Common/Form.ts +2 -1
  151. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -7
  152. package/src/sap/fe/core/converters/controls/Common/KPI.ts +11 -6
  153. package/src/sap/fe/core/converters/controls/Common/Table.js +159 -141
  154. package/src/sap/fe/core/converters/controls/Common/Table.ts +166 -122
  155. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +5 -30
  156. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +3 -29
  157. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +43 -55
  158. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +43 -47
  159. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -4
  160. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +0 -3
  161. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +1 -1
  162. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +3 -8
  163. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +2 -7
  164. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -11
  165. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +0 -9
  166. package/src/sap/fe/core/converters/helpers/Aggregation.js +1 -10
  167. package/src/sap/fe/core/converters/helpers/Aggregation.ts +0 -9
  168. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -7
  169. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +0 -6
  170. package/src/sap/fe/core/converters/helpers/DataFieldHelper.js +1 -9
  171. package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +0 -8
  172. package/src/sap/fe/core/converters/helpers/ID.js +1 -2
  173. package/src/sap/fe/core/converters/helpers/ID.ts +0 -1
  174. package/src/sap/fe/core/converters/helpers/InsightsHelpers.js +1 -2
  175. package/src/sap/fe/core/converters/helpers/InsightsHelpers.ts +0 -1
  176. package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
  177. package/src/sap/fe/core/converters/helpers/Key.js +1 -5
  178. package/src/sap/fe/core/converters/helpers/Key.ts +0 -4
  179. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -2
  180. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +0 -1
  181. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  182. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -7
  183. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +0 -6
  184. package/src/sap/fe/core/converters/templates/ListReportConverter.js +6 -27
  185. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +9 -26
  186. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -16
  187. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +0 -15
  188. package/src/sap/fe/core/definition/FEDefinition.js +2550 -0
  189. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -12
  190. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +9 -10
  191. package/src/sap/fe/core/formatters/CollaborationFormatter.js +8 -2
  192. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +0 -2
  193. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  194. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -2
  195. package/src/sap/fe/core/formatters/FPMFormatter.ts +0 -1
  196. package/src/sap/fe/core/formatters/FiscalFormat.js +9 -14
  197. package/src/sap/fe/core/formatters/FiscalFormat.ts +0 -11
  198. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -4
  199. package/src/sap/fe/core/formatters/KPIFormatter.ts +0 -3
  200. package/src/sap/fe/core/formatters/StandardFormatter.js +6 -3
  201. package/src/sap/fe/core/formatters/StandardFormatter.ts +6 -2
  202. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -4
  203. package/src/sap/fe/core/formatters/ValueFormatter.ts +0 -3
  204. package/src/sap/fe/core/fpm/Component.js +14 -17
  205. package/src/sap/fe/core/fpm/Component.ts +7 -10
  206. package/src/sap/fe/core/fpm/manifest.json +1 -1
  207. package/src/sap/fe/core/helpers/AdaptiveCardExpressionCompiler.js +3 -10
  208. package/src/sap/fe/core/helpers/AdaptiveCardExpressionCompiler.ts +0 -9
  209. package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -13
  210. package/src/sap/fe/core/helpers/AppStartupHelper.ts +0 -11
  211. package/src/sap/fe/core/helpers/BindingHelper.js +1 -4
  212. package/src/sap/fe/core/helpers/BindingHelper.ts +0 -3
  213. package/src/sap/fe/core/helpers/BindingToolkitEvaluator.js +1 -2
  214. package/src/sap/fe/core/helpers/BindingToolkitEvaluator.ts +0 -1
  215. package/src/sap/fe/core/helpers/DeleteHelper.js +61 -32
  216. package/src/sap/fe/core/helpers/DeleteHelper.ts +79 -33
  217. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -2
  218. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +0 -1
  219. package/src/sap/fe/core/helpers/EditState.js +1 -1
  220. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -2
  221. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +0 -1
  222. package/src/sap/fe/core/helpers/FPMHelper.js +1 -2
  223. package/src/sap/fe/core/helpers/FPMHelper.ts +0 -1
  224. package/src/sap/fe/core/helpers/KeepAliveHelper.js +1 -8
  225. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +0 -7
  226. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +7 -1
  227. package/src/sap/fe/core/helpers/LoaderUtils.js +1 -1
  228. package/src/sap/fe/core/helpers/ManifestHelper.js +1 -3
  229. package/src/sap/fe/core/helpers/ManifestHelper.ts +0 -2
  230. package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
  231. package/src/sap/fe/core/helpers/MetaModelFunction.js +3 -8
  232. package/src/sap/fe/core/helpers/MetaModelFunction.ts +0 -5
  233. package/src/sap/fe/core/helpers/MetaPath.js +1 -7
  234. package/src/sap/fe/core/helpers/MetaPath.ts +0 -6
  235. package/src/sap/fe/core/helpers/ModelHelper.js +55 -35
  236. package/src/sap/fe/core/helpers/ModelHelper.ts +64 -38
  237. package/src/sap/fe/core/helpers/PasteHelper.js +77 -24
  238. package/src/sap/fe/core/helpers/PasteHelper.ts +105 -23
  239. package/src/sap/fe/core/helpers/PromiseKeeper.js +1 -3
  240. package/src/sap/fe/core/helpers/PromiseKeeper.ts +0 -2
  241. package/src/sap/fe/core/helpers/RecommendationHelper.js +1 -4
  242. package/src/sap/fe/core/helpers/RecommendationHelper.ts +0 -3
  243. package/src/sap/fe/core/helpers/ResourceModelHelper.js +1 -3
  244. package/src/sap/fe/core/helpers/ResourceModelHelper.ts +3 -4
  245. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -2
  246. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +0 -1
  247. package/src/sap/fe/core/helpers/SizeHelper.js +1 -2
  248. package/src/sap/fe/core/helpers/SizeHelper.ts +0 -1
  249. package/src/sap/fe/core/helpers/StableIdHelper.js +7 -17
  250. package/src/sap/fe/core/helpers/StableIdHelper.ts +7 -17
  251. package/src/sap/fe/core/helpers/StandardRecommendationHelper.js +1 -12
  252. package/src/sap/fe/core/helpers/StandardRecommendationHelper.ts +0 -11
  253. package/src/sap/fe/core/helpers/Synchronization.js +1 -1
  254. package/src/sap/fe/core/helpers/TitleHelper.js +1 -10
  255. package/src/sap/fe/core/helpers/TitleHelper.ts +0 -9
  256. package/src/sap/fe/core/helpers/ToES6Promise.js +1 -2
  257. package/src/sap/fe/core/helpers/ToES6Promise.ts +0 -1
  258. package/src/sap/fe/core/helpers/TypeGuards.js +1 -15
  259. package/src/sap/fe/core/helpers/TypeGuards.ts +0 -14
  260. package/src/sap/fe/core/helpers/WebSocket.js +1 -1
  261. package/src/sap/fe/core/library.js +10 -44
  262. package/src/sap/fe/core/library.support.js +1 -1
  263. package/src/sap/fe/core/library.ts +8 -45
  264. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -6
  265. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -5
  266. package/src/sap/fe/core/messagebundle.properties +12 -1
  267. package/src/sap/fe/core/messagebundle_ar.properties +8 -0
  268. package/src/sap/fe/core/messagebundle_bg.properties +8 -0
  269. package/src/sap/fe/core/messagebundle_ca.properties +8 -0
  270. package/src/sap/fe/core/messagebundle_cnr.properties +8 -0
  271. package/src/sap/fe/core/messagebundle_cs.properties +9 -1
  272. package/src/sap/fe/core/messagebundle_cy.properties +8 -0
  273. package/src/sap/fe/core/messagebundle_da.properties +8 -0
  274. package/src/sap/fe/core/messagebundle_de.properties +8 -0
  275. package/src/sap/fe/core/messagebundle_el.properties +8 -0
  276. package/src/sap/fe/core/messagebundle_en.properties +8 -0
  277. package/src/sap/fe/core/messagebundle_en_GB.properties +8 -0
  278. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +144 -65
  279. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +8 -0
  280. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +273 -194
  281. package/src/sap/fe/core/messagebundle_es.properties +9 -1
  282. package/src/sap/fe/core/messagebundle_es_MX.properties +8 -0
  283. package/src/sap/fe/core/messagebundle_et.properties +8 -0
  284. package/src/sap/fe/core/messagebundle_fi.properties +8 -0
  285. package/src/sap/fe/core/messagebundle_fr.properties +8 -0
  286. package/src/sap/fe/core/messagebundle_fr_CA.properties +8 -0
  287. package/src/sap/fe/core/messagebundle_hi.properties +9 -1
  288. package/src/sap/fe/core/messagebundle_hr.properties +8 -0
  289. package/src/sap/fe/core/messagebundle_hu.properties +8 -0
  290. package/src/sap/fe/core/messagebundle_id.properties +12 -4
  291. package/src/sap/fe/core/messagebundle_it.properties +8 -0
  292. package/src/sap/fe/core/messagebundle_iw.properties +8 -0
  293. package/src/sap/fe/core/messagebundle_ja.properties +8 -0
  294. package/src/sap/fe/core/messagebundle_kk.properties +8 -0
  295. package/src/sap/fe/core/messagebundle_ko.properties +8 -0
  296. package/src/sap/fe/core/messagebundle_lt.properties +8 -0
  297. package/src/sap/fe/core/messagebundle_lv.properties +8 -0
  298. package/src/sap/fe/core/messagebundle_mk.properties +8 -0
  299. package/src/sap/fe/core/messagebundle_ms.properties +8 -0
  300. package/src/sap/fe/core/messagebundle_nl.properties +16 -8
  301. package/src/sap/fe/core/messagebundle_no.properties +8 -0
  302. package/src/sap/fe/core/messagebundle_pl.properties +8 -0
  303. package/src/sap/fe/core/messagebundle_pt.properties +8 -0
  304. package/src/sap/fe/core/messagebundle_pt_PT.properties +8 -0
  305. package/src/sap/fe/core/messagebundle_ro.properties +8 -0
  306. package/src/sap/fe/core/messagebundle_ru.properties +8 -0
  307. package/src/sap/fe/core/messagebundle_sh.properties +8 -0
  308. package/src/sap/fe/core/messagebundle_sk.properties +8 -0
  309. package/src/sap/fe/core/messagebundle_sl.properties +8 -0
  310. package/src/sap/fe/core/messagebundle_sr.properties +8 -0
  311. package/src/sap/fe/core/messagebundle_sv.properties +8 -0
  312. package/src/sap/fe/core/messagebundle_th.properties +12 -4
  313. package/src/sap/fe/core/messagebundle_tr.properties +8 -0
  314. package/src/sap/fe/core/messagebundle_uk.properties +10 -2
  315. package/src/sap/fe/core/messagebundle_vi.properties +8 -0
  316. package/src/sap/fe/core/messagebundle_zh_CN.properties +8 -0
  317. package/src/sap/fe/core/messagebundle_zh_TW.properties +8 -0
  318. package/src/sap/fe/core/operationsHelper.js +22 -7
  319. package/src/sap/fe/core/operationsHelper.ts +24 -5
  320. package/src/sap/fe/core/rootView/Fcl.controller.js +7 -27
  321. package/src/sap/fe/core/rootView/Fcl.controller.ts +0 -18
  322. package/src/sap/fe/core/rootView/NavContainer.controller.js +7 -12
  323. package/src/sap/fe/core/rootView/NavContainer.controller.ts +0 -5
  324. package/src/sap/fe/core/rootView/RootViewBaseController.js +10 -24
  325. package/src/sap/fe/core/rootView/RootViewBaseController.ts +3 -16
  326. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +3 -3
  327. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +3 -3
  328. package/src/sap/fe/core/services/CollaborationManagerServiceFactory.js +4 -4
  329. package/src/sap/fe/core/services/CollaborativeToolsServiceFactory.js +3 -3
  330. package/src/sap/fe/core/services/ContextSharingServiceFactory.js +3 -4
  331. package/src/sap/fe/core/services/ContextSharingServiceFactory.ts +0 -1
  332. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +13 -20
  333. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +11 -17
  334. package/src/sap/fe/core/services/NavigationServiceFactory.js +11 -21
  335. package/src/sap/fe/core/services/NavigationServiceFactory.ts +4 -17
  336. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +3 -3
  337. package/src/sap/fe/core/services/RoutingServiceFactory.js +7 -19
  338. package/src/sap/fe/core/services/RoutingServiceFactory.ts +0 -12
  339. package/src/sap/fe/core/services/ShellServicesFactory.js +8 -44
  340. package/src/sap/fe/core/services/ShellServicesFactory.ts +1 -41
  341. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +19 -60
  342. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +14 -57
  343. package/src/sap/fe/core/services/TelemetryServiceFactory.js +6 -14
  344. package/src/sap/fe/core/services/TelemetryServiceFactory.ts +2 -10
  345. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +17 -7
  346. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +17 -3
  347. package/src/sap/fe/core/services/ValueHelpHistoryServiceFactory.js +11 -24
  348. package/src/sap/fe/core/services/ValueHelpHistoryServiceFactory.ts +0 -19
  349. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.js +3 -31
  350. package/src/sap/fe/core/services/collaborativeDraftServiceFactory.ts +0 -27
  351. package/src/sap/fe/core/services/valueHelpService/HistoryOptOutProvider.js +1 -4
  352. package/src/sap/fe/core/services/valueHelpService/HistoryOptOutProvider.ts +0 -3
  353. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +7 -7
  354. package/src/sap/fe/core/support/AnnotationIssue.support.js +1 -1
  355. package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +1 -1
  356. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +1 -1
  357. package/src/sap/fe/core/support/CommonHelper.js +4 -1
  358. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  359. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +1 -1
  360. package/src/sap/fe/core/templating/ActionHelper.js +1 -2
  361. package/src/sap/fe/core/templating/ActionHelper.ts +0 -1
  362. package/src/sap/fe/core/templating/CommonFormatters.js +1 -2
  363. package/src/sap/fe/core/templating/CommonFormatters.ts +0 -1
  364. package/src/sap/fe/core/templating/CriticalityFormatters.js +1 -6
  365. package/src/sap/fe/core/templating/CriticalityFormatters.ts +0 -5
  366. package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -2
  367. package/src/sap/fe/core/templating/DataFieldFormatters.ts +0 -1
  368. package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -18
  369. package/src/sap/fe/core/templating/DataModelPathHelper.ts +0 -17
  370. package/src/sap/fe/core/templating/DisplayModeFormatter.js +6 -1
  371. package/src/sap/fe/core/templating/EntitySetHelper.js +1 -4
  372. package/src/sap/fe/core/templating/EntitySetHelper.ts +0 -3
  373. package/src/sap/fe/core/templating/EntityTypeHelper.js +4 -5
  374. package/src/sap/fe/core/templating/EntityTypeHelper.ts +3 -4
  375. package/src/sap/fe/core/templating/FieldControlHelper.js +4 -9
  376. package/src/sap/fe/core/templating/FieldControlHelper.ts +3 -9
  377. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  378. package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
  379. package/src/sap/fe/core/templating/PropertyHelper.js +1 -31
  380. package/src/sap/fe/core/templating/PropertyHelper.ts +0 -30
  381. package/src/sap/fe/core/templating/SemanticObjectHelper.js +1 -7
  382. package/src/sap/fe/core/templating/SemanticObjectHelper.ts +0 -6
  383. package/src/sap/fe/core/templating/UIFormatters.js +18 -14
  384. package/src/sap/fe/core/templating/UIFormatters.ts +30 -18
  385. package/src/sap/fe/core/type/Date.js +3 -6
  386. package/src/sap/fe/core/type/Date.ts +0 -3
  387. package/src/sap/fe/core/type/DateTimeWithTimezone.js +3 -3
  388. package/src/sap/fe/core/type/EDM.js +1 -1
  389. package/src/sap/fe/core/type/Email.js +3 -3
  390. package/src/sap/fe/core/type/FiscalDate.js +3 -9
  391. package/src/sap/fe/core/type/FiscalDate.ts +0 -6
  392. package/src/sap/fe/core/type/InputMask.js +3 -7
  393. package/src/sap/fe/core/type/InputMask.ts +0 -4
@@ -4,6 +4,7 @@ import type { CustomMessage } from "sap/fe/core/controllerextensions/MessageHand
4
4
  import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
5
5
  import type FieldAPI from "sap/fe/macros/field/FieldAPI";
6
6
  import type TableAPI from "sap/fe/macros/table/TableAPI";
7
+ import type { TableColumnProperties } from "sap/fe/macros/table/TableAPI";
7
8
  import type TableDelegate from "sap/fe/macros/table/delegates/TableDelegate";
8
9
  import Bar from "sap/m/Bar";
9
10
  import Button from "sap/m/Button";
@@ -23,8 +24,8 @@ import IconPool from "sap/ui/core/IconPool";
23
24
  import Library from "sap/ui/core/Lib";
24
25
  import Messaging from "sap/ui/core/Messaging";
25
26
  import DateFormat from "sap/ui/core/format/DateFormat";
26
- import CoreLib from "sap/ui/core/library";
27
27
  import Message from "sap/ui/core/message/Message";
28
+ import MessageType from "sap/ui/core/message/MessageType";
28
29
  import type View from "sap/ui/core/mvc/View";
29
30
  import type MDCTable from "sap/ui/mdc/Table";
30
31
  import type Column from "sap/ui/mdc/table/Column";
@@ -45,7 +46,6 @@ import type ObjectPageSubSection from "sap/uxap/ObjectPageSubSection";
45
46
  import type { AnnotationTableColumn, CustomBasedTableColumn, TableColumn } from "../../converters/controls/Common/Table";
46
47
 
47
48
  const ButtonType = MLib.ButtonType;
48
- const MessageType = CoreLib.MessageType;
49
49
  let aResolveFunctions: ((param1: void | Dialog) => void)[] = [];
50
50
  let dialogControl: Dialog;
51
51
  let oBackButton: Button;
@@ -75,11 +75,21 @@ type ColumnInfoType = {
75
75
  sColumnIndicator: string;
76
76
  };
77
77
 
78
+ export type SupportedUIElement = "Dialog" | "Box" | "Toast" | "None";
79
+
80
+ // FE related technical information to be stored with the message.
81
+ // Like, this would be used to store pre-text with the message when it is the only message to be shown in UI.
82
+ type FEMessageTechnicalDetails = object & {
83
+ fe?: {
84
+ changeSetPreTextForSingleError?: string;
85
+ singleErrorPreText?: string;
86
+ };
87
+ };
88
+
78
89
  export type MessageUIDecisions = {
79
- uiElementToUse: "Dialog" | "Box" | "Toast" | "None";
90
+ uiElementToUse: SupportedUIElement;
80
91
  messagesToShow: Message[];
81
92
  containsBoundTransition: boolean;
82
- showChangeSetErrorDialog: boolean;
83
93
  contextNeedsEtagRefresh?: ODataV4Context;
84
94
  };
85
95
 
@@ -94,7 +104,8 @@ export type messageHandlingType = {
94
104
  control?: Control,
95
105
  actionName?: string | undefined,
96
106
  onBeforeShowMessage?: (messages: Message[], showMessageParameters: ShowMessageParameters) => ShowMessageParameters,
97
- viewType?: string
107
+ viewType?: string,
108
+ showStateMessages?: boolean
98
109
  ) => MessageUIDecisions;
99
110
  showMessagesInUI: (uiDecision: MessageUIDecisions) => Promise<void>;
100
111
  removeUnboundTransitionMessages: () => void;
@@ -153,19 +164,13 @@ export type messageHandlingType = {
153
164
  ) => string | null | undefined;
154
165
  determineColumnInfo: (oColFromTableSettings: TableColumn | undefined, resourceModel: ResourceModel) => ColumnInfoType;
155
166
  fetchColumnInfo: (oMessage: MessageWithHeader, oTable: MDCTable) => TableColumn | undefined;
156
- getTableFirstColBindingContextForTextAnnotation: (
157
- oTable: MDCTable,
158
- oTableRowContext: ODataV4Context | undefined,
159
- sTableFirstColProperty: string
167
+ getTableColBindingContextForTextAnnotation: (
168
+ table: MDCTable,
169
+ tableRowContext: ODataV4Context | undefined,
170
+ tableColProperty: TableColumnProperties
160
171
  ) => Context | null | undefined;
161
172
  getMessageRank: (obj: MessageWithHeader) => number;
162
173
  fnCallbackSetGroupName: (aMessage: MessageWithHeader, sActionName: string | undefined, bIsGeneralGroupName?: boolean) => void;
163
- getTableFirstColValue: (
164
- sTableFirstColProperty: string,
165
- oTableRowContext: Context,
166
- sTextAnnotationPath: string,
167
- sTextArrangement: string
168
- ) => string;
169
174
  setGroupNameOPDisplayMode: (aModelData: MessageWithHeader, sActionName: string | undefined, control: View) => void;
170
175
  updateMessageObjectGroupName: (
171
176
  messagesToShow: MessageWithHeader[],
@@ -177,10 +182,29 @@ export type messageHandlingType = {
177
182
  isControlInTable: (oTable: MDCTable, sControlId: string) => UI5Element[] | boolean;
178
183
  isControlPartOfCreationRow: (oControl: UI5Element | undefined) => boolean;
179
184
  removeMessageShownInMessageStrip: (transientMessages: Message[], context: Context) => Message[];
180
- getFiltersForMessages: (showBoundTransition: boolean) => Filter[];
185
+ getFiltersForMessages: (showBoundTransition: boolean, showStateMessages?: boolean) => Filter[];
181
186
  showMessageToast: (message: Message) => Promise<void>;
182
187
  showMessageDialogControl: (uiDecisions: MessageUIDecisions, runToTest?: boolean) => Promise<void | Dialog>;
183
188
  showMessageBoxControl: (uiDecisions: MessageUIDecisions) => Promise<void>;
189
+ getMessagesForContext: (context: ODataV4Context) => Message[];
190
+ isMessageOutOfParameterDialog: (aControlIds: string[]) => boolean;
191
+ removeContextMessagesfromModel: (messages?: Message[], context?: Context[]) => void;
192
+ removeMessagesForActionParameterDialog: (Messages: Message[]) => Message[];
193
+ setGroupNameOPTableDisplayMode(
194
+ subsection: ObjectPageSubSection,
195
+ mdcTable: MDCTable,
196
+ message: MessageWithHeader,
197
+ viewContext: Context | null | undefined,
198
+ groupNameIsGeneral: boolean,
199
+ actionName?: string
200
+ ): boolean;
201
+ updateAddtionalTextForMessageInOPTable(mdcTable: MDCTable, message: MessageWithHeader, targetTableInfo: TargetTableInfoType): void;
202
+ updateHeaderNameForMessageInOPTable(
203
+ subsection: ObjectPageSubSection,
204
+ mdcTable: MDCTable,
205
+ message: MessageWithHeader,
206
+ targetTableInfo: TargetTableInfoType
207
+ ): void;
184
208
  };
185
209
 
186
210
  function fnFormatTechnicalDetails(): string {
@@ -241,11 +265,10 @@ function fnFormatDescription(): string {
241
265
  }
242
266
  /**
243
267
  * Calculates the highest priority message type(Error/Warning/Success/Information) from the available messages.
244
- *
245
268
  * @param [aMessages] Messages list
246
269
  * @returns Highest priority message from the available messages
247
270
  */
248
- function fnGetHighestMessagePriority(aMessages: MessageItem[]): CoreLib.MessageType {
271
+ function fnGetHighestMessagePriority(aMessages: MessageItem[]): MessageType {
249
272
  let sMessagePriority = MessageType.None;
250
273
  const iLength = aMessages.length;
251
274
  const oMessageCount = { Error: 0, Warning: 0, Success: 0, Information: 0 };
@@ -342,7 +365,6 @@ function getRetryAfterMessage(oMessage: Message, bMessageDialog?: boolean): stri
342
365
 
343
366
  /**
344
367
  * Checks if there are any warning or error messages(bound and unbound)..
345
- *
346
368
  * @returns Boolean indicating existence of messages
347
369
  */
348
370
  function hasTransitionErrorsOrWarnings(): boolean {
@@ -427,6 +449,7 @@ export type ShowMessageParameters = {
427
449
  showChangeSetErrorDialog?: boolean;
428
450
  filteredMessages?: Message[];
429
451
  fnGetMessageSubtitle?: Function;
452
+ containsBoundTransistion?: boolean;
430
453
  };
431
454
 
432
455
  function isNonTechnicalMessage(message: Message): boolean {
@@ -444,41 +467,40 @@ function isNonTechnicalMessage(message: Message): boolean {
444
467
 
445
468
  /**
446
469
  * Get transition messages for creating the UI decision to show messages.
447
- *
448
470
  * @param showBoundTransition Should bound transition messages be shown.
449
- * @param context Binding context of the page.
471
+ * @param _context Binding context of the page.
450
472
  * @returns Transition messages relevant to show in UI.
451
473
  */
452
- function getTransitionMessagesForUIDecision(this: messageHandlingType, showBoundTransition: boolean, context: ODataV4Context): Message[] {
474
+ function getTransitionMessagesForUIDecision(this: messageHandlingType, showBoundTransition: boolean, _context: ODataV4Context): Message[] {
453
475
  let transitionMessages = this.getMessages();
454
476
  if (showBoundTransition) {
455
477
  //bound Transistion Messages
456
- transitionMessages = transitionMessages.concat(getMessages(true, true));
478
+ transitionMessages = transitionMessages.concat(this.getMessages(true, true));
457
479
  }
458
480
  return transitionMessages;
459
481
  }
460
482
 
461
483
  /**
462
484
  * Execute 'onBeforeShowMessages' callback to let the caller influence the UI decision to show messages.
463
- *
464
485
  * @param transitionMessages Transition messages.
465
486
  * @param onBeforeShowMessage Callback.
466
- * @returns Infromation to change UI decision based on onBeforeShowMessages callback implementation.
487
+ * @returns ShowMessageParameters Infromation to change UI decision based on onBeforeShowMessages callback implementation.
467
488
  */
468
489
  function executeOnBeforeShowMessages(
469
490
  transitionMessages: MessageWithHeader[],
470
491
  onBeforeShowMessage?: (messages: Message[], showMessageParameters: ShowMessageParameters) => ShowMessageParameters
471
492
  ): {
472
- uiElementToUse: MessageUIDecisions["uiElementToUse"];
493
+ uiElementToUse: SupportedUIElement;
473
494
  messagesToShow: MessageWithHeader[];
474
495
  fnGetMessageSubtitle?: Function;
475
496
  showChangeSetErrorDialog?: boolean;
497
+ containsBoundTransition?: boolean;
476
498
  } {
477
499
  let messagesToShow = [...transitionMessages];
478
- let uiElementToUse: MessageUIDecisions["uiElementToUse"] =
500
+ let uiElementToUse: SupportedUIElement =
479
501
  transitionMessages.length === 1 && transitionMessages[0].getCode() === "503" ? "Box" : "Dialog";
480
502
  let fnGetMsgSubtitle: Function | undefined;
481
- let changeSetErrorDialog: boolean | undefined;
503
+ let showBoundMessages: boolean | undefined;
482
504
 
483
505
  if (onBeforeShowMessage) {
484
506
  // The callback onBeforeShowMessage alters the UIElement to use in a different format(showMessageDialog and showMessageBox).
@@ -486,10 +508,14 @@ function executeOnBeforeShowMessages(
486
508
  showMessageDialog: uiElementToUse === "Dialog",
487
509
  showMessageBox: uiElementToUse === "Box"
488
510
  };
489
- const { showMessageBox, showMessageDialog, showChangeSetErrorDialog, filteredMessages, fnGetMessageSubtitle } = onBeforeShowMessage(
490
- transitionMessages,
491
- showMessageParameters
492
- );
511
+ const {
512
+ showMessageBox,
513
+ showMessageDialog,
514
+ showChangeSetErrorDialog,
515
+ filteredMessages,
516
+ fnGetMessageSubtitle,
517
+ containsBoundTransistion
518
+ } = onBeforeShowMessage(transitionMessages, showMessageParameters);
493
519
  if (showMessageBox === true) {
494
520
  uiElementToUse = "Box";
495
521
  } else if (showMessageDialog === true) {
@@ -497,10 +523,10 @@ function executeOnBeforeShowMessages(
497
523
  } else {
498
524
  uiElementToUse = "None";
499
525
  }
526
+ showBoundMessages = containsBoundTransistion;
500
527
  fnGetMsgSubtitle = fnGetMessageSubtitle;
501
- changeSetErrorDialog = showChangeSetErrorDialog ?? false;
502
- if (uiElementToUse === "Dialog" || changeSetErrorDialog) {
503
- messagesToShow = filteredMessages ? filteredMessages : messagesToShow;
528
+ if (showChangeSetErrorDialog || containsBoundTransistion === false) {
529
+ messagesToShow = filteredMessages ?? [];
504
530
  }
505
531
  }
506
532
 
@@ -508,7 +534,7 @@ function executeOnBeforeShowMessages(
508
534
  uiElementToUse,
509
535
  messagesToShow,
510
536
  fnGetMessageSubtitle: fnGetMsgSubtitle,
511
- showChangeSetErrorDialog: changeSetErrorDialog
537
+ containsBoundTransition: showBoundMessages
512
538
  };
513
539
  }
514
540
 
@@ -519,7 +545,6 @@ function executeOnBeforeShowMessages(
519
545
  * It would also hold information for after process like..
520
546
  * 1. refresh context due to etag mismatch.
521
547
  * 2. do we show bound messages and hence clear them after we show the UI element.
522
- *
523
548
  * @param customMessages Custom messages to add to message model and show.
524
549
  * @param context Binding context of the page.
525
550
  * @param showBoundTransition Should bound transition messages be shown.
@@ -528,6 +553,7 @@ function executeOnBeforeShowMessages(
528
553
  * @param actionName Name of the action whose process requested for messages to be shown.
529
554
  * @param onBeforeShowMessage Callback to influence UI decision before creating final UI decision.
530
555
  * @param viewType View type, list report or object page.
556
+ * @param showStateMessages Should state messages be shown.
531
557
  * @returns UI decisions used to show messages.
532
558
  */
533
559
  function getUIDecisions(
@@ -539,7 +565,8 @@ function getUIDecisions(
539
565
  control?: Control,
540
566
  actionName?: string | undefined,
541
567
  onBeforeShowMessage?: (messages: Message[], showMessageParameters: ShowMessageParameters) => ShowMessageParameters,
542
- viewType?: string
568
+ viewType?: string,
569
+ showStateMessages = false
543
570
  ): MessageUIDecisions {
544
571
  // Add Custom messages
545
572
  // TODO: Will these messages be part of transitionMessages?
@@ -551,22 +578,33 @@ function getUIDecisions(
551
578
  const transitionMessages = getTransitionMessagesForUIDecision.call(this, showBoundTransition, context);
552
579
 
553
580
  // UI representation of the Dialog
554
- let uiElementToUse: MessageUIDecisions["uiElementToUse"] = "Dialog";
555
581
  const uiDecisionIntermittent = executeOnBeforeShowMessages.call(this, transitionMessages, onBeforeShowMessage);
556
- let { messagesToShow } = uiDecisionIntermittent;
557
- uiElementToUse = uiDecisionIntermittent.uiElementToUse;
582
+ let { messagesToShow, uiElementToUse = "Dialog" } = uiDecisionIntermittent;
558
583
  // Get Filters for Unbound Messages
559
- const filters = getFiltersForMessages(showBoundTransition);
584
+ showBoundTransition = uiDecisionIntermittent.containsBoundTransition ?? showBoundTransition;
585
+ const filters = getFiltersForMessages(showBoundTransition, showStateMessages);
560
586
  messagesToShow = getMessagesToShow(filters, messagesToShow ?? []);
561
587
  // handle context bound messages, If there is a single message of which is bounded to the context then remove that from the dialog
562
588
  messagesToShow = removeMessageShownInMessageStrip(messagesToShow, context);
563
- if (messagesToShow.length > 0) {
564
- if (messagesToShow.length === 1 && messagesToShow[0].getType() === MessageType.Success) {
565
- uiElementToUse = "Toast";
566
- }
567
- if (uiElementToUse === "Dialog") {
568
- messageHandling.updateMessageObjectGroupName(messagesToShow, control, actionName, viewType);
589
+ ({ messagesToShow, uiElementToUse } = processMessagesFromChangesetFailure({ messagesToShow, uiElementToUse }));
590
+ // Modify ETag Messages
591
+ const hasEtagMessage = this.modifyETagMessagesOnly(Library.getResourceBundleFor("sap.fe.core")!, concurrentEditFlag);
592
+
593
+ if (messagesToShow.length > 0 && uiElementToUse !== "None") {
594
+ if (messagesToShow.length === 1) {
595
+ const messageToShow = messagesToShow[0];
596
+ if (messageToShow.getType() === MessageType.Success) {
597
+ uiElementToUse = "Toast";
598
+ } else if (hasEtagMessage || messageToShow.getDescription()?.length || messageToShow.getDescriptionUrl()?.length) {
599
+ uiElementToUse = "Dialog";
600
+ } else {
601
+ // We would show single message in message box only when:
602
+ // 1. It is not an Etag message.
603
+ // 2. There is no message description or description url available for long text.
604
+ uiElementToUse = "Box";
605
+ }
569
606
  }
607
+ messageHandling.updateMessageObjectGroupName(messagesToShow, control, actionName, viewType);
570
608
  const fnGetMessageSubtitle = uiDecisionIntermittent.fnGetMessageSubtitle;
571
609
  if (fnGetMessageSubtitle) {
572
610
  messagesToShow.forEach(function (oMessage: Message) {
@@ -575,21 +613,16 @@ function getUIDecisions(
575
613
  }
576
614
  }
577
615
 
578
- // Modify ETag Messages
579
- const hasEtagMessage = this.modifyETagMessagesOnly(Library.getResourceBundleFor("sap.fe.core")!, concurrentEditFlag);
580
-
581
616
  return {
582
617
  messagesToShow,
583
618
  uiElementToUse,
584
619
  contextNeedsEtagRefresh: hasEtagMessage ? context : undefined,
585
- containsBoundTransition: showBoundTransition,
586
- showChangeSetErrorDialog: uiDecisionIntermittent.showChangeSetErrorDialog ?? false
620
+ containsBoundTransition: showBoundTransition
587
621
  };
588
622
  }
589
623
 
590
624
  /**
591
625
  * Show messages in the decided UI Element.
592
- *
593
626
  * @param uiDecisions UI Decision to be used to show the messages.
594
627
  * @returns Promise that resolves or rejects based on user interaction with the UI element.
595
628
  */
@@ -614,38 +647,18 @@ async function showMessagesInUI(uiDecisions: MessageUIDecisions): Promise<void>
614
647
 
615
648
  /**
616
649
  * Get model filters for getting the relevant messages.
617
- *
618
650
  * @param showBoundTransition Should bound transition messages be shown.
651
+ * @param showStateMessages Should state messages be shown.
619
652
  * @returns Model filters
620
653
  */
621
- function getFiltersForMessages(showBoundTransition: boolean): Filter[] {
622
- const filters = [new Filter({ path: "persistent", operator: FilterOperator.NE, value1: false })];
654
+ function getFiltersForMessages(showBoundTransition: boolean, showStateMessages = false): Filter[] {
655
+ const filters = showStateMessages ? [] : [new Filter({ path: "persistent", operator: FilterOperator.NE, value1: false })];
623
656
  const isNonTechnicalMessageFilter = new Filter({ path: "", test: isNonTechnicalMessage });
624
- if (showBoundTransition) {
625
- // we only want to show bound transition messages not bound state messages hence add a filter for the same
626
- filters.push(new Filter({ path: "persistent", operator: FilterOperator.EQ, value1: true }));
657
+ if (showStateMessages || showBoundTransition) {
627
658
  const fnCheckControlIdInDialog = function (aControlIds: string[]): boolean {
628
- let index = Infinity,
629
- oControl = UI5Element.getElementById(aControlIds[0]) as ManagedObject | null;
630
- const errorFieldControl = UI5Element.getElementById(aControlIds[0]) as Control;
631
- while (oControl) {
632
- const fieldRankinDialog =
633
- oControl instanceof Dialog
634
- ? (errorFieldControl.getParent() as Control).findElements(true).indexOf(errorFieldControl)
635
- : Infinity;
636
- if (oControl instanceof Dialog) {
637
- if (index > fieldRankinDialog) {
638
- index = fieldRankinDialog;
639
- // Set the focus to the dialog's control
640
- errorFieldControl.focus();
641
- }
642
- // messages with target inside sap.m.Dialog should not bring up the message dialog
643
- return false;
644
- }
645
- oControl = oControl.getParent();
646
- }
647
- return true;
659
+ return messageHandling.isMessageOutOfParameterDialog(aControlIds);
648
660
  };
661
+ // Add the filter for state messages or bound transition messages
649
662
  filters.push(
650
663
  new Filter({
651
664
  path: "controlIds",
@@ -653,6 +666,11 @@ function getFiltersForMessages(showBoundTransition: boolean): Filter[] {
653
666
  caseSensitive: true
654
667
  })
655
668
  );
669
+ }
670
+
671
+ if (showBoundTransition) {
672
+ // we only want to show bound transition messages not bound state messages hence add a filter for the same
673
+ filters.push(new Filter({ path: "persistent", operator: FilterOperator.EQ, value1: true }));
656
674
  filters.push(isNonTechnicalMessageFilter);
657
675
  } else {
658
676
  // only unbound messages have to be shown so add filter accordingly
@@ -672,9 +690,51 @@ function getFiltersForMessages(showBoundTransition: boolean): Filter[] {
672
690
  return filters;
673
691
  }
674
692
 
693
+ function processMessagesFromChangesetFailure({
694
+ messagesToShow,
695
+ uiElementToUse
696
+ }: Pick<MessageUIDecisions, "uiElementToUse" | "messagesToShow">): Pick<MessageUIDecisions, "uiElementToUse" | "messagesToShow"> {
697
+ let retMessages = [...messagesToShow];
698
+ if (messagesToShow.length === 2) {
699
+ // There are 2 message:
700
+ // 1. Generic error changeset message added by FE.
701
+ // 2. Main error message from the interaction.
702
+ // We remove the generic message, show only an enhanced 'Main error message' with a generic messsage pre-text in the message box.
703
+ const genericMsgs: Message[] = [];
704
+ const nonGenericMsgs: Message[] = [];
705
+ messagesToShow.forEach((message) => {
706
+ if (message.getCode() === "FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED") {
707
+ genericMsgs.push(message);
708
+ } else {
709
+ nonGenericMsgs.push(message);
710
+ }
711
+ });
712
+ if (genericMsgs.length === 1) {
713
+ const { fe: feTechnicalDetails } = (genericMsgs[0].getTechnicalDetails() || {}) as FEMessageTechnicalDetails;
714
+ if (feTechnicalDetails?.changeSetPreTextForSingleError) {
715
+ const preText = feTechnicalDetails?.changeSetPreTextForSingleError;
716
+ if (preText) {
717
+ const techDetailsForNonGenericMessage: FEMessageTechnicalDetails = {
718
+ fe: {
719
+ singleErrorPreText: preText
720
+ }
721
+ };
722
+ const existingTechDetails = nonGenericMsgs[0].getTechnicalDetails() ?? {};
723
+ // combine existing technical details if any, with the change set information we want to add.
724
+ nonGenericMsgs[0].setTechnicalDetails({ ...existingTechDetails, ...techDetailsForNonGenericMessage });
725
+ retMessages = nonGenericMsgs;
726
+ }
727
+ }
728
+ }
729
+ }
730
+ return {
731
+ messagesToShow: retMessages,
732
+ uiElementToUse: retMessages.length === 1 && uiElementToUse !== "None" ? "Box" : uiElementToUse
733
+ };
734
+ }
735
+
675
736
  /**
676
737
  * Add the custom messages to message model.
677
- *
678
738
  * @param customMessages Custom messages to add.
679
739
  */
680
740
  function addCustomMessages(customMessages: CustomMessage[]): void {
@@ -815,38 +875,74 @@ async function showMessageDialogControl(uiDecision: MessageUIDecisions, runToTes
815
875
 
816
876
  async function showMessageBoxControl(uiDecision: MessageUIDecisions): Promise<void> {
817
877
  return new Promise(function (resolve) {
818
- const { messagesToShow, showChangeSetErrorDialog, containsBoundTransition } = uiDecision;
878
+ const { messagesToShow } = uiDecision;
819
879
  const messageToShow = messagesToShow[0];
820
880
  const messageTechnicalDetails = messageToShow.getTechnicalDetails() as MessageTechnicalDetails | undefined;
821
- if (messageTechnicalDetails || showChangeSetErrorDialog) {
881
+ const retryAfterMessage = messageHandling.getRetryAfterMessage(messageToShow, true);
882
+ // If it is a retry message, then it needs to have technical details to show it.
883
+ const showMessageBox = retryAfterMessage ? messageTechnicalDetails : true;
884
+ if (showMessageBox) {
822
885
  let formattedTextString = "<html><body>";
823
- const retryAfterMessage = getRetryAfterMessage(messageToShow, true);
886
+
887
+ // Adding pre-text for the messages
824
888
  if (retryAfterMessage) {
825
- formattedTextString = `<h6>${retryAfterMessage}</h6><br>`;
889
+ formattedTextString = `${formattedTextString}<h6>${retryAfterMessage}</h6><br/>`;
890
+ } else {
891
+ const singleErrorPreText = (messageTechnicalDetails as FEMessageTechnicalDetails)?.fe?.singleErrorPreText;
892
+ if (singleErrorPreText) {
893
+ const messageHeader = (messageToShow as MessageWithHeader)?.["headerName"]
894
+ ? `${(messageToShow as MessageWithHeader)?.["headerName"]}:`
895
+ : "";
896
+ formattedTextString = `${formattedTextString}${singleErrorPreText}<br/><br/>${messageHeader} `;
897
+ }
826
898
  }
899
+
900
+ // Adding the main error message.
827
901
  if (messageToShow.getCode() !== "503" && messageToShow.getAdditionalText() !== undefined) {
828
902
  formattedTextString = `${
829
903
  formattedTextString + messageToShow.getAdditionalText()
830
- }: ${messageToShow.getMessage()}</html></body>`;
904
+ }: ${messageToShow.getMessage()}</body></html>`;
831
905
  } else {
832
- formattedTextString = `${formattedTextString + messageToShow.getMessage()}</html></body>`;
906
+ formattedTextString = `${formattedTextString + messageToShow.getMessage()}</body></html>`;
833
907
  }
834
908
  const formattedText = new FormattedText({
835
909
  htmlText: formattedTextString
836
910
  });
837
- MessageBox.error(formattedText as unknown as string, {
838
- onClose: function () {
839
- if (containsBoundTransition) {
840
- removeBoundTransitionMessages();
841
- }
842
- removeUnboundTransitionMessages();
843
- resolve(undefined);
844
- }
845
- });
911
+
912
+ const closeMessageBox = function (): void {
913
+ Messaging.removeMessages(messageToShow);
914
+ resolve(undefined);
915
+ };
916
+ showMessageBoxPerType(
917
+ formattedText as unknown as string,
918
+ {
919
+ onClose: closeMessageBox
920
+ },
921
+ messageToShow
922
+ );
846
923
  }
847
924
  });
848
925
  }
849
926
 
927
+ function showMessageBoxPerType(formattedText: string, close: { onClose: Function }, message: Message): void {
928
+ switch (message.getType()) {
929
+ case MessageType.Error:
930
+ MessageBox.error(formattedText, close);
931
+ break;
932
+ case MessageType.Warning:
933
+ MessageBox.warning(formattedText, close);
934
+ break;
935
+ case MessageType.Success:
936
+ MessageBox.success(formattedText, close);
937
+ break;
938
+ case MessageType.Information:
939
+ MessageBox.information(formattedText, close);
940
+ break;
941
+ default:
942
+ MessageBox.show(formattedText, close);
943
+ }
944
+ }
945
+
850
946
  function removeMessageShownInMessageStrip(transitionMessages: Message[], context: Context): Message[] {
851
947
  const boundContextMessages: Message[] = [];
852
948
  transitionMessages?.forEach((message: Message) => {
@@ -863,7 +959,6 @@ function removeMessageShownInMessageStrip(transitionMessages: Message[], context
863
959
  }
864
960
  /**
865
961
  * This function sets the group name for all messages in a dialog.
866
- *
867
962
  * @param aModelDataArray Messages array
868
963
  * @param control
869
964
  * @param sActionName
@@ -897,7 +992,6 @@ function updateMessageObjectGroupName(
897
992
 
898
993
  /**
899
994
  * This function will set the group name of Message Object for LR table.
900
- *
901
995
  * @param oElem
902
996
  * @param aModelData
903
997
  * @param sActionName
@@ -930,9 +1024,93 @@ function setGroupNameLRTable(oElem: Control | undefined, aModelData: MessageWith
930
1024
  }
931
1025
  }
932
1026
 
1027
+ function updateAddtionalTextForMessageInOPTable(
1028
+ mdcTable: MDCTable,
1029
+ message: MessageWithHeader,
1030
+ targetTableInfo: TargetTableInfoType
1031
+ ): void {
1032
+ const identifierColumn = (mdcTable.getParent() as TableAPI).getIdentifierColumn() as string;
1033
+ if (identifierColumn) {
1034
+ const allRowContexts = mdcTable.getRowBinding().getContexts();
1035
+ allRowContexts.forEach((rowContext: Context) => {
1036
+ if (message.target?.includes(rowContext.getPath())) {
1037
+ const rowIdentifier = identifierColumn ? rowContext.getObject()[identifierColumn] : undefined;
1038
+ const columnNameSuffix = targetTableInfo.sTableTargetColName ? `, ${targetTableInfo.sTableTargetColName}` : "";
1039
+ message["additionalText"] = `${rowIdentifier}${columnNameSuffix}`;
1040
+ }
1041
+ });
1042
+ } else {
1043
+ message["additionalText"] = `${targetTableInfo.sTableTargetColName}`;
1044
+ }
1045
+ }
1046
+
1047
+ function updateHeaderNameForMessageInOPTable(
1048
+ subsection: ObjectPageSubSection,
1049
+ mdcTable: MDCTable,
1050
+ message: MessageWithHeader,
1051
+ targetTableInfo: TargetTableInfoType
1052
+ ): void {
1053
+ let headerName = mdcTable.getHeaderVisible() && targetTableInfo.tableHeader;
1054
+ if (!headerName) {
1055
+ headerName = subsection.getTitle();
1056
+ } else {
1057
+ const oResourceBundle = Library.getResourceBundleFor("sap.fe.core")!;
1058
+ headerName = `${oResourceBundle.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${headerName}`;
1059
+ }
1060
+ message["headerName"] = headerName;
1061
+ }
1062
+
1063
+ /**
1064
+ * This function sets the group name of the message object on the object page in display mode.
1065
+ * @param subsection Subsection
1066
+ * @param mdcTable MDC table
1067
+ * @param message Message
1068
+ * @param viewContext View's binding context
1069
+ * @param groupNameIsGeneral Is present group name 'General'
1070
+ * @param actionName Action name
1071
+ * @returns If group name is 'General'
1072
+ */
1073
+ function setGroupNameOPTableDisplayMode(
1074
+ subsection: ObjectPageSubSection,
1075
+ mdcTable: MDCTable,
1076
+ message: MessageWithHeader,
1077
+ viewContext: Context | null | undefined,
1078
+ groupNameIsGeneral: boolean,
1079
+ actionName?: string
1080
+ ): boolean {
1081
+ const oRowBinding = mdcTable.getRowBinding(),
1082
+ setSectionNameInGroup = true;
1083
+ let childTableElement: UI5Element | undefined;
1084
+
1085
+ mdcTable.findElements(true).forEach((oElement) => {
1086
+ if (oElement.isA<Table>("sap.m.Table") || oElement.isA<UITable>("sap.ui.table.Table")) {
1087
+ childTableElement = oElement;
1088
+ }
1089
+ });
1090
+ if (oRowBinding) {
1091
+ const sElemeBindingPath = `${viewContext?.getPath()}/${mdcTable.getRowBinding()?.getPath()}`;
1092
+ if (message.target?.indexOf(sElemeBindingPath) === 0) {
1093
+ const obj = messageHandling.getTableColumnDataAndSetSubtile(
1094
+ message,
1095
+ mdcTable,
1096
+ childTableElement,
1097
+ oRowBinding,
1098
+ actionName,
1099
+ setSectionNameInGroup,
1100
+ fnCallbackSetGroupName
1101
+ );
1102
+ const { oTargetTableInfo } = obj;
1103
+
1104
+ messageHandling.updateAddtionalTextForMessageInOPTable(mdcTable, message, oTargetTableInfo);
1105
+ messageHandling.updateHeaderNameForMessageInOPTable(subsection, mdcTable, message, oTargetTableInfo);
1106
+ groupNameIsGeneral = false;
1107
+ }
1108
+ }
1109
+ return groupNameIsGeneral;
1110
+ }
1111
+
933
1112
  /**
934
1113
  * This function will set the group name of Message Object in OP Display mode.
935
- *
936
1114
  * @param aModelData Message Object
937
1115
  * @param sActionName Action name
938
1116
  * @param control
@@ -947,57 +1125,14 @@ function setGroupNameOPDisplayMode(aModelData: MessageWithHeader, sActionName: s
947
1125
  subSections.forEach(function (oSubSection: ObjectPageSubSection) {
948
1126
  oSubSection.findElements(true).forEach(function (oElem) {
949
1127
  if (oElem.isA<MDCTable>("sap.ui.mdc.Table")) {
950
- const oRowBinding = oElem.getRowBinding(),
951
- setSectionNameInGroup = true;
952
- let childTableElement: UI5Element | undefined;
953
-
954
- oElem.findElements(true).forEach((oElement) => {
955
- if (oElement.isA<Table>("sap.m.Table") || oElement.isA<UITable>("sap.ui.table.Table")) {
956
- childTableElement = oElement;
957
- }
958
- });
959
- if (oRowBinding) {
960
- const sElemeBindingPath = `${oViewContext?.getPath()}/${oElem.getRowBinding()?.getPath()}`;
961
- if (aModelData.target?.indexOf(sElemeBindingPath) === 0) {
962
- const obj = messageHandling.getTableColumnDataAndSetSubtile(
963
- aModelData,
964
- oElem,
965
- childTableElement,
966
- oRowBinding,
967
- sActionName,
968
- setSectionNameInGroup,
969
- fnCallbackSetGroupName
970
- );
971
- const { oTargetTableInfo } = obj;
972
-
973
- if (setSectionNameInGroup) {
974
- const identifierColumn = (oElem.getParent() as TableAPI).getIdentifierColumn() as string;
975
- if (identifierColumn) {
976
- const allRowContexts = oElem.getRowBinding().getContexts();
977
- allRowContexts.forEach((rowContext: Context) => {
978
- if (aModelData.target?.includes(rowContext.getPath())) {
979
- const rowIdentifier = identifierColumn
980
- ? rowContext.getObject()[identifierColumn]
981
- : undefined;
982
- aModelData["additionalText"] = `${rowIdentifier}, ${oTargetTableInfo.sTableTargetColName}`;
983
- }
984
- });
985
- } else {
986
- aModelData["additionalText"] = `${oTargetTableInfo.sTableTargetColName}`;
987
- }
988
-
989
- let headerName = oElem.getHeaderVisible() && oTargetTableInfo.tableHeader;
990
- if (!headerName) {
991
- headerName = oSubSection.getTitle();
992
- } else {
993
- const oResourceBundle = Library.getResourceBundleFor("sap.fe.core")!;
994
- headerName = `${oResourceBundle.getText("T_MESSAGE_GROUP_TITLE_TABLE_DENOMINATOR")}: ${headerName}`;
995
- }
996
- aModelData["headerName"] = headerName;
997
- bIsGeneralGroupName = false;
998
- }
999
- }
1000
- }
1128
+ bIsGeneralGroupName = setGroupNameOPTableDisplayMode(
1129
+ oSubSection,
1130
+ oElem,
1131
+ aModelData,
1132
+ oViewContext,
1133
+ bIsGeneralGroupName,
1134
+ sActionName
1135
+ );
1001
1136
  }
1002
1137
  });
1003
1138
  });
@@ -1023,23 +1158,23 @@ function getLastActionTextAndActionName(sActionName: string | undefined): string
1023
1158
  /**
1024
1159
  * This function will give rank based on Message Group/Header name, which will be used for Sorting messages in Message dialog
1025
1160
  * Last Action should be shown at top, next Row Id and last General.
1026
- *
1027
1161
  * @param obj
1028
1162
  * @returns Rank of message
1029
1163
  */
1030
1164
  function getMessageRank(obj: MessageWithHeader): number {
1031
- if (obj.headerName?.toString().includes("Last Action")) {
1165
+ if (obj.getCode() === "FE_CUSTOM_MESSAGE_CHANGESET_ALL_FAILED") {
1032
1166
  return 1;
1167
+ } else if (obj.headerName?.toString().includes("Last Action")) {
1168
+ return 2;
1033
1169
  } else if (obj.headerName?.toString().includes("General")) {
1034
- return 3;
1170
+ return 4;
1035
1171
  } else {
1036
- return 2;
1172
+ return 3;
1037
1173
  }
1038
1174
  }
1039
1175
 
1040
1176
  /**
1041
1177
  * This function will set the group name which can either General or Last Action.
1042
- *
1043
1178
  * @param aMessage
1044
1179
  * @param sActionName
1045
1180
  * @param bIsGeneralGroupName
@@ -1054,7 +1189,6 @@ const fnCallbackSetGroupName = (aMessage: MessageWithHeader, sActionName: string
1054
1189
 
1055
1190
  /**
1056
1191
  * This function will get the table row/column info and set subtitle.
1057
- *
1058
1192
  * @param aMessage
1059
1193
  * @param oTable
1060
1194
  * @param oElement
@@ -1110,185 +1244,131 @@ function getTableColumnDataAndSetSubtile(
1110
1244
 
1111
1245
  /**
1112
1246
  * This function will create the subtitle based on Table Row/Column data.
1113
- *
1114
1247
  * @param message
1115
- * @param oTableRowBindingContexts
1116
- * @param oTableRowContext
1117
- * @param sTableTargetColName
1118
- * @param oTable
1119
- * @param bIsCreationRow
1120
- * @param oTargetedControl
1248
+ * @param tableRowBindingContexts
1249
+ * @param tableRowContext
1250
+ * @param tableTargetColName
1251
+ * @param table
1252
+ * @param isCreationRow
1253
+ * @param targetedControl
1121
1254
  * @returns Message subtitle.
1122
1255
  */
1123
1256
  function getMessageSubtitle(
1124
1257
  message: MessageWithHeader,
1125
- oTableRowBindingContexts: Context[],
1126
- oTableRowContext: ODataV4Context | undefined,
1127
- sTableTargetColName: string | undefined,
1128
- oTable: MDCTable,
1129
- bIsCreationRow: boolean | undefined,
1130
- oTargetedControl?: Control
1258
+ tableRowBindingContexts: Context[],
1259
+ tableRowContext: ODataV4Context | undefined,
1260
+ tableTargetColName: string | undefined,
1261
+ table: MDCTable,
1262
+ isCreationRow: boolean | undefined,
1263
+ targetedControl?: Control
1131
1264
  ): string | null | undefined {
1132
- let sMessageSubtitle;
1133
- let sRowSubtitleValue;
1134
- const resourceModel = getResourceModel(oTable);
1135
- const sTableFirstColProperty = (oTable.getParent() as TableAPI).getIdentifierColumn() as string;
1136
- const oColFromTableSettings = messageHandling.fetchColumnInfo(message, oTable);
1137
- if (bIsCreationRow || oTableRowContext?.isInactive()) {
1138
- sMessageSubtitle = resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE", [
1265
+ let messageSubtitle;
1266
+ let rowSubtitleValue;
1267
+ const resourceModel = getResourceModel(table);
1268
+ const tableColProperty = (table.getParent() as TableAPI)?.getTableColumnVisibilityInfo();
1269
+ const colFromTableSettings = messageHandling.fetchColumnInfo(message, table);
1270
+ if (isCreationRow || tableRowContext?.isInactive()) {
1271
+ messageSubtitle = resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE", [
1139
1272
  resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE_CREATION_ROW_INDICATOR"),
1140
- sTableTargetColName ? sTableTargetColName : (oColFromTableSettings as AnnotationTableColumn).label
1273
+ tableTargetColName ? tableTargetColName : (colFromTableSettings as AnnotationTableColumn).label
1141
1274
  ]);
1142
1275
  } else {
1143
- const oTableFirstColBindingContextTextAnnotation = messageHandling.getTableFirstColBindingContextForTextAnnotation(
1144
- oTable,
1145
- oTableRowContext,
1146
- sTableFirstColProperty
1276
+ const tableColBindingContextTextAnnotation = messageHandling.getTableColBindingContextForTextAnnotation(
1277
+ table,
1278
+ tableRowContext,
1279
+ tableColProperty
1147
1280
  );
1148
- const sTableFirstColTextAnnotationPath = oTableFirstColBindingContextTextAnnotation
1149
- ? oTableFirstColBindingContextTextAnnotation.getObject("$Path")
1281
+ const tableColTextAnnotationPath = tableColBindingContextTextAnnotation
1282
+ ? tableColBindingContextTextAnnotation.getObject("$Path")
1150
1283
  : undefined;
1151
- const sTableFirstColTextArrangement =
1152
- sTableFirstColTextAnnotationPath && oTableFirstColBindingContextTextAnnotation
1153
- ? oTableFirstColBindingContextTextAnnotation.getObject("@com.sap.vocabularies.UI.v1.TextArrangement/$EnumMember")
1284
+ const tableColTextArrangement =
1285
+ tableColTextAnnotationPath && tableColBindingContextTextAnnotation
1286
+ ? tableColBindingContextTextAnnotation.getObject("@com.sap.vocabularies.UI.v1.TextArrangement/$EnumMember")
1154
1287
  : undefined;
1155
- if (oTableRowBindingContexts.length > 0) {
1288
+ if (tableRowBindingContexts.length > 0) {
1156
1289
  // set Row subtitle text
1157
- if (oTargetedControl) {
1290
+ if (targetedControl) {
1158
1291
  // The UI error is on the first column, we then get the control input as the row indicator:
1159
- sRowSubtitleValue = (oTargetedControl as FieldAPI).getValue();
1160
- } else if (oTableRowContext && sTableFirstColProperty) {
1161
- sRowSubtitleValue = messageHandling.getTableFirstColValue(
1162
- sTableFirstColProperty,
1163
- oTableRowContext,
1164
- sTableFirstColTextAnnotationPath,
1165
- sTableFirstColTextArrangement
1292
+ rowSubtitleValue = (targetedControl as FieldAPI).getValue();
1293
+ } else if (tableRowContext && tableColProperty && tableColProperty.length === 1) {
1294
+ // Getting the column label and its value of a single row
1295
+ rowSubtitleValue = (table.getParent() as TableAPI)?.getTableColValue(
1296
+ tableRowContext,
1297
+ tableColTextAnnotationPath,
1298
+ tableColTextArrangement,
1299
+ tableColProperty
1166
1300
  );
1301
+ } else if (tableRowContext && tableColProperty && tableColProperty.length > 1) {
1302
+ // If there are multiple rows, the subtitle is displayed as ‘See message details’
1303
+ rowSubtitleValue = resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE_DETAILED_ROW_INFO");
1167
1304
  } else {
1168
- sRowSubtitleValue = undefined;
1305
+ rowSubtitleValue = undefined;
1169
1306
  }
1170
1307
  // set the message subtitle
1171
- const oColumnInfo: ColumnInfoType = messageHandling.determineColumnInfo(oColFromTableSettings, resourceModel);
1172
- if (sRowSubtitleValue && sTableTargetColName) {
1173
- sMessageSubtitle = resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE", [sRowSubtitleValue, sTableTargetColName]);
1174
- } else if (sRowSubtitleValue && oColumnInfo.sColumnIndicator === "Hidden") {
1175
- sMessageSubtitle = `${resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [
1176
- sRowSubtitleValue
1177
- ])}, ${oColumnInfo.sColumnValue}`;
1178
- } else if (sRowSubtitleValue && oColumnInfo.sColumnIndicator === "Unknown") {
1179
- sMessageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [sRowSubtitleValue]);
1180
- } else if (sRowSubtitleValue && oColumnInfo.sColumnIndicator === "undefined") {
1181
- sMessageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [sRowSubtitleValue]);
1182
- } else if (!sRowSubtitleValue && sTableTargetColName) {
1183
- sMessageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN") + ": " + sTableTargetColName;
1184
- } else if (!sRowSubtitleValue && oColumnInfo.sColumnIndicator === "Hidden") {
1185
- sMessageSubtitle = oColumnInfo.sColumnValue;
1308
+ const oColumnInfo: ColumnInfoType = messageHandling.determineColumnInfo(colFromTableSettings, resourceModel);
1309
+ if (rowSubtitleValue && tableTargetColName) {
1310
+ messageSubtitle = resourceModel.getText("T_MESSAGE_ITEM_SUBTITLE", [rowSubtitleValue, tableTargetColName]);
1311
+ } else if (rowSubtitleValue && oColumnInfo.sColumnIndicator === "Hidden") {
1312
+ messageSubtitle = `${resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [rowSubtitleValue])}, ${
1313
+ oColumnInfo.sColumnValue
1314
+ }`;
1315
+ } else if (rowSubtitleValue && oColumnInfo.sColumnIndicator === "Unknown") {
1316
+ messageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [rowSubtitleValue]);
1317
+ } else if (rowSubtitleValue && oColumnInfo.sColumnIndicator === "undefined") {
1318
+ messageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_ROW_WITH_IDENTIFIER", [rowSubtitleValue]);
1319
+ } else if (!rowSubtitleValue && tableTargetColName) {
1320
+ messageSubtitle = resourceModel.getText("T_MESSAGE_GROUP_DESCRIPTION_TABLE_COLUMN") + ": " + tableTargetColName;
1321
+ } else if (!rowSubtitleValue && oColumnInfo.sColumnIndicator === "Hidden") {
1322
+ messageSubtitle = oColumnInfo.sColumnValue;
1186
1323
  } else {
1187
- sMessageSubtitle = null;
1324
+ messageSubtitle = null;
1188
1325
  }
1189
1326
  } else {
1190
- sMessageSubtitle = null;
1327
+ messageSubtitle = null;
1191
1328
  }
1192
1329
  }
1193
-
1194
- return sMessageSubtitle;
1330
+ return messageSubtitle;
1195
1331
  }
1196
1332
 
1197
1333
  /**
1198
- * This function will get the first column for text Annotation, this is needed to set subtitle of Message.
1199
- *
1200
- * @param oTable
1201
- * @param oTableRowContext
1202
- * @param sTableFirstColProperty
1334
+ * This function gets the first column for text Annotation, this is needed to set subtitle of Message.
1335
+ * @param table
1336
+ * @param tableRowContext
1337
+ * @param tableColProperty
1203
1338
  * @returns Binding context.
1204
1339
  */
1205
- function getTableFirstColBindingContextForTextAnnotation(
1206
- oTable: MDCTable,
1207
- oTableRowContext: ODataV4Context | undefined,
1208
- sTableFirstColProperty: string
1340
+ function getTableColBindingContextForTextAnnotation(
1341
+ table: MDCTable,
1342
+ tableRowContext: ODataV4Context | undefined,
1343
+ tableColProperty: TableColumnProperties
1209
1344
  ): Context | null | undefined {
1210
- let oBindingContext;
1211
- if (oTableRowContext && sTableFirstColProperty) {
1212
- const oModel = oTable?.getModel();
1345
+ let bindingContext;
1346
+ if (tableRowContext && tableColProperty && tableColProperty.length === 1) {
1347
+ const { key } = tableColProperty[0];
1348
+ const oModel = table?.getModel();
1213
1349
  const oMetaModel = oModel?.getMetaModel() as ODataMetaModel | undefined; // must be an ODataMetaModel to match the type of the table row context
1214
- const sMetaPath = oMetaModel?.getMetaPath(oTableRowContext.getPath());
1215
- if (oMetaModel?.getObject(`${sMetaPath}/${sTableFirstColProperty}@com.sap.vocabularies.Common.v1.Text/$Path`)) {
1216
- oBindingContext = oMetaModel.createBindingContext(`${sMetaPath}/${sTableFirstColProperty}@com.sap.vocabularies.Common.v1.Text`);
1350
+ const sMetaPath = oMetaModel?.getMetaPath(tableRowContext.getPath());
1351
+ if (oMetaModel?.getObject(`${sMetaPath}/${key}@com.sap.vocabularies.Common.v1.Text/$Path`)) {
1352
+ bindingContext = oMetaModel.createBindingContext(`${sMetaPath}/${key}@com.sap.vocabularies.Common.v1.Text`);
1217
1353
  }
1218
1354
  }
1219
- return oBindingContext;
1220
- }
1221
-
1222
- /**
1223
- * This function will get the value of first Column of Table, with its text Arrangement.
1224
- *
1225
- * @param sTableFirstColProperty
1226
- * @param oTableRowContext
1227
- * @param sTextAnnotationPath
1228
- * @param sTextArrangement
1229
- * @returns Column Value.
1230
- */
1231
- function getTableFirstColValue(
1232
- sTableFirstColProperty: string,
1233
- oTableRowContext: Context,
1234
- sTextAnnotationPath: string,
1235
- sTextArrangement: string
1236
- ): string {
1237
- const sCodeValue = oTableRowContext.getObject(sTableFirstColProperty);
1238
- let sTextValue;
1239
- let sComputedValue = sCodeValue;
1240
- if (sTextAnnotationPath) {
1241
- if (sTableFirstColProperty.lastIndexOf("/") > 0) {
1242
- // the target property is replaced with the text annotation path
1243
- sTableFirstColProperty = sTableFirstColProperty.slice(0, sTableFirstColProperty.lastIndexOf("/") + 1);
1244
- sTableFirstColProperty = sTableFirstColProperty.concat(sTextAnnotationPath);
1245
- } else {
1246
- sTableFirstColProperty = sTextAnnotationPath;
1247
- }
1248
- sTextValue = oTableRowContext.getObject(sTableFirstColProperty);
1249
- if (sTextValue) {
1250
- if (sTextArrangement) {
1251
- const sEnumNumber = sTextArrangement.slice(sTextArrangement.indexOf("/") + 1);
1252
- switch (sEnumNumber) {
1253
- case "TextOnly":
1254
- sComputedValue = sTextValue;
1255
- break;
1256
- case "TextFirst":
1257
- sComputedValue = `${sTextValue} (${sCodeValue})`;
1258
- break;
1259
- case "TextLast":
1260
- sComputedValue = `${sCodeValue} (${sTextValue})`;
1261
- break;
1262
- case "TextSeparate":
1263
- sComputedValue = sCodeValue;
1264
- break;
1265
- default:
1266
- }
1267
- } else {
1268
- sComputedValue = `${sTextValue} (${sCodeValue})`;
1269
- }
1270
- }
1271
- }
1272
- return sComputedValue;
1355
+ return bindingContext;
1273
1356
  }
1274
1357
 
1275
1358
  /**
1276
1359
  * The method that is called to retrieve the column info from the associated message of the message popover.
1277
- *
1278
1360
  * @param oMessage Message object
1279
1361
  * @param oTable MdcTable
1280
1362
  * @returns Returns the column info.
1281
1363
  */
1364
+
1282
1365
  function fetchColumnInfo(oMessage: MessageWithHeader, oTable: MDCTable): TableColumn | undefined {
1283
1366
  const sColNameFromMessageObj = oMessage?.getTargets()[0].split("/").pop();
1284
- return (oTable.getParent() as TableAPI).getTableDefinition().columns.find(function (oColumn): boolean {
1285
- return oColumn.key.split("::").pop() === sColNameFromMessageObj;
1286
- });
1367
+ return (oTable.getParent() as TableAPI)?.getKeyColumnInfo(sColNameFromMessageObj);
1287
1368
  }
1288
1369
 
1289
1370
  /**
1290
- * This function get the Column data depending on its availability in Table, this is needed for setting subtitle of Message.
1291
- *
1371
+ * This function gets the Column data depending on its availability in Table, this is needed for setting subtitle of Message.
1292
1372
  * @param oColFromTableSettings
1293
1373
  * @param resourceModel
1294
1374
  * @returns Column data.
@@ -1315,7 +1395,6 @@ function determineColumnInfo(oColFromTableSettings: TableColumn | undefined, res
1315
1395
 
1316
1396
  /**
1317
1397
  * This function check if a given control id is a part of Table.
1318
- *
1319
1398
  * @param oTable
1320
1399
  * @param sControlId
1321
1400
  * @returns True if control is part of table.
@@ -1386,7 +1465,6 @@ function getMessagesFromMessageModel(oMessageModel: MessageModel, sPathToBeRemov
1386
1465
 
1387
1466
  /**
1388
1467
  * Get relevant messages.
1389
- *
1390
1468
  * @param bBoundMessages To get only bound messages
1391
1469
  * @param bTransitionOnly To get only transition messages
1392
1470
  * @param sPathToBeRemoved Filter out bound messages with path
@@ -1457,7 +1535,6 @@ function setMessageSubtitle(oTable: MDCTable, aContexts: Context[], message: Mes
1457
1535
 
1458
1536
  /**
1459
1537
  * The method retrieves the visible sections from an object page.
1460
- *
1461
1538
  * @param oObjectPageLayout The objectPageLayout object for which we want to retrieve the visible sections.
1462
1539
  * @returns Array of visible sections.
1463
1540
  */
@@ -1469,7 +1546,6 @@ function getVisibleSectionsFromObjectPageLayout(oObjectPageLayout: Control | Obj
1469
1546
 
1470
1547
  /**
1471
1548
  * This function checks if control ids from message are a part of a given subsection.
1472
- *
1473
1549
  * @param subSection
1474
1550
  * @param oMessageObject
1475
1551
  * @returns SubSection matching control ids.
@@ -1505,7 +1581,6 @@ function getTableColProperty(oTable: Control, oMessageObject: MessageWithHeader,
1505
1581
 
1506
1582
  /**
1507
1583
  * This function gives the column information if it matches with the property name from target of message.
1508
- *
1509
1584
  * @param oTable
1510
1585
  * @param sTableTargetColProperty
1511
1586
  * @returns Column name and property.
@@ -1571,7 +1646,6 @@ function getTableColInfo(
1571
1646
 
1572
1647
  /**
1573
1648
  * This function gives Table and column info if any of it matches the target from Message.
1574
- *
1575
1649
  * @param oTable
1576
1650
  * @param oMessageObject
1577
1651
  * @param oElement
@@ -1617,7 +1691,6 @@ function fnFilterUponIds(aControlIds: string[], oItem: UI5Element): boolean {
1617
1691
 
1618
1692
  /**
1619
1693
  * This function gives the group name having section and subsection data.
1620
- *
1621
1694
  * @param section
1622
1695
  * @param subSection
1623
1696
  * @param bMultipleSubSections
@@ -1651,9 +1724,96 @@ function bIsOrphanElement(oElement: UI5Element, aElements: UI5Element[]): boolea
1651
1724
  });
1652
1725
  }
1653
1726
 
1727
+ /**
1728
+ * This function filters and gives back the messages based on the context passed.
1729
+ * @param context
1730
+ * @returns Messages.
1731
+ */
1732
+ function getMessagesForContext(context: Context): Message[] {
1733
+ const oMessageModel = Messaging.getMessageModel();
1734
+ const listBinding = oMessageModel.bindList("/");
1735
+ listBinding.filter(
1736
+ new Filter({
1737
+ path: "",
1738
+ test: (message: Message) => message.getTargets().length > 0 && message.getTargets()[0].startsWith(context.getPath())
1739
+ })
1740
+ );
1741
+ const currentContexts = listBinding.getCurrentContexts();
1742
+ return currentContexts.map((currentContext) => currentContext.getObject());
1743
+ }
1744
+
1745
+ /**
1746
+ * This function returns the boolean to check if the target is present in the dialog based on the control Ids.
1747
+ * @param controlIds Array of control Ids
1748
+ * @returns Boolean value based on the target present in the dialog.
1749
+ */
1750
+ function isMessageOutOfParameterDialog(controlIds: string[]): boolean {
1751
+ let oControl: ManagedObject | null | undefined, errorFieldControl;
1752
+ const index = Infinity;
1753
+ if (controlIds.length === 1) {
1754
+ oControl = UI5Element.getElementById(controlIds[0]);
1755
+ errorFieldControl = UI5Element.getElementById(controlIds[0]) as UI5Element;
1756
+ } else {
1757
+ let errorControlId;
1758
+ controlIds.forEach((controlId) => {
1759
+ const control = UI5Element.getElementById(controlId);
1760
+ if (control?.isA("sap.ui.mdc.Field")) {
1761
+ errorControlId = controlId;
1762
+ oControl = UI5Element.getElementById(errorControlId);
1763
+ }
1764
+ });
1765
+ }
1766
+ while (oControl) {
1767
+ const fieldRankinDialog = Infinity;
1768
+ if (oControl instanceof Dialog) {
1769
+ if (index > fieldRankinDialog) {
1770
+ // Set the focus to the dialog's control
1771
+ errorFieldControl?.focus();
1772
+ }
1773
+ // messages with target inside sap.m.Dialog should not bring up the message dialog
1774
+ return false;
1775
+ }
1776
+ oControl = oControl.getParent();
1777
+ }
1778
+ return true;
1779
+ }
1780
+
1781
+ /**
1782
+ * This method is responsible for removing messages related to the context from the message model when there is error on the dialog and when the dialog is open.
1783
+ * @param messages Array of messages
1784
+ * @param contexts Contexts array
1785
+ */
1786
+ function removeContextMessagesfromModel(messages?: Message[], contexts?: Context[]): void {
1787
+ const boundContextMessages: Message[] = [];
1788
+ if (contexts?.length === 1) {
1789
+ messages?.forEach((message: Message) => {
1790
+ if (
1791
+ message.getTargets().length === 1 &&
1792
+ message.getTargets()[0] === contexts?.[0]?.getPath() &&
1793
+ message.getPersistent() === true
1794
+ ) {
1795
+ boundContextMessages.push(message);
1796
+ }
1797
+ });
1798
+ }
1799
+ if (boundContextMessages.length > 0) {
1800
+ Messaging.removeMessages(boundContextMessages);
1801
+ }
1802
+ }
1803
+
1804
+ /**
1805
+ * This method is responsible for removing messages related to the action parameter dialog from showing the messages.
1806
+ * @param messages Array of messages
1807
+ * @returns Array of messages after removing the messages related to the action parameter dialog.
1808
+ */
1809
+ function removeMessagesForActionParameterDialog(messages: Message[]): Message[] {
1810
+ const messagesToBeRemoved = messages?.filter((message: Message) => message.getPersistent() === true && message.getTargets()[0] !== "");
1811
+ messages = messages?.filter((message: Message) => !messagesToBeRemoved?.includes(message));
1812
+ return messages;
1813
+ }
1814
+
1654
1815
  /**
1655
1816
  * Static functions for Fiori Message Handling
1656
- *
1657
1817
  * @namespace
1658
1818
  * @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
1659
1819
  * @since 1.56.0
@@ -1680,11 +1840,10 @@ const messageHandling: messageHandlingType = {
1680
1840
  getMessageSubtitle: getMessageSubtitle,
1681
1841
  determineColumnInfo: determineColumnInfo,
1682
1842
  fetchColumnInfo: fetchColumnInfo,
1683
- getTableFirstColBindingContextForTextAnnotation: getTableFirstColBindingContextForTextAnnotation,
1843
+ getTableColBindingContextForTextAnnotation: getTableColBindingContextForTextAnnotation,
1684
1844
  getMessageRank: getMessageRank,
1685
1845
  hasTransitionErrorsOrWarnings: hasTransitionErrorsOrWarnings,
1686
1846
  fnCallbackSetGroupName: fnCallbackSetGroupName,
1687
- getTableFirstColValue: getTableFirstColValue,
1688
1847
  setGroupNameOPDisplayMode: setGroupNameOPDisplayMode,
1689
1848
  updateMessageObjectGroupName: updateMessageObjectGroupName,
1690
1849
  setGroupNameLRTable: setGroupNameLRTable,
@@ -1695,7 +1854,14 @@ const messageHandling: messageHandlingType = {
1695
1854
  showMessagesInUI: showMessagesInUI,
1696
1855
  showMessageDialogControl: showMessageDialogControl,
1697
1856
  showMessageToast: showMessageToast,
1698
- showMessageBoxControl: showMessageBoxControl
1857
+ showMessageBoxControl: showMessageBoxControl,
1858
+ getMessagesForContext: getMessagesForContext,
1859
+ isMessageOutOfParameterDialog: isMessageOutOfParameterDialog,
1860
+ removeContextMessagesfromModel: removeContextMessagesfromModel,
1861
+ removeMessagesForActionParameterDialog: removeMessagesForActionParameterDialog,
1862
+ setGroupNameOPTableDisplayMode: setGroupNameOPTableDisplayMode,
1863
+ updateAddtionalTextForMessageInOPTable: updateAddtionalTextForMessageInOPTable,
1864
+ updateHeaderNameForMessageInOPTable: updateHeaderNameForMessageInOPTable
1699
1865
  };
1700
1866
 
1701
1867
  export default messageHandling;