@sapui5/sap.fe.core 1.111.1 → 1.112.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 (524) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/ActionRuntime-dbg.js +4 -4
  4. package/src/sap/fe/core/ActionRuntime.js +1 -1
  5. package/src/sap/fe/core/ActionRuntime.js.map +1 -1
  6. package/src/sap/fe/core/ActionRuntime.ts +11 -11
  7. package/src/sap/fe/core/AppComponent-dbg.js +27 -5
  8. package/src/sap/fe/core/AppComponent.js +1 -1
  9. package/src/sap/fe/core/AppComponent.js.map +1 -1
  10. package/src/sap/fe/core/AppComponent.ts +58 -3
  11. package/src/sap/fe/core/AppStateHandler-dbg.js +5 -2
  12. package/src/sap/fe/core/AppStateHandler.js +1 -1
  13. package/src/sap/fe/core/AppStateHandler.js.map +1 -1
  14. package/src/sap/fe/core/AppStateHandler.ts +10 -1
  15. package/src/sap/fe/core/BaseController-dbg.js +1 -1
  16. package/src/sap/fe/core/BaseController.ts +2 -1
  17. package/src/sap/fe/core/CommonUtils-dbg.js +152 -365
  18. package/src/sap/fe/core/CommonUtils.js +1 -1
  19. package/src/sap/fe/core/CommonUtils.js.map +1 -1
  20. package/src/sap/fe/core/CommonUtils.ts +201 -478
  21. package/src/sap/fe/core/ExtensionAPI-dbg.js +2 -1
  22. package/src/sap/fe/core/ExtensionAPI.js +1 -1
  23. package/src/sap/fe/core/ExtensionAPI.js.map +1 -1
  24. package/src/sap/fe/core/ExtensionAPI.ts +9 -1
  25. package/src/sap/fe/core/PageController-dbg.js +26 -31
  26. package/src/sap/fe/core/PageController.js +1 -1
  27. package/src/sap/fe/core/PageController.js.map +1 -1
  28. package/src/sap/fe/core/PageController.ts +17 -3
  29. package/src/sap/fe/core/ResourceModel-dbg.js +71 -0
  30. package/src/sap/fe/core/ResourceModel.js +6 -0
  31. package/src/sap/fe/core/ResourceModel.js.map +1 -0
  32. package/src/sap/fe/core/ResourceModel.ts +67 -0
  33. package/src/sap/fe/core/TemplateComponent-dbg.js +1 -1
  34. package/src/sap/fe/core/TemplateComponent.ts +1 -0
  35. package/src/sap/fe/core/TemplateModel-dbg.js +1 -1
  36. package/src/sap/fe/core/TemplateModel.ts +6 -1
  37. package/src/sap/fe/core/buildingBlocks/AttributeModel-dbg.js +5 -7
  38. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
  39. package/src/sap/fe/core/buildingBlocks/AttributeModel.js.map +1 -1
  40. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +6 -5
  41. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase-dbg.js +163 -0
  42. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +6 -0
  43. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js.map +1 -0
  44. package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +169 -0
  45. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport-dbg.js +88 -0
  46. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js +6 -0
  47. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js.map +1 -0
  48. package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.ts +147 -0
  49. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor-dbg.js +905 -0
  50. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js +21 -0
  51. package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js.map +1 -0
  52. package/src/sap/fe/core/buildingBlocks/{BuildingBlockRuntime.ts → BuildingBlockTemplateProcessor.ts} +290 -362
  53. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock-dbg.js +79 -0
  54. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js +15 -0
  55. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js.map +1 -0
  56. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.ts +68 -0
  57. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment-dbg.js +162 -0
  58. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js +6 -0
  59. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js.map +1 -0
  60. package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.ts +181 -0
  61. package/src/sap/fe/core/buildingBlocks/TraceInfo-dbg.js +4 -2
  62. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +1 -1
  63. package/src/sap/fe/core/buildingBlocks/TraceInfo.js.map +1 -1
  64. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +5 -3
  65. package/src/sap/fe/core/controllerextensions/EditFlow-dbg.js +890 -220
  66. package/src/sap/fe/core/controllerextensions/EditFlow.js +1 -1
  67. package/src/sap/fe/core/controllerextensions/EditFlow.js.map +1 -1
  68. package/src/sap/fe/core/controllerextensions/EditFlow.ts +974 -239
  69. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation-dbg.js +24 -34
  70. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +1 -1
  71. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js.map +1 -1
  72. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +71 -61
  73. package/src/sap/fe/core/controllerextensions/InternalRouting-dbg.js +14 -17
  74. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1 -1
  75. package/src/sap/fe/core/controllerextensions/InternalRouting.js.map +1 -1
  76. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +23 -17
  77. package/src/sap/fe/core/controllerextensions/KPIManagement-dbg.js +1 -1
  78. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -0
  79. package/src/sap/fe/core/controllerextensions/MassEdit-dbg.js +3 -3
  80. package/src/sap/fe/core/controllerextensions/MassEdit.js +1 -1
  81. package/src/sap/fe/core/controllerextensions/MassEdit.js.map +1 -1
  82. package/src/sap/fe/core/controllerextensions/MassEdit.ts +2 -2
  83. package/src/sap/fe/core/controllerextensions/MessageHandler-dbg.js +2 -1
  84. package/src/sap/fe/core/controllerextensions/MessageHandler.js.map +1 -1
  85. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +2 -0
  86. package/src/sap/fe/core/controllerextensions/PageReady-dbg.js +1 -1
  87. package/src/sap/fe/core/controllerextensions/PageReady.ts +24 -0
  88. package/src/sap/fe/core/controllerextensions/Paginator-dbg.js +2 -1
  89. package/src/sap/fe/core/controllerextensions/Paginator.js.map +1 -1
  90. package/src/sap/fe/core/controllerextensions/Paginator.ts +7 -0
  91. package/src/sap/fe/core/controllerextensions/Placeholder-dbg.js +1 -1
  92. package/src/sap/fe/core/controllerextensions/Placeholder.ts +8 -0
  93. package/src/sap/fe/core/controllerextensions/Share-dbg.js +8 -1
  94. package/src/sap/fe/core/controllerextensions/Share.js.map +1 -1
  95. package/src/sap/fe/core/controllerextensions/Share.ts +11 -0
  96. package/src/sap/fe/core/controllerextensions/SideEffects-dbg.js +14 -13
  97. package/src/sap/fe/core/controllerextensions/SideEffects.js +1 -1
  98. package/src/sap/fe/core/controllerextensions/SideEffects.js.map +1 -1
  99. package/src/sap/fe/core/controllerextensions/SideEffects.ts +27 -27
  100. package/src/sap/fe/core/controllerextensions/ViewState-dbg.js +17 -8
  101. package/src/sap/fe/core/controllerextensions/ViewState.js +1 -1
  102. package/src/sap/fe/core/controllerextensions/ViewState.js.map +1 -1
  103. package/src/sap/fe/core/controllerextensions/ViewState.ts +35 -14
  104. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase-dbg.js +6 -5
  105. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -1
  106. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js.map +1 -1
  107. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +7 -4
  108. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync-dbg.js +285 -82
  109. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +1 -1
  110. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js.map +1 -1
  111. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +326 -89
  112. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon-dbg.js +23 -2
  113. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +1 -1
  114. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js.map +1 -1
  115. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +32 -3
  116. package/src/sap/fe/core/controllerextensions/collaboration/Manage-dbg.js +1 -1
  117. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js.map +1 -1
  118. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +2 -3
  119. package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +17 -3
  120. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block-dbg.js +65 -34
  121. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +1 -1
  122. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js.map +1 -1
  123. package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +33 -18
  124. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper-dbg.js +45 -31
  125. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1 -1
  126. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js.map +1 -1
  127. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +52 -42
  128. package/src/sap/fe/core/controllerextensions/editFlow/draft-dbg.js +44 -49
  129. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -1
  130. package/src/sap/fe/core/controllerextensions/editFlow/draft.js.map +1 -1
  131. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +43 -63
  132. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js.map +1 -1
  133. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal-dbg.js +77 -0
  134. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js +6 -0
  135. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js.map +1 -0
  136. package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.ts +114 -0
  137. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade-dbg.js +1505 -0
  138. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +6 -0
  139. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js.map +1 -0
  140. package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +1985 -0
  141. package/src/sap/fe/core/controllerextensions/editFlow/operations-dbg.js +3 -1415
  142. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
  143. package/src/sap/fe/core/controllerextensions/editFlow/operations.js.map +1 -1
  144. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +2 -1921
  145. package/src/sap/fe/core/controllerextensions/editFlow/sticky-dbg.js +10 -11
  146. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -1
  147. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js.map +1 -1
  148. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +9 -13
  149. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling-dbg.js +43 -41
  150. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +1 -1
  151. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js.map +1 -1
  152. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +44 -47
  153. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher-dbg.js +12 -1
  154. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js.map +1 -1
  155. package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +19 -0
  156. package/src/sap/fe/core/controllerextensions/routing/RouterProxy-dbg.js +12 -13
  157. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +1 -1
  158. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js.map +1 -1
  159. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +32 -13
  160. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -1
  161. package/src/sap/fe/core/controls/CommandExecution-dbg.js +16 -5
  162. package/src/sap/fe/core/controls/CommandExecution.js +1 -1
  163. package/src/sap/fe/core/controls/CommandExecution.js.map +1 -1
  164. package/src/sap/fe/core/controls/CommandExecution.ts +15 -3
  165. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler-dbg.js +3 -2
  166. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
  167. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js.map +1 -1
  168. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +4 -1
  169. package/src/sap/fe/core/controls/FilterBar-dbg.js +1 -1
  170. package/src/sap/fe/core/controls/FilterBar.ts +5 -0
  171. package/src/sap/fe/core/controls/FormElementWrapper-dbg.js +1 -1
  172. package/src/sap/fe/core/controls/FormElementWrapper.ts +3 -0
  173. package/src/sap/fe/core/controls/filterbar/FilterContainer-dbg.js +1 -1
  174. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +7 -0
  175. package/src/sap/fe/core/controls/filterbar/VisualFilter-dbg.js +1 -1
  176. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +4 -0
  177. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer-dbg.js +1 -1
  178. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +10 -0
  179. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils-dbg.js +4 -3
  180. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
  181. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js.map +1 -1
  182. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +3 -2
  183. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +0 -1
  184. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +2 -0
  185. package/src/sap/fe/core/controls/massEdit/MassEditHandlers-dbg.js +6 -1
  186. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +1 -1
  187. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js.map +1 -1
  188. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +5 -0
  189. package/src/sap/fe/core/converters/ConverterContext-dbg.js +1 -1
  190. package/src/sap/fe/core/converters/ConverterContext.ts +2 -1
  191. package/src/sap/fe/core/converters/ManifestSettings-dbg.js +1 -8
  192. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  193. package/src/sap/fe/core/converters/ManifestSettings.js.map +1 -1
  194. package/src/sap/fe/core/converters/ManifestSettings.ts +15 -6
  195. package/src/sap/fe/core/converters/ManifestWrapper-dbg.js +17 -1
  196. package/src/sap/fe/core/converters/ManifestWrapper.js +1 -1
  197. package/src/sap/fe/core/converters/ManifestWrapper.js.map +1 -1
  198. package/src/sap/fe/core/converters/ManifestWrapper.ts +16 -0
  199. package/src/sap/fe/core/converters/MetaModelConverter-dbg.js +61 -49
  200. package/src/sap/fe/core/converters/MetaModelConverter.js +1 -1
  201. package/src/sap/fe/core/converters/MetaModelConverter.js.map +1 -1
  202. package/src/sap/fe/core/converters/MetaModelConverter.ts +65 -51
  203. package/src/sap/fe/core/converters/TemplateConverter-dbg.js +2 -1
  204. package/src/sap/fe/core/converters/TemplateConverter.js.map +1 -1
  205. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
  206. package/src/sap/fe/core/converters/annotations/DataField-dbg.js +65 -16
  207. package/src/sap/fe/core/converters/annotations/DataField.js +1 -1
  208. package/src/sap/fe/core/converters/annotations/DataField.js.map +1 -1
  209. package/src/sap/fe/core/converters/annotations/DataField.ts +62 -18
  210. package/src/sap/fe/core/converters/common/AnnotationConverter-dbg.js +1010 -957
  211. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1 -1
  212. package/src/sap/fe/core/converters/common/AnnotationConverter.js.map +1 -1
  213. package/src/sap/fe/core/converters/controls/Common/Action-dbg.js +8 -8
  214. package/src/sap/fe/core/converters/controls/Common/Action.js +1 -1
  215. package/src/sap/fe/core/converters/controls/Common/Action.js.map +1 -1
  216. package/src/sap/fe/core/converters/controls/Common/Action.ts +28 -26
  217. package/src/sap/fe/core/converters/controls/Common/Chart-dbg.js +95 -33
  218. package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -1
  219. package/src/sap/fe/core/converters/controls/Common/Chart.js.map +1 -1
  220. package/src/sap/fe/core/converters/controls/Common/Chart.ts +133 -49
  221. package/src/sap/fe/core/converters/controls/Common/DataVisualization-dbg.js +99 -62
  222. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -1
  223. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js.map +1 -1
  224. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +140 -75
  225. package/src/sap/fe/core/converters/controls/Common/Form-dbg.js +1 -1
  226. package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -3
  227. package/src/sap/fe/core/converters/controls/Common/KPI-dbg.js +6 -6
  228. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  229. package/src/sap/fe/core/converters/controls/Common/KPI.js.map +1 -1
  230. package/src/sap/fe/core/converters/controls/Common/KPI.ts +15 -15
  231. package/src/sap/fe/core/converters/controls/Common/Table-dbg.js +97 -69
  232. package/src/sap/fe/core/converters/controls/Common/Table.js +1 -1
  233. package/src/sap/fe/core/converters/controls/Common/Table.js.map +1 -1
  234. package/src/sap/fe/core/converters/controls/Common/Table.ts +161 -137
  235. package/src/sap/fe/core/converters/controls/Common/table/StandardActions-dbg.js +3 -3
  236. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +1 -1
  237. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js.map +1 -1
  238. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +10 -9
  239. package/src/sap/fe/core/converters/controls/ListReport/FilterBar-dbg.js +48 -44
  240. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +1 -1
  241. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js.map +1 -1
  242. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +130 -86
  243. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters-dbg.js +34 -26
  244. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -1
  245. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js.map +1 -1
  246. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +62 -45
  247. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar-dbg.js +1 -1
  248. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +1 -1
  249. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet-dbg.js +6 -6
  250. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +1 -1
  251. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js.map +1 -1
  252. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +5 -8
  253. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection-dbg.js +34 -13
  254. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -1
  255. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js.map +1 -1
  256. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +54 -20
  257. package/src/sap/fe/core/converters/helpers/Aggregation-dbg.js +3 -1
  258. package/src/sap/fe/core/converters/helpers/Aggregation.js.map +1 -1
  259. package/src/sap/fe/core/converters/helpers/Aggregation.ts +8 -0
  260. package/src/sap/fe/core/converters/helpers/ConfigurableObject-dbg.js +7 -6
  261. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
  262. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js.map +1 -1
  263. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +19 -10
  264. package/src/sap/fe/core/converters/helpers/DataFieldHelper-dbg.js +1 -1
  265. package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +7 -2
  266. package/src/sap/fe/core/converters/helpers/ID-dbg.js +1 -1
  267. package/src/sap/fe/core/converters/helpers/ID.ts +2 -1
  268. package/src/sap/fe/core/converters/helpers/IssueManager-dbg.js +9 -8
  269. package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
  270. package/src/sap/fe/core/converters/helpers/IssueManager.js.map +1 -1
  271. package/src/sap/fe/core/converters/helpers/IssueManager.ts +8 -7
  272. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction-dbg.js +8 -7
  273. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -1
  274. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js.map +1 -1
  275. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +9 -6
  276. package/src/sap/fe/core/converters/templates/ListReportConverter-dbg.js +25 -33
  277. package/src/sap/fe/core/converters/templates/ListReportConverter.js +1 -1
  278. package/src/sap/fe/core/converters/templates/ListReportConverter.js.map +1 -1
  279. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +35 -35
  280. package/src/sap/fe/core/converters/templates/ObjectPageConverter-dbg.js +11 -4
  281. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -1
  282. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js.map +1 -1
  283. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +7 -1
  284. package/src/sap/fe/core/formatters/FPMFormatter-dbg.js +1 -1
  285. package/src/sap/fe/core/formatters/FPMFormatter.ts +1 -1
  286. package/src/sap/fe/core/formatters/FiscalFormat-dbg.js +2 -2
  287. package/src/sap/fe/core/formatters/FiscalFormat.ts +6 -1
  288. package/src/sap/fe/core/formatters/TableFormatter-dbg.js +2 -2
  289. package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
  290. package/src/sap/fe/core/formatters/TableFormatter.js.map +1 -1
  291. package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
  292. package/src/sap/fe/core/formatters/ValueFormatter-dbg.js +5 -5
  293. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  294. package/src/sap/fe/core/formatters/ValueFormatter.js.map +1 -1
  295. package/src/sap/fe/core/formatters/ValueFormatter.ts +6 -4
  296. package/src/sap/fe/core/fpm/Component-dbg.js +1 -1
  297. package/src/sap/fe/core/fpm/Component.ts +1 -0
  298. package/src/sap/fe/core/fpm/manifest.json +1 -1
  299. package/src/sap/fe/core/helpers/AppStartupHelper-dbg.js +2 -2
  300. package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -1
  301. package/src/sap/fe/core/helpers/AppStartupHelper.js.map +1 -1
  302. package/src/sap/fe/core/helpers/AppStartupHelper.ts +1 -1
  303. package/src/sap/fe/core/helpers/BindingToolkit-dbg.js +6 -6
  304. package/src/sap/fe/core/helpers/BindingToolkit.js.map +1 -1
  305. package/src/sap/fe/core/helpers/BindingToolkit.ts +8 -8
  306. package/src/sap/fe/core/helpers/ClassSupport-dbg.js +1 -1
  307. package/src/sap/fe/core/helpers/ClassSupport.js.map +1 -1
  308. package/src/sap/fe/core/helpers/ClassSupport.ts +1 -0
  309. package/src/sap/fe/core/helpers/DeleteHelper-dbg.js +93 -62
  310. package/src/sap/fe/core/helpers/DeleteHelper.js +1 -1
  311. package/src/sap/fe/core/helpers/DeleteHelper.js.map +1 -1
  312. package/src/sap/fe/core/helpers/DeleteHelper.ts +140 -185
  313. package/src/sap/fe/core/helpers/MassEditHelper-dbg.js +20 -18
  314. package/src/sap/fe/core/helpers/MassEditHelper.js +1 -1
  315. package/src/sap/fe/core/helpers/MassEditHelper.js.map +1 -1
  316. package/src/sap/fe/core/helpers/MassEditHelper.ts +22 -23
  317. package/src/sap/fe/core/helpers/MessageStrip-dbg.js +4 -5
  318. package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
  319. package/src/sap/fe/core/helpers/MessageStrip.js.map +1 -1
  320. package/src/sap/fe/core/helpers/MessageStrip.ts +4 -4
  321. package/src/sap/fe/core/helpers/MetaModelFunction-dbg.js +354 -0
  322. package/src/sap/fe/core/helpers/MetaModelFunction.js +6 -0
  323. package/src/sap/fe/core/helpers/MetaModelFunction.js.map +1 -0
  324. package/src/sap/fe/core/helpers/MetaModelFunction.ts +408 -0
  325. package/src/sap/fe/core/helpers/ModelHelper-dbg.js +13 -13
  326. package/src/sap/fe/core/helpers/ModelHelper.js.map +1 -1
  327. package/src/sap/fe/core/helpers/ModelHelper.ts +13 -13
  328. package/src/sap/fe/core/helpers/PasteHelper-dbg.js +5 -5
  329. package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
  330. package/src/sap/fe/core/helpers/PasteHelper.js.map +1 -1
  331. package/src/sap/fe/core/helpers/PasteHelper.ts +6 -10
  332. package/src/sap/fe/core/helpers/ResourceModelHelper-dbg.js +26 -0
  333. package/src/sap/fe/core/helpers/ResourceModelHelper.js +6 -0
  334. package/src/sap/fe/core/helpers/ResourceModelHelper.js.map +1 -0
  335. package/src/sap/fe/core/helpers/ResourceModelHelper.ts +19 -0
  336. package/src/sap/fe/core/helpers/SemanticDateOperators-dbg.js +93 -18
  337. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  338. package/src/sap/fe/core/helpers/SemanticDateOperators.js.map +1 -1
  339. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +70 -17
  340. package/src/sap/fe/core/helpers/SemanticKeyHelper-dbg.js +2 -2
  341. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  342. package/src/sap/fe/core/helpers/SemanticKeyHelper.js.map +1 -1
  343. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
  344. package/src/sap/fe/core/helpers/Synchronization-dbg.js +1 -1
  345. package/src/sap/fe/core/helpers/Synchronization.ts +2 -0
  346. package/src/sap/fe/core/helpers/TypeGuards-dbg.js +5 -1
  347. package/src/sap/fe/core/helpers/TypeGuards.js +1 -1
  348. package/src/sap/fe/core/helpers/TypeGuards.js.map +1 -1
  349. package/src/sap/fe/core/helpers/TypeGuards.ts +12 -1
  350. package/src/sap/fe/core/jsx-runtime/ViewLoader-dbg.js +2 -1
  351. package/src/sap/fe/core/jsx-runtime/ViewLoader.js.map +1 -1
  352. package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +6 -2
  353. package/src/sap/fe/core/jsx-runtime/jsx-control-dbg.js +1 -1
  354. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +3 -1
  355. package/src/sap/fe/core/jsx-runtime/useMDXComponents-dbg.js +3 -3
  356. package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +1 -1
  357. package/src/sap/fe/core/jsx-runtime/useMDXComponents.js.map +1 -1
  358. package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +1 -1
  359. package/src/sap/fe/core/library-dbg.js +2 -2
  360. package/src/sap/fe/core/library-preload.js +127 -125
  361. package/src/sap/fe/core/library-preload.js.map +1 -1
  362. package/src/sap/fe/core/library.js +1 -1
  363. package/src/sap/fe/core/library.ts +7 -0
  364. package/src/sap/fe/core/manifest.json +1 -1
  365. package/src/sap/fe/core/messagebundle.properties +33 -0
  366. package/src/sap/fe/core/messagebundle_ar.properties +12 -10
  367. package/src/sap/fe/core/messagebundle_bg.properties +11 -9
  368. package/src/sap/fe/core/messagebundle_ca.properties +11 -9
  369. package/src/sap/fe/core/messagebundle_cs.properties +11 -9
  370. package/src/sap/fe/core/messagebundle_cy.properties +11 -9
  371. package/src/sap/fe/core/messagebundle_da.properties +11 -9
  372. package/src/sap/fe/core/messagebundle_de.properties +3 -1
  373. package/src/sap/fe/core/messagebundle_el.properties +11 -9
  374. package/src/sap/fe/core/messagebundle_en.properties +3 -1
  375. package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
  376. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
  377. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +20 -0
  378. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +21 -3
  379. package/src/sap/fe/core/messagebundle_es.properties +11 -9
  380. package/src/sap/fe/core/messagebundle_es_MX.properties +11 -9
  381. package/src/sap/fe/core/messagebundle_et.properties +11 -9
  382. package/src/sap/fe/core/messagebundle_fi.properties +11 -9
  383. package/src/sap/fe/core/messagebundle_fr.properties +11 -9
  384. package/src/sap/fe/core/messagebundle_fr_CA.properties +3 -1
  385. package/src/sap/fe/core/messagebundle_hi.properties +2 -0
  386. package/src/sap/fe/core/messagebundle_hr.properties +11 -9
  387. package/src/sap/fe/core/messagebundle_hu.properties +11 -9
  388. package/src/sap/fe/core/messagebundle_id.properties +3 -1
  389. package/src/sap/fe/core/messagebundle_it.properties +11 -9
  390. package/src/sap/fe/core/messagebundle_iw.properties +11 -9
  391. package/src/sap/fe/core/messagebundle_ja.properties +11 -9
  392. package/src/sap/fe/core/messagebundle_kk.properties +11 -9
  393. package/src/sap/fe/core/messagebundle_ko.properties +2 -0
  394. package/src/sap/fe/core/messagebundle_lt.properties +11 -9
  395. package/src/sap/fe/core/messagebundle_lv.properties +2 -0
  396. package/src/sap/fe/core/messagebundle_ms.properties +12 -10
  397. package/src/sap/fe/core/messagebundle_nl.properties +12 -10
  398. package/src/sap/fe/core/messagebundle_no.properties +11 -9
  399. package/src/sap/fe/core/messagebundle_pl.properties +2 -0
  400. package/src/sap/fe/core/messagebundle_pt.properties +11 -9
  401. package/src/sap/fe/core/messagebundle_pt_PT.properties +11 -9
  402. package/src/sap/fe/core/messagebundle_ro.properties +3 -1
  403. package/src/sap/fe/core/messagebundle_ru.properties +3 -1
  404. package/src/sap/fe/core/messagebundle_sh.properties +11 -9
  405. package/src/sap/fe/core/messagebundle_sk.properties +11 -9
  406. package/src/sap/fe/core/messagebundle_sl.properties +11 -9
  407. package/src/sap/fe/core/messagebundle_sv.properties +2 -0
  408. package/src/sap/fe/core/messagebundle_th.properties +11 -9
  409. package/src/sap/fe/core/messagebundle_tr.properties +11 -9
  410. package/src/sap/fe/core/messagebundle_uk.properties +11 -9
  411. package/src/sap/fe/core/messagebundle_vi.properties +12 -10
  412. package/src/sap/fe/core/messagebundle_zh_CN.properties +2 -0
  413. package/src/sap/fe/core/messagebundle_zh_TW.properties +2 -0
  414. package/src/sap/fe/core/operationsHelper-dbg.js +70 -44
  415. package/src/sap/fe/core/operationsHelper.js +1 -1
  416. package/src/sap/fe/core/operationsHelper.js.map +1 -1
  417. package/src/sap/fe/core/operationsHelper.ts +88 -63
  418. package/src/sap/fe/core/rootView/Fcl-dbg.controller.js +1 -1
  419. package/src/sap/fe/core/rootView/Fcl.controller.ts +10 -0
  420. package/src/sap/fe/core/rootView/NavContainer-dbg.controller.js +2 -2
  421. package/src/sap/fe/core/rootView/NavContainer.controller.js +1 -1
  422. package/src/sap/fe/core/rootView/NavContainer.controller.js.map +1 -1
  423. package/src/sap/fe/core/rootView/NavContainer.controller.ts +5 -3
  424. package/src/sap/fe/core/rootView/RootViewBaseController-dbg.js +4 -3
  425. package/src/sap/fe/core/rootView/RootViewBaseController.js +1 -1
  426. package/src/sap/fe/core/rootView/RootViewBaseController.js.map +1 -1
  427. package/src/sap/fe/core/rootView/RootViewBaseController.ts +15 -5
  428. package/src/sap/fe/core/services/AsyncComponentServiceFactory-dbg.js +1 -1
  429. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  430. package/src/sap/fe/core/services/CacheHandlerServiceFactory-dbg.js +1 -1
  431. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js.map +1 -1
  432. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +15 -1
  433. package/src/sap/fe/core/services/EnvironmentServiceFactory-dbg.js +1 -1
  434. package/src/sap/fe/core/services/EnvironmentServiceFactory.js.map +1 -1
  435. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +4 -1
  436. package/src/sap/fe/core/services/NavigationServiceFactory-dbg.js +9 -1
  437. package/src/sap/fe/core/services/NavigationServiceFactory.js.map +1 -1
  438. package/src/sap/fe/core/services/NavigationServiceFactory.ts +19 -1
  439. package/src/sap/fe/core/services/ResourceModelServiceFactory-dbg.js +2 -2
  440. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
  441. package/src/sap/fe/core/services/ResourceModelServiceFactory.js.map +1 -1
  442. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +10 -3
  443. package/src/sap/fe/core/services/RoutingServiceFactory-dbg.js +3 -3
  444. package/src/sap/fe/core/services/RoutingServiceFactory.js +1 -1
  445. package/src/sap/fe/core/services/RoutingServiceFactory.js.map +1 -1
  446. package/src/sap/fe/core/services/RoutingServiceFactory.ts +29 -3
  447. package/src/sap/fe/core/services/ShellServicesFactory-dbg.js +1 -1
  448. package/src/sap/fe/core/services/ShellServicesFactory.ts +14 -2
  449. package/src/sap/fe/core/services/SideEffectsServiceFactory-dbg.js +448 -279
  450. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +1 -1
  451. package/src/sap/fe/core/services/SideEffectsServiceFactory.js.map +1 -1
  452. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +502 -333
  453. package/src/sap/fe/core/services/TemplatedViewServiceFactory-dbg.js +18 -5
  454. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +1 -1
  455. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js.map +1 -1
  456. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +41 -12
  457. package/src/sap/fe/core/support/Diagnostics-dbg.js +1 -1
  458. package/src/sap/fe/core/support/Diagnostics.ts +5 -0
  459. package/src/sap/fe/core/templating/DataModelPathHelper-dbg.js +185 -86
  460. package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -1
  461. package/src/sap/fe/core/templating/DataModelPathHelper.js.map +1 -1
  462. package/src/sap/fe/core/templating/DataModelPathHelper.ts +190 -82
  463. package/src/sap/fe/core/templating/DisplayModeFormatter-dbg.js +1 -1
  464. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +1 -1
  465. package/src/sap/fe/core/templating/EntitySetHelper-dbg.js +2 -3
  466. package/src/sap/fe/core/templating/EntitySetHelper.js +1 -1
  467. package/src/sap/fe/core/templating/EntitySetHelper.js.map +1 -1
  468. package/src/sap/fe/core/templating/EntitySetHelper.ts +1 -3
  469. package/src/sap/fe/core/templating/FilterHelper-dbg.js +3 -3
  470. package/src/sap/fe/core/templating/FilterHelper.js +1 -1
  471. package/src/sap/fe/core/templating/FilterHelper.js.map +1 -1
  472. package/src/sap/fe/core/templating/FilterHelper.ts +5 -3
  473. package/src/sap/fe/core/templating/PropertyHelper-dbg.js +1 -1
  474. package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
  475. package/src/sap/fe/core/templating/UIFormatters-dbg.js +1 -1
  476. package/src/sap/fe/core/templating/UIFormatters.ts +4 -0
  477. package/src/sap/fe/core/type/DateTimeWithTimezone-dbg.js +1 -1
  478. package/src/sap/fe/core/type/DateTimeWithTimezone.ts +2 -0
  479. package/src/sap/fe/core/type/FiscalDate-dbg.js +2 -2
  480. package/src/sap/fe/core/type/FiscalDate.js.map +1 -1
  481. package/src/sap/fe/core/type/FiscalDate.ts +2 -1
  482. package/src/sap/fe/core/type/TypeUtil-dbg.js +5 -10
  483. package/src/sap/fe/core/type/TypeUtil.js +1 -1
  484. package/src/sap/fe/core/type/TypeUtil.js.map +1 -1
  485. package/src/sap/fe/core/type/TypeUtil.ts +3 -6
  486. package/src/sap/fe/core/buildingBlocks/BuildingBlock-dbg.js +0 -410
  487. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +0 -15
  488. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js.map +0 -1
  489. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +0 -536
  490. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment-dbg.js +0 -44
  491. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js +0 -6
  492. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js.map +0 -1
  493. package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.ts +0 -14
  494. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime-dbg.js +0 -948
  495. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +0 -19
  496. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js.map +0 -1
  497. package/src/sap/fe/core/controllerextensions/InternalEditFlow-dbg.js +0 -711
  498. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +0 -6
  499. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js.map +0 -1
  500. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +0 -863
  501. package/src/sap/fe/core/controls/ConditionalWrapper-dbg.js +0 -151
  502. package/src/sap/fe/core/controls/ConditionalWrapper.js +0 -6
  503. package/src/sap/fe/core/controls/ConditionalWrapper.js.map +0 -1
  504. package/src/sap/fe/core/controls/ConditionalWrapper.ts +0 -88
  505. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper-dbg.js +0 -330
  506. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +0 -6
  507. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js.map +0 -1
  508. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +0 -292
  509. package/src/sap/fe/core/controls/CustomQuickViewPage-dbg.js +0 -126
  510. package/src/sap/fe/core/controls/CustomQuickViewPage.js +0 -6
  511. package/src/sap/fe/core/controls/CustomQuickViewPage.js.map +0 -1
  512. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +0 -105
  513. package/src/sap/fe/core/controls/FieldWrapper-dbg.js +0 -194
  514. package/src/sap/fe/core/controls/FieldWrapper.js +0 -6
  515. package/src/sap/fe/core/controls/FieldWrapper.js.map +0 -1
  516. package/src/sap/fe/core/controls/FieldWrapper.ts +0 -121
  517. package/src/sap/fe/core/controls/FileWrapper-dbg.js +0 -280
  518. package/src/sap/fe/core/controls/FileWrapper.js +0 -6
  519. package/src/sap/fe/core/controls/FileWrapper.js.map +0 -1
  520. package/src/sap/fe/core/controls/FileWrapper.ts +0 -202
  521. package/src/sap/fe/core/helpers/SideEffectsHelper-dbg.js +0 -141
  522. package/src/sap/fe/core/helpers/SideEffectsHelper.js +0 -6
  523. package/src/sap/fe/core/helpers/SideEffectsHelper.js.map +0 -1
  524. package/src/sap/fe/core/helpers/SideEffectsHelper.ts +0 -129
