@sapui5/sap.fe.core 1.103.0 → 1.106.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 (303) hide show
  1. package/package.json +5 -5
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/ActionRuntime.js +121 -0
  4. package/src/sap/fe/core/ActionRuntime.ts +122 -0
  5. package/src/sap/fe/core/AppComponent.js +24 -11
  6. package/src/sap/fe/core/AppComponent.ts +17 -5
  7. package/src/sap/fe/core/AppStateHandler.js +74 -62
  8. package/src/sap/fe/core/AppStateHandler.ts +24 -29
  9. package/src/sap/fe/core/BaseController.js +2 -2
  10. package/src/sap/fe/core/CommonUtils.js +147 -180
  11. package/src/sap/fe/core/CommonUtils.ts +166 -193
  12. package/src/sap/fe/core/ExtensionAPI.js +2 -2
  13. package/src/sap/fe/core/PageController.js +2 -2
  14. package/src/sap/fe/core/TemplateComponent.js +21 -10
  15. package/src/sap/fe/core/TemplateComponent.ts +3 -0
  16. package/src/sap/fe/core/TemplateModel.js +2 -2
  17. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +11 -3
  18. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +7 -1
  19. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +194 -43
  20. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +162 -24
  21. package/src/sap/fe/core/buildingBlocks/BuildingBlockFormatter.js +14 -0
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlockFormatter.ts +5 -0
  23. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +609 -227
  24. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +268 -119
  25. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +111 -76
  26. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +96 -76
  27. package/src/sap/fe/core/controllerextensions/BusyLocker.js +1 -1
  28. package/src/sap/fe/core/controllerextensions/EditFlow.js +723 -637
  29. package/src/sap/fe/core/controllerextensions/EditFlow.ts +361 -398
  30. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +2 -2
  31. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +83 -55
  32. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +42 -44
  33. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +29 -27
  34. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +35 -30
  35. package/src/sap/fe/core/controllerextensions/InternalRouting.js +171 -74
  36. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +167 -76
  37. package/src/sap/fe/core/controllerextensions/KPIManagement.js +5 -21
  38. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -17
  39. package/src/sap/fe/core/controllerextensions/MassEdit.js +3 -3
  40. package/src/sap/fe/core/controllerextensions/MassEdit.ts +1 -1
  41. package/src/sap/fe/core/controllerextensions/MessageHandler.js +2 -2
  42. package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
  43. package/src/sap/fe/core/controllerextensions/PageReady.ts +5 -1
  44. package/src/sap/fe/core/controllerextensions/Paginator.js +13 -13
  45. package/src/sap/fe/core/controllerextensions/Paginator.ts +11 -11
  46. package/src/sap/fe/core/controllerextensions/Placeholder.js +2 -2
  47. package/src/sap/fe/core/controllerextensions/Routing.js +2 -2
  48. package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
  49. package/src/sap/fe/core/controllerextensions/Share.js +154 -123
  50. package/src/sap/fe/core/controllerextensions/Share.ts +93 -95
  51. package/src/sap/fe/core/controllerextensions/SideEffects.js +157 -97
  52. package/src/sap/fe/core/controllerextensions/SideEffects.ts +151 -95
  53. package/src/sap/fe/core/controllerextensions/ViewState.js +151 -80
  54. package/src/sap/fe/core/controllerextensions/ViewState.ts +95 -93
  55. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -1
  56. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +9 -9
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +6 -7
  58. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +26 -11
  59. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +30 -11
  60. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +57 -40
  61. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +55 -47
  62. package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +31 -32
  63. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1376 -914
  64. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +654 -714
  65. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +372 -326
  66. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +210 -276
  67. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +309 -0
  68. package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +320 -0
  69. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +670 -521
  70. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +537 -535
  71. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +85 -65
  72. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +16 -21
  73. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +25 -13
  74. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +53 -43
  75. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +18 -27
  76. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +9 -15
  77. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +19 -3
  78. package/src/sap/fe/core/controls/ActionParameterDialogFieldValueHelp.fragment.xml +35 -0
  79. package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +26 -16
  80. package/src/sap/fe/core/controls/Any.js +1 -1
  81. package/src/sap/fe/core/controls/CommandExecution.js +2 -2
  82. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +5 -5
  84. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +0 -3
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
  86. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
  87. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  88. package/src/sap/fe/core/controls/FileWrapper.js +8 -3
  89. package/src/sap/fe/core/controls/FileWrapper.ts +5 -1
  90. package/src/sap/fe/core/controls/FilterBar.js +2 -2
  91. package/src/sap/fe/core/controls/FormElementWrapper.js +2 -2
  92. package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
  93. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +1 -1
  94. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +48 -17
  95. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +2 -2
  96. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +2 -2
  97. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +2 -2
  98. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -3
  99. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +2 -2
  100. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
  101. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +2 -2
  102. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +1 -1
  103. package/src/sap/fe/core/converters/ConverterContext.js +23 -2
  104. package/src/sap/fe/core/converters/ConverterContext.ts +34 -9
  105. package/src/sap/fe/core/converters/ManifestSettings.js +19 -18
  106. package/src/sap/fe/core/converters/ManifestSettings.ts +53 -47
  107. package/src/sap/fe/core/converters/ManifestWrapper.js +1 -1
  108. package/src/sap/fe/core/converters/MetaModelConverter.js +32 -10
  109. package/src/sap/fe/core/converters/MetaModelConverter.ts +42 -19
  110. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  111. package/src/sap/fe/core/converters/annotations/DataField.js +5 -2
  112. package/src/sap/fe/core/converters/annotations/DataField.ts +5 -1
  113. package/src/sap/fe/core/converters/common/AnnotationConverter.js +69 -23
  114. package/src/sap/fe/core/converters/controls/Common/Action.js +98 -51
  115. package/src/sap/fe/core/converters/controls/Common/Action.ts +121 -44
  116. package/src/sap/fe/core/converters/controls/Common/Chart.js +31 -34
  117. package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -34
  118. package/src/sap/fe/core/converters/controls/Common/Criticality.js +1 -1
  119. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +43 -7
  120. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -33
  121. package/src/sap/fe/core/converters/controls/Common/Form.js +8 -6
  122. package/src/sap/fe/core/converters/controls/Common/Form.ts +11 -14
  123. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  124. package/src/sap/fe/core/converters/controls/Common/KPI.ts +16 -15
  125. package/src/sap/fe/core/converters/controls/Common/Table.js +188 -157
  126. package/src/sap/fe/core/converters/controls/Common/Table.ts +279 -230
  127. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +1 -1
  128. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +4 -4
  129. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +57 -21
  130. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +71 -18
  131. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +30 -8
  132. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +24 -7
  133. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +1 -1
  134. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +43 -34
  135. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +37 -25
  136. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +85 -49
  137. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +74 -50
  138. package/src/sap/fe/core/converters/helpers/Aggregation.js +54 -4
  139. package/src/sap/fe/core/converters/helpers/Aggregation.ts +56 -8
  140. package/src/sap/fe/core/converters/helpers/BindingHelper.js +1 -1
  141. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +6 -4
  142. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +10 -2
  143. package/src/sap/fe/core/converters/helpers/DataFieldHelper.js +182 -0
  144. package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +167 -0
  145. package/src/sap/fe/core/converters/helpers/ID.js +3 -1
  146. package/src/sap/fe/core/converters/helpers/ID.ts +1 -0
  147. package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
  148. package/src/sap/fe/core/converters/helpers/Key.js +1 -1
  149. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  150. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +2 -3
  151. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  152. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +8 -14
  153. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +6 -9
  154. package/src/sap/fe/core/converters/templates/ListReportConverter.js +31 -31
  155. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +54 -47
  156. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +44 -15
  157. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +64 -30
  158. package/src/sap/fe/core/designtime/AppComponent.designtime.js +1 -1
  159. package/src/sap/fe/core/formatters/CollaborationFormatter.js +1 -1
  160. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  161. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  162. package/src/sap/fe/core/formatters/StandardFormatter.js +13 -6
  163. package/src/sap/fe/core/formatters/StandardFormatter.ts +20 -14
  164. package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
  165. package/src/sap/fe/core/formatters/TableFormatterTypes.js +1 -1
  166. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  167. package/src/sap/fe/core/fpm/Component.js +33 -7
  168. package/src/sap/fe/core/fpm/Component.ts +14 -0
  169. package/src/sap/fe/core/helpers/AnnotationEnum.js +1 -1
  170. package/src/sap/fe/core/helpers/AppStartupHelper.js +5 -4
  171. package/src/sap/fe/core/helpers/AppStartupHelper.ts +4 -3
  172. package/src/sap/fe/core/helpers/BindingToolkit.js +56 -24
  173. package/src/sap/fe/core/helpers/BindingToolkit.ts +67 -21
  174. package/src/sap/fe/core/helpers/ClassSupport.js +31 -3
  175. package/src/sap/fe/core/helpers/ClassSupport.ts +24 -1
  176. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -1
  177. package/src/sap/fe/core/helpers/EditState.js +1 -1
  178. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -1
  179. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  180. package/src/sap/fe/core/helpers/KeepAliveHelper.js +1 -1
  181. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +1 -1
  182. package/src/sap/fe/core/helpers/LoaderUtils.js +39 -0
  183. package/src/sap/fe/core/helpers/LoaderUtils.ts +14 -0
  184. package/src/sap/fe/core/helpers/MassEditHelper.js +475 -99
  185. package/src/sap/fe/core/helpers/MassEditHelper.ts +468 -155
  186. package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
  187. package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
  188. package/src/sap/fe/core/helpers/ModelHelper.js +1 -1
  189. package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
  190. package/src/sap/fe/core/helpers/SemanticDateOperators.js +82 -36
  191. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +52 -36
  192. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  193. package/src/sap/fe/core/helpers/SideEffectsHelper.js +146 -0
  194. package/src/sap/fe/core/helpers/SideEffectsHelper.ts +128 -0
  195. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
  196. package/src/sap/fe/core/helpers/Synchronization.js +1 -1
  197. package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
  198. package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
  199. package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
  200. package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
  201. package/src/sap/fe/core/jsx-runtime/ViewLoader.js +109 -0
  202. package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +47 -0
  203. package/src/sap/fe/core/jsx-runtime/jsx-control.js +119 -0
  204. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +98 -0
  205. package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
  206. package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
  207. package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
  208. package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
  209. package/src/sap/fe/core/jsx-runtime/jsxs.js +1 -1
  210. package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +179 -0
  211. package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +150 -0
  212. package/src/sap/fe/core/library.js +2 -2
  213. package/src/sap/fe/core/library.support.js +1 -1
  214. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  215. package/src/sap/fe/core/messagebundle.properties +4 -41
  216. package/src/sap/fe/core/messagebundle_ar.properties +22 -45
  217. package/src/sap/fe/core/messagebundle_bg.properties +22 -45
  218. package/src/sap/fe/core/messagebundle_ca.properties +22 -45
  219. package/src/sap/fe/core/messagebundle_cs.properties +22 -45
  220. package/src/sap/fe/core/messagebundle_cy.properties +21 -44
  221. package/src/sap/fe/core/messagebundle_da.properties +22 -45
  222. package/src/sap/fe/core/messagebundle_de.properties +22 -45
  223. package/src/sap/fe/core/messagebundle_el.properties +22 -45
  224. package/src/sap/fe/core/messagebundle_en.properties +21 -44
  225. package/src/sap/fe/core/messagebundle_en_GB.properties +21 -44
  226. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +21 -42
  227. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +20 -40
  228. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +21 -42
  229. package/src/sap/fe/core/messagebundle_es.properties +22 -45
  230. package/src/sap/fe/core/messagebundle_es_MX.properties +22 -45
  231. package/src/sap/fe/core/messagebundle_et.properties +22 -45
  232. package/src/sap/fe/core/messagebundle_fi.properties +22 -45
  233. package/src/sap/fe/core/messagebundle_fr.properties +21 -44
  234. package/src/sap/fe/core/messagebundle_fr_CA.properties +20 -43
  235. package/src/sap/fe/core/messagebundle_hi.properties +22 -45
  236. package/src/sap/fe/core/messagebundle_hr.properties +22 -45
  237. package/src/sap/fe/core/messagebundle_hu.properties +22 -45
  238. package/src/sap/fe/core/messagebundle_id.properties +22 -45
  239. package/src/sap/fe/core/messagebundle_it.properties +22 -45
  240. package/src/sap/fe/core/messagebundle_iw.properties +22 -45
  241. package/src/sap/fe/core/messagebundle_ja.properties +22 -45
  242. package/src/sap/fe/core/messagebundle_kk.properties +22 -45
  243. package/src/sap/fe/core/messagebundle_ko.properties +27 -50
  244. package/src/sap/fe/core/messagebundle_lt.properties +22 -45
  245. package/src/sap/fe/core/messagebundle_lv.properties +22 -45
  246. package/src/sap/fe/core/messagebundle_ms.properties +22 -45
  247. package/src/sap/fe/core/messagebundle_nl.properties +24 -47
  248. package/src/sap/fe/core/messagebundle_no.properties +22 -45
  249. package/src/sap/fe/core/messagebundle_pl.properties +23 -46
  250. package/src/sap/fe/core/messagebundle_pt.properties +23 -46
  251. package/src/sap/fe/core/messagebundle_pt_PT.properties +22 -45
  252. package/src/sap/fe/core/messagebundle_ro.properties +22 -45
  253. package/src/sap/fe/core/messagebundle_ru.properties +22 -45
  254. package/src/sap/fe/core/messagebundle_sh.properties +22 -45
  255. package/src/sap/fe/core/messagebundle_sk.properties +22 -45
  256. package/src/sap/fe/core/messagebundle_sl.properties +22 -45
  257. package/src/sap/fe/core/messagebundle_sv.properties +22 -45
  258. package/src/sap/fe/core/messagebundle_th.properties +20 -43
  259. package/src/sap/fe/core/messagebundle_tr.properties +22 -45
  260. package/src/sap/fe/core/messagebundle_uk.properties +22 -45
  261. package/src/sap/fe/core/messagebundle_vi.properties +22 -45
  262. package/src/sap/fe/core/messagebundle_zh_CN.properties +22 -45
  263. package/src/sap/fe/core/messagebundle_zh_TW.properties +22 -45
  264. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  265. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +102 -74
  266. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +62 -63
  267. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +2 -2
  268. package/src/sap/fe/core/services/NavigationServiceFactory.js +11 -8
  269. package/src/sap/fe/core/services/NavigationServiceFactory.ts +10 -7
  270. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  271. package/src/sap/fe/core/services/RoutingServiceFactory.js +2 -2
  272. package/src/sap/fe/core/services/ShellServicesFactory.js +22 -2
  273. package/src/sap/fe/core/services/ShellServicesFactory.ts +19 -0
  274. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
  275. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +2 -2
  276. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +251 -200
  277. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +160 -144
  278. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +2 -2
  279. package/src/sap/fe/core/support/AnnotationIssue.support.js +1 -1
  280. package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +1 -1
  281. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +1 -1
  282. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  283. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  284. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +1 -1
  285. package/src/sap/fe/core/templating/CommonFormatters.js +4 -3
  286. package/src/sap/fe/core/templating/CommonFormatters.ts +5 -1
  287. package/src/sap/fe/core/templating/CriticalityFormatters.js +1 -1
  288. package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -1
  289. package/src/sap/fe/core/templating/DataModelPathHelper.js +8 -1
  290. package/src/sap/fe/core/templating/DataModelPathHelper.ts +5 -2
  291. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  292. package/src/sap/fe/core/templating/EntitySetHelper.js +4 -5
  293. package/src/sap/fe/core/templating/EntitySetHelper.ts +4 -3
  294. package/src/sap/fe/core/templating/FieldControlHelper.js +1 -1
  295. package/src/sap/fe/core/templating/FilterHelper.js +34 -15
  296. package/src/sap/fe/core/templating/FilterHelper.ts +28 -12
  297. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  298. package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
  299. package/src/sap/fe/core/templating/PropertyHelper.js +1 -1
  300. package/src/sap/fe/core/templating/UIFormatters.js +5 -3
  301. package/src/sap/fe/core/templating/UIFormatters.ts +7 -5
  302. package/src/sap/fe/core/type/DateTimeWithTimezone.js +2 -2
  303. package/src/sap/fe/core/type/Email.js +2 -2
