@sapui5/sap.fe.core 1.98.0 → 1.101.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 (318) hide show
  1. package/package.json +8 -5
  2. package/src/sap/fe/core/.library +2 -3
  3. package/src/sap/fe/core/AnnotationHelper.js +328 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +321 -0
  5. package/src/sap/fe/core/AppComponent.js +382 -399
  6. package/src/sap/fe/core/AppComponent.ts +397 -0
  7. package/src/sap/fe/core/AppStateHandler.js +198 -181
  8. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  9. package/src/sap/fe/core/BaseController.js +83 -58
  10. package/src/sap/fe/core/BaseController.ts +67 -0
  11. package/src/sap/fe/core/BusyLocker.js +105 -121
  12. package/src/sap/fe/core/BusyLocker.ts +98 -0
  13. package/src/sap/fe/core/CommonUtils.js +2221 -2399
  14. package/src/sap/fe/core/CommonUtils.ts +2248 -0
  15. package/src/sap/fe/core/ExtensionAPI.js +280 -274
  16. package/src/sap/fe/core/ExtensionAPI.ts +242 -0
  17. package/src/sap/fe/core/PageController.js +219 -131
  18. package/src/sap/fe/core/PageController.ts +129 -0
  19. package/src/sap/fe/core/RouterProxy.js +936 -823
  20. package/src/sap/fe/core/RouterProxy.ts +854 -0
  21. package/src/sap/fe/core/Synchronization.js +41 -35
  22. package/src/sap/fe/core/Synchronization.ts +29 -0
  23. package/src/sap/fe/core/TemplateComponent.js +248 -164
  24. package/src/sap/fe/core/TemplateComponent.ts +161 -0
  25. package/src/sap/fe/core/TemplateModel.js +77 -54
  26. package/src/sap/fe/core/TemplateModel.ts +63 -0
  27. package/src/sap/fe/core/TransactionHelper.js +1575 -1664
  28. package/src/sap/fe/core/TransactionHelper.ts +1736 -0
  29. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
  30. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
  31. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
  32. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
  33. package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
  34. package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
  35. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
  36. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  37. package/src/sap/fe/core/actions/draft.js +663 -608
  38. package/src/sap/fe/core/actions/draft.ts +669 -0
  39. package/src/sap/fe/core/actions/messageHandling.js +576 -514
  40. package/src/sap/fe/core/actions/messageHandling.ts +562 -0
  41. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  42. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  43. package/src/sap/fe/core/actions/operations.js +1093 -1215
  44. package/src/sap/fe/core/actions/operations.ts +1193 -0
  45. package/src/sap/fe/core/actions/sticky.js +114 -104
  46. package/src/sap/fe/core/actions/sticky.ts +119 -0
  47. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
  48. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
  49. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
  50. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
  51. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
  52. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
  53. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
  54. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
  55. package/src/sap/fe/core/controllerextensions/EditFlow.js +1855 -1827
  56. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
  57. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
  58. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
  59. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +717 -512
  60. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
  61. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -815
  62. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
  63. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1057 -1004
  64. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
  65. package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -533
  66. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +36 -32
  67. package/src/sap/fe/core/controllerextensions/MassEdit.js +142 -77
  68. package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
  69. package/src/sap/fe/core/controllerextensions/MessageHandler.js +222 -236
  70. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
  71. package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
  72. package/src/sap/fe/core/controllerextensions/PageReady.ts +63 -55
  73. package/src/sap/fe/core/controllerextensions/Paginator.js +189 -175
  74. package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
  75. package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -149
  76. package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
  77. package/src/sap/fe/core/controllerextensions/Routing.js +145 -121
  78. package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
  79. package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
  80. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  81. package/src/sap/fe/core/controllerextensions/Share.js +231 -268
  82. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  83. package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
  84. package/src/sap/fe/core/controllerextensions/SideEffects.ts +79 -79
  85. package/src/sap/fe/core/controllerextensions/ViewState.js +775 -806
  86. package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
  87. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
  88. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  89. package/src/sap/fe/core/controls/Any.js +28 -0
  90. package/src/sap/fe/core/controls/Any.ts +30 -0
  91. package/src/sap/fe/core/controls/CommandExecution.js +93 -68
  92. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  93. package/src/sap/fe/core/controls/ConditionalWrapper.js +166 -79
  94. package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
  95. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
  96. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
  97. package/src/sap/fe/core/controls/CustomQuickViewPage.js +168 -125
  98. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
  99. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
  100. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +164 -122
  101. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
  102. package/src/sap/fe/core/controls/FieldWrapper.js +213 -153
  103. package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
  104. package/src/sap/fe/core/controls/FileWrapper.js +313 -0
  105. package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
  106. package/src/sap/fe/core/controls/FilterBar.js +198 -159
  107. package/src/sap/fe/core/controls/FilterBar.ts +148 -0
  108. package/src/sap/fe/core/controls/FormElementWrapper.js +101 -39
  109. package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
  110. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
  111. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  112. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
  113. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +148 -115
  114. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
  115. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +301 -265
  116. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
  117. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +186 -140
  118. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  119. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
  120. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  121. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
  122. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +76 -74
  123. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
  124. package/src/sap/fe/core/converters/ConverterContext.js +348 -379
  125. package/src/sap/fe/core/converters/ConverterContext.ts +23 -19
  126. package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
  127. package/src/sap/fe/core/converters/ManifestSettings.ts +18 -2
  128. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -365
  129. package/src/sap/fe/core/converters/ManifestWrapper.ts +19 -0
  130. package/src/sap/fe/core/converters/MetaModelConverter.js +16 -11
  131. package/src/sap/fe/core/converters/MetaModelConverter.ts +21 -18
  132. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  133. package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
  134. package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
  135. package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
  136. package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
  137. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -11
  138. package/src/sap/fe/core/converters/controls/Common/Action.ts +22 -21
  139. package/src/sap/fe/core/converters/controls/Common/Chart.js +12 -10
  140. package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -14
  141. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  142. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  143. package/src/sap/fe/core/converters/controls/Common/Form.js +9 -7
  144. package/src/sap/fe/core/converters/controls/Common/Form.ts +23 -5
  145. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  146. package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
  147. package/src/sap/fe/core/converters/controls/Common/Table.js +562 -218
  148. package/src/sap/fe/core/converters/controls/Common/Table.ts +670 -320
  149. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +218 -94
  150. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +265 -159
  151. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +495 -77
  152. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +535 -130
  153. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
  154. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
  155. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +10 -7
  156. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +13 -16
  157. package/src/sap/fe/core/converters/helpers/Aggregation.js +117 -127
  158. package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
  159. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  160. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  161. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  162. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  163. package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
  164. package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
  165. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  166. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  167. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  168. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
  169. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +54 -30
  170. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
  171. package/src/sap/fe/core/converters/templates/ListReportConverter.js +52 -28
  172. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +111 -74
  173. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
  174. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
  175. package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -98
  176. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  177. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  178. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  179. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  180. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  181. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  182. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  183. package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
  184. package/src/sap/fe/core/formatters/KPIFormatter.ts +4 -1
  185. package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
  186. package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
  187. package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
  188. package/src/sap/fe/core/formatters/ValueFormatter.ts +5 -7
  189. package/src/sap/fe/core/fpm/Component.js +81 -55
  190. package/src/sap/fe/core/fpm/Component.ts +43 -0
  191. package/src/sap/fe/core/helpers/AppStartupHelper.js +324 -310
  192. package/src/sap/fe/core/helpers/AppStartupHelper.ts +370 -341
  193. package/src/sap/fe/core/helpers/BindingExpression.js +319 -360
  194. package/src/sap/fe/core/helpers/BindingExpression.ts +323 -397
  195. package/src/sap/fe/core/helpers/ClassSupport.js +321 -168
  196. package/src/sap/fe/core/helpers/ClassSupport.ts +362 -158
  197. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
  198. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
  199. package/src/sap/fe/core/helpers/EditState.js +81 -84
  200. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  201. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  202. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  203. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  204. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  205. package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
  206. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
  207. package/src/sap/fe/core/helpers/MassEditHelper.js +736 -676
  208. package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
  209. package/src/sap/fe/core/helpers/ModelHelper.js +281 -225
  210. package/src/sap/fe/core/helpers/ModelHelper.ts +273 -0
  211. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  212. package/src/sap/fe/core/helpers/PasteHelper.ts +197 -0
  213. package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
  214. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +336 -0
  215. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  216. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  217. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -10
  218. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -10
  219. package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
  220. package/src/sap/fe/core/jsx-runtime/jsx.ts +23 -9
  221. package/src/sap/fe/core/library.js +426 -451
  222. package/src/sap/fe/core/library.support.js +23 -33
  223. package/src/sap/fe/core/library.support.ts +23 -0
  224. package/src/sap/fe/core/library.ts +420 -0
  225. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
  226. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +5 -5
  227. package/src/sap/fe/core/messagebundle.properties +63 -18
  228. package/src/sap/fe/core/messagebundle_ar.properties +37 -6
  229. package/src/sap/fe/core/messagebundle_bg.properties +37 -6
  230. package/src/sap/fe/core/messagebundle_ca.properties +37 -6
  231. package/src/sap/fe/core/messagebundle_cs.properties +38 -7
  232. package/src/sap/fe/core/messagebundle_cy.properties +37 -6
  233. package/src/sap/fe/core/messagebundle_da.properties +37 -6
  234. package/src/sap/fe/core/messagebundle_de.properties +37 -6
  235. package/src/sap/fe/core/messagebundle_el.properties +37 -6
  236. package/src/sap/fe/core/messagebundle_en.properties +37 -6
  237. package/src/sap/fe/core/messagebundle_en_GB.properties +37 -6
  238. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -6
  239. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -6
  240. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +37 -6
  241. package/src/sap/fe/core/messagebundle_es.properties +37 -6
  242. package/src/sap/fe/core/messagebundle_es_MX.properties +37 -6
  243. package/src/sap/fe/core/messagebundle_et.properties +37 -6
  244. package/src/sap/fe/core/messagebundle_fi.properties +38 -7
  245. package/src/sap/fe/core/messagebundle_fr.properties +43 -12
  246. package/src/sap/fe/core/messagebundle_fr_CA.properties +45 -14
  247. package/src/sap/fe/core/messagebundle_hi.properties +43 -12
  248. package/src/sap/fe/core/messagebundle_hr.properties +43 -12
  249. package/src/sap/fe/core/messagebundle_hu.properties +37 -6
  250. package/src/sap/fe/core/messagebundle_id.properties +38 -7
  251. package/src/sap/fe/core/messagebundle_it.properties +37 -6
  252. package/src/sap/fe/core/messagebundle_iw.properties +37 -6
  253. package/src/sap/fe/core/messagebundle_ja.properties +36 -5
  254. package/src/sap/fe/core/messagebundle_kk.properties +43 -12
  255. package/src/sap/fe/core/messagebundle_ko.properties +37 -6
  256. package/src/sap/fe/core/messagebundle_lt.properties +37 -6
  257. package/src/sap/fe/core/messagebundle_lv.properties +44 -13
  258. package/src/sap/fe/core/messagebundle_ms.properties +42 -11
  259. package/src/sap/fe/core/messagebundle_nl.properties +37 -6
  260. package/src/sap/fe/core/messagebundle_no.properties +37 -6
  261. package/src/sap/fe/core/messagebundle_pl.properties +37 -6
  262. package/src/sap/fe/core/messagebundle_pt.properties +38 -7
  263. package/src/sap/fe/core/messagebundle_pt_PT.properties +37 -6
  264. package/src/sap/fe/core/messagebundle_ro.properties +37 -6
  265. package/src/sap/fe/core/messagebundle_ru.properties +37 -6
  266. package/src/sap/fe/core/messagebundle_sh.properties +39 -8
  267. package/src/sap/fe/core/messagebundle_sk.properties +37 -6
  268. package/src/sap/fe/core/messagebundle_sl.properties +43 -12
  269. package/src/sap/fe/core/messagebundle_sv.properties +38 -7
  270. package/src/sap/fe/core/messagebundle_th.properties +36 -5
  271. package/src/sap/fe/core/messagebundle_tr.properties +39 -8
  272. package/src/sap/fe/core/messagebundle_uk.properties +37 -6
  273. package/src/sap/fe/core/messagebundle_vi.properties +37 -6
  274. package/src/sap/fe/core/messagebundle_zh_CN.properties +37 -6
  275. package/src/sap/fe/core/messagebundle_zh_TW.properties +43 -12
  276. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
  277. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  278. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
  279. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +211 -0
  280. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
  281. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -8
  282. package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
  283. package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
  284. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
  285. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
  286. package/src/sap/fe/core/services/RoutingServiceFactory.js +963 -899
  287. package/src/sap/fe/core/services/RoutingServiceFactory.ts +907 -0
  288. package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
  289. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -40
  290. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +572 -643
  291. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +67 -96
  292. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -487
  293. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +449 -0
  294. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +48 -8
  295. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +11 -0
  296. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  297. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  298. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  299. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  300. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  301. package/src/sap/fe/core/support/CommonHelper.ts +1 -4
  302. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  303. package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
  304. package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
  305. package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
  306. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
  307. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  308. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  309. package/src/sap/fe/core/templating/FilterHelper.js +138 -79
  310. package/src/sap/fe/core/templating/FilterHelper.ts +148 -79
  311. package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
  312. package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
  313. package/src/sap/fe/core/templating/UIFormatters.js +179 -43
  314. package/src/sap/fe/core/templating/UIFormatters.ts +190 -61
  315. package/src/sap/fe/core/type/Email.js +26 -8
  316. package/src/sap/fe/core/type/Email.ts +10 -11
  317. package/ui5.yaml +0 -3
  318. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -74