@@ -1,43 +1,44 @@
1
- import type {
2
- Action,
3
- AnnotationTerm,
4
- ComplexType,
5
- ConvertedMetadata,
6
- EntityType,
7
- NavigationProperty,
8
- NavigationPropertyPath,
9
- Property,
10
- PropertyPath
11
- } from "@sap-ux/vocabularies-types";
1
+ import type { Action, ConvertedMetadata, EntityType, NavigationPropertyPath, PropertyPath } from "@sap-ux/vocabularies-types";
12
2
  import type { SideEffectsType as CommonSideEffectsType } from "@sap-ux/vocabularies-types/vocabularies/Common";
13
3
  import { CommonAnnotationTypes } from "@sap-ux/vocabularies-types/vocabularies/Common";
14
4
  import Log from "sap/base/Log";
15
- import type { EnvironmentCapabilities } from "sap/fe/core/converters/MetaModelConverter";
16
- import { convertTypes } from "sap/fe/core/converters/MetaModelConverter";
5
+ import {
6
+ convertTypes,
7
+ EnvironmentCapabilities,
8
+ getInvolvedDataModelObjects,
9
+ isComplexType,
10
+ isEntityType
11
+ } from "sap/fe/core/converters/MetaModelConverter";
17
12
  import Service from "sap/ui/core/service/Service";
