@sapui5/sap.ushell 1.121.2 → 1.122.1

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 (351) hide show
  1. package/package.json +2 -2
  2. package/src/main/js/sap/ushell/.library +1 -1
  3. package/src/main/js/sap/ushell/CanvasShapesManager.js +5 -3
  4. package/src/main/js/sap/ushell/Container.js +14 -0
  5. package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
  6. package/src/main/js/sap/ushell/Fiori20AdapterTest.js +1 -1
  7. package/src/main/js/sap/ushell/Layout.js +1 -1
  8. package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
  9. package/src/main/js/sap/ushell/SessionHandler.js +1 -1
  10. package/src/main/js/sap/ushell/TechnicalParameters.js +1 -1
  11. package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
  12. package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +1 -1
  13. package/src/main/js/sap/ushell/Ui5ServiceFactory.js +1 -1
  14. package/src/main/js/sap/ushell/_URLTemplateProcessor/DefinitionParameterSetBuilder.js +1 -1
  15. package/src/main/js/sap/ushell/_URLTemplateProcessor/DependencyGraph.js +1 -1
  16. package/src/main/js/sap/ushell/_URLTemplateProcessor/Functions.js +1 -1
  17. package/src/main/js/sap/ushell/_URLTemplateProcessor/Resolvers.js +1 -1
  18. package/src/main/js/sap/ushell/_URLTemplateProcessor/TemplateParameterParser.js +1 -1
  19. package/src/main/js/sap/ushell/_URLTemplateProcessor/utils.js +1 -1
  20. package/src/main/js/sap/ushell/adapters/cdm/ClientSideTargetResolutionAdapter.js +1 -1
  21. package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +1 -1
  22. package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
  23. package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -1
  24. package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +1 -1
  25. package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +1 -1
  26. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
  27. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +1 -1
  28. package/src/main/js/sap/ushell/adapters/cdm/Ui5ComponentLoaderAdapter.js +1 -1
  29. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/modifyHome.js +1 -1
  30. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readCatalogs.js +1 -1
  31. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readHome.js +1 -1
  32. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/uri.transform.js +1 -1
  33. package/src/main/js/sap/ushell/adapters/cdm/util/AppForInbound.js +1 -1
  34. package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +1 -1
  35. package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +1 -1
  36. package/src/main/js/sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter.js +1 -1
  37. package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +1 -1
  38. package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
  39. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
  40. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
  41. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
  42. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
  43. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
  44. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
  45. package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +1 -1
  46. package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +8 -185
  47. package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionInternalAdapter.js +198 -0
  48. package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +1 -1
  49. package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +1 -1
  50. package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
  51. package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +6 -5
  52. package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +5 -4
  53. package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -1
  54. package/src/main/js/sap/ushell/adapters/local/FlpLaunchPageAdapter.js +27 -22
  55. package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
  56. package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +7 -193
  57. package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionInternalAdapter.js +205 -0
  58. package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
  59. package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
  60. package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
  61. package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +1 -1
  62. package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
  63. package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
  64. package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
  65. package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
  66. package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +1 -1
  67. package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
  68. package/src/main/js/sap/ushell/api/workpage/Designtime.js +24 -4
  69. package/src/main/js/sap/ushell/api/workpage/Runtime.js +45 -7
  70. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +6 -0
  71. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/AppLifeCycleUtils.js +4 -4
  72. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/Renderer.js +17 -49
  73. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/Component.js +13 -18
  74. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/Component.js +24 -36
  75. package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +2 -3
  76. package/src/main/js/sap/ushell/appRuntime/ui5/services/CrossApplicationNavigation.js +4 -4
  77. package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolution.js +4 -5
  78. package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolutionInternal.js +113 -0
  79. package/src/main/js/sap/ushell/appRuntime/ui5/services/Navigation.js +2 -2
  80. package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigation.js +1 -1
  81. package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigationInternal.js +1 -1
  82. package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
  83. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
  84. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
  85. package/src/main/js/sap/ushell/bootstrap/cdm/cdm.constants.js +1 -1
  86. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
  87. package/src/main/js/sap/ushell/bootstrap/common/common.create.configcontract.core.js +3 -1
  88. package/src/main/js/sap/ushell/bootstrap/common/common.read.ushell.config.from.url.js +2 -1
  89. package/src/main/js/sap/ushell/bootstrap/common/common.util.js +17 -2
  90. package/src/main/js/sap/ushell/bootstrap/sandbox2/sandboxConfig.json +12 -3
  91. package/src/main/js/sap/ushell/bootstrap/sandbox2.js +54 -22
  92. package/src/main/js/sap/ushell/components/CatalogsManager.js +31 -11
  93. package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
  94. package/src/main/js/sap/ushell/components/HomepageManager.js +5 -3
  95. package/src/main/js/sap/ushell/components/appfinder/AppFinder.controller.js +2 -2
  96. package/src/main/js/sap/ushell/components/appfinder/Catalog.controller.js +1 -1
  97. package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +3 -4
  98. package/src/main/js/sap/ushell/components/appfinder/Component.js +5 -2
  99. package/src/main/js/sap/ushell/components/appfinder/HierarchyAppsView.js +3 -3
  100. package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
  101. package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -13
  102. package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
  103. package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
  104. package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +64 -8
  105. package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +67 -83
  106. package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
  107. package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
  108. package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +1 -1
  109. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/AdvancedFormatters.js +3 -3
  110. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/appendStyleVars.js +3 -3
  111. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/categories/Event.js +3 -3
  112. package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +4 -4
  113. package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
  114. package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +12 -5
  115. package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
  116. package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
  117. package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
  118. package/src/main/js/sap/ushell/components/contentFinder/resources/resources.properties +1 -1
  119. package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchBox.fragment.xml +3 -1
  120. package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
  121. package/src/main/js/sap/ushell/components/factsheet/factory/ThingInspector.js +37 -37
  122. package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
  123. package/src/main/js/sap/ushell/components/homepage/DashboardContent.controller.js +2 -2
  124. package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
  125. package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +2 -2
  126. package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +2 -2
  127. package/src/main/js/sap/ushell/components/homepage/manifest.json +1 -1
  128. package/src/main/js/sap/ushell/components/pages/ActionMode.js +1 -1
  129. package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
  130. package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
  131. package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +1 -1
  132. package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
  133. package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +1 -1
  134. package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
  135. package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +1 -1
  136. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +1 -1
  137. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +1 -1
  138. package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +1 -1
  139. package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +525 -613
  140. package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
  141. package/src/main/js/sap/ushell/components/shell/Search/manifest.json +1 -1
  142. package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +1 -1
  143. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
  144. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
  145. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
  146. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
  147. package/src/main/js/sap/ushell/components/shell/Settings/Component.js +1 -1
  148. package/src/main/js/sap/ushell/components/shell/Settings/appearance/Appearance.controller.js +4 -4
  149. package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/UserDefaultsEntry.js +3 -5
  150. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
  151. package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +1 -1
  152. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/indicatorTileHelper.js +18 -18
  153. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +1 -1
  154. package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +1 -1
  155. package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
  156. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
  157. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +2 -2
  158. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
  159. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +1 -1
  160. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +1 -1
  161. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +1 -1
  162. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +1 -1
  163. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +1 -1
  164. package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +3 -3
  165. package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
  166. package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -1
  167. package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
  168. package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
  169. package/src/main/js/sap/ushell/library.js +9 -1
  170. package/src/main/js/sap/ushell/navigationMode.js +3 -3
  171. package/src/main/js/sap/ushell/performance/FesrEnhancer.js +33 -4
  172. package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
  173. package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
  174. package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
  175. package/src/main/js/sap/ushell/plugins/rta-personalize/Component.js +6 -254
  176. package/src/main/js/sap/ushell/plugins/rta-personalize/manifest.json +0 -102
  177. package/src/main/js/sap/ushell/renderer/AccessKeysHandler.js +0 -8
  178. package/src/main/js/sap/ushell/renderer/Renderer.js +2 -2
  179. package/src/main/js/sap/ushell/renderer/Shell.controller.js +7 -7
  180. package/src/main/js/sap/ushell/renderer/Shell.view.js +2 -10
  181. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.controller.js +10 -11
  182. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.view.xml +49 -71
  183. package/src/main/js/sap/ushell/renderer/resources/resources.properties +0 -2
  184. package/src/main/js/sap/ushell/renderer/search/searchComponent/manifest.json +1 -1
  185. package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +1 -1
  186. package/src/main/js/sap/ushell/services/AppLifeCycle.js +1 -1
  187. package/src/main/js/sap/ushell/services/AppState.js +1 -1
  188. package/src/main/js/sap/ushell/services/Bookmark.js +2 -2
  189. package/src/main/js/sap/ushell/services/BookmarkV2.js +2 -2
  190. package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +3 -3
  191. package/src/main/js/sap/ushell/services/CommonDataModel.js +3 -5
  192. package/src/main/js/sap/ushell/services/Configuration.js +1 -1
  193. package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +1 -1
  194. package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
  195. package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +20 -20
  196. package/src/main/js/sap/ushell/services/DarkModeSupport.js +3 -3
  197. package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +1 -1
  198. package/src/main/js/sap/ushell/services/Extension/Footer.js +1 -1
  199. package/src/main/js/sap/ushell/services/Extension/Header.js +1 -1
  200. package/src/main/js/sap/ushell/services/Extension/Item.js +1 -1
  201. package/src/main/js/sap/ushell/services/Extension/SidePane.js +1 -1
  202. package/src/main/js/sap/ushell/services/Extension/ToolArea.js +1 -1
  203. package/src/main/js/sap/ushell/services/Extension.js +1 -1
  204. package/src/main/js/sap/ushell/services/FlpLaunchPage.js +1 -1
  205. package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
  206. package/src/main/js/sap/ushell/services/Menu.js +1 -1
  207. package/src/main/js/sap/ushell/services/Message.js +1 -1
  208. package/src/main/js/sap/ushell/services/MessageBroker.js +1 -1
  209. package/src/main/js/sap/ushell/services/NavTargetResolution.js +24 -995
  210. package/src/main/js/sap/ushell/services/NavTargetResolutionInternal.js +1272 -0
  211. package/src/main/js/sap/ushell/services/Navigation/utils.js +1 -1
  212. package/src/main/js/sap/ushell/services/Navigation.js +11 -11
  213. package/src/main/js/sap/ushell/services/NavigationDataProvider.js +1 -1
  214. package/src/main/js/sap/ushell/services/Notifications.js +0 -14
  215. package/src/main/js/sap/ushell/services/NotificationsV2.js +10 -34
  216. package/src/main/js/sap/ushell/services/PageBuilding.js +1 -1
  217. package/src/main/js/sap/ushell/services/PagePersistence.js +1 -1
  218. package/src/main/js/sap/ushell/services/PageReferencing.js +1 -1
  219. package/src/main/js/sap/ushell/services/Pages.js +1 -1
  220. package/src/main/js/sap/ushell/services/Personalization.js +1 -1
  221. package/src/main/js/sap/ushell/services/PersonalizationV2.js +1 -1
  222. package/src/main/js/sap/ushell/services/PluginManager.js +2 -2
  223. package/src/main/js/sap/ushell/services/ReferenceResolver.js +1 -1
  224. package/src/main/js/sap/ushell/services/Search.js +1 -1
  225. package/src/main/js/sap/ushell/services/SearchCEP.js +1 -1
  226. package/src/main/js/sap/ushell/services/SearchableContent.js +2 -2
  227. package/src/main/js/sap/ushell/services/ShellNavigation.js +1 -1
  228. package/src/main/js/sap/ushell/services/ShellNavigationHashChanger.js +1 -1
  229. package/src/main/js/sap/ushell/services/ShellNavigationInternal.js +3 -2
  230. package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
  231. package/src/main/js/sap/ushell/services/SpaceContent.js +1 -1
  232. package/src/main/js/sap/ushell/services/UITracer.js +5 -5
  233. package/src/main/js/sap/ushell/services/URLParsing.js +2 -2
  234. package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
  235. package/src/main/js/sap/ushell/services/URLTemplate.js +1 -1
  236. package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +1 -1
  237. package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +1 -1
  238. package/src/main/js/sap/ushell/services/UserDefaultParameters.js +1 -1
  239. package/src/main/js/sap/ushell/services/UserInfo.js +1 -1
  240. package/src/main/js/sap/ushell/services/UserRecents.js +1 -1
  241. package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +1 -1
  242. package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +1 -1
  243. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
  244. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
  245. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
  246. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
  247. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
  248. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
  249. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
  250. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +1 -1
  251. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +1 -1
  252. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
  253. package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
  254. package/src/main/js/sap/ushell/services/_CommonDataModel/vizTypeDefaults/VizTypeDefaults.js +1 -1
  255. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
  256. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
  257. package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +1 -1
  258. package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
  259. package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +4 -4
  260. package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
  261. package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
  262. package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
  263. package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +1 -1
  264. package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
  265. package/src/main/js/sap/ushell/themes/base/Catalog.less +12 -2
  266. package/src/main/js/sap/ushell/themes/base/SearchCEP.less +1 -1
  267. package/src/main/js/sap/ushell/themes/base/ShellAppTitle.less +15 -57
  268. package/src/main/js/sap/ushell/themes/base/WorkPageCell.less +0 -1
  269. package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-icon_120x120.png +0 -0
  270. package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-retina_180x180.png +0 -0
  271. package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-icon_152x152.png +0 -0
  272. package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-retina_167x167.png +0 -0
  273. package/src/main/js/sap/ushell/themes/sap_belize/ShellHeader.less +11 -36
  274. package/src/main/js/sap/ushell/themes/sap_fiori_3/ShellHeader.less +9 -31
  275. package/src/main/js/sap/ushell/themes/sap_fiori_3_dark/ShellHeader.less +9 -32
  276. package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +11 -39
  277. package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +11 -39
  278. package/src/main/js/sap/ushell/ui/appfinder/AppBox.js +3 -136
  279. package/src/main/js/sap/ushell/ui/appfinder/AppBoxInternal.js +161 -0
  280. package/src/main/js/sap/ushell/ui/appfinder/AppBoxRenderer.js +6 -0
  281. package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
  282. package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.controller.js +1 -1
  283. package/src/main/js/sap/ushell/ui/launchpad/CatalogEntryContainer.js +1 -1
  284. package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
  285. package/src/main/js/sap/ushell/ui/launchpad/Section.js +1 -1
  286. package/src/main/js/sap/ushell/ui/launchpad/TileContainer.js +1 -1
  287. package/src/main/js/sap/ushell/ui/launchpad/VizInstanceLaunchPage.js +1 -1
  288. package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
  289. package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +7 -9
  290. package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
  291. package/src/main/js/sap/ushell/ui/utils.js +1 -1
  292. package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
  293. package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
  294. package/src/main/js/sap/ushell/utils/UrlShortening.js +2 -2
  295. package/src/main/js/sap/ushell/utils/workpage/WorkPageHost.js +366 -0
  296. package/src/main/js/sap/ushell/utils/workpage/WorkPageService.js +1 -1
  297. package/src/main/js/sap/ushell/utils/workpage/WorkPageVizInstantiation.js +5 -2
  298. package/src/main/js/sap/ushell/utils/workpage/resources/resources.properties +157 -0
  299. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ar.properties +78 -0
  300. package/src/main/js/sap/ushell/utils/workpage/resources/resources_bg.properties +78 -0
  301. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ca.properties +78 -0
  302. package/src/main/js/sap/ushell/utils/workpage/resources/resources_cs.properties +78 -0
  303. package/src/main/js/sap/ushell/utils/workpage/resources/resources_cy.properties +78 -0
  304. package/src/main/js/sap/ushell/utils/workpage/resources/resources_da.properties +78 -0
  305. package/src/main/js/sap/ushell/utils/workpage/resources/resources_de.properties +78 -0
  306. package/src/main/js/sap/ushell/utils/workpage/resources/resources_el.properties +78 -0
  307. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en.properties +78 -0
  308. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_GB.properties +78 -0
  309. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_sappsd.properties +78 -0
  310. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saprigi.properties +78 -0
  311. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saptrc.properties +78 -0
  312. package/src/main/js/sap/ushell/utils/workpage/resources/resources_es.properties +78 -0
  313. package/src/main/js/sap/ushell/utils/workpage/resources/resources_es_MX.properties +78 -0
  314. package/src/main/js/sap/ushell/utils/workpage/resources/resources_et.properties +78 -0
  315. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fi.properties +78 -0
  316. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr.properties +78 -0
  317. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr_CA.properties +78 -0
  318. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hi.properties +78 -0
  319. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hr.properties +78 -0
  320. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hu.properties +78 -0
  321. package/src/main/js/sap/ushell/utils/workpage/resources/resources_id.properties +78 -0
  322. package/src/main/js/sap/ushell/utils/workpage/resources/resources_it.properties +78 -0
  323. package/src/main/js/sap/ushell/utils/workpage/resources/resources_iw.properties +78 -0
  324. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ja.properties +78 -0
  325. package/src/main/js/sap/ushell/utils/workpage/resources/resources_kk.properties +78 -0
  326. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ko.properties +78 -0
  327. package/src/main/js/sap/ushell/utils/workpage/resources/resources_lt.properties +78 -0
  328. package/src/main/js/sap/ushell/utils/workpage/resources/resources_lv.properties +78 -0
  329. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ms.properties +78 -0
  330. package/src/main/js/sap/ushell/utils/workpage/resources/resources_nl.properties +78 -0
  331. package/src/main/js/sap/ushell/utils/workpage/resources/resources_no.properties +78 -0
  332. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pl.properties +78 -0
  333. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt.properties +78 -0
  334. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt_PT.properties +78 -0
  335. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ro.properties +78 -0
  336. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ru.properties +78 -0
  337. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sh.properties +78 -0
  338. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sk.properties +78 -0
  339. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sl.properties +78 -0
  340. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sv.properties +78 -0
  341. package/src/main/js/sap/ushell/utils/workpage/resources/resources_th.properties +78 -0
  342. package/src/main/js/sap/ushell/utils/workpage/resources/resources_tr.properties +78 -0
  343. package/src/main/js/sap/ushell/utils/workpage/resources/resources_uk.properties +78 -0
  344. package/src/main/js/sap/ushell/utils/workpage/resources/resources_vi.properties +78 -0
  345. package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_CN.properties +78 -0
  346. package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_TW.properties +78 -0
  347. package/src/main/js/sap/ushell/utils.js +2 -2
  348. package/src/test/js/sap/ushell/bootstrap/sandbox.js +70 -60
  349. package/ui5.yaml +30 -2
  350. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +0 -350
  351. package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n.properties +0 -38