@@ -0,0 +1,810 @@
1
+ import Log from "sap/base/Log";
2
+ import mergeObjects from "sap/base/util/merge";
3
+ import AppComponent from "sap/fe/core/AppComponent";
4
+ import CommonUtils from "sap/fe/core/CommonUtils";
5
+ import {
6
+ defineUI5Class,
7
+ extensible,
8
+ finalExtension,
9
+ methodOverride,
10
+ privateExtension,
11
+ publicExtension
12
+ } from "sap/fe/core/helpers/ClassSupport";
13
+ import KeepAliveHelper from "sap/fe/core/helpers/KeepAliveHelper";
14
+ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
15
+ import PageController from "sap/fe/core/PageController";
16
+ import { NavigationService } from "sap/fe/core/services/NavigationServiceFactory";
17
+ import SelectionVariant from "sap/fe/navigation/SelectionVariant";
18
+ import Dialog from "sap/m/Dialog";
19
+ import Core from "sap/ui/core/Core";
20
+ import Fragment from "sap/ui/core/Fragment";
21
+ import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
22
+ import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
23
+ import View from "sap/ui/core/mvc/View";
24
+ import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
25
+ import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
26
+ import Context from "sap/ui/model/Context";
27
+ import JSONModel from "sap/ui/model/json/JSONModel";
28
+ import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
29
+ import { CoreEx } from "types/extension_types";
30
+
31
+ /**
32
+ * {@link sap.ui.core.mvc.ControllerExtension Controller extension}
33
+ *
34
+ * @namespace
35
+ * @alias sap.fe.core.controllerextensions.InternalInternalBasedNavigation
36
+ *
37
+ * @private
38
+ * @since 1.84.0
39
+ */
40
+ @defineUI5Class("sap.fe.core.controllerextensions.InternalInternalBasedNavigation")
41
+ class InternalIntentBasedNavigation extends ControllerExtension {
42
+ protected base!: PageController;
43
+ private _oAppComponent!: AppComponent;
44
+ private _oMetaModel!: ODataMetaModel;
45
+ private _oNavigationService!: NavigationService;
46
+ private _oView!: View;
47
+ @methodOverride()
48
+ onInit() {
49
+ this._oAppComponent = this.base.getAppComponent();
50
+ this._oMetaModel = this._oAppComponent.getModel().getMetaModel() as ODataMetaModel;
51
+ this._oNavigationService = this._oAppComponent.getNavigationService();
52
+ this._oView = this.base.getView();
53
+ }
54
+
55
+ /**
56
+ * Enables intent-based navigation (SemanticObject-Action) with the provided context.
57
+ * If semantic object mapping is provided, this is also applied to the selection variant after the adaptation by a consumer.
58
+ * This takes care of removing any technical parameters and determines if an explace or inplace navigation should take place.
59
+ *
60
+ * @param {string} sSemanticObject Semantic object for the target app
61
+ * @param {string} sAction Action for the target app
62
+ * @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
63
+ * @param {Array|object} [mNavigationParameters.navigationContexts] Uses one of the following to be passed to the intent:
64
+ * a single instance of {@link sap.ui.model.odata.v4.Context}
65
+ * multiple instances of {@link sap.ui.model.odata.v4.Context}
66
+ * an object or an array of objects
67
+ * If an array of objects is passed, the context is used to determine the metaPath and to remove any sensitive data
68
+ * If an array of objects is passed, the following format ix expected:
69
+ * {
70
+ * data: {
71
+ * ProductID: 7634,
72
+ * Name: "Laptop"
73
+ * },
74
+ * metaPath: "/SalesOrderManage"
75
+ * }
76
+ * @param {string | object} [mNavigationParameters.semanticObjectMapping] String representation of the SemanticObjectMapping or SemanticObjectMapping that applies to this navigation
77
+ * @param {object} [mNavigationParameters.defaultRefreshStrategy] Default refresh strategy to be used in case no refresh strategy is specified for the intent in the view.
78
+ * @param {object} [mNavigationParameters.refreshStrategies]
79
+ * @param {object} [mNavigationParameters.additionalNavigationParameters] Additional navigation parameters configured in the crossAppNavigation outbound parameters.
80
+ **/
81
+ @publicExtension()
82
+ @finalExtension()
83
+ navigate(
84
+ sSemanticObject: string,
85
+ sAction: string,
86
+ mNavigationParameters:
87
+ | {
88
+ navigationContexts?: object | any[] | undefined;
89
+ semanticObjectMapping?: string | object | undefined;
90
+ defaultRefreshStrategy?: object | undefined;
91
+ refreshStrategies?: any;
92
+ additionalNavigationParameters?: object | undefined;
93
+ }
94
+ | undefined
95
+ ) {
96
+ const _doNavigate = (oContext?: any) => {
97
+ const vNavigationContexts = mNavigationParameters && mNavigationParameters.navigationContexts,
98
+ aNavigationContexts =
99
+ vNavigationContexts && !Array.isArray(vNavigationContexts) ? [vNavigationContexts] : vNavigationContexts,
100
+ vSemanticObjectMapping = mNavigationParameters && mNavigationParameters.semanticObjectMapping,
101
+ vOutboundParams = mNavigationParameters && mNavigationParameters.additionalNavigationParameters,
102
+ oTargetInfo: any = {
103
+ semanticObject: sSemanticObject,
104
+ action: sAction
105
+ },
106
+ oView = this.base.getView(),
107
+ oController = oView.getController() as PageController;
108
+
109
+ if (oContext) {
110
+ this._oView.setBindingContext(oContext);
111
+ }
112
+
113
+ if (sSemanticObject && sAction) {
114
+ let aSemanticAttributes: any[] = [],
115
+ oSelectionVariant = new SelectionVariant();
116
+ // 1. get SemanticAttributes for navigation
117
+ if (aNavigationContexts && aNavigationContexts.length) {
118
+ aNavigationContexts.forEach((oNavigationContext: any) => {
119
+ // 1.1.a if navigation context is instance of sap.ui.mode.odata.v4.Context
120
+ // else check if navigation context is of type object
121
+ if (oNavigationContext.isA && oNavigationContext.isA("sap.ui.model.odata.v4.Context")) {
122
+ // 1.1.b remove sensitive data
123
+ let oSemanticAttributes = oNavigationContext.getObject();
124
+ const sMetaPath = this._oMetaModel.getMetaPath(oNavigationContext.getPath());
125
+ // TODO: also remove sensitive data from navigation properties
126
+ oSemanticAttributes = this.removeSensitiveData(oSemanticAttributes, sMetaPath);
127
+ const oNavContext = this.prepareContextForExternalNavigation(oSemanticAttributes, oNavigationContext);
128
+ oTargetInfo["propertiesWithoutConflict"] = oNavContext.propertiesWithoutConflict;
129
+ aSemanticAttributes.push(oNavContext.semanticAttributes);
130
+ } else if (
131
+ !(oNavigationContext && Array.isArray(oNavigationContext.data)) &&
132
+ typeof oNavigationContext === "object"
133
+ ) {
134
+ // 1.1.b remove sensitive data from object
135
+ aSemanticAttributes.push(this.removeSensitiveData(oNavigationContext.data, oNavigationContext.metaPath));
136
+ } else if (oNavigationContext && Array.isArray(oNavigationContext.data)) {
137
+ // oNavigationContext.data can be array already ex : [{Customer: "10001"}, {Customer: "10091"}]
138
+ // hence assigning it to the aSemanticAttributes
139
+ aSemanticAttributes = this.removeSensitiveData(oNavigationContext.data, oNavigationContext.metaPath);
140
+ }
141
+ });
142
+ }
143
+ // 2.1 Merge base selection variant and sanitized semantic attributes into one SelectionVariant
144
+ if (aSemanticAttributes && aSemanticAttributes.length) {
145
+ oSelectionVariant = this._oNavigationService.mixAttributesAndSelectionVariant(
146
+ aSemanticAttributes,
147
+ oSelectionVariant.toJSONString()
148
+ );
149
+ }
150
+
151
+ // 3. Add filterContextUrl to SV so the NavigationHandler can remove any sensitive data based on view entitySet
152
+ const oModel = this._oView.getModel(),
153
+ sEntitySet = this.getEntitySet(),
154
+ sContextUrl = sEntitySet ? this._oNavigationService.constructContextUrl(sEntitySet, oModel) : undefined;
155
+ if (sContextUrl) {
156
+ oSelectionVariant.setFilterContextUrl(sContextUrl);
157
+ }
158
+
159
+ // Apply Outbound Parameters to the SV
160
+ if (vOutboundParams) {
161
+ this._applyOutboundParams(oSelectionVariant, vOutboundParams);
162
+ }
163
+
164
+ // 4. give an opportunity for the application to influence the SelectionVariant
165
+ oController.intentBasedNavigation.adaptNavigationContext(oSelectionVariant, oTargetInfo);
166
+
167
+ // 5. Apply semantic object mappings to the SV
168
+ if (vSemanticObjectMapping) {
169
+ this._applySemanticObjectMappings(oSelectionVariant, vSemanticObjectMapping);
170
+ }
171
+
172
+ // 6. remove technical parameters from Selection Variant
173
+ this._removeTechnicalParameters(oSelectionVariant);
174
+
175
+ // 7. check if programming model is sticky and page is editable
176
+ const sNavMode = oController._intentBasedNavigation.getNavigationMode();
177
+
178
+ // 8. Updating refresh strategy in internal model
179
+ const mRefreshStrategies = (mNavigationParameters && mNavigationParameters.refreshStrategies) || {},
180
+ oInternalModel = oView.getModel("internal") as JSONModel;
181
+ if (oInternalModel) {
182
+ if ((oView && (oView.getViewData() as any)).refreshStrategyOnAppRestore) {
183
+ const mViewRefreshStrategies = (oView.getViewData() as any).refreshStrategyOnAppRestore || {};
184
+ mergeObjects(mRefreshStrategies, mViewRefreshStrategies);
185
+ }
186
+ const mRefreshStrategy = KeepAliveHelper.getRefreshStrategyForIntent(mRefreshStrategies, sSemanticObject, sAction);
187
+ if (mRefreshStrategy) {
188
+ oInternalModel.setProperty("/refreshStrategyOnAppRestore", mRefreshStrategy);
189
+ }
190
+ }
191
+
192
+ // 9. Navigate via NavigationHandler
193
+ const onError = function () {
194
+ sap.ui.require(["sap/m/MessageBox"], function (MessageBox: any) {
195
+ const oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
196
+ MessageBox.show(oResourceBundle.getText("C_COMMON_HELPER_NAVIGATION_ERROR_MESSAGE"), {
197
+ title: oResourceBundle.getText("C_COMMON_NAVIGATION_ERROR_TITLE")
198
+ });
199
+ });
200
+ };
201
+ this._oNavigationService.navigate(
202
+ sSemanticObject,
203
+ sAction,
204
+ (oSelectionVariant as any).toJSONString(),
205
+ undefined,
206
+ onError,
207
+ undefined,
208
+ sNavMode
209
+ );
210
+ } else {
211
+ throw new Error("Semantic Object/action is not provided");
212
+ }
213
+ };
214
+ const oBindingContext = this.base.getView().getBindingContext();
215
+ const oMetaModel = oBindingContext && (oBindingContext.getModel().getMetaModel() as ODataMetaModel);
216
+ if (
217
+ (this.getView().getViewData() as any).converterType === "ObjectPage" &&
218
+ oMetaModel &&
219
+ !ModelHelper.isStickySessionSupported(oMetaModel)
220
+ ) {
221
+ CommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(
222
+ _doNavigate.bind(this),
223
+ Function.prototype,
224
+ this.base.getView().getBindingContext(),
225
+ this.base.getView().getController()
226
+ );
227
+ } else {
228
+ _doNavigate();
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Prepare attributes to be passed to external navigation.
234
+ * @param {object} oSemanticAttributes Context data after removing all sensitive information.
235
+ * @param {object} oContext Actual context from which the semanticAttributes were derived.
236
+ * @returns {object} Object of prepared attributes for external navigation and no conflict properties.
237
+ */
238
+ @publicExtension()
239
+ @finalExtension()
240
+ prepareContextForExternalNavigation(oSemanticAttributes: any, oContext: Context) {
241
+ // 1. Find all distinct keys in the object SemanticAttributes
242
+ // Store meta path for each occurence of the key
243
+ const oDistinctKeys: any = {},
244
+ sContextPath = oContext.getPath(),
245
+ oMetaModel = oContext.getModel().getMetaModel() as ODataMetaModel,
246
+ sMetaPath = oMetaModel.getMetaPath(sContextPath),
247
+ aMetaPathParts = sMetaPath.split("/").filter(Boolean);
248
+
249
+ function _findDistinctKeysInObject(LookUpObject: any, sLookUpObjectMetaPath: any) {
250
+ for (const sKey in LookUpObject) {
251
+ // null case??
252
+ if (LookUpObject[sKey] === null || typeof LookUpObject[sKey] !== "object") {
253
+ if (!oDistinctKeys[sKey]) {
254
+ // if key is found for the first time then create array
255
+ oDistinctKeys[sKey] = [];
256
+ }
257
+ // push path to array
258
+ oDistinctKeys[sKey].push(sLookUpObjectMetaPath);
259
+ } else {
260
+ // if a nested object is found
261
+ const oNewLookUpObject = LookUpObject[sKey];
262
+ _findDistinctKeysInObject(oNewLookUpObject, sLookUpObjectMetaPath + "/" + sKey);
263
+ }
264
+ }
265
+ }
266
+
267
+ _findDistinctKeysInObject(oSemanticAttributes, sMetaPath);
268
+
269
+ // 2. Determine distinct key value and add conflicted paths to semantic attributes
270
+ const sMainEntitySetName = aMetaPathParts[0],
271
+ sMainEntityTypeName = oMetaModel.getObject("/" + sMainEntitySetName + "/@sapui.name"),
272
+ oPropertiesWithoutConflict: any = {};
273
+ let sMainEntityValuePath, sCurrentValuePath, sLastValuePath;
274
+ for (const sDistinctKey in oDistinctKeys) {
275
+ const aConflictingPaths = oDistinctKeys[sDistinctKey];
276
+ let sWinnerValuePath;
277
+ // Find winner value for each distinct key in case of conflict by the following rule:
278
+
279
+ // -> A. if any meta path for a distinct key is the same as main entity take that as the value
280
+ // -> B. if A is not met keep the value from the current context (sMetaPath === path of distince key)
281
+ // -> C. if A, B or C are not met take the last path for value
282
+ if (aConflictingPaths.length > 1) {
283
+ // conflict
284
+ for (let i = 0; i <= aConflictingPaths.length - 1; i++) {
285
+ const sPath = aConflictingPaths[i];
286
+ let sPathInContext = sPath.replace(sPath === sMetaPath ? sMetaPath : sMetaPath + "/", "");
287
+ sPathInContext = (sPathInContext === "" ? sPathInContext : sPathInContext + "/") + sDistinctKey;
288
+ const sEntityTypeName = oMetaModel.getObject(sPath + "/@sapui.name");
289
+ // rule A
290
+
291
+ // rule A
292
+ if (sEntityTypeName === sMainEntityTypeName) {
293
+ sMainEntityValuePath = sPathInContext;
294
+ }
295
+
296
+ // rule B
297
+ if (sPath === sMetaPath) {
298
+ sCurrentValuePath = sPathInContext;
299
+ }
300
+
301
+ // rule C
302
+ sLastValuePath = sPathInContext;
303
+
304
+ // add conflicted path to semantic attributes
305
+ // check if the current path points to main entity and prefix attribute names accordingly
306
+ oSemanticAttributes[
307
+ (sMetaPath + "/" + sPathInContext)
308
+ .split("/")
309
+ .filter(function (sValue: string) {
310
+ return sValue != "";
311
+ })
312
+ .join(".")
313
+ ] = oContext.getProperty(sPathInContext);
314
+ }
315
+ // A || B || C
316
+ sWinnerValuePath = sMainEntityValuePath || sCurrentValuePath || sLastValuePath;
317
+ oSemanticAttributes[sDistinctKey] = oContext.getProperty(sWinnerValuePath);
318
+ sMainEntityValuePath = undefined;
319
+ sCurrentValuePath = undefined;
320
+ sLastValuePath = undefined;
321
+ } else {
322
+ // no conflict, add distinct key without adding paths
323
+ const sPath = aConflictingPaths[0]; // because there is only one and hence no conflict
324
+ let sPathInContext = sPath.replace(sPath === sMetaPath ? sMetaPath : sMetaPath + "/", "");
325
+ sPathInContext = (sPathInContext === "" ? sPathInContext : sPathInContext + "/") + sDistinctKey;
326
+ oSemanticAttributes[sDistinctKey] = oContext.getProperty(sPathInContext);
327
+ oPropertiesWithoutConflict[sDistinctKey] = (sMetaPath + "/" + sPathInContext)
328
+ .split("/")
329
+ .filter(function (sValue: string) {
330
+ return sValue != "";
331
+ })
332
+ .join(".");
333
+ }
334
+ }
335
+ // 3. Remove all Navigation properties
336
+ for (const sProperty in oSemanticAttributes) {
337
+ if (oSemanticAttributes[sProperty] !== null && typeof oSemanticAttributes[sProperty] === "object") {
338
+ delete oSemanticAttributes[sProperty];
339
+ }
340
+ }
341
+ return {
342
+ semanticAttributes: oSemanticAttributes,
343
+ propertiesWithoutConflict: oPropertiesWithoutConflict
344
+ };
345
+ }
346
+ /**
347
+ * Prepare filter conditions to be passed to external navigation.
348
+ * @param {object} oFilterBarConditions Filter conditions.
349
+ * @param {string} sRootPath Root path of the application.
350
+ * @param {Array} aParameters Names of parameters to be considered.
351
+ * @returns {object} Object of prepared filter conditions for external navigation and no conflict filters.
352
+ */
353
+ @publicExtension()
354
+ @finalExtension()
355
+ prepareFiltersForExternalNavigation(oFilterBarConditions: any, sRootPath: string, aParameters?: any[]) {
356
+ let sPath;
357
+ const oDistinctKeys: any = {};
358
+ const oFilterConditionsWithoutConflict: any = {};
359
+ let sMainEntityValuePath, sCurrentValuePath, sFullContextPath, sWinnerValuePath, sPathInContext;
360
+
361
+ function _findDistinctKeysInObject(LookUpObject: any) {
362
+ let sLookUpObjectMetaPath;
363
+ for (let sKey in LookUpObject) {
364
+ if (LookUpObject[sKey]) {
365
+ if (sKey.includes("/")) {
366
+ sLookUpObjectMetaPath = sKey; // "/SalesOrdermanage/_Item/Material"
367
+ const aPathParts = sKey.split("/");
368
+ sKey = aPathParts[aPathParts.length - 1];
369
+ } else {
370
+ sLookUpObjectMetaPath = sRootPath;
371
+ }
372
+ if (!oDistinctKeys[sKey]) {
373
+ // if key is found for the first time then create array
374
+ oDistinctKeys[sKey] = [];
375
+ }
376
+
377
+ // push path to array
378
+ oDistinctKeys[sKey].push(sLookUpObjectMetaPath);
379
+ }
380
+ }
381
+ }
382
+
383
+ _findDistinctKeysInObject(oFilterBarConditions);
384
+ for (const sDistinctKey in oDistinctKeys) {
385
+ const aConflictingPaths = oDistinctKeys[sDistinctKey];
386
+
387
+ if (aConflictingPaths.length > 1) {
388
+ // conflict
389
+ for (let i = 0; i <= aConflictingPaths.length - 1; i++) {
390
+ sPath = aConflictingPaths[i];
391
+ if (sPath === sRootPath) {
392
+ sFullContextPath = sRootPath + "/" + sDistinctKey;
393
+ sPathInContext = sDistinctKey;
394
+ sMainEntityValuePath = sDistinctKey;
395
+ if (aParameters && aParameters.includes(sDistinctKey)) {
396
+ oFilterBarConditions["$Parameter." + sDistinctKey] = oFilterBarConditions[sDistinctKey];
397
+ }
398
+ } else {
399
+ sPathInContext = sPath;
400
+ sFullContextPath = ((sRootPath + "/" + sPath) as any).replaceAll(/\*/g, "");
401
+ sCurrentValuePath = sPath;
402
+ }
403
+ oFilterBarConditions[
404
+ sFullContextPath
405
+ .split("/")
406
+ .filter(function (sValue: any) {
407
+ return sValue != "";
408
+ })
409
+ .join(".")
410
+ ] = oFilterBarConditions[sPathInContext];
411
+ delete oFilterBarConditions[sPath];
412
+ }
413
+
414
+ sWinnerValuePath = sMainEntityValuePath || sCurrentValuePath;
415
+ oFilterBarConditions[sDistinctKey] = oFilterBarConditions[sWinnerValuePath];
416
+ } else {
417
+ // no conflict, add distinct key without adding paths
418
+ sPath = aConflictingPaths[0];
419
+ sFullContextPath =
420
+ sPath === sRootPath ? sRootPath + "/" + sDistinctKey : ((sRootPath + "/" + sPath) as any).replaceAll("*", "");
421
+ oFilterConditionsWithoutConflict[sDistinctKey] = sFullContextPath
422
+ .split("/")
423
+ .filter(function (sValue: any) {
424
+ return sValue != "";
425
+ })
426
+ .join(".");
427
+ if (aParameters && aParameters.includes(sDistinctKey)) {
428
+ oFilterBarConditions["$Parameter." + sDistinctKey] = oFilterBarConditions[sDistinctKey];
429
+ }
430
+ }
431
+ }
432
+
433
+ return {
434
+ filterConditions: oFilterBarConditions,
435
+ filterConditionsWithoutConflict: oFilterConditionsWithoutConflict
436
+ };
437
+ }
438
+
439
+ /**
440
+ * Get Navigation mode.
441
+ *
442
+ * @returns {string}
443
+ */
444
+ @publicExtension()
445
+ @extensible(OverrideExecution.Instead)
446
+ getNavigationMode() {
447
+ return undefined;
448
+ }
449
+ /**
450
+ * Allows for navigation to a given intent (SemanticObject-Action) with the provided context, using a dialog that shows the contexts which cannot be passed
451
+ * If semantic object mapping is provided, this setting is also applied to the selection variant after adaptation by a consumer.
452
+ * This setting also removes any technical parameters and determines if an inplace or explace navigation should take place.
453
+ *
454
+ * @param {string} sSemanticObject Semantic object for the target app
455
+ * @param {string} sAction Action for the target app
456
+ * @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
457
+ * @param {string} [mNavigationParameters.label]
458
+ * @param {Array|object} [mNavigationParameters.navigationContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent.
459
+ * @param {Array|object} [mNavigationParameters.applicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent and for which the IBN button is enabled
460
+ * @param {Array|object} [mNavigationParameters.notApplicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, which cannot be passed to the intent.
461
+ * if an array of contexts is passed the context is used to determine the meta path and accordingly remove the sensitive data
462
+ * If an array of objects is passed, the following format is expected:
463
+ * {
464
+ * data: {
465
+ * ProductID: 7634,
466
+ * Name: "Laptop"
467
+ * },
468
+ * metaPath: "/SalesOrderManage"
469
+ * }
470
+ * The metaPath is used to remove any sensitive data.
471
+ * @param {string | object} [mNavigationParameters.semanticObjectMapping] String representation of SemanticObjectMapping or SemanticObjectMapping that applies to this navigation
472
+ **/
473
+ @publicExtension()
474
+ @finalExtension()
475
+ navigateWithConfirmationDialog(
476
+ sSemanticObject: string,
477
+ sAction: string,
478
+ mNavigationParameters?: {
479
+ navigationContexts?: object | any[];
480
+ applicableContexts?: object | any[];
481
+ notApplicableContexts?: any;
482
+ label?: string;
483
+ semanticObjectMapping?: string | object;
484
+ }
485
+ ) {
486
+ if (mNavigationParameters?.notApplicableContexts && mNavigationParameters.notApplicableContexts?.length >= 1) {
487
+ let oApplicableContextDialog: Dialog;
488
+ const oController = {
489
+ onClose: function () {
490
+ // User cancels action
491
+ oApplicableContextDialog.close();
492
+ },
493
+ onContinue: () => {
494
+ // Users continues the action with the bound contexts
495
+ mNavigationParameters.navigationContexts = mNavigationParameters.applicableContexts;
496
+ oApplicableContextDialog.close();
497
+ this.navigate(sSemanticObject, sAction, mNavigationParameters);
498
+ }
499
+ };
500
+ const fnOpenAndFillDialog = function () {
501
+ let oDialogContent;
502
+ const nNotApplicable = mNavigationParameters.notApplicableContexts.length,
503
+ aNotApplicableItems = [];
504
+ for (let i = 0; i < mNavigationParameters.notApplicableContexts.length; i++) {
505
+ oDialogContent = mNavigationParameters.notApplicableContexts[i].getObject();
506
+ aNotApplicableItems.push(oDialogContent);
507
+ }
508
+ const oNotApplicableItemsModel = new JSONModel(aNotApplicableItems);
509
+ const oTotals = new JSONModel({ total: nNotApplicable, label: mNavigationParameters.label });
510
+ oApplicableContextDialog.setModel(oNotApplicableItemsModel, "notApplicable");
511
+ oApplicableContextDialog.setModel(oTotals, "totals");
512
+ oApplicableContextDialog.open();
513
+ };
514
+ // Show the contexts that are not applicable and will not therefore be processed
515
+ const sFragmentName = "sap.fe.core.controls.ActionPartial";
516
+ const oDialogFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
517
+ const oModel = this._oView.getModel();
518
+ const oMetaModel = oModel.getMetaModel();
519
+ const sCanonicalPath = mNavigationParameters.notApplicableContexts[0].getCanonicalPath();
520
+ const sEntitySet = sCanonicalPath.substr(0, sCanonicalPath.indexOf("(")) + "/";
521
+ Promise.resolve(
522
+ XMLPreprocessor.process(
523
+ oDialogFragment,
524
+ { name: sFragmentName },
525
+ {
526
+ bindingContexts: {
527
+ entityType: oMetaModel.createBindingContext(sEntitySet)
528
+ },
529
+ models: {
530
+ entityType: oMetaModel,
531
+ metaModel: oMetaModel
532
+ }
533
+ }
534
+ )
535
+ )
536
+ .then(function (oFragment: any) {
537
+ return Fragment.load({ definition: oFragment, controller: oController });
538
+ })
539
+ .then((oPopover: any) => {
540
+ oApplicableContextDialog = oPopover;
541
+ this.getView().addDependent(oPopover);
542
+ fnOpenAndFillDialog();
543
+ })
544
+ .catch(function () {
545
+ Log.error("Error");
546
+ });
547
+ } else {
548
+ this.navigate(sSemanticObject, sAction, mNavigationParameters);
549
+ }
550
+ }
551
+ _removeTechnicalParameters(oSelectionVariant: any) {
552
+ oSelectionVariant.removeSelectOption("@odata.context");
553
+ oSelectionVariant.removeSelectOption("@odata.metadataEtag");
554
+ oSelectionVariant.removeSelectOption("SAP__Messages");
555
+ }
556
+ /**
557
+ * Get targeted Entity set.
558
+ *
559
+ * @returns {string} Entity set name
560
+ *
561
+ *
562
+ */
563
+ @privateExtension()
564
+ getEntitySet() {
565
+ return (this._oView.getViewData() as any).entitySet;
566
+ }
567
+ /**
568
+ * Removes sensitive data from the semantic attribute with respect to entitySet.
569
+ *
570
+ * @param {object} oAttributes Context data
571
+ * @param {string} sMetaPath Meta path to reach the entityset in the MetaModel
572
+ * @returns {Array} Array of semantic Attributes
573
+ * @private
574
+ **/
575
+ // TO-DO add unit tests for this function in the controller extension qunit.
576
+ @publicExtension()
577
+ @finalExtension()
578
+ removeSensitiveData(oAttributes: any, sMetaPath: string) {
579
+ const aProperties = Object.keys(oAttributes);
580
+ if (aProperties.length) {
581
+ delete oAttributes["@odata.context"];
582
+ delete oAttributes["@odata.metadataEtag"];
583
+ delete oAttributes["SAP__Messages"];
584
+ for (let j = 0; j < aProperties.length; j++) {
585
+ if (oAttributes[aProperties[j]] && typeof oAttributes[aProperties[j]] === "object") {
586
+ this.removeSensitiveData(oAttributes[aProperties[j]], sMetaPath + "/" + aProperties[j]);
587
+ }
588
+ const sProp = aProperties[j],
589
+ aPropertyAnnotations = this._oMetaModel.getObject(sMetaPath + "/" + sProp + "@");
590
+ if (aPropertyAnnotations) {
591
+ if (
592
+ aPropertyAnnotations["@com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"] ||
593
+ aPropertyAnnotations["@com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext"] ||
594
+ aPropertyAnnotations["@com.sap.vocabularies.Analytics.v1.Measure"]
595
+ ) {
596
+ delete oAttributes[sProp];
597
+ } else if (aPropertyAnnotations["@com.sap.vocabularies.Common.v1.FieldControl"]) {
598
+ const oFieldControl = aPropertyAnnotations["@com.sap.vocabularies.Common.v1.FieldControl"];
599
+ if (oFieldControl["$EnumMember"] && oFieldControl["$EnumMember"].split("/")[1] === "Inapplicable") {
600
+ delete oAttributes[sProp];
601
+ } else if (oFieldControl["$Path"] && this._isFieldControlPathInapplicable(oFieldControl["$Path"], oAttributes)) {
602
+ delete oAttributes[sProp];
603
+ }
604
+ }
605
+ }
606
+ }
607
+ }
608
+ return oAttributes;
609
+ }
610
+
611
+ /**
612
+ * Check if Path based FieldControl Evaluates to inapplicable.
613
+ *
614
+ * @param {string} sFieldControlPath Field control path
615
+ * @param {object} oAttribute SemanticAttributes
616
+ * @returns {boolean} `true` if inapplicable
617
+ *
618
+ */
619
+ _isFieldControlPathInapplicable(sFieldControlPath: string, oAttribute: any) {
620
+ let bInapplicable = false;
621
+ const aParts = sFieldControlPath.split("/");
622
+ // sensitive data is removed only if the path has already been resolved.
623
+ if (aParts.length > 1) {
624
+ bInapplicable =
625
+ oAttribute[aParts[0]] && oAttribute[aParts[0]].hasOwnProperty(aParts[1]) && oAttribute[aParts[0]][aParts[1]] === 0;
626
+ } else {
627
+ bInapplicable = oAttribute[sFieldControlPath] === 0;
628
+ }
629
+ return bInapplicable;
630
+ }
631
+ /**
632
+ * Method to replace Local Properties with Semantic Object mappings.
633
+ *
634
+ * @param {object} oSelectionVariant SelectionVariant consisting of filterbar, Table and Page Context
635
+ * @param {object | string} vMappings A string representation of semantic object mapping
636
+ * @returns {object} - Modified SelectionVariant with LocalProperty replaced with SemanticObjectProperties.
637
+ */
638
+ _applySemanticObjectMappings(oSelectionVariant: SelectionVariant, vMappings: object | string) {
639
+ const oMappings = typeof vMappings === "string" ? JSON.parse(vMappings) : vMappings;
640
+ for (let i = 0; i < oMappings.length; i++) {
641
+ const sLocalProperty =
642
+ (oMappings[i]["LocalProperty"] && oMappings[i]["LocalProperty"]["$PropertyPath"]) ||
643
+ (oMappings[i]["@com.sap.vocabularies.Common.v1.LocalProperty"] &&
644
+ oMappings[i]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"]);
645
+ const sSemanticObjectProperty =
646
+ oMappings[i]["SemanticObjectProperty"] || oMappings[i]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];
647
+ if (oSelectionVariant.getSelectOption(sLocalProperty)) {
648
+ const oSelectOption = oSelectionVariant.getSelectOption(sLocalProperty);
649
+
650
+ //Create a new SelectOption with sSemanticObjectProperty as the property Name and remove the older one
651
+ oSelectionVariant.removeSelectOption(sLocalProperty);
652
+ oSelectionVariant.massAddSelectOption(sSemanticObjectProperty, oSelectOption);
653
+ }
654
+ }
655
+ return oSelectionVariant;
656
+ }
657
+ /**
658
+ * Navigates to an Outbound provided in the manifest.
659
+ * @function
660
+ * @param {string} sOutbound Identifier to location the outbound in the manifest
661
+ * @param {object} mNavigationParameters Optional map containing key/value pairs to be passed to the intent
662
+ * @alias sap.fe.core.controllerextensions.IntentBasedNavigation#navigateOutbound
663
+ * @since 1.86.0
664
+ **/
665
+ @publicExtension()
666
+ @finalExtension()
667
+ navigateOutbound(sOutbound: string, mNavigationParameters: any) {
668
+ let aNavParams: any[] | undefined;
669
+ const oManifestEntry = this.base.getAppComponent().getManifestEntry("sap.app"),
670
+ oOutbound = oManifestEntry.crossNavigation && oManifestEntry.crossNavigation.outbounds[sOutbound];
671
+ if (!oOutbound) {
672
+ Log.error("Outbound is not defined in manifest!!");
673
+ return;
674
+ }
675
+ const sSemanticObject = oOutbound.semanticObject,
676
+ sAction = oOutbound.action,
677
+ outboundParams = oOutbound.parameters && this.getOutboundParams(oOutbound.parameters);
678
+
679
+ if (mNavigationParameters) {
680
+ aNavParams = [];
681
+ Object.keys(mNavigationParameters).forEach(function (key: string) {
682
+ let oParams: any;
683
+ if (Array.isArray(mNavigationParameters[key])) {
684
+ const aValues = mNavigationParameters[key];
685
+ for (let i = 0; i < aValues.length; i++) {
686
+ oParams = {};
687
+ oParams[key] = aValues[i];
688
+ aNavParams?.push(oParams);
689
+ }
690
+ } else {
691
+ oParams = {};
692
+ oParams[key] = mNavigationParameters[key];
693
+ aNavParams?.push(oParams);
694
+ }
695
+ });
696
+ }
697
+ if (aNavParams || outboundParams) {
698
+ mNavigationParameters = {
699
+ navigationContexts: {
700
+ data: aNavParams || outboundParams
701
+ }
702
+ };
703
+ }
704
+ this.base._intentBasedNavigation.navigate(sSemanticObject, sAction, mNavigationParameters);
705
+ }
706
+
707
+ /**
708
+ * Method to apply outbound parameters defined in the manifest.
709
+ * @param {object} oSelectionVariant SelectionVariant consisting of a filter bar, a table, and a page context
710
+ * @param {object} vOutboundParams Outbound Properties defined in the manifest
711
+ * @returns {object} - The modified SelectionVariant with outbound parameters.
712
+ */
713
+ _applyOutboundParams(oSelectionVariant: SelectionVariant, vOutboundParams: any) {
714
+ const aParameters = Object.keys(vOutboundParams);
715
+ const aSelectProperties = oSelectionVariant.getSelectOptionsPropertyNames();
716
+ aParameters.forEach(function (key: string) {
717
+ if (!aSelectProperties.includes(key)) {
718
+ oSelectionVariant.addSelectOption(key, "I", "EQ", vOutboundParams[key]);
719
+ }
720
+ });
721
+ return oSelectionVariant;
722
+ }
723
+ /**
724
+ * Method to get the outbound parameters defined in the manifest.
725
+ *
726
+ * @function
727
+ * @param {object} oOutboundParams Parameters defined in the outbounds. Only "plain" is supported
728
+ * @returns {Array} Parameters with the key-Value pair
729
+ **/
730
+ @publicExtension()
731
+ @finalExtension()
732
+ getOutboundParams(oOutboundParams: any) {
733
+ const oParamsMapping: any = {};
734
+ if (oOutboundParams) {
735
+ const aParameters = Object.keys(oOutboundParams) || [];
736
+ if (aParameters.length > 0) {
737
+ aParameters.forEach(function (key: string) {
738
+ const oMapping = oOutboundParams[key];
739
+ if (oMapping.value && oMapping.value.value && oMapping.value.format === "plain") {
740
+ if (!oParamsMapping[key]) {
741
+ oParamsMapping[key] = oMapping.value.value;
742
+ }
743
+ }
744
+ });
745
+ }
746
+ }
747
+ return oParamsMapping;
748
+ }
749
+
750
+ /**
751
+ * Triggers an outbound navigation when a user chooses the chevron.
752
+ *
753
+ * @param {object} oController
754
+ * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
755
+ * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
756
+ * @param {string} sCreatePath Create path when the chevron is created.
757
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
758
+ */
759
+
760
+ @publicExtension()
761
+ @finalExtension()
762
+ onChevronPressNavigateOutBound(oController: PageController, sOutboundTarget: string, oContext: any, sCreatePath: string) {
763
+ const oOutbounds = (oController.getAppComponent() as any).getRoutingService().getOutbounds();
764
+ const oDisplayOutbound = oOutbounds[sOutboundTarget];
765
+ let additionalNavigationParameters;
766
+ if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
767
+ const oRefreshStrategies: any = {
768
+ intents: {}
769
+ };
770
+ const oDefaultRefreshStrategy: any = {};
771
+ let sMetaPath;
772
+
773
+ if (oContext) {
774
+ if (oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context")) {
775
+ sMetaPath = ModelHelper.getMetaPathForContext(oContext);
776
+ oContext = [oContext];
777
+ } else {
778
+ sMetaPath = ModelHelper.getMetaPathForContext(oContext[0]);
779
+ }
780
+ oDefaultRefreshStrategy[sMetaPath] = "self";
781
+ oRefreshStrategies["_feDefault"] = oDefaultRefreshStrategy;
782
+ }
783
+
784
+ if (sCreatePath) {
785
+ const sKey = oDisplayOutbound.semanticObject + "-" + oDisplayOutbound.action;
786
+ oRefreshStrategies.intents[sKey] = {};
787
+ oRefreshStrategies.intents[sKey][sCreatePath] = "self";
788
+ }
789
+ if (oDisplayOutbound && oDisplayOutbound.parameters) {
790
+ const oParams = oDisplayOutbound.parameters && this.getOutboundParams(oDisplayOutbound.parameters);
791
+ if (Object.keys(oParams).length > 0) {
792
+ additionalNavigationParameters = oParams;
793
+ }
794
+ }
795
+
796
+ oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
797
+ navigationContexts: oContext,
798
+ refreshStrategies: oRefreshStrategies,
799
+ additionalNavigationParameters: additionalNavigationParameters
800
+ });
801
+
802
+ //TODO: check why returning a promise is required
803
+ return Promise.resolve();
804
+ } else {
805
+ throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
806
+ }
807
+ }
808
+ }
809
+
810
+ export default InternalIntentBasedNavigation;