18
13
  import ServiceFactory from "sap/ui/core/service/ServiceFactory";
19
14
  import type Context from "sap/ui/model/odata/v4/Context";
20
15
  import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
21
- import type { ServiceContext, V4Context } from "types/extension_types";
22
- import { isPathExpression } from "../templating/PropertyHelper";
16
+ import type { ServiceContext } from "types/metamodel_types";
17
+ import { DataModelObjectPath, enhanceDataModelPath, getTargetNavigationPath, getTargetObjectPath } from "../templating/DataModelPathHelper";
18
+ import { getAssociatedTextPropertyPath, isProperty } from "../templating/PropertyHelper";
23
19
 
24
20
  type SideEffectsSettings = {};
25
21
 
26
- export type SideEffectsTargetEntityType = {
22
+ export type SideEffectsEntityType = {
27
23
  $NavigationPropertyPath: string;
28
- $PropertyPath?: string;
29
24
  };
30
- export type SideEffectsTarget = SideEffectsTargetEntityType | string;
25
+ export type SideEffectsTarget = SideEffectsEntityType | string;
31
26
 
32
- type SideEffectsTargetType = {
33
- TargetProperties: string[];
34
- TargetEntities: SideEffectsTargetEntityType[];
27
+ export type SideEffectsTargetType = {
28
+ targetProperties: string[];
29
+ targetEntities: SideEffectsEntityType[];
35
30
  };
36
31
 
37
32
  type BaseSideEffectsType = {
33
+ sourceProperties?: string[];
34
+ sourceEntities?: SideEffectsEntityType[];
38
35
  fullyQualifiedName: string;
39
36
  } & SideEffectsTargetType;
40
37
 
38
+ export type ODataSideEffectsType = BaseSideEffectsType & {
39
+ triggerAction?: string;
40
+ };
41
+
41
42
  export type ActionSideEffectsType = {
42
43
  pathExpressions: SideEffectsTarget[];
43
44
  triggerActions?: string[];
@@ -45,22 +46,21 @@ export type ActionSideEffectsType = {
45
46
 
46
47
  export type ControlSideEffectsType = Partial<BaseSideEffectsType> & {
47
48
  fullyQualifiedName: string;
48
- SourceProperties: string[];
49
+ sourceProperties: string[];
49
50
  sourceControlId: string;
50
51
  };
51
52
 
52
- export type ODataSideEffectsType = BaseSideEffectsType & {
53
- SourceProperties?: PropertyPath[];
54
- SourceEntities?: NavigationPropertyPath[];
55
- TriggerAction?: string;
56
- };
57
-
58
53
  export type SideEffectsType = ControlSideEffectsType | ODataSideEffectsType;
59
54
 
55
+ //TODO fix this type in the ux vocabularies
56
+ type CommonSideEffectTypeWithQualifier = CommonSideEffectsType & { qualifier?: string };
57
+
60
58
  export type ODataSideEffectsEntityDictionary = Record<string, ODataSideEffectsType>;
61
59
  export type ODataSideEffectsActionDictionary = Record<string, ActionSideEffectsType>;
62
60
  export type ControlSideEffectsEntityDictionary = Record<string, ControlSideEffectsType>;
63
61
 
62
+ export type SideEffectInfoForSource = { entity: string; qualifier?: string; hasUniqueSourceProperty?: boolean };
63
+
64
64
  type SideEffectsOriginRegistry = {
65
65
  oData: {
66
66
  entities: {
@@ -75,26 +75,30 @@ type SideEffectsOriginRegistry = {
75
75
  };
76
76
  };
77
77
 
78
- type ExtractorPropertyInfo = {
79
- property: Property;
80
- navigationPath?: string;
81
- };
82
-
83
78
  export class SideEffectsService extends Service<SideEffectsSettings> {
84
79
  initPromise!: Promise<SideEffectsService>;
85
- _oSideEffectsType!: SideEffectsOriginRegistry;
86
- _oCapabilities!: EnvironmentCapabilities | undefined;
87
- _bInitialized!: boolean;
80
+
81
+ private sideEffectsRegistry!: SideEffectsOriginRegistry;
82
+
83
+ private capabilities!: EnvironmentCapabilities | undefined;
84
+
85
+ private isInitialized!: boolean;
86
+
87
+ private sourcesToSideEffectMappings!: {
88
+ entities: Record<string, SideEffectInfoForSource[]>;
89
+ properties: Record<string, SideEffectInfoForSource[]>;
90
+ };
91
+
88
92
  // !: means that we know it will be assigned before usage
89
93
  init() {
90
- this._oSideEffectsType = {
94
+ this.sideEffectsRegistry = {
91
95
  oData: {
92
96
  entities: {},
93
97
  actions: {}
94
98
  },
95
99
  control: {}
96
100
  };
97
- this._bInitialized = false;
101
+ this.isInitialized = false;
98
102
  this.initPromise = Promise.resolve(this);
99
103
  }
100
104
 
@@ -107,113 +111,102 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
107
111
  *
108
112
  * Ensure the sourceControlId matches the associated SAPUI5 control ID.
109
113
  *
110
- * @private
111
114
  * @ui5-restricted
112
- * @param sEntityType Name of the entity type
113
- * @param oSideEffect SideEffects definition
115
+ * @param entityType Name of the entity type
116
+ * @param sideEffect SideEffects definition
114
117
  */
115
- public addControlSideEffects(sEntityType: string, oSideEffect: Omit<ControlSideEffectsType, "fullyQualifiedName">): void {
116
- if (oSideEffect.sourceControlId) {
117
- const oControlSideEffect: ControlSideEffectsType = {
118
- ...oSideEffect,
119
- fullyQualifiedName: `${sEntityType}/SideEffectsForControl/${oSideEffect.sourceControlId}`
118
+ public addControlSideEffects(entityType: string, sideEffect: Omit<ControlSideEffectsType, "fullyQualifiedName">): void {
119
+ if (sideEffect.sourceControlId) {
120
+ const controlSideEffect: ControlSideEffectsType = {
121
+ ...sideEffect,
122
+ fullyQualifiedName: `${entityType}/SideEffectsForControl/${sideEffect.sourceControlId}`
120
123
  };
121
- const mEntityControlSideEffects = this._oSideEffectsType.control[sEntityType] || {};
122
- mEntityControlSideEffects[oControlSideEffect.sourceControlId] = oControlSideEffect;
123
- this._oSideEffectsType.control[sEntityType] = mEntityControlSideEffects;
124
+ const entityControlSideEffects = this.sideEffectsRegistry.control[entityType] || {};
125
+ entityControlSideEffects[controlSideEffect.sourceControlId] = controlSideEffect;
126
+ this.sideEffectsRegistry.control[entityType] = entityControlSideEffects;
124
127
  }
125
128
  }
126
129
 
127
130
  /**
128
131
  * Executes SideEffects action.
129
132
  *
130
- * @private
131
133
  * @ui5-restricted
132
- * @param sTriggerAction Name of the action
133
- * @param oContext Context
134
- * @param sGroupId The group ID to be used for the request
134
+ * @param triggerAction Name of the action
135
+ * @param context Context
136
+ * @param groupId The group ID to be used for the request
135
137
  * @returns A promise that is resolved without data or with a return value context when the action call succeeded
136
138
  */
137
- public executeAction(sTriggerAction: string, oContext: Context, sGroupId?: string): Promise<any> {
138
- const oTriggerAction = oContext.getModel().bindContext(`${sTriggerAction}(...)`, oContext);
139
- return oTriggerAction.execute(sGroupId || oContext.getBinding().getUpdateGroupId());
139
+ public executeAction(triggerAction: string, context: Context, groupId?: string): Promise<void> {
140
+ const action = context.getModel().bindContext(`${triggerAction}(...)`, context);
141
+ return action.execute(groupId || context.getBinding().getUpdateGroupId());
140
142
  }
141
143
 
142
144
  /**
143
145
  * Gets converted OData metaModel.
144
146
  *
145
- * @private
146
147
  * @ui5-restricted
147
148
  * @returns Converted OData metaModel
148
149
  */
149
150
  public getConvertedMetaModel(): ConvertedMetadata {
150
- const oContext = this.getContext();
151
- const oComponent = oContext.scopeObject;
152
- const oMetaModel: ODataMetaModel = oComponent.getModel().getMetaModel();
153
- return convertTypes(oMetaModel, this._oCapabilities);
151
+ return convertTypes(this.getMetaModel(), this.capabilities);
154
152
  }
155
153
 
156
154
  /**
157
155
  * Gets the entity type of a context.
158
156
  *
159
- * @function
160
- * @name getEntityTypeFromContext
161
- * @param oContext Context
157
+ * @param context Context
162
158
  * @returns Entity Type
163
159
  */
164
- public getEntityTypeFromContext(oContext: Context): string | undefined {
165
- const oMetaModel = (oContext as V4Context).getModel().getMetaModel(),
166
- sMetaPath = oMetaModel.getMetaPath(oContext.getPath()),
167
- sEntityType = oMetaModel.getObject(sMetaPath)["$Type"];
168
- return sEntityType;
160
+ public getEntityTypeFromContext(context: Context): string | undefined {
161
+ const metaModel = context.getModel().getMetaModel(),
162
+ metaPath = metaModel.getMetaPath(context.getPath()),
163
+ entityType = metaModel.getObject(metaPath)["$Type"];
164
+ return entityType;
169
165
  }
170
166
 
171
167
  /**
172
168
  * Gets the SideEffects that come from an OData service.
173
169
  *
174
- * @private
175
170
  * @ui5-restricted
176
- * @param sEntityTypeName Name of the entity type
171
+ * @param entityTypeName Name of the entity type
177
172
  * @returns SideEffects dictionary
178
173
  */
179
- public getODataEntitySideEffects(sEntityTypeName: string): Record<string, ODataSideEffectsType> {
180
- return this._oSideEffectsType.oData.entities[sEntityTypeName] || {};
174
+ public getODataEntitySideEffects(entityTypeName: string): Record<string, ODataSideEffectsType> {
175
+ return this.sideEffectsRegistry.oData.entities[entityTypeName] || {};
181
176
  }
182
177
 
183
178
  /**
184
179
  * Gets the global SideEffects that come from an OData service.
185
180
  *
186
- * @private
187
181
  * @ui5-restricted
188
- * @param sEntityTypeName Name of the entity type
182
+ * @param entityTypeName Name of the entity type
189
183
  * @returns Global SideEffects
190
184
  */
191
- public getGlobalODataEntitySideEffects(sEntityTypeName: string): ODataSideEffectsType[] {
192
- const mEntitySideEffects = this.getODataEntitySideEffects(sEntityTypeName);
193
- const aGlobalSideEffects: ODataSideEffectsType[] = [];
194
- for (const key in mEntitySideEffects) {
195
- const oEntitySideEffects = mEntitySideEffects[key];
196
- if (!oEntitySideEffects.SourceEntities && !oEntitySideEffects.SourceProperties) {
197
- aGlobalSideEffects.push(oEntitySideEffects);
185
+ public getGlobalODataEntitySideEffects(entityTypeName: string): ODataSideEffectsType[] {
186
+ const entitySideEffects = this.getODataEntitySideEffects(entityTypeName);
187
+ const globalSideEffects: ODataSideEffectsType[] = [];
188
+ for (const key in entitySideEffects) {
189
+ const sideEffects = entitySideEffects[key];
190
+ if (!sideEffects.sourceEntities && !sideEffects.sourceProperties) {
191
+ globalSideEffects.push(sideEffects);
198
192
  }
199
193
  }
200
- return aGlobalSideEffects;
194
+ return globalSideEffects;
201
195
  }
202
196
 
203
197
  /**
204
198
  * Gets the SideEffects that come from an OData service.
205
199
  *
206
- * @private
207
200
  * @ui5-restricted
208
- * @param sActionName Name of the action
209
- * @param oContext Context
201
+ * @param actionName Name of the action
202
+ * @param context Context
210
203
  * @returns SideEffects definition
211
204
  */
212
- public getODataActionSideEffects(sActionName: string, oContext?: Context): ActionSideEffectsType | undefined {
213
- if (oContext) {
214
- const sEntityType = this.getEntityTypeFromContext(oContext);
215
- if (sEntityType) {
216
- return this._oSideEffectsType.oData.actions[sEntityType]?.[sActionName];
205
+ public getODataActionSideEffects(actionName: string, context?: Context): ActionSideEffectsType | undefined {
206
+ if (context) {
207
+ const entityType = this.getEntityTypeFromContext(context);
208
+ if (entityType) {
209
+ return this.sideEffectsRegistry.oData.actions[entityType]?.[actionName];
217
210
  }
218
211
  }
219
212
  return undefined;
@@ -222,120 +215,136 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
222
215
  /**
223
216
  * Generates the dictionary for the SideEffects.
224
217
  *
225
- * @private
226
218
  * @ui5-restricted
227
- * @param oCapabilities The current capabilities
219
+ * @param capabilities The current capabilities
228
220
  */
229
- public initializeSideEffects(oCapabilities?: EnvironmentCapabilities): void {
230
- this._oCapabilities = oCapabilities;
231
- if (!this._bInitialized) {
232
- const oConvertedMetaModel = this.getConvertedMetaModel();
233
- oConvertedMetaModel.entityTypes.forEach((entityType: EntityType) => {
234
- this._oSideEffectsType.oData.entities[entityType.fullyQualifiedName] = this._retrieveODataEntitySideEffects(entityType);
235
- this._oSideEffectsType.oData.actions[entityType.fullyQualifiedName] = this._retrieveODataActionsSideEffects(entityType); // only bound actions are analyzed since unbound ones don't get SideEffects
221
+ public initializeSideEffects(capabilities?: EnvironmentCapabilities): void {
222
+ this.capabilities = capabilities;
223
+ if (!this.isInitialized) {
224
+ const sideEffectSources: {
225
+ entities: Record<string, SideEffectInfoForSource[]>;
226
+ properties: Record<string, SideEffectInfoForSource[]>;
227
+ } = {
228
+ entities: {},
229
+ properties: {}
230
+ };
231
+ const convertedMetaModel = this.getConvertedMetaModel();
232
+ convertedMetaModel.entityTypes.forEach((entityType: EntityType) => {
233
+ this.sideEffectsRegistry.oData.entities[entityType.fullyQualifiedName] = this.retrieveODataEntitySideEffects(entityType);
234
+ this.sideEffectsRegistry.oData.actions[entityType.fullyQualifiedName] = this.retrieveODataActionsSideEffects(entityType); // only bound actions are analyzed since unbound ones don't get SideEffects
235
+ this.mapSideEffectSources(entityType, sideEffectSources);
236
236
  });
237
- this._bInitialized = true;
237
+ this.sourcesToSideEffectMappings = sideEffectSources;
238
+ this.isInitialized = true;
238
239
  }
239
240
  }
240
241
 
241
242
  /**
242
243
  * Removes all SideEffects related to a control.
243
244
  *
244
- * @private
245
245
  * @ui5-restricted
246
- * @param sControlId Control Id
246
+ * @param controlId Control Id
247
247
  */
248
- public removeControlSideEffects(sControlId: string): void {
249
- Object.keys(this._oSideEffectsType.control).forEach((sEntityType) => {
250
- if (this._oSideEffectsType.control[sEntityType][sControlId]) {
251
- delete this._oSideEffectsType.control[sEntityType][sControlId];
248
+ public removeControlSideEffects(controlId: string): void {
249
+ Object.keys(this.sideEffectsRegistry.control).forEach((sEntityType) => {
250
+ if (this.sideEffectsRegistry.control[sEntityType][controlId]) {
251
+ delete this.sideEffectsRegistry.control[sEntityType][controlId];
252
252
  }
253
253
  });
254
254
  }
255
255
 
256
256
  /**
257
- * Request SideEffects on a specific context.
257
+ * Requests the SideEffects on a specific context.
258
258
  *
259
- * @function
260
- * @name requestSideEffects
261
- * @param aPathExpressions Targets of SideEffects to be executed
262
- * @param oContext Context where SideEffects need to be executed
263
- * @param sGroupId The group ID to be used for the request
259
+ * @param pathExpressions Targets of SideEffects to be executed
260
+ * @param context Context where SideEffects need to be executed
261
+ * @param groupId The group ID to be used for the request
264
262
  * @returns Promise on SideEffects request
265
263
  */
266
- public async requestSideEffects(aPathExpressions: SideEffectsTarget[], oContext: Context, sGroupId?: string | undefined): Promise<any> {
267
- this._logRequest(aPathExpressions, oContext);
268
- return oContext.requestSideEffects(aPathExpressions as object[], sGroupId);
264
+ public requestSideEffects(pathExpressions: SideEffectsTarget[], context: Context, groupId?: string): Promise<undefined> {
265
+ this.logRequest(pathExpressions, context);
266
+ return context.requestSideEffects(pathExpressions as object[], groupId);
269
267
  }
270
268
 
271
- public requestSideEffectsForODataAction(sideEffects: ActionSideEffectsType, oContext: Context): Promise<any> {
272
- let aPromises: Promise<any>[];
269
+ /**
270
+ * Requests the SideEffects for an OData action.
271
+ *
272
+ * @param sideEffects SideEffects definition
273
+ * @param context Context where SideEffects need to be executed
274
+ * @returns Promise on SideEffects requests and action execution
275
+ */
276
+ public requestSideEffectsForODataAction(sideEffects: ActionSideEffectsType, context: Context): Promise<(void | undefined)[]> {
277
+ let promises: Promise<void | undefined>[];
273
278
 
274
279
  if (sideEffects.triggerActions?.length) {
275
- aPromises = sideEffects.triggerActions.map((sTriggerActionName) => {
276
- return this.executeAction(sTriggerActionName, oContext);
280
+ promises = sideEffects.triggerActions.map((actionName) => {
281
+ return this.executeAction(actionName, context);
277
282
  });
278
283
  } else {
279
- aPromises = [];
284
+ promises = [];
280
285
  }
281
286
 
282
287
  if (sideEffects.pathExpressions?.length) {
283
- aPromises.push(this.requestSideEffects(sideEffects.pathExpressions, oContext));
288
+ promises.push(this.requestSideEffects(sideEffects.pathExpressions, context));
284
289
  }
285
290
 
286
- return aPromises.length ? Promise.all(aPromises) : Promise.resolve();
291
+ return promises.length ? Promise.all(promises) : Promise.resolve([]);
287
292
  }
288
293
 
289
294
  /**
290
- * Request SideEffects for a navigation property on a specific context.
295
+ * Requests the SideEffects for a navigation property on a specific context.
291
296
  *
292
297
  * @function
293
- * @name requestSideEffectsForNavigationProperty
294
- * @param sNavigationProperty Navigation property
295
- * @param oContext Context where SideEffects need to be executed
298
+ * @param navigationProperty Navigation property
299
+ * @param context Context where SideEffects need to be executed
300
+ * @param groupId Batch group for the query
296
301
  * @returns SideEffects request on SAPUI5 context
297
302
  */
298
- public requestSideEffectsForNavigationProperty(sNavigationProperty: string, oContext: Context): Promise<any> {
299
- const sBaseEntityType = this.getEntityTypeFromContext(oContext);
300
- if (sBaseEntityType) {
301
- const sNavigationPath = `${sNavigationProperty}/`;
302
- const aSideEffects = this.getODataEntitySideEffects(sBaseEntityType);
303
+ public requestSideEffectsForNavigationProperty(
304
+ navigationProperty: string,
305
+ context: Context,
306
+ groupId?: string
307
+ ): Promise<void | undefined> {
308
+ const baseEntityType = this.getEntityTypeFromContext(context);
309
+ if (baseEntityType) {
310
+ const navigationPath = `${navigationProperty}/`;
311
+ const entitySideEffects = this.getODataEntitySideEffects(baseEntityType);
303
312
  let targetProperties: string[] = [];
304
- let targetEntities: SideEffectsTargetEntityType[] = [];
313
+ let targetEntities: SideEffectsEntityType[] = [];
305
314
  let sideEffectsTargets: SideEffectsTarget[] = [];
306
- Object.keys(aSideEffects)
315
+ Object.keys(entitySideEffects)
307
316
  .filter(
308
317
  // Keep relevant SideEffects
309
- (sAnnotationName) => {
310
- const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
318
+ (annotationName) => {
319
+ const sideEffects: ODataSideEffectsType = entitySideEffects[annotationName];
311
320
  return (
312
- (oSideEffects.SourceProperties || []).some((oPropertyPath) => {
313
- const sPropertyPath = oPropertyPath.value;
314
- return (
315
- sPropertyPath.startsWith(sNavigationPath) &&
316
- sPropertyPath.replace(sNavigationPath, "").indexOf("/") === -1
317
- );
318
- }) ||
319
- (oSideEffects.SourceEntities || []).some(
320
- (oNavigationPropertyPath) => oNavigationPropertyPath.value === sNavigationProperty
321
+ (sideEffects.sourceProperties || []).some(
322
+ (propertyPath) =>
323
+ propertyPath.startsWith(navigationPath) && propertyPath.replace(navigationPath, "").indexOf("/") === -1
324
+ ) ||
325
+ (sideEffects.sourceEntities || []).some(
326
+ (navigation) => navigation.$NavigationPropertyPath === navigationProperty
321
327
  )
322
328
  );
323
329
  }
324
330
  )
325
331
  .forEach((sAnnotationName) => {
326
- const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
327
- if (oSideEffects.TriggerAction) {
328
- this.executeAction(oSideEffects.TriggerAction, oContext);
332
+ const sideEffects = entitySideEffects[sAnnotationName];
333
+ if (sideEffects.triggerAction) {
334
+ this.executeAction(sideEffects.triggerAction, context, groupId);
329
335
  }
330
- targetProperties = targetProperties.concat(oSideEffects.TargetProperties);
331
- targetEntities = targetEntities.concat(oSideEffects.TargetEntities);
336
+ targetProperties = targetProperties.concat(sideEffects.targetProperties);
337
+ targetEntities = targetEntities.concat(sideEffects.targetEntities);
332
338
  });
333
339
  // Remove duplicate targets
334
- const sideEffectsTargetDefinition = this._removeDuplicateTargets(targetProperties, targetEntities);
335
- sideEffectsTargets = [...sideEffectsTargetDefinition.TargetProperties, ...sideEffectsTargetDefinition.TargetEntities];
336
- if (sideEffectsTargets.length > 0) {
337
- return this.requestSideEffects(sideEffectsTargets, oContext).catch((oError) =>
338
- Log.error(`SideEffects - Error while processing SideEffects for Navigation Property ${sNavigationProperty}`, oError)
340
+ const sideEffectsTargetDefinition = this.removeDuplicateTargets({
341
+ targetProperties: targetProperties,
342
+ targetEntities: targetEntities
343
+ });
344
+ sideEffectsTargets = [...sideEffectsTargetDefinition.targetProperties, ...sideEffectsTargetDefinition.targetEntities];
345
+ if (sideEffectsTargets.length) {
346
+ return this.requestSideEffects(sideEffectsTargets, context, groupId).catch((error) =>
347
+ Log.error(`SideEffects - Error while processing SideEffects for Navigation Property ${navigationProperty}`, error)
339
348
  );
340
349
  }
341
350
  }
@@ -345,249 +354,356 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
345
354
  /**
346
355
  * Gets the SideEffects that come from controls.
347
356
  *
348
- * @private
349
357
  * @ui5-restricted
350
- * @param sEntityTypeName Entity type Name
358
+ * @param entityTypeName Entity type Name
351
359
  * @returns SideEffects dictionary
352
360
  */
353
- public getControlEntitySideEffects(sEntityTypeName: string): Record<string, ControlSideEffectsType> {
354
- return this._oSideEffectsType.control[sEntityTypeName] || {};
361
+ public getControlEntitySideEffects(entityTypeName: string): Record<string, ControlSideEffectsType> {
362
+ return this.sideEffectsRegistry.control[entityTypeName] || {};
363
+ }
364
+
365
+ /**
366
+ * Gets SideEffects' qualifier and owner entity where this entity is used as source.
367
+ *
368
+ * @param entityTypeName Entity type fully qualified name
369
+ * @returns Array of sideEffects info
370
+ */
371
+ public getSideEffectWhereEntityIsSource(entityTypeName: string): SideEffectInfoForSource[] {
372
+ return this.sourcesToSideEffectMappings.entities[entityTypeName] || [];
373
+ }
374
+
375
+ /**
376
+ * Common method to get the field groupIds for a source entity and a source property.
377
+ *
378
+ * @param sourceEntityType
379
+ * @param sourceProperty
380
+ * @returns A collection of fieldGroupIds
381
+ */
382
+ public computeFieldGroupIds(sourceEntityType: string, sourceProperty: string): string[] {
383
+ const entityFieldGroupIds = this.getSideEffectWhereEntityIsSource(sourceEntityType).map((sideEffectInfo) =>
384
+ this.getFieldGroupIdForSideEffect(sideEffectInfo, true)
385
+ );
386
+ return entityFieldGroupIds.concat(
387
+ this.getSideEffectWherePropertyIsSource(sourceProperty).map((sideEffectInfo) =>
388
+ this.getFieldGroupIdForSideEffect(sideEffectInfo)
389
+ )
390
+ );
391
+ }
392
+
393
+ /**
394
+ * Gets SideEffects' qualifier and owner entity where this property is used as source.
395
+ *
396
+ * @param propertyName Property fully qualified name
397
+ * @returns Array of sideEffects info
398
+ */
399
+ public getSideEffectWherePropertyIsSource(propertyName: string): SideEffectInfoForSource[] {
400
+ return this.sourcesToSideEffectMappings.properties[propertyName] || [];
355
401
  }
356
402
 
357
403
  /**
358
404
  * Adds the text properties required for SideEffects
359
- * If a property has an associated text then this text needs to be added as targetProperties or targetEntities.
405
+ * If a property has an associated text then this text needs to be added as targetProperties.
360
406
  *
361
- * @private
362
407
  * @ui5-restricted
363
- * @param oSideEffect SideEffects definition
364
- * @param mEntityType Entity type
408
+ * @param sideEffectsTargets SideEffects Targets
409
+ * @param entityType Entity type
365
410
  * @returns SideEffects definition with added text properties
366
411
  */
367
- private _addRequiredTextProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
368
- const aInitialProperties: string[] = oSideEffect.TargetProperties,
369
- aEntitiesRequested: string[] = oSideEffect.TargetEntities.map((navigation) => navigation.$NavigationPropertyPath);
370
- let aDerivedProperties: ExtractorPropertyInfo[] = [];
371
-
372
- aInitialProperties.forEach((sPropertyPath) => {
373
- const bIsStarProperty = sPropertyPath.endsWith("*"), // Can be '*' or '.../navProp/*'
374
- sNavigationPropertyPath: string = sPropertyPath.substring(0, sPropertyPath.lastIndexOf("/")),
375
- sRelativePath = sNavigationPropertyPath ? `${sNavigationPropertyPath}/` : "",
376
- mTarget = mEntityType.resolvePath(sNavigationPropertyPath) || mEntityType;
377
-
378
- // mTarget can be an entity type, navigationProperty or or a complexType
379
- const aTargetEntityProperties: Property[] =
380
- (mTarget as EntityType).entityProperties ||
381
- ((mTarget as Property).targetType as ComplexType)?.properties ||
382
- (mTarget as NavigationProperty).targetType.entityProperties;
383
- if (aTargetEntityProperties) {
384
- if (bIsStarProperty) {
385
- // Add all required properties behind the *
386
- aEntitiesRequested.push(sNavigationPropertyPath);
387
- aDerivedProperties = aDerivedProperties.concat(
388
- aTargetEntityProperties.map((mProperty) => {
389
- return {
390
- navigationPath: sRelativePath,
391
- property: mProperty
392
- };
393
- })
394
- );
395
- } else {
396
- aDerivedProperties.push({
397
- property: aTargetEntityProperties.find(
398
- (mProperty) => mProperty.name === sPropertyPath.split("/").pop()
399
- ) as Property,
400
- navigationPath: sRelativePath
401
- });
402
- }
403
- } else {
404
- Log.info(`SideEffects - The entity type associated to property path ${sPropertyPath} cannot be resolved`);
405
- }
406
- });
407
-
408
- aDerivedProperties.forEach((mPropertyInfo) => {
409
- const textAnnotation = mPropertyInfo.property?.annotations?.Common?.Text;
410
- if (textAnnotation && isPathExpression(textAnnotation)) {
411
- const sTargetTextPath = textAnnotation.path,
412
- sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath,
413
- sTargetCollectionPath = sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"));
414
- /**
415
- * The property Text must be added only if the property is
416
- * - not part of a star property (.i.e '*' or 'navigation/*') or a targeted Entity
417
- * - not include into the initial targeted properties of SideEffects
418
- * Indeed in the two listed cases, the property containing text will be/is requested by initial SideEffects configuration.
419
- */
420
-
412
+ private addTextProperties(sideEffectsTargets: SideEffectsTargetType, entityType: EntityType): SideEffectsTargetType {
413
+ const setOfProperties = new Set(sideEffectsTargets.targetProperties);
414
+ const setOfEntities = new Set(sideEffectsTargets.targetEntities.map((target) => target.$NavigationPropertyPath));
415
+
416
+ // Generate all dataModelPath for the properties to analyze (cover "*" and /*)
417
+ const propertiesToAnalyze = sideEffectsTargets.targetProperties.reduce(
418
+ (dataModelPropertyPaths: DataModelObjectPath[], propertyPath) => {
419
+ return dataModelPropertyPaths.concat(this.getDataModelPropertiesFromAPath(propertyPath, entityType));
420
+ },
421
+ []
422
+ );
423
+
424
+ // Generate all paths related to the text properties and not already covered by the SideEffects
425
+ for (const dataModelPropertyPath of propertiesToAnalyze) {
426
+ const associatedTextPath = getAssociatedTextPropertyPath(dataModelPropertyPath.targetObject);
427
+ if (associatedTextPath) {
428
+ const dataModelTextPath = enhanceDataModelPath(dataModelPropertyPath, associatedTextPath);
429
+ const relativeNavigation = getTargetNavigationPath(dataModelTextPath, true);
430
+ const targetPath = getTargetObjectPath(dataModelTextPath, true);
421
431
  if (
422
- sTargetTextPath &&
423
- aEntitiesRequested.indexOf(sTargetCollectionPath) === -1 &&
424
- aInitialProperties.indexOf(sTextPathFromInitialEntity) === -1
432
+ isProperty(dataModelTextPath.targetObject) &&
433
+ !setOfProperties.has(targetPath) && // the property is already listed
434
+ !setOfProperties.has(`${relativeNavigation}${dataModelTextPath.navigationProperties.length ? "/" : ""}*`) && // the property is already listed thanks to the "*"
435
+ !setOfEntities.has(`${relativeNavigation}`) // the property is not part of a TargetEntities
425
436
  ) {
426
- // The Text association is added as TargetEntities if it's contained on a different entitySet and not a complexType
437
+ // The Text association is added as TargetEntities if
438
+ // - it's contained on a different entitySet than the SideEffects
439
+ // - and it's contained on a different entitySet than the sourced property
427
440
  // Otherwise it's added as targetProperties
428
441
  if (
429
- sTargetTextPath.lastIndexOf("/") > -1 &&
430
- mEntityType.resolvePath(sTargetCollectionPath)?._type === "NavigationProperty"
442
+ dataModelPropertyPath.targetEntitySet !== dataModelTextPath.targetEntitySet &&
443
+ dataModelTextPath.navigationProperties &&
444
+ dataModelTextPath.targetEntityType
431
445
  ) {
432
- oSideEffect.TargetEntities.push({ $NavigationPropertyPath: sTargetCollectionPath });
433
- aEntitiesRequested.push(sTargetCollectionPath);
446
+ setOfEntities.add(relativeNavigation);
434
447
  } else {
435
- oSideEffect.TargetProperties.push(sTextPathFromInitialEntity);
448
+ setOfProperties.add(targetPath);
436
449
  }
437
450
  }
438
451
  }
439
- });
452
+ }
440
453
 
441
- return oSideEffect;
454
+ return {
455
+ targetProperties: Array.from(setOfProperties),
456
+ targetEntities: Array.from(setOfEntities).map((navigation) => {
457
+ return { $NavigationPropertyPath: navigation };
458
+ })
459
+ };
442
460
  }
461
+
443
462
  /**
444
- * Converts SideEffects to expected format
463
+ * Converts the SideEffects to expected format
464
+ * - Set TriggerAction as string
445
465
  * - Converts SideEffects targets to expected format
446
466
  * - Removes binding parameter from SideEffects targets properties
447
467
  * - Adds the text properties
448
468
  * - Replaces TargetProperties having reference to Source Properties for a SideEffects.
449
469
  *
450
- * @private
451
470
  * @ui5-restricted
452
- * @param oSideEffects SideEffects definition
453
- * @param mEntityType Entity type
454
- * @param sBindingParameter Name of the binding parameter
471
+ * @param sideEffects SideEffects definition
472
+ * @param entityType Entity type
473
+ * @param bindingParameter Name of the binding parameter
455
474
  * @returns SideEffects definition
456
475
  */
457
- private _convertSideEffects(
458
- oSideEffects: CommonSideEffectsType,
459
- mEntityType: EntityType,
460
- sBindingParameter?: string
476
+ private convertSideEffects(
477
+ sideEffects: CommonSideEffectsType,
478
+ entityType: EntityType,
479
+ bindingParameter?: string
461
480
  ): ODataSideEffectsType {
462
- const oTempSideEffects = this._removeBindingParameter(this._convertTargetsFormat(oSideEffects), sBindingParameter);
463
- return this._addRequiredTextProperties(oTempSideEffects, mEntityType);
481
+ const triggerAction = sideEffects.TriggerAction as string;
482
+ const newSideEffects = this.convertSideEffectsFormat(sideEffects);
483
+ let sideEffectsTargets = { targetProperties: newSideEffects.targetProperties, targetEntities: newSideEffects.targetEntities };
484
+ sideEffectsTargets = this.removeBindingParameter(sideEffectsTargets, bindingParameter);
485
+ sideEffectsTargets = this.addTextProperties(sideEffectsTargets, entityType);
486
+ sideEffectsTargets = this.removeDuplicateTargets(sideEffectsTargets);
487
+ return {
488
+ ...newSideEffects,
489
+ ...{ targetEntities: sideEffectsTargets.targetEntities, targetProperties: sideEffectsTargets.targetProperties, triggerAction }
490
+ };
464
491
  }
465
492
 
466
493
  /**
467
- * Converts SideEffects targets (TargetEntities and TargetProperties) to expected format
494
+ * Converts the SideEffects targets (TargetEntities and TargetProperties) to expected format
468
495
  * - TargetProperties as array of string
469
496
  * - TargetEntities as array of object with property $NavigationPropertyPath.
470
497
  *
471
- * @private
472
498
  * @ui5-restricted
473
- * @param oSideEffects SideEffects definition
499
+ * @param sideEffects SideEffects definition
474
500
  * @returns Converted SideEffects
475
501
  */
476
- private _convertTargetsFormat(oSideEffects: CommonSideEffectsType): BaseSideEffectsType {
477
- const TargetProperties: string[] = ((oSideEffects.TargetProperties || []) as (string | PropertyPath)[]).reduce(
478
- (aTargetProperties: string[], vTarget) => {
479
- const sTarget = ((vTarget as PropertyPath).type && (vTarget as PropertyPath).value) || (vTarget as string);
480
- if (sTarget) {
481
- aTargetProperties.push(sTarget);
482
- } else {
483
- Log.error(
484
- `SideEffects - Error while processing TargetProperties for SideEffects${oSideEffects.fullyQualifiedName}`
502
+ private convertSideEffectsFormat(sideEffects: CommonSideEffectsType): ODataSideEffectsType {
503
+ const formatProperties = (properties?: (string | PropertyPath)[]) => {
504
+ return properties
505
+ ? properties.reduce((targetProperties: string[], target) => {
506
+ const path = ((target as PropertyPath).type && (target as PropertyPath).value) || (target as string);
507
+ if (path) {
508
+ targetProperties.push(path);
509
+ } else {
510
+ Log.error(
511
+ `SideEffects - Error while processing TargetProperties for SideEffects ${sideEffects.fullyQualifiedName}`
512
+ );
513
+ }
514
+ return targetProperties;
515
+ }, [])
516
+ : properties;
517
+ };
518
+ const formatEntities = (entities?: NavigationPropertyPath[]) => {
519
+ return entities
520
+ ? entities.map((targetEntity) => {
521
+ return { $NavigationPropertyPath: targetEntity.value };
522
+ })
523
+ : entities;
524
+ };
525
+ return {
526
+ fullyQualifiedName: sideEffects.fullyQualifiedName,
527
+ sourceProperties: formatProperties(sideEffects.SourceProperties),
528
+ sourceEntities: formatEntities(sideEffects.SourceEntities),
529
+ targetProperties: formatProperties(sideEffects.TargetProperties as (string | PropertyPath)[]) ?? [],
530
+ targetEntities: formatEntities(sideEffects.TargetEntities) ?? []
531
+ };
532
+ }
533
+
534
+ /**
535
+ * Gets all dataModelObjectPath related to properties listed by a path
536
+ *
537
+ * The path can be:
538
+ * - a path targeting a property on a complexType or an EntityType
539
+ * - a path with a star targeting all properties on a complexType or an EntityType.
540
+ *
541
+ * @ui5-restricted
542
+ * @param path The path to analyze
543
+ * @param entityType Entity type
544
+ * @returns Array of dataModelObjectPath representing the properties
545
+ */
546
+ private getDataModelPropertiesFromAPath(path: string, entityType: EntityType): DataModelObjectPath[] {
547
+ let dataModelObjectPaths: DataModelObjectPath[] = [];
548
+ const convertedMetaModel = this.getConvertedMetaModel();
549
+ const entitySet =
550
+ convertedMetaModel.entitySets.find((relatedEntitySet) => relatedEntitySet.entityType === entityType) ||
551
+ convertedMetaModel.singletons.find((singleton) => singleton.entityType === entityType);
552
+
553
+ if (entitySet) {
554
+ const metaModel = this.getMetaModel(),
555
+ entitySetContext = metaModel.createBindingContext(`/${entitySet.name}`);
556
+ if (entitySetContext) {
557
+ const dataModelEntitySet = getInvolvedDataModelObjects(entitySetContext);
558
+ const dataModelObjectPath = enhanceDataModelPath(dataModelEntitySet, path.replace("*", "") || "/"), // "*" is replaced by "/" to target the current EntityType
559
+ targetObject = dataModelObjectPath.targetObject;
560
+ if (isProperty(targetObject)) {
561
+ if (isComplexType(targetObject.targetType)) {
562
+ dataModelObjectPaths = dataModelObjectPaths.concat(
563
+ targetObject.targetType.properties.map((property) => enhanceDataModelPath(dataModelObjectPath, property.name))
485
564
  );
565
+ } else {
566
+ dataModelObjectPaths.push(dataModelObjectPath);
486
567
  }
487
- return aTargetProperties;
488
- },
489
- []
490
- ),
491
- TargetEntities: SideEffectsTargetEntityType[] = (oSideEffects.TargetEntities || []).map((mTargetEntity) => {
492
- return { $NavigationPropertyPath: mTargetEntity.value || "" };
493
- });
494
- return { ...oSideEffects, ...{ TargetProperties, TargetEntities } };
568
+ } else if (isEntityType(targetObject)) {
569
+ dataModelObjectPaths = dataModelObjectPaths.concat(
570
+ dataModelObjectPath.targetEntityType.entityProperties.map((entityProperty) => {
571
+ return enhanceDataModelPath(dataModelObjectPath, entityProperty.name);
572
+ })
573
+ );
574
+ }
575
+ entitySetContext.destroy();
576
+ }
577
+ }
578
+ return dataModelObjectPaths.filter((dataModelObjectPath) => dataModelObjectPath.targetObject);
579
+ }
580
+
581
+ /**
582
+ * Gets the Odata metamodel.
583
+ *
584
+ * @ui5-restricted
585
+ * @returns The OData metamodel
586
+ */
587
+ private getMetaModel(): ODataMetaModel {
588
+ const oContext = this.getContext();
589
+ const oComponent = oContext.scopeObject;
590
+ return oComponent.getModel().getMetaModel();
495
591
  }
496
592
 
497
593
  /**
498
- * Gets SideEffects related to an entity type or action that come from an OData Service
594
+ * Gets the SideEffects related to an entity type or action that come from an OData Service
499
595
  * Internal routine to get, from converted oData metaModel, SideEffects related to a specific entity type or action
500
596
  * and to convert these SideEffects with expected format.
501
597
  *
502
- * @private
503
598
  * @ui5-restricted
504
- * @param oSource Entity type or action
599
+ * @param source Entity type or action
505
600
  * @returns Array of SideEffects
506
601
  */
507
- private _getSideEffectsFromSource(oSource: EntityType | Action): ODataSideEffectsType[] {
508
- const aSideEffects: ODataSideEffectsType[] = [];
509
- const mEntityType: EntityType | undefined = oSource._type === "EntityType" ? oSource : oSource.sourceEntityType;
510
- if (mEntityType) {
511
- const mCommonAnnotation = oSource.annotations?.Common || ({} as Record<string, AnnotationTerm<any>>);
512
- const mBindingParameter = ((oSource as Action).parameters || []).find(
513
- (mParameter) => mParameter.type === mEntityType.fullyQualifiedName
602
+ private getSideEffectsFromSource(source: EntityType | Action): ODataSideEffectsType[] {
603
+ let bindingAlias = "";
604
+ const isSourceEntityType = isEntityType(source);
605
+ const entityType: EntityType | undefined = isSourceEntityType ? source : source.sourceEntityType;
606
+ const commonAnnotation = source.annotations?.Common as undefined | unknown as Record<string, CommonAnnotationTypes>;
607
+ if (entityType && commonAnnotation) {
608
+ if (!isSourceEntityType) {
609
+ const bindingParameter = source.parameters?.find((parameter) => parameter.type === entityType.fullyQualifiedName);
610
+ bindingAlias = bindingParameter?.fullyQualifiedName.split("/")[1] ?? "";
611
+ }
612
+ return this.getSideEffectsAnnotationFromSource(source).map((sideEffectAnno) =>
613
+ this.convertSideEffects(sideEffectAnno, entityType, bindingAlias)
514
614
  );
515
- const sBindingParameter = mBindingParameter ? mBindingParameter.fullyQualifiedName.split("/")[1] : "";
516
- Object.keys(mCommonAnnotation)
517
- .filter((sAnnotationName) => mCommonAnnotation[sAnnotationName].$Type === CommonAnnotationTypes.SideEffectsType)
518
- .forEach((sAnnotationName) => {
519
- aSideEffects.push(
520
- this._convertSideEffects(
521
- mCommonAnnotation[sAnnotationName] as CommonSideEffectsType,
522
- mEntityType,
523
- sBindingParameter
524
- )
525
- );
526
- });
527
615
  }
528
- return aSideEffects;
616
+ return [];
617
+ }
618
+ /**
619
+ * Gets the SideEffects related to an entity type or action that come from an OData Service
620
+ * Internal routine to get, from converted oData metaModel, SideEffects related to a specific entity type or action.
621
+ *
622
+ * @param source Entity type or action
623
+ * @returns Array of SideEffects
624
+ */
625
+ private getSideEffectsAnnotationFromSource(source: EntityType | Action): CommonSideEffectTypeWithQualifier[] {
626
+ const sideEffects: CommonSideEffectsType[] = [];
627
+ const commonAnnotation = source.annotations?.Common as undefined | unknown as Record<string, CommonSideEffectTypeWithQualifier>;
628
+ for (const key in commonAnnotation) {
629
+ const annotation = commonAnnotation[key];
630
+ if (this.isSideEffectsAnnotation(annotation)) {
631
+ sideEffects.push(annotation);
632
+ }
633
+ }
634
+ return sideEffects;
529
635
  }
530
636
 
531
637
  /**
532
- * Logs SideEffects request.
638
+ * Checks if the annotation is a SideEffects annotation.
533
639
  *
534
- * @private
535
640
  * @ui5-restricted
536
- * @param aPathExpressions SideEffects targets
537
- * @param oContext Context
641
+ * @param annotation Annotation
642
+ * @returns Boolean
538
643
  */
539
- private _logRequest(aPathExpressions: SideEffectsTarget[], oContext: Context) {
540
- const sTargetPaths = aPathExpressions.reduce(function (sPaths, mTarget) {
541
- return `${sPaths}\n\t\t${(mTarget as SideEffectsTargetEntityType).$NavigationPropertyPath || mTarget || ""}`;
644
+ private isSideEffectsAnnotation(annotation: unknown): annotation is CommonSideEffectsType {
645
+ return (annotation as CommonSideEffectsType)?.$Type === CommonAnnotationTypes.SideEffectsType;
646
+ }
647
+
648
+ /**
649
+ * Logs the SideEffects request.
650
+ *
651
+ * @ui5-restricted
652
+ * @param pathExpressions SideEffects targets
653
+ * @param context Context
654
+ */
655
+ private logRequest(pathExpressions: SideEffectsTarget[], context: Context) {
656
+ const targetPaths = pathExpressions.reduce(function (paths, target) {
657
+ return `${paths}\n\t\t${(target as SideEffectsEntityType).$NavigationPropertyPath || target || ""}`;
542
658
  }, "");
543
- Log.debug(`SideEffects - Request:\n\tContext path : ${oContext.getPath()}\n\tProperty paths :${sTargetPaths}`);
659
+ Log.debug(`SideEffects - Request:\n\tContext path : ${context.getPath()}\n\tProperty paths :${targetPaths}`);
544
660
  }
545
661
 
546
662
  /**
547
- * Removes name of binding parameter on SideEffects targets.
663
+ * Removes the name of the binding parameter on the SideEffects targets.
548
664
  *
549
- * @private
550
665
  * @ui5-restricted
551
- * @param oSideEffects SideEffects definition
552
- * @param sBindingParameterName Name of binding parameter
666
+ * @param sideEffectsTargets SideEffects Targets
667
+ * @param bindingParameterName Name of binding parameter
553
668
  * @returns SideEffects definition
554
669
  */
555
- private _removeBindingParameter(oSideEffects: BaseSideEffectsType, sBindingParameterName?: string): BaseSideEffectsType {
556
- if (sBindingParameterName) {
670
+ private removeBindingParameter(sideEffectsTargets: SideEffectsTargetType, bindingParameterName?: string): SideEffectsTargetType {
671
+ if (bindingParameterName) {
557
672
  const replaceBindingParameter = function (value: string) {
558
- return value.replace(new RegExp(`^${sBindingParameterName}/?`), "");
673
+ return value.replace(new RegExp(`^${bindingParameterName}/?`), "");
674
+ };
675
+ return {
676
+ targetProperties: sideEffectsTargets.targetProperties.map((targetProperty) => replaceBindingParameter(targetProperty)),
677
+ targetEntities: sideEffectsTargets.targetEntities.map((targetEntity) => {
678
+ return { $NavigationPropertyPath: replaceBindingParameter(targetEntity.$NavigationPropertyPath) };
679
+ })
559
680
  };
560
-
561
- oSideEffects.TargetProperties = oSideEffects.TargetProperties.map((targetProperty) => replaceBindingParameter(targetProperty));
562
- oSideEffects.TargetEntities = oSideEffects.TargetEntities.map((targetEntity) => {
563
- return { $NavigationPropertyPath: replaceBindingParameter(targetEntity.$NavigationPropertyPath) };
564
- });
565
681
  }
566
- return oSideEffects;
682
+ return {
683
+ targetProperties: sideEffectsTargets.targetProperties,
684
+ targetEntities: sideEffectsTargets.targetEntities
685
+ };
567
686
  }
568
687
 
569
688
  /**
570
689
  * Remove duplicates in SideEffects targets.
571
690
  *
572
- * @private
573
691
  * @ui5-restricted
574
- * @param targetProperties SideEffects TargetProperties
575
- * @param targetEntities SideEffects TargetEntities
692
+ * @param sideEffectsTargets SideEffects Targets
576
693
  * @returns SideEffects targets without duplicates
577
694
  */
578
- private _removeDuplicateTargets(targetProperties: string[], targetEntities: SideEffectsTargetEntityType[]): SideEffectsTargetType {
579
- const uniqueTargetedEntitiesPath = new Set<string>([]);
580
- const uniqueTargetProperties = new Set<string>(targetProperties);
581
- const uniqueTargetedEntities = targetEntities.filter((targetEntity) => {
582
- const navigationPath = targetEntity.$NavigationPropertyPath;
583
- if (!uniqueTargetedEntitiesPath.has(navigationPath)) {
584
- uniqueTargetedEntitiesPath.add(navigationPath);
585
- return true;
586
- }
587
- return false;
695
+ private removeDuplicateTargets(sideEffectsTargets: SideEffectsTargetType): SideEffectsTargetType {
696
+ const targetEntitiesPaths = sideEffectsTargets.targetEntities.map((targetEntity) => targetEntity.$NavigationPropertyPath);
697
+ const uniqueTargetedEntitiesPath = new Set<string>(targetEntitiesPaths);
698
+ const uniqueTargetProperties = new Set<string>(sideEffectsTargets.targetProperties);
699
+
700
+ const uniqueTargetedEntities = Array.from(uniqueTargetedEntitiesPath).map((entityPath) => {
701
+ return {
702
+ $NavigationPropertyPath: entityPath
703
+ };
588
704
  });
589
705
 
590
- return { TargetProperties: Array.from(uniqueTargetProperties), TargetEntities: uniqueTargetedEntities };
706
+ return { targetProperties: Array.from(uniqueTargetProperties), targetEntities: uniqueTargetedEntities };
591
707
  }
592
708
 
593
709
  /**
@@ -596,12 +712,11 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
596
712
  * related to a specific entity type and to convert these SideEffects with
597
713
  * expected format.
598
714
  *
599
- * @private
600
715
  * @ui5-restricted
601
716
  * @param entityType Entity type
602
717
  * @returns Entity type SideEffects dictionary
603
718
  */
604
- private _retrieveODataActionsSideEffects(entityType: EntityType): Record<string, ActionSideEffectsType> {
719
+ private retrieveODataActionsSideEffects(entityType: EntityType): Record<string, ActionSideEffectsType> {
605
720
  const sideEffects: Record<string, ActionSideEffectsType> = {};
606
721
  const actions = entityType.actions;
607
722
  if (actions) {
@@ -609,19 +724,19 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
609
724
  const action = entityType.actions[actionName];
610
725
  const triggerActions = new Set<string>();
611
726
  let targetProperties: string[] = [];
612
- let targetEntities: SideEffectsTargetEntityType[] = [];
727
+ let targetEntities: SideEffectsEntityType[] = [];
613
728
 
614
- this._getSideEffectsFromSource(action).forEach((oDataSideEffect) => {
615
- const triggerAction = oDataSideEffect.TriggerAction;
616
- targetProperties = targetProperties.concat(oDataSideEffect.TargetProperties);
617
- targetEntities = targetEntities.concat(oDataSideEffect.TargetEntities);
729
+ this.getSideEffectsFromSource(action).forEach((oDataSideEffect) => {
730
+ const triggerAction = oDataSideEffect.triggerAction;
731
+ targetProperties = targetProperties.concat(oDataSideEffect.targetProperties);
732
+ targetEntities = targetEntities.concat(oDataSideEffect.targetEntities);
618
733
  if (triggerAction) {
619
734
  triggerActions.add(triggerAction);
620
735
  }
621
736
  });
622
- const sideEffectsTargets = this._removeDuplicateTargets(targetProperties, targetEntities);
737
+ const sideEffectsTargets = this.removeDuplicateTargets({ targetProperties, targetEntities });
623
738
  sideEffects[actionName] = {
624
- pathExpressions: [...sideEffectsTargets.TargetProperties, ...sideEffectsTargets.TargetEntities],
739
+ pathExpressions: [...sideEffectsTargets.targetProperties, ...sideEffectsTargets.targetEntities],
625
740
  triggerActions: Array.from(triggerActions)
626
741
  };
627
742
  });
@@ -635,17 +750,71 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
635
750
  * related to a specific entity type and to convert these SideEffects with
636
751
  * expected format.
637
752
  *
638
- * @private
639
753
  * @ui5-restricted
640
- * @param mEntityType Entity type
754
+ * @param entityType Entity type
641
755
  * @returns Entity type SideEffects dictionary
642
756
  */
643
- private _retrieveODataEntitySideEffects(mEntityType: EntityType): Record<string, ODataSideEffectsType> {
644
- const oEntitySideEffects: Record<string, ODataSideEffectsType> = {};
645
- this._getSideEffectsFromSource(mEntityType).forEach((oSideEffects) => {
646
- oEntitySideEffects[oSideEffects.fullyQualifiedName] = oSideEffects;
757
+ private retrieveODataEntitySideEffects(entityType: EntityType): Record<string, ODataSideEffectsType> {
758
+ const entitySideEffects: Record<string, ODataSideEffectsType> = {};
759
+ this.getSideEffectsFromSource(entityType).forEach((sideEffects) => {
760
+ entitySideEffects[sideEffects.fullyQualifiedName] = sideEffects;
647
761
  });
648
- return oEntitySideEffects;
762
+ return entitySideEffects;
763
+ }
764
+
765
+ /**
766
+ * Defines a map for the Sources of sideEffect on the entity to track where those sources are used in SideEffects annotation.
767
+ *
768
+ * @param entityType The entityType we look for side Effects annotation
769
+ * @param sideEffectsSources The mapping object in construction
770
+ * @param sideEffectsSources.entities
771
+ * @param sideEffectsSources.properties
772
+ */
773
+ private mapSideEffectSources(
774
+ entityType: EntityType,
775
+ sideEffectsSources: { entities: Record<string, SideEffectInfoForSource[]>; properties: Record<string, SideEffectInfoForSource[]> }
776
+ ): void {
777
+ for (const sideEffectDefinition of this.getSideEffectsAnnotationFromSource(entityType)) {
778
+ for (const sourceEntity of sideEffectDefinition.SourceEntities ?? []) {
779
+ const targetEntityType = sourceEntity.value ? sourceEntity.$target?.targetType : entityType;
780
+ if (targetEntityType) {
781
+ if (!sideEffectsSources.entities[targetEntityType.fullyQualifiedName]) {
782
+ sideEffectsSources.entities[targetEntityType.fullyQualifiedName] = [];
783
+ }
784
+ sideEffectsSources.entities[targetEntityType.fullyQualifiedName].push({
785
+ entity: entityType.fullyQualifiedName,
786
+ qualifier: sideEffectDefinition.qualifier
787
+ });
788
+ }
789
+ }
790
+ const hasUniqueSourceProperty = sideEffectDefinition.SourceProperties?.length === 1;
791
+ for (const sourceProperty of sideEffectDefinition.SourceProperties ?? []) {
792
+ if (!sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName]) {
793
+ sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName] = [];
794
+ }
795
+ sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName].push({
796
+ entity: entityType.fullyQualifiedName,
797
+ qualifier: sideEffectDefinition.qualifier,
798
+ hasUniqueSourceProperty
799
+ });
800
+ }
801
+ }
802
+ }
803
+
804
+ /**
805
+ * Get the fieldGroupId based on the stored information on th side effect.
806
+ *
807
+ * @param sideEffectInfo
808
+ * @param isImmediate
809
+ * @returns A string for the fieldGroupId.
810
+ */
811
+ private getFieldGroupIdForSideEffect(sideEffectInfo: SideEffectInfoForSource, isImmediate: boolean = false): string {
812
+ const sideEffectWithQualifier = sideEffectInfo.qualifier
813
+ ? `${sideEffectInfo.entity}#${sideEffectInfo.qualifier}`
814
+ : sideEffectInfo.entity;
815
+ return isImmediate || sideEffectInfo.hasUniqueSourceProperty === true
816
+ ? `${sideEffectWithQualifier}$$ImmediateRequest`
817
+ : sideEffectWithQualifier;
649
818
  }
650
819
 
651
820
  getInterface(): SideEffectsService {