@@ -0,0 +1,1272 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+
3
+ /**
4
+ * @fileOverview The NavTargetResolutionInternal service.
5
+ */
6
+ sap.ui.define([
7
+ "sap/ushell/services/AppConfiguration",
8
+ "sap/ushell/utils",
9
+ "sap/ushell/utils/UrlParsing",
10
+ "sap/ushell/utils/UrlShortening",
11
+ "sap/ushell/utils/HttpClient",
12
+ "sap/ushell/navigationMode",
13
+ "sap/ui/thirdparty/jquery",
14
+ "sap/ui/performance/Measurement",
15
+ "sap/base/util/deepExtend",
16
+ "sap/base/util/isPlainObject",
17
+ "sap/base/Log",
18
+ "sap/ushell/Container"
19
+ ], function (
20
+ appConfiguration,
21
+ utils,
22
+ UrlParsing,
23
+ UrlShortening,
24
+ HttpClient,
25
+ NavigationMode,
26
+ jQuery,
27
+ Measurement,
28
+ deepExtend,
29
+ isPlainObject,
30
+ Log,
31
+ Container
32
+ ) {
33
+ "use strict";
34
+
35
+ /**
36
+ * @alias sap.ushell.services.NavTargetResolutionInternal
37
+ * @class
38
+ * @classdesc The Unified Shell's internal navigation target resolution service.
39
+ *
40
+ * <b>Note:</b> To retrieve a valid instance of this service, it is necessary to call
41
+ * <code>sap.ushell.Container.getServiceAsync("NavTargetResolutionInternal")</code>. For details, see
42
+ * {@link sap.ushell.Container#getServiceAsync}.
43
+ *
44
+ * Methods in this class deal with *internal* representations of the shell hash.
45
+ *
46
+ * configurations:
47
+ * <code>config : { allowTestUrlComponentConfig : true }</code>
48
+ * allow to redefine the Test-url, Test-local1, Test-local2 applications via url parameters
49
+ * (sap-ushell-test-local1-url= / sap-ushell-test-local1-additionalInformation= ... )
50
+ *
51
+ * @param {object} oAdapter Adapter
52
+ * @param {object} oContainerInterface not used
53
+ * @param {string} sParameters not used
54
+ * @param {object} oServiceConfiguration oServiceConfiguration
55
+ *
56
+ * @augments sap.ushell.services.Service
57
+ * @hideconstructor
58
+ *
59
+ * @since 1.120.0
60
+ * @private
61
+ */
62
+ function NavTargetResolutionInternal (oAdapter, oContainerInterface, sParameters, oServiceConfiguration) {
63
+ var oServiceConfig = oServiceConfiguration && oServiceConfiguration.config;
64
+ var fnResolveHashFragment = function (sHashFragment) {
65
+ var oResolutionPromise = this._isClientSideTargetResolutionEnabled()
66
+ ? this._resolveHashFragmentClientSide(sHashFragment)
67
+ : oAdapter.resolveHashFragment(sHashFragment);
68
+
69
+ return oResolutionPromise;
70
+ }.bind(this);
71
+ var aLocalResolvedNavTargets;
72
+ // oAdapter resolver is the "last" custom resolver
73
+ var aResolvers = [{
74
+ name: "DefaultAdapter",
75
+ isApplicable: function () { return true; },
76
+ resolveHashFragment: fnResolveHashFragment.bind(this)
77
+ }];
78
+ var oCurrentResolution;
79
+
80
+ var oHttpClient = new HttpClient();
81
+
82
+ this._isClientSideTargetResolutionEnabled = function () { // need this declaration for fnResolveHashFragment
83
+ return !!(oServiceConfig && oServiceConfig.enableClientSideTargetResolution);
84
+ };
85
+
86
+ this._nextResolveHashFragment = function (aCustomResolvers, sHashFragment) {
87
+ var oResolver = aCustomResolvers.pop();
88
+
89
+ if (oResolver.isApplicable(sHashFragment)) {
90
+ Log.info("NavTargetResolutionInternal: custom resolver " + oResolver.name + " resolves " + sHashFragment);
91
+ var fnNextResolve = this._nextResolveHashFragment.bind(this, aCustomResolvers);
92
+
93
+ return oResolver.resolveHashFragment(sHashFragment, fnNextResolve);
94
+ }
95
+
96
+ return this._nextResolveHashFragment(aCustomResolvers, sHashFragment);
97
+ };
98
+
99
+ /**
100
+ * Resolves shell hash fragment via ClientSideTargetResolution service.
101
+ *
102
+ * @param {string} sHashFragment the hash fragment to be resolved
103
+ * @returns {jQuery.Promise} Resolves the resolution result object.
104
+ * @private
105
+ * @since 1.34.0
106
+ */
107
+ this._resolveHashFragmentClientSide = function (sHashFragment) {
108
+ var oHashValidationResult = this._validateHashFragment(sHashFragment);
109
+ if (!oHashValidationResult.success) {
110
+ return new jQuery.Deferred().reject(sHashFragment + " is not a valid hash fragment").promise();
111
+ }
112
+
113
+ var sFragmentNoHash = oHashValidationResult.hashFragmentWithoutHash;
114
+ return this._resolveHashFragmentClientSideAndFixApplicationType(sFragmentNoHash);
115
+ };
116
+
117
+ /**
118
+ * Invokes {@link sap.ushell.services.ClientSideTargetResolution#resolveHashFragment}
119
+ * and fixes any "SAPUI5" applicationType returned in the response to "URL", to avoid backward compatibility problems.
120
+ *
121
+ * @param {string} sFragmentNoHash the hash fragment to resolve
122
+ * @returns {jQuery.Promise} Resolves to an object representing the resolution result
123
+ * @private
124
+ * @since 1.34.0
125
+ */
126
+ this._resolveHashFragmentClientSideAndFixApplicationType = function (sFragmentNoHash) {
127
+ var oDeferred = new jQuery.Deferred();
128
+
129
+ Container.getServiceAsync("ClientSideTargetResolution")
130
+ .then(function (ClientSideTargetResolutionService) {
131
+ ClientSideTargetResolutionService.resolveHashFragment(sFragmentNoHash)
132
+ .done(function (oResolutionResult) {
133
+ // Ensure backward compatible behavior after incompatible server-side change.
134
+ if (oResolutionResult && oResolutionResult.applicationType === "SAPUI5") {
135
+ oResolutionResult.applicationType = "URL";
136
+ }
137
+
138
+ oDeferred.resolve(oResolutionResult);
139
+ })
140
+ .fail(oDeferred.reject);
141
+ })
142
+ .catch(oDeferred.reject);
143
+ return oDeferred.promise();
144
+ };
145
+
146
+ /**
147
+ * Determines whether the given hash fragment can be used to navigate to an app.
148
+ *
149
+ * NOTE: throws a {@link sap.ushell.utils#Error} in case the given hash fragment does not start with "#".
150
+ *
151
+ * @param {string} sHashFragment the hash fragment to be validated
152
+ * @returns {object} the validation result. An object like:
153
+ * <pre>
154
+ * {
155
+ * success: {boolean}, // whether the hash fragment looks valid
156
+ * hashFragmentWithoutHash: {string} // the hash fragment without leading "#"
157
+ * }
158
+ * </pre>
159
+ * @private
160
+ * @since 1.34.0
161
+ */
162
+ this._validateHashFragment = function (sHashFragment) {
163
+ var sHashFragmentWithoutHash = "";
164
+ var oValidationResult = {
165
+ success: false
166
+ };
167
+
168
+ if (sHashFragment && sHashFragment.charAt(0) !== "#") {
169
+ throw new utils.Error(
170
+ "Hash fragment expected in _validateHashFragment",
171
+ "sap.ushell.services.NavTargetResolutionInternal"
172
+ );
173
+ }
174
+
175
+ sHashFragmentWithoutHash = sHashFragment.substring(1);
176
+
177
+ if (sHashFragmentWithoutHash) {
178
+ oValidationResult.success = true;
179
+ }
180
+ oValidationResult.hashFragmentWithoutHash = sHashFragmentWithoutHash;
181
+
182
+ return oValidationResult;
183
+ };
184
+
185
+ /**
186
+ * expands a URL hash fragment
187
+ *
188
+ * This function gets the hash part of the URL and expands a sap-intent-param if present and retrievable
189
+ *
190
+ * This is an asynchronous operation.
191
+ *
192
+ * @param {string} sHashFragment The formatted URL hash fragment in internal format
193
+ * (as obtained by the SAPUI5 hasher service, not as given in <code>location.hash</code>)
194
+ * @returns {jQuery.Promise} Resolves expanded shell hash (in internal format).
195
+ *
196
+ * @private
197
+ */
198
+ this.expandCompactHash = function (sHashFragment) {
199
+ var oDeferred = new jQuery.Deferred();
200
+
201
+ // augment URL with application parameters from sHashFragment
202
+ var oParsedShellHash = UrlParsing.parseShellHash(sHashFragment);
203
+ if (oParsedShellHash && oParsedShellHash.params && oParsedShellHash.params["sap-intent-param"]) {
204
+ Container.getServiceAsync("AppState")
205
+ .then(function (AppStateService) {
206
+ AppStateService.getAppState(oParsedShellHash.params["sap-intent-param"][0])
207
+ .done(function (oContainer) {
208
+ var sValue = oContainer.getData("sap-intent-param");
209
+ var sHashFragmentPotentiallyExpanded = sHashFragment;
210
+
211
+ if (sValue) {
212
+ sHashFragmentPotentiallyExpanded = UrlShortening.expandParamGivenRetrievalFunction(sHashFragment, "sap-intent-param", function () {
213
+ return sValue;
214
+ });
215
+ }
216
+
217
+ oDeferred.resolve(sHashFragmentPotentiallyExpanded);
218
+ })
219
+ .fail(function () {
220
+ oDeferred.resolve(sHashFragment);
221
+ });
222
+ })
223
+ .catch(oDeferred.reject);
224
+ } else {
225
+ oDeferred.resolve(sHashFragment);
226
+ }
227
+ return oDeferred.promise();
228
+ };
229
+
230
+ var aWDAGUIAppType = ["NWBC", "WDA", "TR"];
231
+
232
+ /**
233
+ * Adjusts the applicationType &quot;SAPUI5&quot; to &quot;URL&quot; and extracts the component name from a resolution result and
234
+ * sets it as separate property <code>ui5ComponentName</code> in the specified object.
235
+ * <p>
236
+ * This is done centrally in the NavTargetResolutionInternal service to avoid parsing of the additionalInformation property at several places.
237
+ * As long as we keep the applicationType URL for ui5 components for backwards compatibility, this is also an indicator that it's a UI5 component.
238
+ * <p>
239
+ * Certain platforms like EP may use results from ABAP backend with custom adapters that do not fix the applicationType back to URL.
240
+ * This is normally done in ABAP adapters which we cannot assume to be present.
241
+ *
242
+ * As soon as the impact for current consumers is clarified, this logic should be done vice versa.
243
+ *
244
+ * @param {object} oResolvedHashFragment the hash fragment resolved by one of the registered resolvers
245
+ * @private
246
+ */
247
+ this._adjustResolutionResultForUi5Components = function (oResolvedHashFragment) {
248
+ if (typeof oResolvedHashFragment !== "object") {
249
+ return;
250
+ }
251
+ delete oResolvedHashFragment["sap.platform.runtime"];
252
+ // TODO: use application type SAPUI5 when impact of incompatibility is clear
253
+ if (oResolvedHashFragment && oResolvedHashFragment.applicationType && oResolvedHashFragment.applicationType === "SAPUI5") {
254
+ oResolvedHashFragment.applicationType = "URL";
255
+ }
256
+
257
+ if (oResolvedHashFragment.applicationType === "URL") {
258
+ var aMatches = /^SAPUI5\.Component=(.*)/.exec(oResolvedHashFragment.additionalInformation);
259
+ var sComponentName = aMatches && aMatches[1];
260
+ if (sComponentName) {
261
+ oResolvedHashFragment.ui5ComponentName = sComponentName;
262
+ }
263
+ }
264
+ };
265
+
266
+ /**
267
+ * Determines the sap-system of given resolution result, if present
268
+ *
269
+ * @param {object} sHashFragment the hash fragment resolved by one of the registered resolvers
270
+ * @param {object} oResolutionResult the resolution result
271
+ * @returns {string} a sap-system, if present, or undefined. The result is taken from the following sequence:
272
+ * <ol>
273
+ * <li><code>result url</code>if the result url contains a parameter value sap-system, this is the value determined by this function </li>
274
+ * <li><code>NWBC/TR/WDA</code>If the application type is of one NWBC/TR/WDA and no sap-system is part of the *resolved* url or already,
275
+ * sap-system is taken from the these original hash if present </li>
276
+ * <li><code>undefined</code> otherwise </li>
277
+ * </ol>
278
+ * Note: in this manner sap-system can be overwritten for SAPUI5 applications within the target mapping
279
+ * @private
280
+ */
281
+ this._getSapSystem = function (sHashFragment, oResolutionResult) {
282
+ var sSystem;
283
+ if (oResolutionResult && oResolutionResult["sap-system"]) {
284
+ return oResolutionResult["sap-system"];
285
+ }
286
+ if (oResolutionResult && oResolutionResult.url) {
287
+ sSystem = new URL(oResolutionResult.url, window.location.href).searchParams.get("sap-system");
288
+ if (sSystem) {
289
+ return sSystem;
290
+ }
291
+ }
292
+ if (aWDAGUIAppType.indexOf(oResolutionResult.applicationType) >= 0 && sHashFragment && sHashFragment.substring(1)) {
293
+ sSystem = new URL(sHashFragment.substring(1), window.location.href).searchParams.get("sap-system");
294
+ if (sSystem) {
295
+ return sSystem;
296
+ }
297
+ }
298
+ return undefined;
299
+ };
300
+
301
+ /**
302
+ * Resolves a navigation target taking into account the sap-system
303
+ *
304
+ * This function should be used by the NWBC browser in order to get a resolved target corresponding to a certain configuration object describing the target.
305
+ * Do not use this function for developing Fiori applications.
306
+ *
307
+ * @param {object} oArgs
308
+ * <pre>
309
+ * {
310
+ * target : {
311
+ * semanticObject : "semantic object",
312
+ * action : "action",
313
+ * },
314
+ * params : {
315
+ * "sap-system-src": "e.g. sid(UR5.120)",
316
+ * "sap-system": {
317
+ * ... data related to the sap-system
318
+ * }
319
+ * }
320
+ * }
321
+ * </pre>
322
+ * @returns {jQuery.Promise} Resolves an object. Typically it contains the following information:
323
+ * <pre>
324
+ * {
325
+ * "url": "/sap/bc/",
326
+ * "text": "My targetmapping description",
327
+ * "externalNavigationMode": boolean
328
+ * }
329
+ * </pre>
330
+ *
331
+ * @protected
332
+ */
333
+ this.resolveTarget = function (oArgs) {
334
+ var sHashFragment;
335
+ var oArgsClone = deepExtend({}, oArgs);
336
+ var oDeferred = new jQuery.Deferred();
337
+
338
+ Measurement.average("sap.ushell.navigation.resolveTarget");
339
+
340
+ utils.storeSapSystemToLocalStorage(oArgsClone);
341
+ sHashFragment = UrlParsing.constructShellHash(oArgsClone);
342
+
343
+ Container.getServiceAsync("NavTargetResolutionInternal")
344
+ .then(function (NavTargetResolutionService) {
345
+ NavTargetResolutionService.resolveHashFragment("#" + sHashFragment)
346
+ .done(function (oResolved) {
347
+ Measurement.end("sap.ushell.navigation.resolveTarget");
348
+
349
+ oDeferred.resolve({
350
+ url: oResolved.url,
351
+ text: oResolved.text,
352
+ externalNavigationMode: oResolved.targetNavigationMode === "explace"
353
+ });
354
+ })
355
+ .fail(oDeferred.reject);
356
+ })
357
+ .catch(oDeferred.reject);
358
+
359
+ return oDeferred.promise();
360
+ };
361
+
362
+ /**
363
+ * Resolves the URL hash fragment.
364
+ *
365
+ * This function should be used by a custom renderer in order to implement custom navigation. Do not use this function for developing Fiori applications.
366
+ *
367
+ * This function gets the hash part of the URL and returns data of the target application.
368
+ *
369
+ * Example of the returned data:
370
+ * <pre>
371
+ * {
372
+ * "additionalInformation": "SAPUI5.Component=sap.ushell.renderer.search.container",
373
+ * "applicationType": "URL",
374
+ * "url": "/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ushell/renderer/search/container",
375
+ * "navigationMode": "embedded"
376
+ * }
377
+ * </pre>
378
+ *
379
+ * This is an asynchronous operation.
380
+ *
381
+ * @param {string} sHashFragment The formatted URL hash fragment in internal format (as obtained by the SAPUI5 hasher service) not as given in <code>location.hash</code>)!
382
+ * Example: <code>#SemanticObject-action?P1=V1&P2=A%20B%20C</code>
383
+ * @returns {jQuery.Promise} Resolves an object that you can use to create a {@link sap.ushell.components.container.ApplicationContainer}
384
+ * or <code>undefined</code> in case the hash fragment was empty. Typically it contains the following information:
385
+ * <pre>
386
+ * {
387
+ * "applicationType": "URL",
388
+ * "url": "/sap/bc/",
389
+ * "additionalInformation": "SAPUI5.Component=com.sap.AComponent",
390
+ * "text": "My targetmapping description",
391
+ * "navigationMode": "embedded"
392
+ * }
393
+ * </pre>
394
+ * <p>
395
+ * The <code>navigationMode</code> indicates how the target application should be navigated.
396
+ * It is added to the result using the logic in {@link navigationMode#getNavigationMode} if none of the resolvers in the chain added it.
397
+ * </p>
398
+ * <p>No navigation should occur when the promise is resolved to <code>undefined</code>.</p>
399
+ *
400
+ * @private
401
+ */
402
+ this.resolveHashFragment = function (sHashFragment) {
403
+ var oDeferred = new jQuery.Deferred();
404
+
405
+ Measurement.average("sap.ushell.navigation.resolveHashFragment");
406
+
407
+ this.expandCompactHash(sHashFragment)
408
+ .done(function (sHashFragmentPotentiallyExpanded) {
409
+ var oErrorDeferred = jQuery.when();
410
+
411
+ if (sHashFragmentPotentiallyExpanded.indexOf("sap-ushell-enc-test") >= 0) {
412
+ var aMatch = /sap-ushell-enc-test=([^&]*)(&.*)?$/.exec(sHashFragmentPotentiallyExpanded);
413
+ if (aMatch) {
414
+ var sSapUshellEncTestValue = aMatch[1];
415
+
416
+ if (sSapUshellEncTestValue !== "A%20B%2520C") {
417
+ oErrorDeferred = new jQuery.Deferred();
418
+
419
+ Container.getServiceAsync("Message")
420
+ .then(function (MessageService) {
421
+ MessageService.error("This navigation is flagged as erroneous because" +
422
+ " (likely the calling procedure) generated a wrong encoded hash." +
423
+ " Please track down the encoding error and make sure to use the CrossApplicationNavigation service for navigation.",
424
+ "Navigation encoding wrong");
425
+ oErrorDeferred.resolve();
426
+ })
427
+ .catch(oErrorDeferred.reject);
428
+ }
429
+ sHashFragmentPotentiallyExpanded = sHashFragmentPotentiallyExpanded.replace(/sap-ushell-enc-test=([^&]*)&/, "");
430
+ sHashFragmentPotentiallyExpanded = sHashFragmentPotentiallyExpanded.replace(/[&?]sap-ushell-enc-test=([^&]*)$/, "");
431
+ }
432
+ }
433
+ var oPromise = this._invokeResolveHashChain(sHashFragmentPotentiallyExpanded);
434
+
435
+ // if method present on adapter, chain through it (adapter has complete freedom to change success into failure etc.)
436
+ if (typeof oAdapter.processPostResolution === "function") {
437
+ oPromise = oAdapter.processPostResolution(sHashFragmentPotentiallyExpanded, oPromise);
438
+ }
439
+
440
+ jQuery.when(oPromise, oErrorDeferred)
441
+ .done(function (oResult) {
442
+ this._adjustResolutionResultForUi5Components(oResult);
443
+
444
+ if (oResult && oResult.navigationMode !== undefined) {
445
+ oResult.targetNavigationMode = NavigationMode.getExternalNavigationMode(
446
+ oResult.navigationMode
447
+ );
448
+ } else {
449
+ Log.error("Resolution Result doesn't contain mandatory navigationMode!", "sap.ushell.services.NavTargetResolutionInternal");
450
+ }
451
+
452
+ // add a sap-system if not already there
453
+ if (isPlainObject(oResult) && !oResult.hasOwnProperty("sap-system")) {
454
+ var sSapSystem = this._getSapSystem(sHashFragment, oResult);
455
+ if (sSapSystem) {
456
+ oResult["sap-system"] = sSapSystem;
457
+ }
458
+ }
459
+ Measurement.end("sap.ushell.navigation.resolveHashFragment");
460
+
461
+ oDeferred.resolve(oResult);
462
+ }.bind(this))
463
+ .fail(oDeferred.reject);
464
+ }.bind(this))
465
+ .fail(oDeferred.reject);
466
+
467
+ return oDeferred.promise().done(function (oResult) {
468
+ return this._recordNavigation("resolveHashFragment", { sHashFragment: sHashFragment }, oResult);
469
+ }.bind(this));
470
+ };
471
+
472
+ this._invokeResolveHashChain = function (sHashFragment) {
473
+ var oCRs = aResolvers.map(function (a) { return a; });
474
+
475
+ return this._nextResolveHashFragment(oCRs, sHashFragment).done(function (oResolution) {
476
+ oCurrentResolution = oResolution;
477
+ });
478
+ };
479
+
480
+ this.baseResolveHashFragment = fnResolveHashFragment.bind(this);
481
+
482
+ /**
483
+ * Returns the method that allows to return results for the getLinks method along with meta information to handle the method call.
484
+ * @param {object} oArgs argument object
485
+ * @returns {object} an object like:
486
+ * <pre>
487
+ * {
488
+ * resolver: function () { ... }, // a bound resolver that can produce results for getLinks
489
+ * warning: "some error details", // a message that can be used to produce a warning
490
+ * isGetSemanticObjectLinksCall: false // whether the getSemanticObjectLinks (not supporting action will be called)
491
+ * }
492
+ * </pre>
493
+ * @private
494
+ * @since 1.38.0
495
+ */
496
+ this._getGetLinksResolver = function (oArgs) {
497
+ var fnGetLinksBound;
498
+
499
+ // decide which method to call
500
+ if (this._isClientSideTargetResolutionEnabled()) {
501
+ fnGetLinksBound = this._getLinksClientSide.bind(this);
502
+ return {
503
+ resolver: fnGetLinksBound,
504
+ warning: undefined,
505
+ isGetSemanticObjectLinksCall: false
506
+ };
507
+ }
508
+
509
+ // must call the adapter
510
+
511
+ if (Object.prototype.toString.apply(oArgs.paramsOptions) === "[object Array]"
512
+ && oArgs.paramsOptions.length > 0) {
513
+ Log.warning(
514
+ "Parameter options supplied to #getLinks will be ignored because FLP is not configured to use sap.ushell.services.ClientSideTargetResolution for target resolution",
515
+ "provided parameters options: " + JSON.stringify(oArgs.paramsOptions, null, 4),
516
+ "sap.ushell.services.NavTargetResolutionInternal"
517
+ );
518
+ }
519
+
520
+ // try getLinks
521
+ fnGetLinksBound = oAdapter && oAdapter.getLinks && oAdapter.getLinks.bind(oAdapter);
522
+ if (fnGetLinksBound) {
523
+ return {
524
+ resolver: fnGetLinksBound,
525
+ warning: undefined,
526
+ isGetSemanticObjectLinksCall: false
527
+ };
528
+ }
529
+
530
+ // fall back to getSemanticObjectLinks call
531
+ fnGetLinksBound = oAdapter && oAdapter.getSemanticObjectLinks && oAdapter.getSemanticObjectLinks.bind(oAdapter);
532
+
533
+ if (fnGetLinksBound) {
534
+ return {
535
+ resolver: fnGetLinksBound,
536
+ warning: oArgs.hasOwnProperty("action")
537
+ ? "the action argument was given, however, NavTargetResolutionAdapter does not implement getLinks method. Action will be ignored."
538
+ : undefined,
539
+ isGetSemanticObjectLinksCall: true // force
540
+ };
541
+ }
542
+
543
+ return {
544
+ resolver: undefined,
545
+ warning: "Cannot determine resolver for getLinks method",
546
+ isGetSemanticObjectLinksCall: undefined
547
+ };
548
+ };
549
+
550
+ /**
551
+ * Resolves a semantic object/action and business parameters to a list of links, taking into account the form factor of the current device.
552
+ *
553
+ * @param {object} oArgs An object containing nominal arguments for the method, having the following structure:
554
+ * {
555
+ * semanticObject: "Object", // optional (matches all semantic objects)
556
+ * action: "action", // optional (matches all actions)
557
+ * params: { // optional business parameters
558
+ * A: "B",
559
+ * C: ["e", "j"]
560
+ * },
561
+ * paramsOptions: [ { name: "A", required: true } ], // optional
562
+ * ignoreFormFactor: true, // optional, defaults to true
563
+ * ui5Component: UI5Component, // optional, the UI5 component invoking the service
564
+ * treatTechHintAsFilter : true, // optional, defaults to false
565
+ * // if true, only apps that match exactly the supplied technology
566
+ * // (e.g. sap-ui-tech-hint=WDA) will be considered
567
+ * appStateKey: "abc123...", // optional, application state key to add to the generated links,
568
+ * // SAP internal usage only
569
+ * compactIntents: true // optional, whether intents should be returned in compact (=URLShortened) format.
570
+ * // Defaults to false.
571
+ * }
572
+ * <p>
573
+ * Note: positional arguments supported prior to version 1.38.0 are now deprecated.
574
+ * The caller should always specify nominal parameters, using an object.
575
+ * Also, wildcards for semanticObject and action parameters are now expressed via <code>undefined</code>,
576
+ * or by just omitting the parameter in the object.
577
+ * </p>
578
+ * @returns {jQuery.Promise} Resolves with an array of links objects containing (at least) the following properties:
579
+ * <pre>
580
+ * {
581
+ * intent: "#AnObject-Action?A=B&C=e&C=j",
582
+ * text: "Perform action",
583
+ * icon: "sap-icon://Fiori2/F0018", //optional
584
+ * subTitle: "Action", //optional
585
+ * shortTitle: "Perform" //optional
586
+ * }
587
+ * </pre>
588
+ * <b>NOTE:</b> the intents returned are in <b>internal</b> format and cannot be directly put into a link tag.
589
+ * <p>
590
+ * Example: Let the string <code>"C&A != H&M"</code> be a parameter value.
591
+ * Intent will be encoded as<code>#AnObject-action?text=C%26A%20!%3D%20H%26M<code>.
592
+ * Note that the intent is in <b>internal</b> format, before putting it into a link tag, you must invoke:
593
+ * <code>externalHash = oCrossApplicationNavigationService.hrefForExternal({ target : { shellHash : oLink.intent} }, that.oComponent);</code>
594
+ * </p>
595
+ * @private
596
+ * @since 1.38.0
597
+ */
598
+ this.getLinks = function (oArgs) {
599
+ var sSemanticObject = oArgs.semanticObject;
600
+ var mParameters = oArgs.params;
601
+ var bIgnoreFormFactor = oArgs.ignoreFormFactor;
602
+ var oComponent = oArgs.ui5Component;
603
+ var sAppStateKey = oArgs.appStateKey;
604
+ var bCompactIntents = oArgs.compactIntents;
605
+ var oDeferred = new jQuery.Deferred();
606
+
607
+ if (/\?/.test(sSemanticObject)) {
608
+ throw new Error("Parameter must not be part of semantic object");
609
+ }
610
+
611
+ var oParameters = (mParameters === undefined) ? undefined : JSON.parse(JSON.stringify(mParameters));
612
+ if (sAppStateKey) {
613
+ oParameters = oParameters || {};
614
+ oParameters["sap-xapp-state"] = encodeURIComponent(sAppStateKey);
615
+ }
616
+
617
+ // outcome determines whether the process of getting links is delegated to ClientSideTargetResolution or NavTargetResolutionAdapter.
618
+ // additional property, 'tags' does not influence how _getGetLinksResolver behaves
619
+ var oResolverResult = this._getGetLinksResolver(oArgs);
620
+
621
+ // warn that functionality is lost in this case
622
+ if (oResolverResult.warning) {
623
+ Log.warning("A problem occurred while determining the resolver for getLinks", oResolverResult.warning, "sap.ushell.services.NavTargetResolutionInternal");
624
+ }
625
+
626
+ var fnResolverBound = oResolverResult.resolver;
627
+
628
+ if (fnResolverBound) {
629
+ var fnHandleGetLinksSuccess = function (aSemanticObjectLinks) {
630
+ if (bCompactIntents) {
631
+ this._shortenGetSemanticObjectLinksResults(aSemanticObjectLinks, oComponent)
632
+ .done(oDeferred.resolve);
633
+ } else {
634
+ oDeferred.resolve(aSemanticObjectLinks);
635
+ }
636
+ }.bind(this);
637
+
638
+ // this will be true for old legacy platform
639
+ if (oResolverResult.isGetSemanticObjectLinksCall) {
640
+ // 'this' in fnResolverBound will be nav target resolution adapter
641
+
642
+ // The portal still does server side resolution on the ABAP server.
643
+ // In here, long parameters are not sent to the server.
644
+ // So we use the hrefForExternal to obtain a sap-intent-param and actually truncate the original list of parameters...
645
+ var oHrefForExternalArg = {
646
+ target: {
647
+ semanticObject: sSemanticObject,
648
+ action: "dummyAction"
649
+ },
650
+ params: oParameters
651
+ };
652
+
653
+ Container.getServiceAsync("ShellNavigationInternal")
654
+ .then(function (ShellNavigationService) {
655
+ ShellNavigationService.hrefForExternal(oHrefForExternalArg, true, oComponent)
656
+ .then(function (oResVerboseCompacted) {
657
+ // may contain sap-intent-param (but server does nothing with it)
658
+ var oMaybeCompactedParameters = oResVerboseCompacted.params || oParameters;
659
+
660
+ fnResolverBound(sSemanticObject, oMaybeCompactedParameters, bIgnoreFormFactor)
661
+ .then(fnHandleGetLinksSuccess)
662
+ .catch(oDeferred.reject);
663
+ })
664
+ .catch(oDeferred.reject);
665
+ });
666
+ } else {
667
+ // 'this' in fnResolverBound will be client side target resolution
668
+ fnResolverBound(oArgs) // safe to pass oArgs (it's handled at CrossApplicationNavigation level)
669
+ .done(fnHandleGetLinksSuccess)
670
+ .fail(oDeferred.reject);
671
+ }
672
+ } else {
673
+ oDeferred.resolve([]);
674
+ }
675
+
676
+ return oDeferred.promise().done(function (aLinks) {
677
+ return this._recordNavigation("getLinks", { oArgs: oArgs }, aLinks);
678
+ }.bind(this));
679
+ };
680
+
681
+ /**
682
+ * Returns a list of unique semantic objects assigned to the current user.
683
+ * Tries to use client side target resolution if it is enabled, falls back to the NavTargetResolutionInternal adapter implementation otherwise.
684
+ *
685
+ * @returns {jQuery.Promise} Resolves with an array of strings
686
+ * representing the User's semantic objects or rejects with an error message.
687
+ * <p>NOTE: semantic objects are returned in lexicographical order in the result array.</p>
688
+ * @private
689
+ * @since 1.38.0
690
+ */
691
+ this.getDistinctSemanticObjects = function () {
692
+ var oDeferred = new jQuery.Deferred();
693
+
694
+ if (this._isClientSideTargetResolutionEnabled()) {
695
+ // Only require service if ClientSideTargetResolution is enabled
696
+
697
+ Container.getServiceAsync("ClientSideTargetResolution")
698
+ .then(function (ClientSideTargetResolutionService) {
699
+ ClientSideTargetResolutionService.getDistinctSemanticObjects()
700
+ .done(oDeferred.resolve)
701
+ .fail(oDeferred.reject);
702
+ })
703
+ .catch(oDeferred.reject);
704
+
705
+ return oDeferred.promise().done(function (aResults) {
706
+ return this._recordNavigation("getDistinctSemanticObjects", {}, aResults);
707
+ }.bind(this));
708
+ }
709
+
710
+ // Use the adapter if it implements this functionality
711
+ if (oAdapter && oAdapter.getDistinctSemanticObjects) {
712
+ return oAdapter.getDistinctSemanticObjects();
713
+ }
714
+
715
+ Log.error(
716
+ "Cannot execute getDistinctSemanticObjects method",
717
+ "ClientSideTargetResolution must be enabled or NavTargetResolutionAdapter must implement getDistinctSemanticObjects method",
718
+ "sap.ushell.services.NavTargetResolutionInternal"
719
+ );
720
+
721
+ return oDeferred.reject("Cannot execute getDistinctSemanticObjects").promise();
722
+ };
723
+
724
+ this._getLinksClientSide = function (oArgs) {
725
+ var oDeferred = new jQuery.Deferred();
726
+ var oCallWithExpandedParamsDeferred = new jQuery.Deferred(); // always resolved
727
+
728
+ /*
729
+ * Expand url parameters in case these come compacted.
730
+ * This is necessary because ClientSideTargetResolution service does not deal with expansion/compaction of parameters.
731
+ *
732
+ * Note that the service returns non-compacted results!
733
+ * This is ok as the client is expected to invoke hrefForExternal again to generate a URL which is effectively compacted
734
+ */
735
+ if ((oArgs.params || {}).hasOwnProperty("sap-intent-param")) {
736
+ var sCompactHash = "#" + oArgs.semanticObject + "-dummyAction?" + UrlParsing.paramsToString(oArgs.params);
737
+ this.expandCompactHash(sCompactHash)
738
+ .done(function (sExpandedHash) {
739
+ var oParsedHash = UrlParsing.parseShellHash(sExpandedHash);
740
+
741
+ oCallWithExpandedParamsDeferred.resolve(oParsedHash.params); // expanded params
742
+ })
743
+ .fail(oDeferred.reject);
744
+ } else {
745
+ oCallWithExpandedParamsDeferred.resolve(oArgs.params);
746
+ }
747
+
748
+ oCallWithExpandedParamsDeferred.done(function () {
749
+ Container.getServiceAsync("ClientSideTargetResolution")
750
+ .then(function (ClientSideTargetResolutionService) {
751
+ ClientSideTargetResolutionService.getLinks(oArgs)
752
+ .done(oDeferred.resolve)
753
+ .fail(oDeferred.reject);
754
+ })
755
+ .catch(oDeferred.reject);
756
+ });
757
+
758
+ return oDeferred.promise();
759
+ };
760
+
761
+ /**
762
+ * Shortens all URLs found in the result of getSemanticObjectLinks.
763
+ *
764
+ * @param {object[]} aGetSemanticObjectLinksResults the result of {@link #getSemanticObjectLinks}
765
+ * @param {object} oComponent a SAPUI5 component. The same passed to getSemanticObjectLinks}.
766
+ * @returns {jQuery.Promise} Always resolves to an array with the same
767
+ * structure as the array returned from getSemanticObjectLinks, but with shortened intents.
768
+ * NOTE: if it's not possible to shorten an intent in the input array, a warning is logged on the console and the entire intent is kept.
769
+ * @private
770
+ * @since 1.32.0
771
+ */
772
+ this._shortenGetSemanticObjectLinksResults = function (aGetSemanticObjectLinksResults, oComponent) {
773
+ var aSemanticObjectLinksShortened = [];
774
+ var i = 0;
775
+ var iPromisesToResolve = aGetSemanticObjectLinksResults.length;
776
+ var oDeferred = new jQuery.Deferred();
777
+
778
+ Container.getServiceAsync("ShellNavigationInternal")
779
+ .then(function (ShellNavigationService) {
780
+ aGetSemanticObjectLinksResults.forEach(function (oIntent) {
781
+ var oUrlParts = UrlParsing.parseShellHash(oIntent.intent);
782
+ var oCompactParamsPromise = ShellNavigationService.compactParams(oUrlParts.params, undefined, oComponent);
783
+
784
+ aSemanticObjectLinksShortened.push(oCompactParamsPromise);
785
+
786
+ aSemanticObjectLinksShortened[i]
787
+ .done(function (index, oCompactParams) {
788
+ aSemanticObjectLinksShortened[index] = {
789
+ text: oIntent.text,
790
+ intent: "#" + oUrlParts.semanticObject + "-" + oUrlParts.action + "?" +
791
+ UrlParsing.paramsToString(oCompactParams)
792
+ };
793
+ }.bind(null, i))
794
+ .fail(function (iIdx, sMsg) {
795
+ Log.warning(
796
+ "Cannot shorten GetSemanticObjectLinks result, using expanded form",
797
+ "Failure message: " + sMsg + "; intent had title ''" + oIntent.title + "'' and link ''" + oIntent.intent + "'",
798
+ "sap.ushell.services.NavTargetResolutionInternal"
799
+ );
800
+ aSemanticObjectLinksShortened[iIdx] = {
801
+ text: oIntent.text,
802
+ intent: oIntent.intent
803
+ };
804
+ }.bind(null, i))
805
+ .always(function () {
806
+ iPromisesToResolve--;
807
+
808
+ if (iPromisesToResolve === 0) {
809
+ oDeferred.resolve(aSemanticObjectLinksShortened);
810
+ }
811
+ });
812
+ i++;
813
+ });
814
+ })
815
+ .catch(oDeferred.reject);
816
+
817
+ return oDeferred.promise();
818
+ };
819
+
820
+ /**
821
+ * Tells whether the given intent(s) are supported, taking into account the form factor of the current device.
822
+ * "Supported" means that navigation to the intent is possible.
823
+ *
824
+ * @param {string[]} aIntents the intents (such as <code>"#AnObject-action?A=B&C=e&C=j"</code>) to be checked.
825
+ * The intents must be in internal format and expanded.
826
+ * @returns {jQuery.Promise} Resolves with a map containing the intents from <code>aIntents</code> as keys.
827
+ * The map values are objects with a property <code>supported</code> of type <code>boolean</code>.<br/>
828
+ * Example:
829
+ * <pre>
830
+ * {
831
+ * "#AnObject-action?A=B&C=e&C=j": { supported: false },
832
+ * "#AnotherObject-action2": { supported: true }
833
+ * }
834
+ * </pre>
835
+ * @deprecated since 1.31. Please use {@link #isNavigationSupported} instead. Note that this has a slightly different response!
836
+ *
837
+ */
838
+ this.isIntentSupported = function (aIntents) {
839
+ var mResult = {};
840
+ var oDeferred = new jQuery.Deferred();
841
+
842
+ if (this._isClientSideTargetResolutionEnabled()) {
843
+ // NOTE: request ClientSideTargetResolution service only if enabled!
844
+ Container.getServiceAsync("ClientSideTargetResolution")
845
+ .then(function (ClientSideTargetResolutionService) {
846
+ ClientSideTargetResolutionService.isIntentSupported(aIntents)
847
+ .done(oDeferred.resolve)
848
+ .fail(oDeferred.reject);
849
+ })
850
+ .catch(oDeferred.reject);
851
+
852
+ return oDeferred.promise();
853
+ }
854
+
855
+ // Adapter based implementation
856
+ if (oAdapter.isIntentSupported) {
857
+ return oAdapter.isIntentSupported(aIntents);
858
+ }
859
+
860
+ // Fallback for no adapter available
861
+ aIntents.forEach(function (sIntent) {
862
+ mResult[sIntent] = { supported: undefined };
863
+ });
864
+ return oDeferred.resolve(mResult).promise();
865
+ };
866
+
867
+ /**
868
+ * Tells whether the given intent(s) are supported, taking into account the form factor of the current device.
869
+ * "Supported" means that navigation to the intent is possible.
870
+ *
871
+ * @param {string[]} aIntents the intents (such as <code>"#AnObject-action?A=B&C=e&C=j"</code>) to be checked.
872
+ * The intents must be in internal format and expanded.
873
+ * @returns {jQuery.Promise} Resolves with a map containing the intents from <code>aIntents</code> as keys.
874
+ * The map values are objects with a property <code>supported</code> of type <code>boolean</code>.<br/>
875
+ * Example:
876
+ * <pre>
877
+ * {
878
+ * "#AnObject-action?A=B&C=e&C=j": { supported: false },
879
+ * "#AnotherObject-action2": { supported: true }
880
+ * }
881
+ * </pre>
882
+ * @private
883
+ *
884
+ */
885
+ this._isIntentSupported = function (aIntents) {
886
+ var mResult = {};
887
+ var oDeferred = new jQuery.Deferred();
888
+
889
+ if (this._isClientSideTargetResolutionEnabled()) {
890
+ // NOTE: request ClientSideTargetResolution service only if enabled!
891
+ Container.getServiceAsync("ClientSideTargetResolution")
892
+ .then(function (ClientSideTargetResolutionService) {
893
+ ClientSideTargetResolutionService.isIntentSupported(aIntents)
894
+ .done(oDeferred.resolve)
895
+ .fail(oDeferred.reject);
896
+ })
897
+ .catch(oDeferred.reject);
898
+
899
+ return oDeferred.promise();
900
+ }
901
+
902
+ // Adapter based implementation
903
+ if (oAdapter.isIntentSupported) {
904
+ return oAdapter.isIntentSupported(aIntents);
905
+ }
906
+
907
+ // Fallback for no adapter available
908
+ aIntents.forEach(function (sIntent) {
909
+ mResult[sIntent] = { supported: undefined };
910
+ });
911
+ return oDeferred.resolve(mResult).promise();
912
+ };
913
+
914
+ /**
915
+ * Tells whether the given navigation intent(s) are supported for the given parameters
916
+ * Supported" means that a valid navigation target is configured for the user for the given device form factor.
917
+ *
918
+ * This is effectively a test function for {@link toExternal}/ {@link hrefForExternal}.
919
+ * It function accepts the same input as {@link toExternal}/ {@link hrefForExternal}.
920
+ *
921
+ * @param {object[]} aIntents the intents (such as <code>["#AnObject-action?A=B&c=e"]</code>) to be checked
922
+ * with object being instances the oArgs object of toExternal, hrefForExternal etc.
923
+ * e.g.
924
+ * <pre>
925
+ * {
926
+ * target : { semanticObject : "AnObject", action: "action" },
927
+ * params : { A : "B" }
928
+ * }
929
+ * </pre>
930
+ * or e.g.
931
+ * <pre>
932
+ * {
933
+ * target : { semanticObject : "AnObject", action: "action" },
934
+ * params : { A : "B", c : "e" }
935
+ * }
936
+ * </pre>
937
+ * or
938
+ * <code>{ target : { shellHash : "AnObject-action?A=B&c=e" } }</code>
939
+ * @returns {jQuery.Promise} Resolves an array of objects representing whether the intent is supported or not objects with a property <code>supported</code> of type <code>boolean</code>.<br/>
940
+ * Example:
941
+ *
942
+ * aIntents:
943
+ * an array of parameterized (parsed) Intent objects, in the corresponding structure to arguments to
944
+ * {@link sap.ushell.services.CrossApplicationNavigation.toExternal}, {@link sap.ushell.services.CrossApplicationNavigation.hrefForExternal}
945
+ * <pre>
946
+ * [
947
+ * {
948
+ * target : {
949
+ * semanticObject : "AnObject",
950
+ * action: "action"
951
+ * },
952
+ * params : { P1 : "B", P2 : [ "V2a", "V2b"] }
953
+ * },
954
+ * {
955
+ * target : {
956
+ * semanticObject : "SalesOrder",
957
+ * action: "display"
958
+ * },
959
+ * params : { P3 : "B", SalesOrderIds : [ "4711", "472"] }
960
+ * }
961
+ * ]
962
+ * </pre>
963
+ *
964
+ * The following formats are also supported as input to ease migration of existing code:
965
+ * <code>[ "#AnObject-action?P1=B&SalesOrderIds=4711&SalesOrderIds=472" ]</code>
966
+ *
967
+ * response:
968
+ * <pre>
969
+ * [
970
+ * { supported: false },
971
+ * { supported: true }
972
+ * ]
973
+ * </pre>
974
+ *
975
+ * Example usage:
976
+ * <pre>
977
+ * this.oCrossAppNav.isNavigationSupported([ ])
978
+ * .done(function(aResponses) {
979
+ * if (oResponse[0].supported===true){
980
+ * // enable link
981
+ * }
982
+ * else {
983
+ * // disable link
984
+ * }
985
+ * })
986
+ * .fail(function() {
987
+ * // disable link
988
+ * // request failed or other fatal error
989
+ * });
990
+ * </pre>
991
+ *
992
+ * @since 1.32
993
+ * @private
994
+ */
995
+ this.isNavigationSupported = function (aIntents) {
996
+ var oDeferred = new jQuery.Deferred();
997
+ var aIntentsAsString = [];
998
+ aIntentsAsString = aIntents.map(function (oArg) {
999
+ if (typeof oArg === "string") {
1000
+ return oArg;
1001
+ }
1002
+ return "#" + UrlParsing.constructShellHash(oArg);
1003
+ });
1004
+ this._isIntentSupported(aIntentsAsString).done(function (oResult) {
1005
+ var aResults = aIntentsAsString.map(function (sIntent) { return oResult[sIntent] || { supported: false }; });
1006
+ oDeferred.resolve(aResults);
1007
+ }).fail(oDeferred.reject.bind(oDeferred));
1008
+
1009
+ return oDeferred.promise().done(function (aResults) {
1010
+ return this._recordNavigation("isNavigationSupported", { aIntents: aIntents }, aResults);
1011
+ }.bind(this));
1012
+ };
1013
+
1014
+ /**
1015
+ * if the usageRecorder config is enabled, records a navigation for the
1016
+ * given function name with given input and output.
1017
+ *
1018
+ * @param {string} sFunctionName The name of the function called.
1019
+ * @param {object} oParameters The input parameters of the function.
1020
+ * @param {object|array} vResult The output result of the function.
1021
+ * @returns {object|array} The output result for further processing.
1022
+ * @private
1023
+ */
1024
+ this._recordNavigation = function (sFunctionName, oParameters, vResult) {
1025
+ var oUsageRecorderConfig = oServiceConfig && oServiceConfig.usageRecorder || {};
1026
+ if (oUsageRecorderConfig.enabled) {
1027
+ var sUsageRecorderEndpoint = oUsageRecorderConfig.serviceUrl || "/navigation/api/v2/record";
1028
+ oHttpClient.post(sUsageRecorderEndpoint, {
1029
+ headers: {
1030
+ "content-type": "application/json; charset=utf-8"
1031
+ },
1032
+ data: {
1033
+ function: sFunctionName,
1034
+ parameters: JSON.stringify(oParameters),
1035
+ result: JSON.stringify(vResult)
1036
+ }
1037
+ });
1038
+ }
1039
+
1040
+ return vResult;
1041
+ };
1042
+
1043
+ /**
1044
+ * Register a custom resolver for semantic objects
1045
+ *
1046
+ * The resolver must be JavaScript object with a string property name, and two functions
1047
+ * resolveHashFragment(sHashFragment,nextResolver) returning a promise and isApplicable(sHashFragment) returning a boolean
1048
+ *
1049
+ * @param {object} oResolver the custom resolver
1050
+ * @returns {boolean} true if resolver was registered, false otherwise
1051
+ *
1052
+ * @private
1053
+ * @ui5-restricted cp.portal
1054
+ */
1055
+ this.registerCustomResolver = function (oResolver) {
1056
+ // verify oResolver
1057
+ if (typeof oResolver.name !== "string") {
1058
+ Log.error("NavTargetResolutionInternal: Custom Resolver must have name {string} member");
1059
+ return false;
1060
+ }
1061
+ if (typeof oResolver.isApplicable !== "function") {
1062
+ Log.error("NavTargetResolutionInternal: Custom Resolver must have isApplicable member");
1063
+ return false;
1064
+ }
1065
+ if (typeof oResolver.resolveHashFragment !== "function") {
1066
+ Log.error("NavTargetResolutionInternal: Custom Resolver must have \"resolveHashFragment\" member");
1067
+ return false;
1068
+ }
1069
+ aResolvers.push(oResolver);
1070
+ return true;
1071
+ };
1072
+
1073
+ // specific custom resolvers enabled by a configuration
1074
+ // #1 localResolveNavigationResolver : given an array in config.resolveLocal, resolve
1075
+ // given SO-action strings to a locally supplied configuration member of a resolveLocal setting are locally resolved
1076
+ if (oServiceConfig && Array.isArray(oServiceConfig.resolveLocal)) {
1077
+ // register a custom resolver which redirects all !allowed to defaultOthersTo
1078
+ aLocalResolvedNavTargets = oServiceConfig.resolveLocal.map(function (oArg) {
1079
+ return oArg.linkId;
1080
+ });
1081
+ this.registerCustomResolver({
1082
+ name: "localResolveNavigationResolver",
1083
+ cleanHash: function (sHashFragment) {
1084
+ if (sHashFragment === "") {
1085
+ return "#";
1086
+ }
1087
+ var res = UrlParsing.parseShellHash(sHashFragment.substring(1));
1088
+ if (!res) {
1089
+ return "#";
1090
+ }
1091
+ sHashFragment = "#" + res.semanticObject + "-" + res.action;
1092
+ return sHashFragment;
1093
+ },
1094
+ _getIndex: function (sOrigHashFragment) {
1095
+ var sHashFragment = this.cleanHash(sOrigHashFragment);
1096
+ return aLocalResolvedNavTargets.indexOf(sHashFragment.substring(1));
1097
+ },
1098
+ // applicability test
1099
+ isApplicable: function (sOrigHashFragment) {
1100
+ return this._getIndex(sOrigHashFragment) >= 0;
1101
+ },
1102
+ // replace hash, then resolve to app
1103
+ resolveHashFragment: function (sHashFragment) {
1104
+ var idx = this._getIndex(sHashFragment);
1105
+ var oDeferred = new jQuery.Deferred();
1106
+ var oResolvedResult = JSON.parse(JSON.stringify(oServiceConfig.resolveLocal[idx].resolveTo));
1107
+
1108
+ // augment url with application parameters from sHashFragment
1109
+ var obj = UrlParsing.parseShellHash(sHashFragment);
1110
+ if (obj && obj.params) {
1111
+ var newsh = UrlParsing.paramsToString(obj.params);
1112
+ if (newsh) {
1113
+ var hasQM = oResolvedResult.url.indexOf("?") >= 0;
1114
+ oResolvedResult.url = oResolvedResult.url + (hasQM ? "&" : "?") + newsh;
1115
+ }
1116
+ }
1117
+
1118
+ oDeferred.resolve(oResolvedResult);
1119
+ return oDeferred.promise();
1120
+ }
1121
+ });
1122
+ }
1123
+
1124
+ /*
1125
+ * Register one fixed sample resolver for local resolution (portal use case)
1126
+ * #Test-local1 => local storage key "sap.ushell#Test-local1"
1127
+ * #Test-local2 => local storage key "sap.ushell#Test-local1"
1128
+ * #Test-url => sap-ushell-test-local1 , sap-ushell-test-url1-additionalInformation
1129
+ * #Test-config
1130
+ */
1131
+ this.registerCustomResolver({
1132
+ name: "LocalResolver",
1133
+ aElement: undefined,
1134
+ cleanHash: function (sHashFragment) {
1135
+ if (sHashFragment === "") {
1136
+ return undefined;
1137
+ }
1138
+ var res = UrlParsing.parseShellHash(sHashFragment.substring(1));
1139
+ if (!res) {
1140
+ return undefined;
1141
+ }
1142
+ sHashFragment = "#" + res.semanticObject + "-" + res.action;
1143
+ return sHashFragment;
1144
+ },
1145
+ isApplicable: function (sHashFragment) {
1146
+ sHashFragment = this.cleanHash(sHashFragment);
1147
+ if (!sHashFragment) {
1148
+ return false;
1149
+ }
1150
+ return sHashFragment === "#Test-url" ||
1151
+ sHashFragment === "#Test-local1" ||
1152
+ sHashFragment === "#Test-local2" ||
1153
+ sHashFragment === "#Test-config" ||
1154
+ sHashFragment === "#Test-clear";
1155
+ },
1156
+ parseUrl: function (url) {
1157
+ if (!this.aElement) {
1158
+ this.aElement = window.document.createElement("a");
1159
+ }
1160
+ this.aElement.href = url;
1161
+ return this.aElement;
1162
+ },
1163
+ resolveHashFragment: function (sHashFragment) {
1164
+ var oDeferred = new jQuery.Deferred();
1165
+ var res;
1166
+ var oLocal;
1167
+ var that = this;
1168
+ sHashFragment = this.cleanHash(sHashFragment);
1169
+ if (!sHashFragment) {
1170
+ return false;
1171
+ }
1172
+ var hardCoded = {
1173
+ "#Test-config": {
1174
+ applicationType: "URL",
1175
+ url: "/sap/bc/ui5_ui5/ui2/ushell/test-resources/sap/ushell/demoapps/FioriSandboxConfigApp",
1176
+ additionalInformation: "SAPUI5.Component=sap.ushell.demoapps.FioriSandboxConfigApp",
1177
+ navigationMode: "embedded"
1178
+ },
1179
+ none: {
1180
+ applicationType: "URL",
1181
+ url: "",
1182
+ additionalInformation: ""
1183
+ }
1184
+ };
1185
+ function getFromLocalStorage (sKey) {
1186
+ if (localStorage) {
1187
+ return localStorage[sKey];
1188
+ }
1189
+ return undefined;
1190
+ }
1191
+ // return undefined URL if not in same domain
1192
+ function localURL (sUrl) {
1193
+ if (utils.calculateOrigin(that.parseUrl(sUrl)) !== utils.calculateOrigin(window.location)) {
1194
+ return undefined;
1195
+ }
1196
+ return sUrl;
1197
+ }
1198
+ function getURLParameter (sKey) {
1199
+ return new URLSearchParams(window.location.search).get(sKey);
1200
+ }
1201
+ function addToLocalStorage (sKey, sValue) {
1202
+ if (localStorage) {
1203
+ localStorage[sKey] = sValue;
1204
+ }
1205
+ }
1206
+ if (hardCoded[sHashFragment]) {
1207
+ res = hardCoded[sHashFragment];
1208
+ } else if (sHashFragment === "#Test-clear") {
1209
+ addToLocalStorage("sap.ushell.#Test-local1", undefined);
1210
+ addToLocalStorage("sap.ushell.#Test-local2", undefined);
1211
+ Log.info("NavTargetResolutionInternal: Local storage keys for #Test have been cleared");
1212
+ res = hardCoded["#Test-config"];
1213
+ } else if (sHashFragment === "#Test-local1" || sHashFragment === "#Test-local2" || sHashFragment === "#Test-url") {
1214
+ res = getFromLocalStorage("sap.ushell." + sHashFragment);
1215
+ if (!res || res === "undefined") {
1216
+ oLocal = { applicationType: "URL", navigationMode: "embedded" };
1217
+ } else {
1218
+ oLocal = JSON.parse(res);
1219
+ }
1220
+ // Configuring an app via url parameters is restricted to localhost for security reasons,
1221
+ // unless explicitly enabled by config
1222
+ if ((window.location.hostname === "localhost") ||
1223
+ (oServiceConfig && oServiceConfig.allowTestUrlComponentConfig)) {
1224
+ var sPrefix = "sap-ushell-test-" + sHashFragment.substring(6);
1225
+ var additionalInformation = getURLParameter(sPrefix + "-additionalInformation");
1226
+ if (additionalInformation) {
1227
+ oLocal.additionalInformation = additionalInformation;
1228
+ }
1229
+ var url = getURLParameter(sPrefix + "-url");
1230
+ if (url) {
1231
+ oLocal.url = localURL(url);
1232
+ }
1233
+ }
1234
+ if (!oLocal.url) {
1235
+ // eslint-disable-next-line max-len
1236
+ Log.info("NavTargetResolutionInternal: No configured app for " + sHashFragment + " found ( local storage or url params sap-ushell-test-local1-url sap-ushell-test-local1-additionalInfo not supplied? ");
1237
+ Log.info("NavTargetResolutionInternal: Defaulting to config app ...\n");
1238
+ oDeferred.reject("URL is not resolvable");
1239
+ return oDeferred.promise();
1240
+ }
1241
+ oLocal.url = localURL(oLocal.url);
1242
+ res = oLocal;
1243
+ }
1244
+ if (res.url === undefined) {
1245
+ oDeferred.reject("URL is not resolvable");
1246
+ return oDeferred.promise();
1247
+ }
1248
+ // eslint-disable-next-line max-len
1249
+ Log.info("NavTargetResolutionInternal: As URL: http://localhost:8080/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-ushell-test-local1-url=" + encodeURIComponent((res && res.url) || "") + "&sap-ushell-test-local1-additionalInformation=" + encodeURIComponent((res && res.additionalInfo) || "") + "#Test-local1");
1250
+ Log.info("NavTargetResolutionInternal: Resolving " + sHashFragment + " to " + JSON.stringify(res));
1251
+ oDeferred.resolve(res);
1252
+ return oDeferred.promise();
1253
+ }
1254
+ });
1255
+
1256
+ /**
1257
+ * Returns the last successful resolution of a hash fragment or <code>undefined</code> if no resolution has been performed yet.
1258
+ *
1259
+ * @returns {object} the last successful resolution
1260
+ * @private
1261
+ * @see #resolveHashFragment
1262
+ */
1263
+ this.getCurrentResolution = function () {
1264
+ return oCurrentResolution;
1265
+ };
1266
+ }
1267
+
1268
+ // Note: we set it to true to allow platforms that did not yet switch to ClientSideTargetResolution to keep using the adapter.
1269
+ NavTargetResolutionInternal.hasNoAdapter = false;
1270
+
1271
+ return NavTargetResolutionInternal;
1272
+ });