@@ -1,10 +1,11 @@
1
+ import { CommonAnnotationTerms } from "@sap-ux/vocabularies-types/vocabularies/Common";
1
2
  import type ResourceBundle from "sap/base/i18n/ResourceBundle";
2
3
  import Log from "sap/base/Log";
3
4
  import mergeObjects from "sap/base/util/merge";
4
5
  import type AppComponent from "sap/fe/core/AppComponent";
5
6
  import { IssueCategory, IssueCategoryType, IssueSeverity } from "sap/fe/core/converters/helpers/IssueManager";
6
7
  import type { CompiledBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
7
- import { compileExpression, constant, not, or, pathInModel, transformRecursively } from "sap/fe/core/helpers/BindingToolkit";
8
+ import { compileExpression, not, or, pathInModel } from "sap/fe/core/helpers/BindingToolkit";
8
9
  import ModelHelper from "sap/fe/core/helpers/ModelHelper";
9
10
  import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
10
11
  import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
@@ -18,14 +19,14 @@ import Component from "sap/ui/core/Component";
18
19
  import type Control from "sap/ui/core/Control";
19
20
  import Core from "sap/ui/core/Core";
20
21
  import Fragment from "sap/ui/core/Fragment";
21
- import View from "sap/ui/core/mvc/View";
22
+ import type View from "sap/ui/core/mvc/View";
22
23
  import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
23
24
  import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
24
- import { system } from "sap/ui/Device";
25
25
  import FilterOperatorUtil from "sap/ui/mdc/condition/FilterOperatorUtil";
26
26
  import TypeUtil from "sap/ui/mdc/odata/v4/TypeUtil";
27
27
  import type Context from "sap/ui/model/Context";
28
28
  import JSONModel from "sap/ui/model/json/JSONModel";
29
+ import type ODataV4Context from "sap/ui/model/odata/v4/Context";
29
30
  import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
30
31
  import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
31
32
  import type { CoreEx } from "types/extension_types";
@@ -291,13 +292,21 @@ function _createMappings(oMapping: any) {
291
292
  * @param aExcludedActions
292
293
  * @param oTargetParams
293
294
  * @param aItems
295
+ * @param aAllowedActions
294
296
  */
295
- function _getRelatedAppsMenuItems(aLinks: any, aExcludedActions: any, oTargetParams: any, aItems: any) {
297
+ function _getRelatedAppsMenuItems(aLinks: any, aExcludedActions: any, oTargetParams: any, aItems: any, aAllowedActions?: any) {
296
298
  for (let i = 0; i < aLinks.length; i++) {
297
299
  const oLink = aLinks[i];
298
300
  const sIntent = oLink.intent;
299
301
  const sAction = sIntent.split("-")[1].split("?")[0];
300
- if (aExcludedActions && aExcludedActions.indexOf(sAction) === -1) {
302
+ if (aAllowedActions && aAllowedActions.includes(sAction)) {
303
+ aItems.push({
304
+ text: oLink.text,
305
+ targetSemObject: sIntent.split("#")[1].split("-")[0],
306
+ targetAction: sAction.split("~")[0],
307
+ targetParams: oTargetParams
308
+ });
309
+ } else if (!aAllowedActions && aExcludedActions && aExcludedActions.indexOf(sAction) === -1) {
301
310
  aItems.push({
302
311
  text: oLink.text,
303
312
  targetSemObject: sIntent.split("#")[1].split("-")[0],
@@ -315,10 +324,11 @@ function _getRelatedAppsMenuItems(aLinks: any, aExcludedActions: any, oTargetPar
315
324
  */
316
325
  function _getRelatedIntents(oAdditionalSemanticObjects: any, oBindingContext: any, aManifestSOItems: any, aLinks: any) {
317
326
  if (aLinks && aLinks.length > 0) {
327
+ const aAllowedActions = oAdditionalSemanticObjects.allowedActions || undefined;
318
328
  const aExcludedActions = oAdditionalSemanticObjects.unavailableActions ? oAdditionalSemanticObjects.unavailableActions : [];
319
329
  const aSOMappings = oAdditionalSemanticObjects.mapping ? _createMappings(oAdditionalSemanticObjects.mapping) : [];
320
330
  const oTargetParams = { navigationContexts: oBindingContext, semanticObjectMapping: aSOMappings };
321
- _getRelatedAppsMenuItems(aLinks, aExcludedActions, oTargetParams, aManifestSOItems);
331
+ _getRelatedAppsMenuItems(aLinks, aExcludedActions, oTargetParams, aManifestSOItems, aAllowedActions);
322
332
  }
323
333
  }
324
334
  function updateRelateAppsModel(
@@ -421,16 +431,17 @@ function updateRelateAppsModel(
421
431
  function _getSemanticObjectAnnotations(oEntityAnnotations: any, sCurrentSemObj: any) {
422
432
  const oSemanticObjectAnnotations = {
423
433
  bHasEntitySetSO: false,
434
+ aAllowedActions: [],
424
435
  aUnavailableActions: [],
425
436
  aMappings: []
426
437
  };
427
438
  let sAnnotationMappingTerm, sAnnotationActionTerm;
428
439
  let sQualifier;
429
440
  for (const key in oEntityAnnotations) {
430
- if (key.indexOf("com.sap.vocabularies.Common.v1.SemanticObject") > -1 && oEntityAnnotations[key] === sCurrentSemObj) {
441
+ if (key.indexOf(CommonAnnotationTerms.SemanticObject) > -1 && oEntityAnnotations[key] === sCurrentSemObj) {
431
442
  oSemanticObjectAnnotations.bHasEntitySetSO = true;
432
- sAnnotationMappingTerm = "@com.sap.vocabularies.Common.v1.SemanticObjectMapping";
433
- sAnnotationActionTerm = "@com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions";
443
+ sAnnotationMappingTerm = `@${CommonAnnotationTerms.SemanticObjectMapping}`;
444
+ sAnnotationActionTerm = `@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`;
434
445
 
435
446
  if (key.indexOf("#") > -1) {
436
447
  sQualifier = key.split("#")[1];
@@ -499,12 +510,20 @@ function getAppComponent(oControl: any): AppComponent {
499
510
  return getAppComponent(oOwner);
500
511
  }
501
512
  }
513
+
514
+ function getCurrentPageView(oAppComponent: AppComponent) {
515
+ const rootViewController = oAppComponent.getRootViewController() as any;
516
+ return rootViewController.isFclEnabled()
517
+ ? rootViewController.getRightmostView()
518
+ : CommonUtils.getTargetView((oAppComponent.getRootContainer() as any).getCurrentPage());
519
+ }
520
+
502
521
  function getTargetView(oControl: any) {
503
522
  if (oControl && oControl.isA("sap.ui.core.ComponentContainer")) {
504
523
  oControl = oControl.getComponentInstance();
505
524
  oControl = oControl && oControl.getRootControl();
506
525
  }
507
- while (oControl && !(oControl instanceof View)) {
526
+ while (oControl && !oControl.isA("sap.ui.core.mvc.View")) {
508
527
  oControl = oControl.getParent();
509
528
  }
510
529
  return oControl;
@@ -660,7 +679,7 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
660
679
 
661
680
  // "hasText" only checks for the key in the immediate resource bundle and not it's custom bundles
662
681
  // hence we need to do this recurrsively to check if the key exists in any of the bundles the forms the FE resource bundle
663
- const bResourceKeyExists = _checkIfResourceKeyExists(
682
+ const bResourceKeyExists = checkIfResourceKeyExists(
664
683
  (oResourceBundle as any).aCustomBundles,
665
684
  `${sFrameworkKey}|${sEntitySetName}`
666
685
  );
@@ -676,7 +695,7 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
676
695
  oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
677
696
  return oResourceBundle.getText(sResourceKey, oParams);
678
697
  }
679
- function _checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
698
+ function checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
680
699
  if (aCustomBundles.length) {
681
700
  for (let i = aCustomBundles.length - 1; i >= 0; i--) {
682
701
  const sValue = aCustomBundles[i].hasText(sKey);
@@ -684,7 +703,7 @@ function _checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
684
703
  if (sValue) {
685
704
  return true;
686
705
  }
687
- _checkIfResourceKeyExists(aCustomBundles[i].aCustomBundles, sKey);
706
+ checkIfResourceKeyExists(aCustomBundles[i].aCustomBundles, sKey);
688
707
  }
689
708
  }
690
709
  return false;
@@ -765,7 +784,7 @@ function _requestObject(sAction: any, oSelectedContext: any, sProperty: any) {
765
784
 
766
785
  return oContext.requestObject(sProperty);
767
786
  }
768
- function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, sDynamicActionEnabledPath: any) {
787
+ function requestProperty(oSelectedContext: any, sAction: any, sProperty: any, sDynamicActionEnabledPath: any) {
769
788
  const oPromise =
770
789
  sProperty && sProperty.indexOf("/") === 0
771
790
  ? requestSingletonProperty(sProperty, oSelectedContext.getModel())
@@ -780,7 +799,7 @@ function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, s
780
799
  });
781
800
  });
782
801
  }
783
- function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequestPromises: any) {
802
+ function setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequestPromises: any) {
784
803
  return Promise.all(aRequestPromises)
785
804
  .then(function (aResults: any[]) {
786
805
  if (aResults.length) {
@@ -796,7 +815,7 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
796
815
  }
797
816
  }
798
817
  });
799
- _setDynamicActionContexts(oInternalModelContext, aResults[0].sAction, aApplicableContexts, aNotApplicableContexts);
818
+ setDynamicActionContexts(oInternalModelContext, aResults[0].sAction, aApplicableContexts, aNotApplicableContexts);
800
819
  }
801
820
  })
802
821
  .catch(function (oError: any) {
@@ -809,96 +828,14 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
809
828
  * @param aApplicable
810
829
  * @param aNotApplicable
811
830
  */
812
- function _setDynamicActionContexts(oInternalModelContext: any, sAction: any, aApplicable: any, aNotApplicable: any) {
831
+ function setDynamicActionContexts(oInternalModelContext: any, sAction: any, aApplicable: any, aNotApplicable: any) {
813
832
  const sDynamicActionPathPrefix = `${oInternalModelContext.getPath()}/dynamicActions/${sAction}`,
814
833
  oInternalModel = oInternalModelContext.getModel();
815
834
  oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aApplicable`, aApplicable);
816
835
  oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aNotApplicable`, aNotApplicable);
817
836
  }
818
- function setActionEnablement(oInternalModelContext: any, oActionOperationAvailableMap: any, aSelectedContexts: any) {
819
- const aPromises = [];
820
- for (const sAction in oActionOperationAvailableMap) {
821
- // Reset all properties before computation
822
- oInternalModelContext.setProperty(`dynamicActions/${sAction}`, {
823
- bEnabled: false,
824
- aApplicable: [],
825
- aNotApplicable: []
826
- });
827
- // Note that non dynamic actions are not processed here. They are enabled because
828
- // one or more are selected and the second part of the condition in the templating
829
- // is then undefined and thus the button takes the default enabling, which is true!
830
- const aApplicable = [],
831
- aNotApplicable = [],
832
- sProperty = oActionOperationAvailableMap[sAction],
833
- sDynamicActionEnabledPath = `${oInternalModelContext.getPath()}/dynamicActions/${sAction}/bEnabled`;
834
-
835
- if (typeof sProperty === "object" && sProperty !== null && sProperty !== undefined) {
836
- for (let i = 0; i < aSelectedContexts.length; i++) {
837
- const oSelectedContext = aSelectedContexts[i];
838
- if (oSelectedContext) {
839
- const oContextData = oSelectedContext.getObject();
840
- const oTransformedBinding = transformRecursively(
841
- sProperty,
842
- "PathInModel",
843
- // eslint-disable-next-line no-loop-func
844
- function (oBindingExpression: any) {
845
- return constant(oContextData[oBindingExpression.path]);
846
- },
847
- true
848
- );
849
- const sResult = compileExpression(oTransformedBinding);
850
- if (sResult === "true") {
851
- oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
852
- aApplicable.push(oSelectedContext);
853
- } else {
854
- aNotApplicable.push(oSelectedContext);
855
- }
856
- }
857
- }
858
- _setDynamicActionContexts(oInternalModelContext, sAction, aApplicable, aNotApplicable);
859
- } else {
860
- const aRequestPromises = [];
861
- for (let i = 0; i < aSelectedContexts.length; i++) {
862
- const oSelectedContext = aSelectedContexts[i];
863
- if (oSelectedContext) {
864
- const oContextData = oSelectedContext.getObject();
865
- if (sProperty === null && !!oContextData[`#${sAction}`]) {
866
- //look for action advertisement if present and its value is not null
867
- oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
868
- break;
869
- } else {
870
- // Collect promises to retrieve singleton or normal property value asynchronously
871
- aRequestPromises.push(_requestProperty(oSelectedContext, sAction, sProperty, sDynamicActionEnabledPath));
872
- }
873
- }
874
- }
875
-
876
- // When all property values have been retrieved, set
877
- // The applicable and not-applicable selected contexts for each action and
878
- // The enabled property of the dynamic action in internal model context.
879
- aPromises.push(_setContextsBasedOnOperationAvailable(oInternalModelContext, aRequestPromises));
880
- }
881
- }
882
- return Promise.all(aPromises);
883
- }
884
-
885
- function setObjectMappings(sSemanticObject: string, oParams: any, aSemanticObjectMappings: any) {
886
- aSemanticObjectMappings.forEach(function (oItem: any) {
887
- if (sSemanticObject === oItem.semanticObject) {
888
- const oMappings = oItem.items;
889
- for (let i = 0; i < oMappings.length; i++) {
890
- const sLocalProperty = oMappings[i].key;
891
- const sSemanticObjectProperty = oMappings[i].value;
892
- if (oParams[sLocalProperty]) {
893
- oParams[sSemanticObjectProperty] = oParams[sLocalProperty];
894
- }
895
- }
896
- }
897
- });
898
- return oParams;
899
- }
900
837
 
901
- function _getDefaultOperators(sPropertyType: string) {
838
+ function _getDefaultOperators(sPropertyType?: string) {
902
839
  // mdc defines the full set of operations that are meaningful for each Edm Type
903
840
  // TODO Replace with model / internal way of retrieving the actual model type used for the property
904
841
  const oDataClass = TypeUtil.getDataTypeClassName(sPropertyType);
@@ -923,14 +860,27 @@ function getSpecificAllowedExpression(aExpressions: any) {
923
860
 
924
861
  return aExpressions[0];
925
862
  }
926
- function getOperatorsForProperty(
927
- sProperty: any,
928
- sEntitySetPath: any,
929
- oContext: any,
930
- sType?: any,
931
- bUseSemanticDateRange?: any,
932
- sSettings?: any
933
- ) {
863
+
864
+ /**
865
+ * Method to fetch the correct operators based on the filter restrictions that can be annotated on an entity set or a navigation property.
866
+ * We return the correct operators based on the specified restriction and also check for the operators defined in the manifest to include or exclude them.
867
+ *
868
+ * @param sProperty String name of the property
869
+ * @param sEntitySetPath String path to the entity set
870
+ * @param oContext Context used during templating
871
+ * @param sType String data type od the property, for example edm.Date
872
+ * @param bUseSemanticDateRange Boolean passed from the manifest for semantic date range
873
+ * @param sSettings Stringified object of the property settings
874
+ * @returns String containing comma-separated list of operators for filtering
875
+ */
876
+ export function getOperatorsForProperty(
877
+ sProperty: string,
878
+ sEntitySetPath: string,
879
+ oContext: Context,
880
+ sType?: string,
881
+ bUseSemanticDateRange?: boolean | string,
882
+ sSettings?: string
883
+ ): string | undefined {
934
884
  const oFilterRestrictions = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oContext);
935
885
  const aEqualsOps = ["EQ"];
936
886
  const aSingleRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
@@ -949,7 +899,7 @@ function getOperatorsForProperty(
949
899
  "FIRSTDAYYEAR",
950
900
  "LASTDAYYEAR"
951
901
  ];
952
- const aBasicDateTimeOps = ["EQ", "LE", "GE", "BT"];
902
+ const aBasicDateTimeOps = ["EQ", "BT"];
953
903
  const aMultiRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NE", "NOTBT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
954
904
  const aSearchExpressionOps = ["Contains", "NotContains", "StartsWith", "NotStartsWith", "EndsWith", "NotEndsWith"];
955
905
  const aSemanticDateOpsExt = SemanticDateOperators.getSupportedOperations();
@@ -957,7 +907,7 @@ function getOperatorsForProperty(
957
907
  let aSemanticDateOps: any[] = [];
958
908
  const oSettings = typeof sSettings === "string" ? JSON.parse(sSettings).customData : sSettings;
959
909
 
960
- if (oContext.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) === true) {
910
+ if ((oContext.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) as any) === true) {
961
911
  return aEqualsOps.toString();
962
912
  }
963
913
 
@@ -966,20 +916,17 @@ function getOperatorsForProperty(
966
916
  } else {
967
917
  aSemanticDateOps = SemanticDateOperators.getSemanticDateOperations();
968
918
  }
969
- const aSingleRangeDateTimeOps = aSemanticDateOps.filter(function (sOperator) {
970
- return sOperator !== "DATE" && sOperator !== "DATERANGE" && sOperator !== "FROM" && sOperator !== "TO";
971
- });
972
919
  // Get the default Operators for this Property Type
973
920
  let aDefaultOperators = _getDefaultOperators(sType);
921
+ if (bSemanticDateRange) {
922
+ aDefaultOperators = aSemanticDateOpsExt.concat(aDefaultOperators);
923
+ }
924
+ let sRestrictions;
974
925
 
975
926
  // Is there a Filter Restriction defined for this property?
976
927
  if (oFilterRestrictions && oFilterRestrictions.FilterAllowedExpressions && oFilterRestrictions.FilterAllowedExpressions[sProperty]) {
977
928
  // Extending the default operators list with Semantic Date options DATERANGE, DATE, FROM and TO
978
- if (bSemanticDateRange) {
979
- aDefaultOperators = aSemanticDateOpsExt.concat(aDefaultOperators);
980
- }
981
929
  const sAllowedExpression = CommonUtils.getSpecificAllowedExpression(oFilterRestrictions.FilterAllowedExpressions[sProperty]);
982
- let sRestrictions;
983
930
  // In case more than one Allowed Expressions has been defined for a property
984
931
  // choose the most restrictive Allowed Expression
985
932
 
@@ -998,7 +945,7 @@ function getOperatorsForProperty(
998
945
  if (sType === "Edm.Date") {
999
946
  aExpressionOps = aSemanticDateOps;
1000
947
  } else if (sType === "Edm.DateTimeOffset") {
1001
- aExpressionOps = aSingleRangeDateTimeOps.concat(aBasicDateTimeOps);
948
+ aExpressionOps = aSemanticDateOps.concat(aBasicDateTimeOps);
1002
949
  } else {
1003
950
  aExpressionOps = aSingleRangeOps;
1004
951
  }
@@ -1019,23 +966,29 @@ function getOperatorsForProperty(
1019
966
  case "MultiRangeOrSearchExpression":
1020
967
  sRestrictions = _getRestrictions(aDefaultOperators, aSearchExpressionOps.concat(aMultiRangeOps));
1021
968
  break;
1022
-
1023
969
  default:
1024
970
  break;
1025
971
  }
1026
972
  // In case AllowedExpressions is not recognised, undefined in return results in the default set of
1027
973
  // operators for the type.
1028
- return sRestrictions;
1029
- } else if (sType === "Edm.Date") {
1030
- // In case AllowedExpressions is not provided for type Edm.Date then all the default
1031
- // operators for the type should be returned excluding semantic operators from the list.
1032
- aSemanticDateOps = SemanticDateOperators.getSemanticDateOperations();
1033
- const aOperators = aDefaultOperators.filter(function (sElement: any) {
1034
- return aSemanticDateOps.indexOf(sElement) < 0;
1035
- });
1036
- return aOperators.toString();
974
+ } else if (sType === "Edm.Date" || sType === "Edm.DateTimeOffset") {
975
+ // The default considered is MultiRange
976
+ sRestrictions = _getRestrictions(aDefaultOperators, aMultiRangeOps);
1037
977
  }
978
+ return sRestrictions;
1038
979
  }
980
+
981
+ function getOperatorsForDateProperty(): string {
982
+ // In case AllowedExpressions is not provided for type Edm.Date then all the default
983
+ // operators for the type should be returned excluding semantic operators from the list.
984
+ const aDefaultOperators = _getDefaultOperators("Edm.Date");
985
+ const aSemanticDateOps = SemanticDateOperators.getSemanticDateOperations();
986
+ const aOperators = aDefaultOperators.filter(function (sElement: any) {
987
+ return aSemanticDateOps.indexOf(sElement) < 0;
988
+ });
989
+ return aOperators.toString();
990
+ }
991
+
1039
992
  function getParameterInfo(oMetaModel: any, sContextPath: any) {
1040
993
  const sParameterContextPath = sContextPath.substring(0, sContextPath.lastIndexOf("/"));
1041
994
  const bResultContext = oMetaModel.getObject(`${sParameterContextPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
@@ -1180,9 +1133,10 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
1180
1133
 
1181
1134
  aSelectOptionsPropertyNames.forEach(function (sSelectOption: any) {
1182
1135
  if (sSelectOption.indexOf(".") > 0 && !sSelectOption.includes("$Parameter")) {
1183
- const sFullContextPath = `/${sSelectOption.replaceAll(".", "/")}`.startsWith(sContextPath)
1184
- ? `/${sSelectOption.replaceAll(".", "/")}`
1185
- : `${sContextPath}/${sSelectOption.replaceAll(".", "/")}`; // check if the full path, eg SalesOrderManage._Item.Material exists in the metamodel
1136
+ const sReplacedOption = sSelectOption.replaceAll(".", "/");
1137
+ const sFullContextPath = `/${sReplacedOption}`.startsWith(sContextPath)
1138
+ ? `/${sReplacedOption}`
1139
+ : `${sContextPath}/${sReplacedOption}`; // check if the full path, eg SalesOrderManage._Item.Material exists in the metamodel
1186
1140
  if (oMetaModel.getObject(sFullContextPath.replace("P_", ""))) {
1187
1141
  _createConditionsForNavProperties(
1188
1142
  sFullContextPath,
@@ -1370,10 +1324,12 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
1370
1324
  sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
1371
1325
  sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
1372
1326
  if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
1373
- const aFilter = oFilterInfo[0].aFilters.filter(function (filter: any) {
1374
- return filter.sPath === sFilterName;
1375
- });
1376
- sLow = aFilter[0].oValue1 || "";
1327
+ const aFilter =
1328
+ oFilterInfo[0].aFilters &&
1329
+ oFilterInfo[0].aFilters.filter(function (filter: any) {
1330
+ return filter.sPath === sFilterName;
1331
+ });
1332
+ sLow = (aFilter && aFilter[0].oValue1) || oFilterInfo[0].oValue1 || "";
1377
1333
  sHigh = null;
1378
1334
  }
1379
1335
  const oSelectOptionValues = fnGetSignAndOption(oFilter.operator, sLow, sHigh);
@@ -1572,7 +1528,7 @@ function hasRestrictedPropertiesInAnnotations(
1572
1528
  function setUserDefaults(
1573
1529
  oAppComponent: AppComponent,
1574
1530
  aParameters: any[],
1575
- oModel: JSONModel,
1531
+ oModel: JSONModel | ODataV4Context,
1576
1532
  bIsAction: boolean,
1577
1533
  bIsCreate?: boolean,
1578
1534
  oActionDefaultValues?: any
@@ -1734,12 +1690,19 @@ function setSemanticObjectMappings(oSelectionVariant: any, vMappings: object) {
1734
1690
  }
1735
1691
  return oSelectionVariant;
1736
1692
  }
1737
- function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: any) {
1693
+ function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: string, sQualifier: string) {
1738
1694
  return new Promise(function (resolve: (value: any) => void) {
1739
- const sSemanticObject = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.SemanticObject`);
1740
- const aSemanticObjectUnavailableActions = oMetaModel.getObject(
1741
- `${sPath}@com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions`
1742
- );
1695
+ let sSemanticObject, aSemanticObjectUnavailableActions;
1696
+ if (sQualifier === "") {
1697
+ sSemanticObject = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObject}`);
1698
+ aSemanticObjectUnavailableActions = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`);
1699
+ } else {
1700
+ sSemanticObject = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObject}#${sQualifier}`);
1701
+ aSemanticObjectUnavailableActions = oMetaModel.getObject(
1702
+ `${sPath}@${CommonAnnotationTerms.SemanticObjectUnavailableActions}#${sQualifier}`
1703
+ );
1704
+ }
1705
+
1743
1706
  const aSemanticObjectForGetLinks = [{ semanticObject: sSemanticObject }];
1744
1707
  const oSemanticObject = {
1745
1708
  semanticObject: sSemanticObject
@@ -1836,8 +1799,35 @@ function fnUpdateSemanticTargetsModel(aGetLinksPromises: any, aSemanticObjects:
1836
1799
  Log.error("fnUpdateSemanticTargetsModel: Cannot read links", oError);
1837
1800
  });
1838
1801
  }
1839
- function fnGetSemanticObjectPromise(oAppComponent: any, oView: any, oMetaModel: any, sPath: any) {
1840
- return CommonUtils.getSemanticObjectsFromPath(oMetaModel, sPath);
1802
+ function fnGetSemanticObjectPromise(oAppComponent: any, oView: any, oMetaModel: any, sPath: string, sQualifier: string) {
1803
+ return CommonUtils.getSemanticObjectsFromPath(oMetaModel, sPath, sQualifier);
1804
+ }
1805
+ function fnPrepareSemanticObjectsPromises(
1806
+ _oAppComponent: any,
1807
+ _oView: any,
1808
+ _oMetaModel: any,
1809
+ _aSemanticObjectsFound: string[],
1810
+ _aSemanticObjectsPromises: Promise<any>[]
1811
+ ) {
1812
+ let _Keys: string[], sPath;
1813
+ let sQualifier: string, regexResult;
1814
+ for (let i = 0; i < _aSemanticObjectsFound.length; i++) {
1815
+ sPath = _aSemanticObjectsFound[i];
1816
+ _Keys = Object.keys(_oMetaModel.getObject(sPath + "@"));
1817
+ for (let index = 0; index < _Keys.length; index++) {
1818
+ if (
1819
+ _Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObject}`) === 0 &&
1820
+ _Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObjectMapping}`) === -1 &&
1821
+ _Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`) === -1
1822
+ ) {
1823
+ regexResult = /#(.*)/.exec(_Keys[index]);
1824
+ sQualifier = regexResult ? regexResult[1] : "";
1825
+ _aSemanticObjectsPromises.push(
1826
+ CommonUtils.getSemanticObjectPromise(_oAppComponent, _oView, _oMetaModel, sPath, sQualifier)
1827
+ );
1828
+ }
1829
+ }
1830
+ }
1841
1831
  }
1842
1832
  function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string) {
1843
1833
  const _fnfindValuesHelper = function (obj: any, key: any, list: any) {
@@ -1876,7 +1866,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
1876
1866
  const oInternalModelContext = oView.getBindingContext("internal");
1877
1867
 
1878
1868
  if (oInternalModelContext) {
1879
- const aSemanticObjectsPromises = [];
1869
+ const aSemanticObjectsPromises: Promise<any>[] = [];
1880
1870
  const oComponent = oController.getOwnerComponent();
1881
1871
  const oAppComponent = Component.getOwnerComponentFor(oComponent) as AppComponent;
1882
1872
  const oMetaModel = oAppComponent.getMetaModel();
@@ -1890,7 +1880,6 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
1890
1880
  let sCurrentHash = CommonUtils.getHash();
1891
1881
  const aSemanticObjectsForGetLinks = [];
1892
1882
  const aSemanticObjects: any[] = [];
1893
- let sPath;
1894
1883
  let _oSemanticObject;
1895
1884
 
1896
1885
  if (sCurrentHash && sCurrentHash.indexOf("?") !== -1) {
@@ -1898,10 +1887,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
1898
1887
  sCurrentHash = sCurrentHash.split("?")[0];
1899
1888
  }
1900
1889
 
1901
- for (let i = 0; i < aSemanticObjectsFound.length; i++) {
1902
- sPath = aSemanticObjectsFound[i];
1903
- aSemanticObjectsPromises.push(CommonUtils.getSemanticObjectPromise(oAppComponent, oView, oMetaModel, sPath));
1904
- }
1890
+ fnPrepareSemanticObjectsPromises(oAppComponent, oView, oMetaModel, aSemanticObjectsFound, aSemanticObjectsPromises);
1905
1891
 
1906
1892
  if (aSemanticObjectsPromises.length === 0) {
1907
1893
  return Promise.resolve();
@@ -2110,21 +2096,25 @@ function loadMacroLibrary() {
2110
2096
  });
2111
2097
  }
2112
2098
 
2113
- function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel: ODataModel, aMessages: any[]) {
2114
- const localI18nRef = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
2115
- sActionName = actionName,
2116
- sCancelButtonTxt = localI18nRef.getText("C_COMMON_DIALOG_CANCEL");
2099
+ function fnOnStrictHandlingFailed(sGroupId: string, mParameters: any, oResourceBundle: any, aMessages: any[]) {
2100
+ const sActionName = mParameters.label,
2101
+ oModel = mParameters.model,
2102
+ sCancelButtonTxt = CommonUtils.getTranslatedText("C_COMMON_DIALOG_CANCEL", oResourceBundle);
2103
+ aMessages = aMessages.filter((oMessage) => oMessage.getTechnicalDetails() && oMessage.getTechnicalDetails().httpStatus === 412);
2117
2104
  if (aMessages.length === 1) {
2118
- const sMessage = `${aMessages[0].message}\n${localI18nRef.getText("PROCEED")}`;
2105
+ const sMessage = `${aMessages[0].message}\n${CommonUtils.getTranslatedText("PROCEED", oResourceBundle)}`;
2119
2106
  return new Promise(function (resolve) {
2120
2107
  MessageBox.warning(sMessage, {
2121
- title: localI18nRef.getText("WARNING"),
2108
+ title: CommonUtils.getTranslatedText("WARNING", oResourceBundle),
2122
2109
  actions: [sActionName, sCancelButtonTxt],
2123
2110
  emphasizedAction: sActionName,
2124
2111
  onClose: function (sAction: string) {
2125
2112
  if (sAction === sActionName) {
2126
2113
  resolve(true);
2127
2114
  oModel.submitBatch(sGroupId);
2115
+ if (mParameters.requestSideEffects) {
2116
+ mParameters.requestSideEffects();
2117
+ }
2128
2118
  } else {
2129
2119
  resolve(false);
2130
2120
  }
@@ -2154,16 +2144,18 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
2154
2144
  press: function () {
2155
2145
  resolve(true);
2156
2146
  oModel.submitBatch(sGroupId);
2147
+ oMessageDialogModel.setData({});
2157
2148
  oDialog.close();
2158
2149
  },
2159
2150
  type: "Emphasized",
2160
- text: getTranslatedText("IGNORE", localI18nRef, sActionName)
2151
+ text: sActionName
2161
2152
  })
2162
2153
  );
2163
2154
  oDialog.setEndButton(
2164
2155
  new Button({
2165
2156
  press: function () {
2166
2157
  resolve(false);
2158
+ oMessageDialogModel.setData({});
2167
2159
  oDialog.close();
2168
2160
  },
2169
2161
  text: sCancelButtonTxt
@@ -2233,41 +2225,17 @@ function getKeys(oMetaModel: any, sPath: string, sEntitySetName: string): string
2233
2225
  }
2234
2226
  return sKey;
2235
2227
  }
2236
-
2237
- function getMessageStripText(
2238
- view: any,
2239
- aIgnoredLabels: any,
2240
- oFilterBar: any,
2241
- bIsChart: any,
2242
- bIsSearchIgnored: any,
2243
- sTabTitle: any,
2244
- oResourceBundle: any,
2245
- fnGetLocalizedText: any
2246
- ): string {
2247
- let sText = "";
2248
- if (bIsChart) {
2249
- const oChart = view.getController().getChartControl();
2250
- const bIsDraftSupported = oChart.data("draftSupported") === "true";
2251
- const oMacroResourceBundle = Core.getLibraryResourceBundle("sap.fe.macros") as ResourceBundle;
2252
- bIsSearchIgnored = bIsSearchIgnored && aIgnoredLabels.includes(oMacroResourceBundle.getText("M_FILTERBAR_SEARCH"));
2253
- if (aIgnoredLabels.length === 2 && bIsSearchIgnored && bIsDraftSupported) {
2254
- sText = oResourceBundle.getText("C_LR_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA_AND_SEARCH");
2255
- } else if (aIgnoredLabels.length === 1 && bIsDraftSupported) {
2256
- sText = oResourceBundle.getText("C_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA");
2257
- } else {
2258
- const sResource = `C_LR_MULTIVIZ_CHART_${aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI"}_IGNORED_FILTER_${
2259
- system.desktop ? "LARGE" : "SMALL"
2260
- }`;
2261
- sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", ")]);
2262
- }
2228
+ // Get the path for action parameters that is needed to read the annotations
2229
+ function getParameterPath(sPath: any, sParameter: any) {
2230
+ let sContext;
2231
+ if (sPath.indexOf("@$ui5.overload") > -1) {
2232
+ sContext = sPath.split("@$ui5.overload")[0];
2263
2233
  } else {
2264
- const sResource = `C_LR_MULTITABLES_${aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI"}_IGNORED_FILTER_${
2265
- system.desktop ? "LARGE" : "SMALL"
2266
- }`,
2267
- sLocalizedTableTitle = fnGetLocalizedText(sTabTitle, oFilterBar);
2268
- sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", "), sLocalizedTableTitle]);
2234
+ // For Unbound Actions in Action Parameter Dialogs
2235
+ const aAction = sPath.split("/0")[0].split(".");
2236
+ sContext = `/${aAction[aAction.length - 1]}/`;
2269
2237
  }
2270
- return sText;
2238
+ return sContext + sParameter;
2271
2239
  }
2272
2240
 
2273
2241
  const CommonUtils = {
@@ -2276,6 +2244,7 @@ const CommonUtils = {
2276
2244
  removeSensitiveData: removeSensitiveData,
2277
2245
  fireButtonPress: fnFireButtonPress,
2278
2246
  getTargetView: getTargetView,
2247
+ getCurrentPageView: getCurrentPageView,
2279
2248
  hasTransientContext: fnHasTransientContexts,
2280
2249
  updateRelatedAppsDetails: fnUpdateRelatedAppsDetails,
2281
2250
  resolveStringtoBoolean: fnResolveStringtoBoolean,
@@ -2288,9 +2257,9 @@ const CommonUtils = {
2288
2257
  getEntitySetName: getEntitySetName,
2289
2258
  getActionPath: getActionPath,
2290
2259
  computeDisplayMode: computeDisplayMode,
2291
- setActionEnablement: setActionEnablement,
2292
2260
  isStickyEditMode: isStickyEditMode,
2293
2261
  getOperatorsForProperty: getOperatorsForProperty,
2262
+ getOperatorsForDateProperty: getOperatorsForDateProperty,
2294
2263
  addSelectionVariantToConditions: addSelectionVariantToConditions,
2295
2264
  addExternalStateFiltersToSelectionVariant: addExternalStateFiltersToSelectionVariant,
2296
2265
  addPageContextToSelectionVariant: addPageContextToSelectionVariant,
@@ -2316,7 +2285,6 @@ const CommonUtils = {
2316
2285
  requestSingletonProperty: requestSingletonProperty,
2317
2286
  templateControlFragment: templateControlFragment,
2318
2287
  addEventToBindingInfo: addEventToBindingInfo,
2319
- setObjectMappings: setObjectMappings,
2320
2288
  FilterRestrictions: {
2321
2289
  REQUIRED_PROPERTIES: "RequiredProperties",
2322
2290
  NON_FILTERABLE_PROPERTIES: "NonFilterableProperties",
@@ -2326,14 +2294,19 @@ const CommonUtils = {
2326
2294
  normalizeSearchTerm: normalizeSearchTerm,
2327
2295
  fnOnStrictHandlingFailed: fnOnStrictHandlingFailed,
2328
2296
  getSingletonPath: getSingletonPath,
2329
- getMessageStripText: getMessageStripText,
2330
2297
  getMessageColumn: getMessageColumn,
2331
2298
  getRequiredPropertiesFromUpdateRestrictions: getRequiredPropertiesFromUpdateRestrictions,
2332
2299
  getRequiredPropertiesFromInsertRestrictions: getRequiredPropertiesFromInsertRestrictions,
2333
2300
  hasRestrictedPropertiesInAnnotations: hasRestrictedPropertiesInAnnotations,
2334
2301
  getRequiredPropertiesFromAnnotations: getRequiredPropertiesFromAnnotations,
2335
2302
  getRequiredProperties: getRequiredProperties,
2336
- getKeys: getKeys
2303
+ getKeys: getKeys,
2304
+ checkIfResourceKeyExists: checkIfResourceKeyExists,
2305
+ setContextsBasedOnOperationAvailable: setContextsBasedOnOperationAvailable,
2306
+ setDynamicActionContexts: setDynamicActionContexts,
2307
+ requestProperty: requestProperty,
2308
+ getParameterPath: getParameterPath,
2309
+ getRelatedAppsMenuItems: _getRelatedAppsMenuItems
2337
2310
  };
2338
2311
 
2339
2312
  export default CommonUtils;