@sapui5/sap.ushell 1.117.2 → 1.119.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.
- package/package.json +6 -5
- package/src/main/js/sap/ushell/.library +1 -1
- package/src/main/js/sap/ushell/ApplicationType.js +5 -7
- package/src/main/js/sap/ushell/CanvasShapesManager.js +13 -7
- package/src/main/js/sap/ushell/Config.js +1 -1
- package/src/main/js/sap/ushell/Container.js +254 -190
- package/src/main/js/sap/ushell/EventHub.js +1 -1
- package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
- package/src/main/js/sap/ushell/Fiori20AdapterTest.js +2 -2
- package/src/main/js/sap/ushell/Layout.js +3 -3
- package/src/main/js/sap/ushell/NWBCInterface.js +3 -3
- package/src/main/js/sap/ushell/SessionHandler.js +4 -4
- package/src/main/js/sap/ushell/TechnicalParameters.js +3 -3
- package/src/main/js/sap/ushell/UIActions.js +44 -44
- package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
- package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +1 -1
- package/src/main/js/sap/ushell/Ui5ServiceFactory.js +4 -4
- package/src/main/js/sap/ushell/User.js +11 -1
- package/src/main/js/sap/ushell/UserActivityLog.js +8 -8
- package/src/main/js/sap/ushell/_ApplicationType/guiResolution.js +5 -5
- package/src/main/js/sap/ushell/_ApplicationType/systemAlias.js +1 -1
- package/src/main/js/sap/ushell/_ApplicationType/urlTemplateResolution.js +75 -62
- package/src/main/js/sap/ushell/_ApplicationType/wdaResolution.js +5 -5
- package/src/main/js/sap/ushell/_Config/utils.js +5 -5
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DefinitionParameterSetBuilder.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DependencyGraph.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Functions.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Resolvers.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/TemplateParameterParser.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/utils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ClientSideTargetResolutionAdapter.js +15 -9
- package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +4 -5
- package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -2
- package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +12 -13
- package/src/main/js/sap/ushell/adapters/cdm/MenuAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +4 -3
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/modifyHome.js +2 -2
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/uri.transform.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_Personalization/internals.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/util/AppForInbound.js +5 -2
- package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +4 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +3 -4
- package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +10 -11
- package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +11 -9
- package/src/main/js/sap/ushell/adapters/cdm/v3/utilsCdm.js +3 -3
- package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +0 -1
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +3 -4
- package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +3 -2
- package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +3 -3
- package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +2 -3
- package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +3 -3
- package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -3
- package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +2 -3
- package/src/main/js/sap/ushell/adapters/local/MenuAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +3 -2
- package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +2 -2
- package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -2
- package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +1 -2
- package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +22 -28
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeContext.js +3 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/SessionHandlerAgent.js +10 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/Renderer.js +5 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/RendererExtensions.js +31 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +4 -11
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/SchedulingAgent.js +8 -4
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/EventProcessor.js +21 -2
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/FLPLoader.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/FLPScheduler.js +23 -7
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/StepConfiguration.json +4 -3
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +3 -3
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5.js +3 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.create.configcontract.core.js +1 -0
- package/src/main/js/sap/ushell/bootstrap/common/common.load.core-min.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/common/common.load.launchpad.js +7 -3
- package/src/main/js/sap/ushell/bootstrap/common/common.load.script.js +4 -4
- package/src/main/js/sap/ushell/bootstrap/common/common.util.js +7 -7
- package/src/main/js/sap/ushell/bootstrap/sandbox2/sandboxConfig.json +214 -0
- package/src/main/js/sap/ushell/bootstrap/sandbox2/sandboxSite.json +511 -0
- package/src/main/js/sap/ushell/bootstrap/sandbox2.js +398 -0
- package/src/main/js/sap/ushell/components/CatalogsManager.js +26 -25
- package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +20 -15
- package/src/main/js/sap/ushell/components/DestroyHelper.js +2 -2
- package/src/main/js/sap/ushell/components/HeaderManager.js +6 -6
- package/src/main/js/sap/ushell/components/HomepageManager.js +6 -6
- package/src/main/js/sap/ushell/components/_HeaderManager/ControlManager.js +1 -1
- package/src/main/js/sap/ushell/components/_HomepageManager/PagingManager.js +5 -5
- package/src/main/js/sap/ushell/components/appfinder/AppFinder.controller.js +19 -15
- package/src/main/js/sap/ushell/components/appfinder/AppFinderView.js +12 -12
- package/src/main/js/sap/ushell/components/appfinder/Catalog.controller.js +18 -18
- package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +17 -18
- package/src/main/js/sap/ushell/components/appfinder/EasyAccess.controller.js +2 -2
- package/src/main/js/sap/ushell/components/appfinder/HierarchyApps.controller.js +6 -6
- package/src/main/js/sap/ushell/components/appfinder/HierarchyAppsView.js +1 -1
- package/src/main/js/sap/ushell/components/appfinder/VisualizationOrganizerHelper.js +4 -4
- package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +16 -16
- package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +8 -2
- package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +9 -18
- package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +9 -5
- package/src/main/js/sap/ushell/components/applicationIntegration/application/WebGUIStatefulHandler.js +5 -5
- package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +21 -26
- package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +2 -4
- package/src/main/js/sap/ushell/components/cards/Configuration.controller.js +2 -2
- package/src/main/js/sap/ushell/components/cepsearchresult/app/Main.controller.js +6 -2
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/Category.js +44 -6
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/categories/Application.js +22 -9
- package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +25 -23
- package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +3 -3
- package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/manifest.json +4 -2
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearch.view.xml +37 -17
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchBox.fragment.xml +111 -35
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchPaginated.view.xml +37 -18
- package/src/main/js/sap/ushell/components/contentFinder/view/ContentFinderDialog.view.xml +24 -15
- package/src/main/js/sap/ushell/components/contentFinder/view/WidgetGallery.view.xml +67 -39
- package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
- package/src/main/js/sap/ushell/components/factsheet/controls/PictureTile.js +1 -2
- package/src/main/js/sap/ushell/components/factsheet/controls/PictureViewer.js +5 -6
- package/src/main/js/sap/ushell/components/factsheet/controls/PictureViewerItem.js +1 -2
- package/src/main/js/sap/ushell/components/factsheet/factory/ThingInspector.js +3 -3
- package/src/main/js/sap/ushell/components/factsheet/tools/ODataUrlTemplating.js +1 -1
- package/src/main/js/sap/ushell/components/homeApp/error/HomeAppError.controller.js +0 -1
- package/src/main/js/sap/ushell/components/homeApp/error/HomeAppError.view.xml +7 -6
- package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.controller.js +2 -7
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +13 -13
- package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/pages/ActionMode.js +10 -10
- package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
- package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
- package/src/main/js/sap/ushell/components/pages/StateManager.js +2 -2
- package/src/main/js/sap/ushell/components/pages/controller/ImportDialog.controller.js +12 -12
- package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +94 -96
- package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/pages/view/PageRuntime.view.xml +31 -23
- package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +1 -1
- package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/MenuBar/controller/MenuBar.controller.js +7 -6
- package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +3 -3
- package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Search/ESearch.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Search/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +2 -2
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchCEP.controller.js +74 -16
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchFieldFragment.fragment.xml +2 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -2
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -2
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -2
- package/src/main/js/sap/ushell/components/shell/Settings/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/ErrorMessageHelper.js +8 -9
- package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.controller.js +3 -3
- package/src/main/js/sap/ushell/components/shell/Settings/appearance/Appearance.controller.js +43 -40
- package/src/main/js/sap/ushell/components/shell/Settings/notifications/NotificationsSetting.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.controller.js +2 -2
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/UserDefaultsForm.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/controller/UserDefaultsSetting.controller.js +8 -4
- package/src/main/js/sap/ushell/components/shell/Settings/userLanguageRegion/LanguageRegionSelector.controller.js +65 -17
- package/src/main/js/sap/ushell/components/shell/Settings/userLanguageRegion/LanguageRegionSelector.view.xml +18 -1
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/applauncher/Configuration.view.xml +2 -2
- package/src/main/js/sap/ushell/components/tiles/applauncher/StaticTile.view.js +0 -2
- package/src/main/js/sap/ushell/components/tiles/applauncher/StaticTileTmp.view.js +0 -2
- package/src/main/js/sap/ushell/components/tiles/applauncherdynamic/Configuration.view.xml +2 -2
- package/src/main/js/sap/ushell/components/tiles/applauncherdynamic/DynamicTileTmp.view.js +0 -2
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncher/StaticTile.view.js +0 -2
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncherdynamic/DynamicTile.controller.js +1 -1
- package/src/main/js/sap/ushell/components/tiles/cdm/applauncherdynamic/DynamicTile.view.js +0 -2
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/oData4Analytics.js +41 -48
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +3 -3
- package/src/main/js/sap/ushell/components/tiles/utils.js +4 -3
- package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +5 -18
- package/src/main/js/sap/ushell/components/visualizationOrganizer/VisualizationOrganizerPopover.fragment.xml +3 -3
- package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +332 -153
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.layout.js +182 -90
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +2 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +9 -11
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +48 -48
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +12 -12
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +8 -8
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnRenderer.js +7 -9
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +44 -44
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRenderer.js +7 -4
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +60 -10
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRowRenderer.js +12 -8
- package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +8 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources.properties +10 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ar.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_bg.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ca.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cs.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cy.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_da.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_de.properties +11 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_el.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en.properties +6 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_GB.properties +6 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_sappsd.properties +6 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_saprigi.properties +6 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_saptrc.properties +13 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_es.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_es_MX.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_et.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fi.properties +11 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fr.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fr_CA.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hi.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hr.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hu.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_id.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_it.properties +11 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_iw.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ja.properties +11 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_kk.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ko.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_lt.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_lv.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ms.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_nl.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_no.properties +11 -7
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pl.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pt.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pt_PT.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ro.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ru.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sh.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sk.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sl.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sv.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_th.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_tr.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_uk.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_vi.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_zh_CN.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_zh_TW.properties +10 -6
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +50 -34
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageCellDeleteDialog.fragment.xml +25 -0
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageRowDeleteDialog.fragment.xml +13 -5
- package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +7 -3
- package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +5 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/services/NavigationResolver.js +1 -2
- package/src/main/js/sap/ushell/components/workPageRuntime/services/WorkPage.js +1 -2
- package/src/main/js/sap/ushell/components/workPageRuntime/view/WorkPageRuntime.view.xml +5 -4
- package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
- package/src/main/js/sap/ushell/library.js +4 -2
- package/src/main/js/sap/ushell/navigationMode.js +111 -122
- package/src/main/js/sap/ushell/override.js +1 -1
- package/src/main/js/sap/ushell/performance/FesrEnhancer.js +258 -183
- package/src/main/js/sap/ushell/performance/ShellAnalytics.js +206 -207
- package/src/main/js/sap/ushell/performance/StatisticalRecord.js +366 -230
- package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
- package/src/main/js/sap/ushell/renderers/fiori2/LogonFrameProvider.js +2 -2
- package/src/main/js/sap/ushell/renderers/fiori2/Renderer.js +39 -23
- package/src/main/js/sap/ushell/renderers/fiori2/RendererExtensions.js +105 -25
- package/src/main/js/sap/ushell/renderers/fiori2/Shell.controller.js +67 -50
- package/src/main/js/sap/ushell/renderers/fiori2/ShellLayout.js +1 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources.properties +21 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ar.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_bg.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ca.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_cs.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_cy.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_da.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_de.properties +15 -4
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_el.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_en.properties +11 -0
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_en_GB.properties +11 -0
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_en_US_sappsd.properties +11 -0
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_en_US_saprigi.properties +11 -0
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_en_US_saptrc.properties +12 -0
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_es.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_es_MX.properties +14 -3
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_et.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_fi.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_fr.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_fr_CA.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_hi.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_hr.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_hu.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_id.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_it.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_iw.properties +16 -5
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ja.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_kk.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ko.properties +13 -2
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_lt.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_lv.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ms.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_nl.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_no.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_pl.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_pt.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_pt_PT.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ro.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_ru.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_sh.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_sk.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_sl.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_sv.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_th.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_tr.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_uk.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_vi.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_zh_CN.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/resources/resources_zh_TW.properties +12 -1
- package/src/main/js/sap/ushell/renderers/fiori2/search/searchComponent/controller/CEPSearchApp.controller.js +4 -4
- package/src/main/js/sap/ushell/renderers/fiori2/search/searchComponent/controller/SearchApp.controller.js +3 -3
- package/src/main/js/sap/ushell/renderers/fiori2/search/searchComponent/manifest.json +1 -1
- package/src/main/js/sap/ushell/renderers/fiori2/search/searchComponent/view/CEPSearchApp.view.js +4 -3
- package/src/main/js/sap/ushell/renderers/fiori2/search/searchComponent/view/SearchApp.view.js +4 -3
- package/src/main/js/sap/ushell/services/AppConfiguration.js +3 -3
- package/src/main/js/sap/ushell/services/AppLifeCycle.js +1 -1
- package/src/main/js/sap/ushell/services/AppState.js +2 -3
- package/src/main/js/sap/ushell/services/Bookmark.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +97 -101
- package/src/main/js/sap/ushell/services/CommonDataModel.js +4 -5
- package/src/main/js/sap/ushell/services/Configuration.js +1 -2
- package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +2 -2
- package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
- package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +36 -33
- package/src/main/js/sap/ushell/services/DarkModeSupport.js +2 -2
- package/src/main/js/sap/ushell/services/EndUserFeedback.js +2 -2
- package/src/main/js/sap/ushell/services/LaunchPage.js +11 -8
- package/src/main/js/sap/ushell/services/Menu.js +31 -37
- package/src/main/js/sap/ushell/services/Message.js +1 -2
- package/src/main/js/sap/ushell/services/MessageBroker.js +1 -2
- package/src/main/js/sap/ushell/services/NavTargetResolution.js +70 -43
- package/src/main/js/sap/ushell/services/Navigation.js +1356 -0
- package/src/main/js/sap/ushell/services/NavigationDataProvider.js +7 -5
- package/src/main/js/sap/ushell/services/Notifications.js +16 -16
- package/src/main/js/sap/ushell/services/PageBuilding.js +1 -2
- package/src/main/js/sap/ushell/services/PagePersistence.js +6 -6
- package/src/main/js/sap/ushell/services/PageReferencing.js +2 -2
- package/src/main/js/sap/ushell/services/Pages.js +24 -25
- package/src/main/js/sap/ushell/services/Personalization.js +5 -5
- package/src/main/js/sap/ushell/services/PluginManager.js +1 -2
- package/src/main/js/sap/ushell/services/ReferenceResolver.js +2 -2
- package/src/main/js/sap/ushell/services/Search.js +1 -1
- package/src/main/js/sap/ushell/services/SearchCEP.js +2 -1
- package/src/main/js/sap/ushell/services/SearchableContent.js +85 -59
- package/src/main/js/sap/ushell/services/ShellNavigation.js +59 -17
- package/src/main/js/sap/ushell/services/ShellNavigationHashChanger.js +115 -39
- package/src/main/js/sap/ushell/services/SmartNavigation.js +4 -4
- package/src/main/js/sap/ushell/services/SpaceContent.js +5 -6
- package/src/main/js/sap/ushell/services/SupportTicket.js +1 -1
- package/src/main/js/sap/ushell/services/UITracer.js +5 -3
- package/src/main/js/sap/ushell/services/URLShortening.js +2 -2
- package/src/main/js/sap/ushell/services/URLTemplate.js +2 -2
- package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +7 -7
- package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +1 -2
- package/src/main/js/sap/ushell/services/UserDefaultParameters.js +9 -8
- package/src/main/js/sap/ushell/services/UserInfo.js +8 -1
- package/src/main/js/sap/ushell/services/UserRecents.js +91 -69
- package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +10 -6
- package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +1 -3
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +2 -5
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +2 -2
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +11 -11
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +6 -6
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +6 -26
- package/src/main/js/sap/ushell/services/_CommonDataModel/PersonalizationProcessor.js +1 -2
- package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +2 -2
- package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +9 -14
- package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
- package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
- package/src/main/js/sap/ushell/services/_Personalization/ContextContainer.js +34 -21
- package/src/main/js/sap/ushell/services/_Personalization/Variant.js +5 -2
- package/src/main/js/sap/ushell/services/_Personalization/VariantSet.js +18 -12
- package/src/main/js/sap/ushell/services/_Personalization/utils.js +2 -2
- package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +3 -3
- package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
- package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +1 -1
- package/src/main/js/sap/ushell/services/_UserRecents/RecentActivity.js +206 -214
- package/src/main/js/sap/ushell/services/_UserRecents/RecentAppsUsage.js +46 -54
- package/src/main/js/sap/ushell/services/_UserRecents/RecentsList.js +39 -40
- package/src/main/js/sap/ushell/services/_UserRecents/UserRecentsBase.js +29 -36
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstance.js +1 -1
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceAbap.js +1 -1
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceCdm.js +1 -1
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceLaunchPage.js +10 -8
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceLink.js +2 -2
- package/src/main/js/sap/ushell/services/appstate/LimitedBuffer.js +1 -2
- package/src/main/js/sap/ushell/services/appstate/Sequentializer.js +1 -1
- package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
- package/src/main/js/sap/ushell/themes/base/ContentFinder.less +8 -12
- package/src/main/js/sap/ushell/themes/base/SearchCEP.less +11 -4
- package/src/main/js/sap/ushell/themes/base/ShellHeader.less +0 -4
- package/src/main/js/sap/ushell/themes/base/UserSettings.less +3 -46
- package/src/main/js/sap/ushell/themes/base/WorkPage.less +39 -10
- package/src/main/js/sap/ushell/themes/base/WorkPageButton.less +7 -7
- package/src/main/js/sap/ushell/themes/base/WorkPageCell.less +48 -45
- package/src/main/js/sap/ushell/themes/base/WorkPageColumn.less +7 -69
- package/src/main/js/sap/ushell/themes/base/WorkPageColumnResizer.less +43 -38
- package/src/main/js/sap/ushell/themes/base/WorkPageRow.less +879 -29
- package/src/main/js/sap/ushell/themes/base/fonts/horizon/BusinessSuiteInAppSymbols.eot +0 -0
- package/src/main/js/sap/ushell/themes/base/fonts/horizon/BusinessSuiteInAppSymbols.ttf +0 -0
- package/src/main/js/sap/ushell/themes/base/fonts/horizon/BusinessSuiteInAppSymbols.woff +0 -0
- package/src/main/js/sap/ushell/themes/base/fonts/horizon/BusinessSuiteInAppSymbols.woff2 +0 -0
- package/src/main/js/sap/ushell/themes/sap_horizon/SearchCEP.less +5 -1
- package/src/main/js/sap/ushell/themes/sap_horizon/ToolAreaItem.less +1 -1
- package/src/main/js/sap/ushell/themes/sap_horizon/WorkPageCell.less +2 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/SearchCEP.less +5 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/ToolAreaItem.less +1 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/WorkPageCell.less +2 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcb/SearchCEP.less +5 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcb/WorkPageCell.less +2 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcw/SearchCEP.less +5 -1
- package/src/main/js/sap/ushell/themes/sap_horizon_hcw/WorkPageCell.less +2 -1
- package/src/main/js/sap/ushell/ui/AppContainer.js +0 -1
- package/src/main/js/sap/ushell/ui/ContentNodeSelector.js +1 -1
- package/src/main/js/sap/ushell/ui/QuickAccess.js +2 -2
- package/src/main/js/sap/ushell/ui/ShellHeader.js +0 -33
- package/src/main/js/sap/ushell/ui/ShellHeaderRenderer.js +16 -2
- package/src/main/js/sap/ushell/ui/appfinder/AppBox.js +0 -1
- package/src/main/js/sap/ushell/ui/bookmark/SaveOnPage.view.xml +6 -6
- package/src/main/js/sap/ushell/ui/cards/FrequentActivitiesExtension.js +1 -1
- package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
- package/src/main/js/sap/ushell/ui/footerbar/AboutButton.js +0 -1
- package/src/main/js/sap/ushell/ui/footerbar/AddBookmarkButton.js +35 -20
- package/src/main/js/sap/ushell/ui/footerbar/ContactSupportButton.js +5 -5
- package/src/main/js/sap/ushell/ui/footerbar/JamDiscussButton.js +13 -12
- package/src/main/js/sap/ushell/ui/footerbar/JamShareButton.js +30 -23
- package/src/main/js/sap/ushell/ui/footerbar/LogoutButton.js +0 -1
- package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.view.js +1 -12
- package/src/main/js/sap/ushell/ui/footerbar/SendAsEmailButton.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/ActionItem.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/AnchorItem.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/AnchorNavigationBar.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/FailedTileDialog.js +4 -4
- package/src/main/js/sap/ushell/ui/launchpad/GroupHeaderActions.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/GroupListItem.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/LinkTileWrapper.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/LoadingDialog.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/Page.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/PlusTile.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/Section.js +3 -3
- package/src/main/js/sap/ushell/ui/launchpad/Tile.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/TileContainer.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/TileContainerRenderer.js +3 -3
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +4 -5
- package/src/main/js/sap/ushell/ui/shell/RightFloatingContainer.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +3 -2
- package/src/main/js/sap/ushell/ui/shell/ShellHeadItem.js +7 -8
- package/src/main/js/sap/ushell/ui/shell/SysInfoBar.js +5 -4
- package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -2
- package/src/main/js/sap/ushell/ui/tile/DynamicTile.js +0 -1
- package/src/main/js/sap/ushell/ui/tile/ImageTile.js +0 -1
- package/src/main/js/sap/ushell/ui/tile/StaticTile.js +0 -1
- package/src/main/js/sap/ushell/ui/tile/TileBase.js +0 -1
- package/src/main/js/sap/ushell/ui/utils.js +1 -1
- package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
- package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
- package/src/main/js/sap/ushell/ui5service/_ShellUIService/shelluiservice.class.factory.js +1 -1
- package/src/main/js/sap/ushell/utils/DynamicTileRequest.js +353 -323
- package/src/main/js/sap/ushell/utils/HttpClient.js +0 -1
- package/src/main/js/sap/ushell/utils/RestrictedJSONModel.js +1 -1
- package/src/main/js/sap/ushell/utils/UrlParsing.js +18 -14
- package/src/main/js/sap/ushell/utils/UrlShortening.js +2 -2
- package/src/main/js/sap/ushell/utils/objectOperations.js +1 -1
- package/src/main/js/sap/ushell/utils/type.js +1 -1
- package/src/main/js/sap/ushell/utils/utilsCdm.js +3 -3
- package/src/main/js/sap/ushell/utils.js +167 -37
- package/src/test/js/sap/ushell/bootstrap/sandbox.js +2 -2
- package/ui5.yaml +2 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Menu.js +0 -22
- package/src/main/js/sap/ushell/utils/clone.js +0 -167
|
@@ -0,0 +1,1356 @@
|
|
|
1
|
+
// Copyright (c) 2009-2023 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview Navigation.
|
|
5
|
+
* This file exposes an API to perform (invoke) Navigation for applications.
|
|
6
|
+
* It exposes interfaces to perform a hash change and trigger a navigation.
|
|
7
|
+
*
|
|
8
|
+
* @version 1.119.0
|
|
9
|
+
*/
|
|
10
|
+
sap.ui.define([
|
|
11
|
+
"sap/base/Log",
|
|
12
|
+
"sap/base/util/deepClone",
|
|
13
|
+
"sap/base/util/deepExtend",
|
|
14
|
+
"sap/base/util/isPlainObject",
|
|
15
|
+
"sap/base/util/ObjectPath",
|
|
16
|
+
"sap/ui/base/Object",
|
|
17
|
+
"sap/ui/thirdparty/hasher",
|
|
18
|
+
"sap/ushell/ApplicationType",
|
|
19
|
+
"sap/ushell/components/applicationIntegration/AppLifeCycle",
|
|
20
|
+
"sap/ushell/Container",
|
|
21
|
+
"sap/ushell/services/_CrossApplicationNavigation/utils",
|
|
22
|
+
"sap/ushell/services/AppConfiguration",
|
|
23
|
+
"sap/ushell/TechnicalParameters",
|
|
24
|
+
"sap/ushell/UI5ComponentType",
|
|
25
|
+
"sap/ushell/utils",
|
|
26
|
+
"sap/ushell/utils/type",
|
|
27
|
+
"sap/ushell/utils/UrlParsing"
|
|
28
|
+
], function (
|
|
29
|
+
Log,
|
|
30
|
+
deepClone,
|
|
31
|
+
deepExtend,
|
|
32
|
+
isPlainObject,
|
|
33
|
+
ObjectPath,
|
|
34
|
+
BaseObject,
|
|
35
|
+
hasher,
|
|
36
|
+
ApplicationType,
|
|
37
|
+
AppLifeCycleAi,
|
|
38
|
+
Container,
|
|
39
|
+
navigationUtils,
|
|
40
|
+
AppConfiguration,
|
|
41
|
+
TechnicalParameters,
|
|
42
|
+
UI5ComponentType,
|
|
43
|
+
ushellUtils,
|
|
44
|
+
ushellType,
|
|
45
|
+
UrlParsing
|
|
46
|
+
) {
|
|
47
|
+
"use strict";
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @alias sap.ushell.services.Navigation
|
|
51
|
+
* @class
|
|
52
|
+
* @classdesc The Unified Shell's Navigation service allows to navigate to "external" targets outside of the currently running app (but still in scope
|
|
53
|
+
* of the current Fiori launchpad) or create links to such external targets.
|
|
54
|
+
*
|
|
55
|
+
* To use the Navigation service you can retrieve an instance via ushell's Container:
|
|
56
|
+
* <pre>
|
|
57
|
+
* sap.ui.require(["sap/ushell/Container"], async () => {
|
|
58
|
+
* const oNavigationService = await Container.getServiceAsync("Navigation");
|
|
59
|
+
* // Use the Navigation service
|
|
60
|
+
* </pre>
|
|
61
|
+
*
|
|
62
|
+
* The Navigation service currently provides platform independent functionality.
|
|
63
|
+
*
|
|
64
|
+
* The service is meant to be used by applications, plugins and shell components.
|
|
65
|
+
*
|
|
66
|
+
* Usage:
|
|
67
|
+
* <pre>
|
|
68
|
+
* sap.ui.require(["sap/ushell/Container"], async () => {
|
|
69
|
+
* const oNavigationService = await Container.getServiceAsync("Navigation");
|
|
70
|
+
* const sHref = await oNavigationService.getHref({
|
|
71
|
+
* target : {
|
|
72
|
+
* semanticObject: "Product",
|
|
73
|
+
* action: "display"
|
|
74
|
+
* },
|
|
75
|
+
* params: {
|
|
76
|
+
* "ProductID": "102343333"
|
|
77
|
+
* }
|
|
78
|
+
* }, oComponent);
|
|
79
|
+
* // do something with the resolved sHref.
|
|
80
|
+
* });
|
|
81
|
+
* </pre>
|
|
82
|
+
*
|
|
83
|
+
* Parameter names and values are case sensitive.
|
|
84
|
+
*
|
|
85
|
+
* Note that the usage of multi-valued parameters (specifying an array with more than one member as parameter value,
|
|
86
|
+
* e.g. <code>params : { A : ["a1", "a2"] }</code>) is possible with this API but <b>strongly discouraged</b>.
|
|
87
|
+
* Depending on the used platform / back-end implementation the target matching might not support multi-value parameters.
|
|
88
|
+
* Furthermore, it is not guaranteed that additional parameter values specified in the back-end configuration are merged with
|
|
89
|
+
* parameter values passed via the Navigation service.
|
|
90
|
+
*
|
|
91
|
+
* Note that the application parameter length (including SemanticObject/Action) shall not exceed 512 bytes when serialized as UTF-8.
|
|
92
|
+
*
|
|
93
|
+
* Note that when receiving the values as startup parameters (as part of the component data object)
|
|
94
|
+
* single values are represented as an array of size 1.
|
|
95
|
+
* Above example is returned as <code> deepEqual(getComponentData().startupParameters , { "ProductID" : [ "102343333" ] } ) </code>
|
|
96
|
+
*
|
|
97
|
+
* Make sure not to store sensitive data within an URL.
|
|
98
|
+
* URLs may appear in a server log, be persisted inside and outside the system.
|
|
99
|
+
*
|
|
100
|
+
* Note: When constructing large URLs, the URLs may be shortened and persisted on a database server for prolonged time,
|
|
101
|
+
* the actual data is persisted under a key accessible to any User (guessing the key).
|
|
102
|
+
*
|
|
103
|
+
* The same restrictions apply for the Application state.
|
|
104
|
+
*
|
|
105
|
+
* @param {object} oContainerInterface The Container Interface.
|
|
106
|
+
* @param {string} sParameters The parameters.
|
|
107
|
+
* @param {object} oServiceConf Service Configuration.
|
|
108
|
+
*
|
|
109
|
+
* @hideconstructor
|
|
110
|
+
*
|
|
111
|
+
* @see sap.ushell.services.Container#getServiceAsync
|
|
112
|
+
*
|
|
113
|
+
* @since 1.119.0
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
function Navigation (oContainerInterface, sParameters, oServiceConf) {
|
|
117
|
+
let oServiceConfiguration;
|
|
118
|
+
if (oServiceConf && oServiceConf.config) {
|
|
119
|
+
oServiceConfiguration = oServiceConf.config;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @typedef {object} sap.ushell.services.Navigation.LinkFilter
|
|
124
|
+
* @property {string} [semanticObject] Matches the semantic object of a link.
|
|
125
|
+
* @property {string} [action] Matches the action object of a link.
|
|
126
|
+
* @property {object} [params] Matches the parameters of a link.
|
|
127
|
+
* <ol>
|
|
128
|
+
* <li>
|
|
129
|
+
* <b>simple format:</b>
|
|
130
|
+
* <pre>
|
|
131
|
+
* {
|
|
132
|
+
* P1: "B",
|
|
133
|
+
* P2: ["e", "j"],
|
|
134
|
+
* }
|
|
135
|
+
* </pre>
|
|
136
|
+
* </li>
|
|
137
|
+
* <li>
|
|
138
|
+
* <b>extended format:</b>
|
|
139
|
+
* <pre>
|
|
140
|
+
* {
|
|
141
|
+
* P1: { value: "v1" },
|
|
142
|
+
* P2: { value: ["v2", "v3"] }
|
|
143
|
+
* P3: { value: "v4", required: true }
|
|
144
|
+
* }
|
|
145
|
+
* </pre>
|
|
146
|
+
* <code>required</code>: Whether the parameter is be required (<code>true</code>) or not (<code>false</code>) in the signature of
|
|
147
|
+
* the matching target.
|
|
148
|
+
* Please note that this option is only effective on platforms using the <code>sap.ushell.services.ClientSideTargetResolution</code>
|
|
149
|
+
* </li>
|
|
150
|
+
* </ol>
|
|
151
|
+
* @property {boolean} [withAtLeastOneUsedParam=false] If <code>true</code>, matches only links that use at least one (non sap-) parameter from 'params'.
|
|
152
|
+
* @property {string} [sortResultsBy="intent"] How the matching links should be sorted. Possible Values:
|
|
153
|
+
* <ol>
|
|
154
|
+
* <li> <code>"intent"</code> lexicographical sort on returned 'intent' field</li>
|
|
155
|
+
* <li> <code>"text"</code> lexicographical sort on returned 'text' field</li>
|
|
156
|
+
* <li> <code>"priority"</code> experimental - top intents are returned first</li>
|
|
157
|
+
* </ol>
|
|
158
|
+
* @property {boolean} [treatTechHintAsFilter=false] If true, only apps that match exactly the supplied technology (for example sap-ui-tech-hint=WDA) will be considered.
|
|
159
|
+
* @property {sap.ui.core.Component} ui5Component The UI5 component invoking the service, shall be a root component.
|
|
160
|
+
* @property {string} [appStateKey] <b>SAP internal usage only</b> Application state key to add to the generated links.
|
|
161
|
+
* @property {boolean} [compactIntents=false] Whether intents should be returned in compact format.
|
|
162
|
+
* @property {string[]} [tags] Matches only links which match an inbound with certain tags.
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @typedef {object} sap.ushell.services.Navigation.Link
|
|
168
|
+
* Optional properties may not be present in the link.
|
|
169
|
+
* @property {string} intent The intent: for example "#AnObject-Action?A=B&C=e&C=j"
|
|
170
|
+
* <b>Note:</b> The intent is in a <b>internal</b> format and cannot be directly put into a link tag.
|
|
171
|
+
* @property {string} text The title of the link.
|
|
172
|
+
* @property {sap.ui.core.URI} [icon] A URI to the icon: for example "sap-icon://Fiori2/F0018".
|
|
173
|
+
* @property {string} [subTitle] The short title of the link.
|
|
174
|
+
* @property {string} [shortTitle] The short title of the link.
|
|
175
|
+
* @property {string[]} [tags] The list of tags.
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @typedef {object} sap.ushell.services.Navigation.Target
|
|
181
|
+
* A target describing the intent: #<semanticObject>-<action>~<contextRaw>?<params>&/<appSpecificRoute>
|
|
182
|
+
* <b>Note:</b> The intent shall not exceed 512 bytes when serialized as UTF-8.
|
|
183
|
+
* @property {object} [target] Defaults to current hash. Please note that the only the <code>appSpecificRoute</code>
|
|
184
|
+
* will be considered when target is omitted.
|
|
185
|
+
* @property {string} [target.semanticObject] The semanticObject part of the intent.
|
|
186
|
+
* @property {string} [target.action] The action part of the intent.
|
|
187
|
+
* @property {string} [target.contextRaw] The contextRaw part of the intent without the '~' prefix.
|
|
188
|
+
* @property {string} [target.shellHash] The entire intent including parameters and appSpecificRoute.
|
|
189
|
+
* <b>Note:</b> If set all other parameters are ignored.
|
|
190
|
+
* <b>Note:</b> While parameters need to be url-encoded once when used in
|
|
191
|
+
* the <code>shellHash</code> the app specific route must not be encoded.
|
|
192
|
+
* @property {object} [params] The parameters of the target
|
|
193
|
+
* <ol>
|
|
194
|
+
* <li>
|
|
195
|
+
* <b>simple format:</b>
|
|
196
|
+
* <pre>
|
|
197
|
+
* {
|
|
198
|
+
* P1: "B",
|
|
199
|
+
* P2: ["e", "j"],
|
|
200
|
+
* }
|
|
201
|
+
* </pre>
|
|
202
|
+
* </li>
|
|
203
|
+
* <li>
|
|
204
|
+
* <b>extended format:</b>
|
|
205
|
+
* <pre>
|
|
206
|
+
* {
|
|
207
|
+
* P1: { value: "v1" },
|
|
208
|
+
* P2: { value: ["v2", "v3"] }
|
|
209
|
+
* }
|
|
210
|
+
* </pre>
|
|
211
|
+
* </li>
|
|
212
|
+
* </ol>
|
|
213
|
+
* <b>Note:</b> Parameter values can contain special characters and must be provided
|
|
214
|
+
* unencoded. The APIs takes care of the necessary encodings.
|
|
215
|
+
* @property {string} [appSpecificRoute] The appSpecificRoute without the '&/' prefix.
|
|
216
|
+
* @property {boolean} [processParams=false] Wether the parameter provided in <code>params</code> should be applied or ignored.
|
|
217
|
+
* Parameters already set by the shellHash are ignored.
|
|
218
|
+
* @public
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @typedef {object} SimpleTarget
|
|
223
|
+
* The same structure as {@link sap.ushell.services.Navigation.Target} but without the appSpecificRoute
|
|
224
|
+
* @property {object} [target]
|
|
225
|
+
* @property {string} [target.semanticObject]
|
|
226
|
+
* @property {string} [target.action]
|
|
227
|
+
* @property {string} [target.contextRaw]
|
|
228
|
+
* @property {string} [target.shellHash]
|
|
229
|
+
* @property {object} [params]
|
|
230
|
+
*
|
|
231
|
+
* @private
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Adds the system of the current application specified as <code>sap-system</code> parameter in its URL to the
|
|
236
|
+
* parameter object <code>vTarget</code> used in the methods {@link sap.ushell.services.Navigation#getHref}
|
|
237
|
+
* and {@link sap.ushell.services.Navigation#navigate}.
|
|
238
|
+
* The system is only added if the current application specifies it and <code>vTarget</code> does not already contain
|
|
239
|
+
* this parameter.
|
|
240
|
+
*
|
|
241
|
+
* @param {string|SimpleTarget} vTarget The navigation target object or string, for example:
|
|
242
|
+
* <b>Important</b> The target expressed in this parameter should not contain an inner-app route.
|
|
243
|
+
* @param {sap.ui.core.Component} [oComponent] the root component of the application
|
|
244
|
+
* @returns {string|SimpleTarget} The provided target with the sap-system parameter appended.
|
|
245
|
+
*
|
|
246
|
+
* @since 1.119.0
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
249
|
+
this._getTargetWithCurrentSystem = function (vTarget, oComponent) {
|
|
250
|
+
if (typeof vTarget !== "string" && !isPlainObject(vTarget) && vTarget !== undefined) {
|
|
251
|
+
Log.error("Unexpected input type", null, "sap.ushell.services.Navigation");
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (vTarget === undefined) {
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
let sSystem;
|
|
260
|
+
let sNextNavMode;
|
|
261
|
+
|
|
262
|
+
const oResolution = AppConfiguration.getCurrentApplication();
|
|
263
|
+
if (oComponent) {
|
|
264
|
+
// Take sap-system, sap-ushell-next-navmode and sap-app-origin-hint parameters from the component
|
|
265
|
+
let oStartupParameters;
|
|
266
|
+
try {
|
|
267
|
+
oStartupParameters = oComponent.getComponentData().startupParameters; // assume always present on root component
|
|
268
|
+
} catch (oError) {
|
|
269
|
+
// startupParameters not available
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (!isPlainObject(oStartupParameters)) {
|
|
273
|
+
Log.error("Cannot call getComponentData on component", "the component should be an application root component", "sap.ushell.services.Navigation");
|
|
274
|
+
} else {
|
|
275
|
+
if (oStartupParameters.hasOwnProperty("sap-system")) {
|
|
276
|
+
sSystem = oStartupParameters["sap-system"][0];
|
|
277
|
+
}
|
|
278
|
+
if (oStartupParameters.hasOwnProperty("sap-ushell-next-navmode")) {
|
|
279
|
+
sNextNavMode = oStartupParameters["sap-ushell-next-navmode"][0];
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
// Take sap-system, sap-ushell-next-navmode and sap-app-origin-hint parameters from the current application
|
|
284
|
+
if (oResolution && oResolution["sap-system"]) {
|
|
285
|
+
sSystem = oResolution["sap-system"];
|
|
286
|
+
} else if (oResolution && oResolution.url) {
|
|
287
|
+
sSystem = new URL(oResolution.url, window.location.href).searchParams.get("sap-system");
|
|
288
|
+
}
|
|
289
|
+
if (oResolution && oResolution["sap-ushell-next-navmode"]) {
|
|
290
|
+
sNextNavMode = oResolution["sap-ushell-next-navmode"];
|
|
291
|
+
} else if (oResolution && oResolution.url) {
|
|
292
|
+
sNextNavMode = new URL(oResolution.url, window.location.href).searchParams.get("sap-ushell-next-navmode");
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
let sAppOrigin;
|
|
297
|
+
if (oResolution) {
|
|
298
|
+
sAppOrigin = oResolution.contentProviderId;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const vInjectedTarget = navigationUtils._injectParameters({
|
|
302
|
+
type: ushellType,
|
|
303
|
+
inject: {
|
|
304
|
+
"sap-system": sSystem,
|
|
305
|
+
"sap-ushell-navmode": sNextNavMode,
|
|
306
|
+
"sap-app-origin-hint": sAppOrigin
|
|
307
|
+
},
|
|
308
|
+
injectEmptyString: {
|
|
309
|
+
"sap-app-origin-hint": true
|
|
310
|
+
},
|
|
311
|
+
args: vTarget
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
return vInjectedTarget;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Adds the system of the current application specified as <code>sap-ushell-test-enc</code> parameter in its URL to the parameter
|
|
319
|
+
* object <code>vTarget</code> used in the methods {@link sap.ushell.services.Navigation#getHref} and {@link sap.ushell.services.Navigation#navigate}.
|
|
320
|
+
* The parameter is always added. It will be overwritten or duplicated if present.
|
|
321
|
+
*
|
|
322
|
+
* @param {string|sap.ushell.services.Navigation.Target} vTarget The navigation target as string or object.
|
|
323
|
+
* @returns {string|sap.ushell.services.Navigation.Target} The provided target with the sap-system parameter appended.
|
|
324
|
+
*
|
|
325
|
+
* @since 1.119.0
|
|
326
|
+
* @private
|
|
327
|
+
*/
|
|
328
|
+
this._amendTargetWithSapUshellEncTestParameter = function (vTarget) {
|
|
329
|
+
if (localStorage && localStorage["sap-ushell-enc-test"] === "false") {
|
|
330
|
+
return vTarget;
|
|
331
|
+
}
|
|
332
|
+
if (!oServiceConfiguration || !oServiceConfiguration["sap-ushell-enc-test"]) {
|
|
333
|
+
if (localStorage && localStorage["sap-ushell-enc-test"] !== "true") {
|
|
334
|
+
return vTarget;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (typeof vTarget !== "string" && !isPlainObject(vTarget) && vTarget !== undefined) {
|
|
338
|
+
Log.error("Unexpected input type", null, "sap.ushell.services.Navigation");
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (vTarget === undefined) {
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (isPlainObject(vTarget)) {
|
|
347
|
+
// needs deep copy
|
|
348
|
+
const oClonedTarget = deepExtend({}, vTarget);
|
|
349
|
+
if (oClonedTarget.target && oClonedTarget.target.shellHash) {
|
|
350
|
+
if (typeof oClonedTarget.target.shellHash === "string") {
|
|
351
|
+
// process shell hash as a string
|
|
352
|
+
if (oClonedTarget.target.shellHash !== "#" && oClonedTarget.target.shellHash !== "") {
|
|
353
|
+
oClonedTarget.target.shellHash = this._amendTargetWithSapUshellEncTestParameter(
|
|
354
|
+
oClonedTarget.target.shellHash);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return oClonedTarget;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
oClonedTarget.params = oClonedTarget.params || {};
|
|
361
|
+
oClonedTarget.params["sap-ushell-enc-test"] = ["A B%20C"];
|
|
362
|
+
|
|
363
|
+
return oClonedTarget;
|
|
364
|
+
}
|
|
365
|
+
let sShellHash = vTarget;
|
|
366
|
+
|
|
367
|
+
if (!/[?&]sap-system=/.test(sShellHash)) {
|
|
368
|
+
const sSeparator = (sShellHash.indexOf("?") > -1) ? "&" : "?";
|
|
369
|
+
sShellHash += sSeparator + "sap-ushell-enc-test=" + encodeURIComponent("A B%20C");
|
|
370
|
+
}
|
|
371
|
+
return sShellHash;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Extracts the inner app route from a given intent.
|
|
376
|
+
*
|
|
377
|
+
* This method actually amends the input parameter if it is not provided as a string.
|
|
378
|
+
*
|
|
379
|
+
* @param {string|sap.ushell.services.Navigation.Target} vIntent The input intent.
|
|
380
|
+
* @returns {
|
|
381
|
+
* { innerAppRoute: string, intent: string }|
|
|
382
|
+
* { innerAppRoute: string, intent: SimpleTarget }
|
|
383
|
+
* } Object containing the innerAppRoute and the intent without innerAppRoute
|
|
384
|
+
* <b>Note:</b> the returned <code>intent</code> field will be a string if
|
|
385
|
+
* the input <code>vIntent</code> was a string.
|
|
386
|
+
*
|
|
387
|
+
* @since 1.119.0
|
|
388
|
+
* @private
|
|
389
|
+
*/
|
|
390
|
+
this._extractInnerAppRoute = function (vIntent) {
|
|
391
|
+
if (typeof vIntent === "string") {
|
|
392
|
+
const aParts = vIntent.split("&/"); // ["Object-action", "inner-app/route", ... ]
|
|
393
|
+
const sIntent = aParts.shift(); // aParts now contains parts of inner-app route
|
|
394
|
+
|
|
395
|
+
return {
|
|
396
|
+
intent: sIntent,
|
|
397
|
+
innerAppRoute: aParts.length > 0 ? "&/" + aParts.join("&/") : ""
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (isPlainObject(vIntent)) {
|
|
402
|
+
const sShellHash = ObjectPath.get("target.shellHash", vIntent);
|
|
403
|
+
if (typeof sShellHash === "string") {
|
|
404
|
+
const { intent, innerAppRoute } = this._extractInnerAppRoute(sShellHash);
|
|
405
|
+
|
|
406
|
+
// modify the source object
|
|
407
|
+
vIntent.target.shellHash = intent;
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
intent: vIntent,
|
|
411
|
+
innerAppRoute: innerAppRoute
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (vIntent.hasOwnProperty("appSpecificRoute")) {
|
|
416
|
+
const vAppSpecificRoute = vIntent.appSpecificRoute;
|
|
417
|
+
|
|
418
|
+
delete vIntent.appSpecificRoute;
|
|
419
|
+
|
|
420
|
+
const bIsStringWithoutSeparator = typeof vAppSpecificRoute === "string" && vAppSpecificRoute.indexOf("&/") !== 0 && vAppSpecificRoute.length > 0;
|
|
421
|
+
|
|
422
|
+
return {
|
|
423
|
+
innerAppRoute: bIsStringWithoutSeparator ? "&/" + vAppSpecificRoute : vAppSpecificRoute,
|
|
424
|
+
intent: vIntent
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return {
|
|
429
|
+
intent: vIntent,
|
|
430
|
+
innerAppRoute: ""
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
Log.error("Invalid input parameter", "expected string or object", "sap.ushell.services.Navigation");
|
|
435
|
+
|
|
436
|
+
return { intent: vIntent };
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Adds an inner app route to the given intent.
|
|
442
|
+
*
|
|
443
|
+
* @param {string|SimpleTarget|sap.ushell.services.Navigation.Target} vIntent The same input object or string that {@link #_extractInnerAppRoute} takes.
|
|
444
|
+
* @param {string} [sInnerAppRoute] The inner app route.
|
|
445
|
+
* This method assumes that, if provided it always starts wih "&/".
|
|
446
|
+
* @returns {string|sap.ushell.services.Navigation.Target} The intent with the given <code>sInnerAppRoute</code> parameter.
|
|
447
|
+
*
|
|
448
|
+
* @since 1.119.0
|
|
449
|
+
* @private
|
|
450
|
+
*/
|
|
451
|
+
this._injectInnerAppRoute = function (vIntent, sInnerAppRoute) {
|
|
452
|
+
if (!sInnerAppRoute) {
|
|
453
|
+
return vIntent;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
if (typeof vIntent === "string") {
|
|
457
|
+
return vIntent + sInnerAppRoute;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (isPlainObject(vIntent)) {
|
|
461
|
+
const sShellHash = ObjectPath.get("target.shellHash", vIntent);
|
|
462
|
+
|
|
463
|
+
if (typeof sShellHash === "string") {
|
|
464
|
+
vIntent.target.shellHash = this._injectInnerAppRoute(sShellHash, sInnerAppRoute);
|
|
465
|
+
return vIntent;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
vIntent.appSpecificRoute = sInnerAppRoute;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return vIntent;
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Returns a promise resolving to a URL that launches an app with certain parameters.
|
|
476
|
+
* This API can be used to convert the internal shell hash format into the URL format for use in link tags.
|
|
477
|
+
* The resulting href is fully encoded and cannot be used in other APIs expecting the internal decoded hash.
|
|
478
|
+
*
|
|
479
|
+
* <pre>
|
|
480
|
+
* sap.ui.require(["sap/ushell/Container"], async () => {
|
|
481
|
+
* const oNavigationService = await Container.getServiceAsync("Navigation");
|
|
482
|
+
* const sHref = await oNavigationService.getHref({
|
|
483
|
+
* target: { shellHash: oLink.intent }
|
|
484
|
+
* }, oComponent);
|
|
485
|
+
* // do something with the resolved sHref.
|
|
486
|
+
* });
|
|
487
|
+
* </pre>
|
|
488
|
+
*
|
|
489
|
+
* This API accepts a sap-xapp-state-data parameter that can be used generate a url that can be used to launch
|
|
490
|
+
* an app with certain data, for example:
|
|
491
|
+
* <pre>
|
|
492
|
+
* {
|
|
493
|
+
* target : { semanticObject : "AnObject", action: "action" },
|
|
494
|
+
* params : { "sap-xapp-state-data" : JSON.stringify({ a: "b", c: "d" }) }
|
|
495
|
+
* }
|
|
496
|
+
* </pre>
|
|
497
|
+
* Using the arguments as in the example above, a link with a sap-xapp-state parameter that encodes the provided data is returned.
|
|
498
|
+
* The sap-xapp-state-data parameter does not appear in the generated link.
|
|
499
|
+
*
|
|
500
|
+
* Do <b>not</b> use "#Shell-home" to navigate to a specific homepage!
|
|
501
|
+
* A proper way for an application to generate a link to return to the home page of the Fiori launchpad is:
|
|
502
|
+
* <code>getHref( { target : { shellHash : "#" }})</code>
|
|
503
|
+
*
|
|
504
|
+
* @param {sap.ushell.services.Navigation.Target} oTarget The navigation target to transform.
|
|
505
|
+
* @param {sap.ui.core.Component} [oComponent] A UI5 component, used to logically attach any related app state.
|
|
506
|
+
* @returns {Promise<string>} A Promise resolving the encoded href.
|
|
507
|
+
*
|
|
508
|
+
* @since 1.119.0
|
|
509
|
+
* @public
|
|
510
|
+
*/
|
|
511
|
+
this.getHref = async function (oTarget, oComponent) {
|
|
512
|
+
try {
|
|
513
|
+
/**@type {sap.ushell.services.Navigation.Target} */
|
|
514
|
+
let oArgsClone = deepClone(oTarget); // clone to keep input unchanged and to avoid side effects
|
|
515
|
+
if (!oArgsClone.target) {
|
|
516
|
+
Log.debug("Navigation.getHref: No target provided using current hash as fallback", "sap.ushell.services.Navigation");
|
|
517
|
+
const oParsedShellHash = UrlParsing.parseShellHash(hasher.getHash());
|
|
518
|
+
oArgsClone.target = {
|
|
519
|
+
semanticObject: oParsedShellHash.semanticObject,
|
|
520
|
+
action: oParsedShellHash.action,
|
|
521
|
+
contextRaw: oParsedShellHash.contextRaw
|
|
522
|
+
};
|
|
523
|
+
oArgsClone.params = oParsedShellHash.params;
|
|
524
|
+
|
|
525
|
+
if (oParsedShellHash.appSpecificRoute && !oArgsClone.appSpecificRoute) {
|
|
526
|
+
oArgsClone.appSpecificRoute = oParsedShellHash.appSpecificRoute;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
const { intent, innerAppRoute } = this._extractInnerAppRoute(oArgsClone);
|
|
531
|
+
|
|
532
|
+
await navigationUtils.addXAppStateFromParameterAsync(intent, "sap-xapp-state-data" /* parameter containing data */);
|
|
533
|
+
|
|
534
|
+
oArgsClone = this._getTargetWithCurrentSystem(intent, oComponent);
|
|
535
|
+
oArgsClone = await navigationUtils.injectStickyParametersAsync({
|
|
536
|
+
args: oArgsClone,
|
|
537
|
+
appLifeCycle: AppLifeCycleAi,
|
|
538
|
+
technicalParameters: TechnicalParameters,
|
|
539
|
+
type: ushellType
|
|
540
|
+
});
|
|
541
|
+
oArgsClone = this._amendTargetWithSapUshellEncTestParameter(oArgsClone);
|
|
542
|
+
oArgsClone = this._injectInnerAppRoute(oArgsClone, innerAppRoute);
|
|
543
|
+
|
|
544
|
+
const ShellNavigation = await Container.getServiceAsync("ShellNavigation");
|
|
545
|
+
|
|
546
|
+
return ShellNavigation.hrefForExternal(oArgsClone, undefined, oComponent);
|
|
547
|
+
} catch (oError) {
|
|
548
|
+
Log.error("href could not be calculated", oError, "sap.ushell.services.Navigation");
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Attempts to use the browser history to navigate to the previous app.
|
|
554
|
+
*
|
|
555
|
+
* A navigation to the Fiori launchpad Home is performed when this method is called on a first navigation.
|
|
556
|
+
* In all other cases, this function simply performs a browser back navigation.
|
|
557
|
+
*
|
|
558
|
+
* Please note that the behavior of this method is subject to change and therefore it may not yield to the expected results
|
|
559
|
+
* especially on mobile devices where "back" is the previous inner-app state if these are put into the history!
|
|
560
|
+
*
|
|
561
|
+
* @returns {Promise} A promise which resolves once the back navigation was triggered
|
|
562
|
+
*
|
|
563
|
+
* @since 1.119.0
|
|
564
|
+
* @public
|
|
565
|
+
*/
|
|
566
|
+
this.backToPreviousApp = async function () {
|
|
567
|
+
const bIsInitial = await this.isInitialNavigation();
|
|
568
|
+
|
|
569
|
+
if (bIsInitial) {
|
|
570
|
+
// go back home
|
|
571
|
+
return this.navigate({ target: { shellHash: "#" }, writeHistory: false });
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
this.historyBack();
|
|
575
|
+
return undefined;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Navigates back in history the number of given steps if this is supported by the underlying platform.
|
|
580
|
+
* If no argument is provided it will navigate back 1 step.
|
|
581
|
+
*
|
|
582
|
+
* @param {int} iSteps positive integer representing the steps to go back in the history
|
|
583
|
+
*
|
|
584
|
+
* @since 1.119.0
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
this.historyBack = function (iSteps) {
|
|
588
|
+
let iActualStepsBack = -1;
|
|
589
|
+
if (iSteps && typeof iSteps === "number") {
|
|
590
|
+
if (iSteps <= 0) {
|
|
591
|
+
Log.warning(
|
|
592
|
+
"historyBack called with an argument <= 0 and will result in a forward navigation or refresh",
|
|
593
|
+
"expected was an argument > 0",
|
|
594
|
+
"sap.ushell.services.Navigation#historyBack"
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
iActualStepsBack = iSteps * -1;
|
|
598
|
+
}
|
|
599
|
+
window.history.go(iActualStepsBack);
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Checks whether the FLP has performed the first navigation.
|
|
604
|
+
* This method can be used to detect whether the current app was started directly, that is,
|
|
605
|
+
* without a previous navigation to another app, to the FLP home, or another target that adds an entry in the browser history.
|
|
606
|
+
*
|
|
607
|
+
* @returns {Promise<boolean>} This promise resolves with a boolean indicating if the current navigation is considered initial
|
|
608
|
+
*
|
|
609
|
+
* @since 1.119.0
|
|
610
|
+
* @public
|
|
611
|
+
*/
|
|
612
|
+
this.isInitialNavigation = async function () {
|
|
613
|
+
try {
|
|
614
|
+
const ShellNavigation = await Container.getServiceAsync("ShellNavigation");
|
|
615
|
+
const bIsInitialNavigation = ShellNavigation.isInitialNavigation();
|
|
616
|
+
|
|
617
|
+
// An undefined value indicates that the ShellNavigation service did not initialize the ShellNavigationHashChanger yet.
|
|
618
|
+
// Hence this is the first navigation in case asked at this point in time.
|
|
619
|
+
if (typeof bIsInitialNavigation === "undefined") {
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
return bIsInitialNavigation;
|
|
624
|
+
} catch (oError) {
|
|
625
|
+
Log.debug("ShellNavigation service not available", "This will be treated as the initial navigation", "sap.ushell.services.Navigation");
|
|
626
|
+
return true;
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Triggers a navigation to a specified target outside of the currently running application (e.g. different launchpad application).
|
|
632
|
+
* Invocation will trigger a hash change and subsequent invocation of the target.
|
|
633
|
+
*
|
|
634
|
+
* If the navigation target opens in a new window the running application may be retained.
|
|
635
|
+
*
|
|
636
|
+
* This API accepts a sap-xapp-state-data parameter that can be used generate a url that can be used to launch
|
|
637
|
+
* an app with certain data, for example:
|
|
638
|
+
* <pre>
|
|
639
|
+
* {
|
|
640
|
+
* target : { semanticObject : "AnObject", action: "action" },
|
|
641
|
+
* params : { "sap-xapp-state-data" : JSON.stringify({ a: "b", c: "d" }) }
|
|
642
|
+
* }
|
|
643
|
+
* </pre>
|
|
644
|
+
* Using the arguments as in the example above, a link with a sap-xapp-state parameter that encodes the provided data is returned.
|
|
645
|
+
* The sap-xapp-state-data parameter does not appear in the generated link.
|
|
646
|
+
*
|
|
647
|
+
* Do <b>not</b> use "#Shell-home" to navigate to a specific homepage!
|
|
648
|
+
* A proper way for an application to generate a link to return to the home page of the Fiori launchpad is:
|
|
649
|
+
* <code>navigate( { target : { shellHash : "#" }})</code>
|
|
650
|
+
*
|
|
651
|
+
* @param {sap.ushell.services.Navigation.Target} oTarget The navigation target.
|
|
652
|
+
* @param {sap.ui.core.Component} [oComponent] A UI5 component, used to logically attach any related app state.
|
|
653
|
+
* @returns {Promise} A Promise resolving once the navigation was triggered. The Promise might never reject or resolve
|
|
654
|
+
* when an error occurs during the navigation.
|
|
655
|
+
*
|
|
656
|
+
* @since 1.119.0
|
|
657
|
+
* @public
|
|
658
|
+
*/
|
|
659
|
+
this.navigate = async function (oTarget, oComponent) {
|
|
660
|
+
try {
|
|
661
|
+
/**@type {sap.ushell.services.Navigation.Target} */
|
|
662
|
+
let oArgsClone = deepClone(oTarget); // clone to keep input unchanged and to avoid side effects
|
|
663
|
+
const bWriteHistory = oTarget.writeHistory;
|
|
664
|
+
|
|
665
|
+
this._processShellHashWithParams(oArgsClone);
|
|
666
|
+
const { intent, innerAppRoute } = this._extractInnerAppRoute(oArgsClone);
|
|
667
|
+
|
|
668
|
+
const AppLifeCycle = await Container.getServiceAsync("AppLifeCycle");
|
|
669
|
+
const ShellNavigation = await Container.getServiceAsync("ShellNavigation");
|
|
670
|
+
|
|
671
|
+
const oCurrentApplication = AppLifeCycle.getCurrentApplication();
|
|
672
|
+
const oIntent = await (oCurrentApplication && oCurrentApplication.getIntent());
|
|
673
|
+
|
|
674
|
+
// clone again because _extractInnerAppRoute might already changed the original structure
|
|
675
|
+
/**@type {sap.ushell.services.Navigation.Target} */
|
|
676
|
+
const oNavTarget = deepClone(oTarget);
|
|
677
|
+
this._checkIfAppNeedsToBeReloaded(oNavTarget, oCurrentApplication, oIntent, ShellNavigation.hashChanger);
|
|
678
|
+
await navigationUtils.addXAppStateFromParameterAsync(intent, "sap-xapp-state-data" /* parameter containing data */);
|
|
679
|
+
|
|
680
|
+
oArgsClone = this._getTargetWithCurrentSystem(intent, oComponent);
|
|
681
|
+
oArgsClone = await navigationUtils.injectStickyParametersAsync({
|
|
682
|
+
args: oArgsClone,
|
|
683
|
+
appLifeCycle: AppLifeCycleAi,
|
|
684
|
+
technicalParameters: TechnicalParameters,
|
|
685
|
+
type: ushellType
|
|
686
|
+
});
|
|
687
|
+
oArgsClone = this._amendTargetWithSapUshellEncTestParameter(oArgsClone);
|
|
688
|
+
|
|
689
|
+
delete oArgsClone.writeHistory;
|
|
690
|
+
|
|
691
|
+
oArgsClone = this._injectInnerAppRoute(oArgsClone, innerAppRoute);
|
|
692
|
+
|
|
693
|
+
await ShellNavigation.toExternal(oArgsClone, oComponent, bWriteHistory);
|
|
694
|
+
} catch (oError) {
|
|
695
|
+
Log.error("Navigation.navigate failed", oError, "sap.ushell.services.Navigation");
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Check if an external navigation without an inner-app route is triggered to the currently running app.
|
|
701
|
+
* This should cause the app to reload.
|
|
702
|
+
*
|
|
703
|
+
* @param {sap.ushell.services.Navigation.Target} oTarget A configuration object describing the navigation target.
|
|
704
|
+
* @param {object} [oApp] The application that is currently active. {@link sap.ushell.services.AppLifeCycle#getCurrentApplication}
|
|
705
|
+
* @param {object} [oAppIntent] The intent of the currently active application.
|
|
706
|
+
* @param {sap.ushell.services.ShellNavigationHashChanger} oHashChanger The shell navigation hash changer.
|
|
707
|
+
*
|
|
708
|
+
* @since 1.119.0
|
|
709
|
+
* @private
|
|
710
|
+
*/
|
|
711
|
+
this._checkIfAppNeedsToBeReloaded = function (oTarget, oApp, oAppIntent, oHashChanger) {
|
|
712
|
+
if (!oApp || !oAppIntent || !oTarget || !oTarget.target) {
|
|
713
|
+
return; // current application intent needs to be known and there needs to be a target
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (oTarget.target.shellHash) {
|
|
717
|
+
// convert shell hash in to semantic object and action form
|
|
718
|
+
const oHash = UrlParsing.parseShellHash(oTarget.target.shellHash) || {};
|
|
719
|
+
|
|
720
|
+
oTarget.target = {
|
|
721
|
+
semanticObject: oHash.semanticObject,
|
|
722
|
+
action: oHash.action,
|
|
723
|
+
contextRaw: oHash.contextRaw
|
|
724
|
+
};
|
|
725
|
+
oTarget.appSpecificRoute = oHash.appSpecificRoute;
|
|
726
|
+
oTarget.params = Object.assign({}, oTarget.params, oHash.params);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
if (oTarget.appSpecificRoute) {
|
|
730
|
+
return; // appSpecificRoute must be empty
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
if (oApp.applicationType !== "UI5") {
|
|
734
|
+
return; // must be a fiori application
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if (oTarget.target.semanticObject !== oAppIntent.semanticObject) {
|
|
738
|
+
return; // semanticObject must match
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
if (oTarget.target.action !== oAppIntent.action) {
|
|
742
|
+
return; // action must match
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Navigation parameter may not be inside an array and might not be strings
|
|
746
|
+
// So they have to be adjusted in order to be matched against the current parameters
|
|
747
|
+
const oTargetParameters = {};
|
|
748
|
+
if (oTarget.params) {
|
|
749
|
+
Object.keys(oTarget.params).forEach((sKey) => {
|
|
750
|
+
const vValue = oTarget.params[sKey];
|
|
751
|
+
const aValue = Array.isArray(vValue) ? vValue : [vValue];
|
|
752
|
+
oTargetParameters[sKey] = aValue.map((vInnerValue) => {
|
|
753
|
+
return vInnerValue.toString();
|
|
754
|
+
});
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (!oHashChanger.haveSameIntentParameters(oTargetParameters, oAppIntent.params)) {
|
|
759
|
+
return; // intent parameters must match
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
oHashChanger.setReloadApplication(true);
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* For a given semantic object, this method considers all actions associated with the semantic object and
|
|
767
|
+
* returns the one tagged as a "primaryAction".
|
|
768
|
+
* If no inbound tagged as "primaryAction" exists, then the intent of the first inbound
|
|
769
|
+
* (after sorting has been applied) matching the action "displayFactSheet".
|
|
770
|
+
*
|
|
771
|
+
* The primary intent is determined by querying {@link sap.ushell.services.Navigation#getLinks}
|
|
772
|
+
* with the given semantic object and optional parameter.
|
|
773
|
+
* Then the resulting list is filtered to the outcome that a single item remains.
|
|
774
|
+
*
|
|
775
|
+
* @param {string} sSemanticObject The semantic object.
|
|
776
|
+
* @param {sap.ushell.services.Navigation.LinkFilter} [oLinkFilter] A target filter.
|
|
777
|
+
* @returns {Promise<sap.ushell.services.Navigation.Link>} A promise resolving a link matching the 'primaryAction' tag.
|
|
778
|
+
*
|
|
779
|
+
* @since 1.119.0
|
|
780
|
+
* @public
|
|
781
|
+
*/
|
|
782
|
+
this.getPrimaryIntent = async function (sSemanticObject, oLinkFilter) {
|
|
783
|
+
const oQuery = {};
|
|
784
|
+
|
|
785
|
+
oQuery.tags = ["primaryAction"];
|
|
786
|
+
oQuery.semanticObject = sSemanticObject;
|
|
787
|
+
if (oLinkFilter) {
|
|
788
|
+
oQuery.params = oLinkFilter;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const aLinks = await this.getLinks(oQuery);
|
|
792
|
+
if (aLinks.length === 0) {
|
|
793
|
+
delete oQuery.tags;
|
|
794
|
+
oQuery.action = "displayFactSheet";
|
|
795
|
+
|
|
796
|
+
const aFactSheetLinks = await this.getLinks(oQuery);
|
|
797
|
+
|
|
798
|
+
// Priority given to intents with the action "displayFactSheet"
|
|
799
|
+
return aFactSheetLinks.length === 0 ? null : aFactSheetLinks.sort((oLink, oOtherLink) => {
|
|
800
|
+
const rgxDisplayFactSheetAction = /^#\w+-displayFactSheet(?:$|\?.)/;
|
|
801
|
+
|
|
802
|
+
if (oLink.intent === oOtherLink.intent) {
|
|
803
|
+
return 0;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
const bEitherIsFactSheetAction = rgxDisplayFactSheetAction.test(oLink.intent) ^ rgxDisplayFactSheetAction.test(oOtherLink.intent);
|
|
807
|
+
|
|
808
|
+
if (bEitherIsFactSheetAction) {
|
|
809
|
+
return rgxDisplayFactSheetAction.test(oLink.intent) ? -1 : 1;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
return oLink.intent < oOtherLink.intent ? -1 : 1;
|
|
813
|
+
})[0];
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// simple left-right-lexicographic order, based on intent
|
|
817
|
+
return aLinks.length === 0 ? null : aLinks.sort((oLink, oOtherLink) => {
|
|
818
|
+
if (oLink.intent === oOtherLink.intent) {
|
|
819
|
+
return 0;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
return oLink.intent < oOtherLink.intent ? -1 : 1;
|
|
823
|
+
})[0];
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Resolves the given filters to a list of links available to the user.
|
|
828
|
+
*
|
|
829
|
+
* @param {sap.ushell.services.Navigation.LinkFilter[]} [aLinkFilter=[]] A list of target filters.
|
|
830
|
+
* @returns {Promise<Array<sap.ushell.services.Navigation.Link[]>>} A promise that resolves an array with a list for each filter containing the matched links.
|
|
831
|
+
* <p>
|
|
832
|
+
* <b>Note:</b>
|
|
833
|
+
* The intent is in a <b>internal</b> format and cannot be directly put into a link tag.
|
|
834
|
+
* If you want to use it directly you have to transform it first into a href.
|
|
835
|
+
* <pre>
|
|
836
|
+
* const sHref = await NavigationService.getHref({ target: { shellHash: oLink.intent} }, oComponent);
|
|
837
|
+
* </pre>
|
|
838
|
+
* </p>
|
|
839
|
+
*
|
|
840
|
+
* @since 1.119.0
|
|
841
|
+
* @public
|
|
842
|
+
*/
|
|
843
|
+
this.getLinks = function (aLinkFilter = []) {
|
|
844
|
+
if (aLinkFilter.length === 0) {
|
|
845
|
+
aLinkFilter.push({});
|
|
846
|
+
}
|
|
847
|
+
return Promise.all(aLinkFilter.map(async (oArgs) => {
|
|
848
|
+
// ensure certain parameters are specified
|
|
849
|
+
let oArgsClone = deepExtend({}, oArgs);
|
|
850
|
+
oArgsClone.compactIntents = !!oArgsClone.compactIntents;
|
|
851
|
+
oArgsClone.action = oArgsClone.action || undefined;
|
|
852
|
+
oArgsClone.paramsOptions = navigationUtils.extractGetLinksParameterOptions(oArgsClone.params);
|
|
853
|
+
|
|
854
|
+
oArgsClone = await navigationUtils.injectStickyParametersAsync({
|
|
855
|
+
args: oArgsClone,
|
|
856
|
+
appLifeCycle: AppLifeCycleAi,
|
|
857
|
+
technicalParameters: TechnicalParameters,
|
|
858
|
+
type: ushellType
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
let oParameterDefinition;
|
|
862
|
+
if (oArgsClone.params) {
|
|
863
|
+
oParameterDefinition = navigationUtils.extractGetLinksParameterDefinition(oArgsClone.params);
|
|
864
|
+
} else {
|
|
865
|
+
oParameterDefinition = oArgsClone.params;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// propagate sap-system into parameters
|
|
869
|
+
let oParametersPlusSapSystem = this._getTargetWithCurrentSystem(
|
|
870
|
+
{ params: oParameterDefinition }, oArgsClone.ui5Component
|
|
871
|
+
).params;
|
|
872
|
+
|
|
873
|
+
oParametersPlusSapSystem = this._amendTargetWithSapUshellEncTestParameter({
|
|
874
|
+
params: oParametersPlusSapSystem
|
|
875
|
+
}).params;
|
|
876
|
+
if (oArgsClone.appStateKey) {
|
|
877
|
+
oParametersPlusSapSystem["sap-xapp-state"] = [oArgsClone.appStateKey];
|
|
878
|
+
delete oArgsClone.appStateKey;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
oArgsClone.params = oParametersPlusSapSystem;
|
|
882
|
+
|
|
883
|
+
const NavTargetResolution = await Container.getServiceAsync("NavTargetResolution");
|
|
884
|
+
|
|
885
|
+
return ushellUtils.promisify(NavTargetResolution.getLinks(oArgsClone));
|
|
886
|
+
}));
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Returns a list of semantic objects of the intents the current user can navigate to.
|
|
891
|
+
*
|
|
892
|
+
* @returns {Promise<string[]>} A promise that resolves with an array of strings representing the semantic objects
|
|
893
|
+
* of the intents the current user can navigate to, or rejects with an error message.
|
|
894
|
+
* The returned array will not contain duplicates.
|
|
895
|
+
* <p><b>Note:</b> the caller should not rely on the specific order the semantic objects appear in the returned array.</p>
|
|
896
|
+
*
|
|
897
|
+
* @since 1.119.0
|
|
898
|
+
* @public
|
|
899
|
+
*/
|
|
900
|
+
this.getSemanticObjects = async function () {
|
|
901
|
+
const NavTargetResolution = await Container.getServiceAsync("NavTargetResolution");
|
|
902
|
+
|
|
903
|
+
return ushellUtils.promisify(NavTargetResolution.getDistinctSemanticObjects());
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Calculates whether the given navigation targets are supported for the given parameters, form factor etc. .
|
|
908
|
+
* "Supported" means that a valid navigation target is configured for the user and for the given device.
|
|
909
|
+
*
|
|
910
|
+
* <code>isNavigationSupported</code> is a test function for {@link sap.ushell.services.Navigation#navigate}
|
|
911
|
+
* and {@link sap.ushell.services.Navigation#getHref}.
|
|
912
|
+
*
|
|
913
|
+
* Example usage:
|
|
914
|
+
* <pre>
|
|
915
|
+
* const aResult = await oNavigationService.isNavigationSupported([{
|
|
916
|
+
* target: { shellHash: "SalesOrder-approve?SOId=1234" }
|
|
917
|
+
* }])
|
|
918
|
+
* if (aResult[0].supported===true){
|
|
919
|
+
* // enable link
|
|
920
|
+
* }
|
|
921
|
+
* else {
|
|
922
|
+
* // disable link
|
|
923
|
+
* }
|
|
924
|
+
* </pre>
|
|
925
|
+
*
|
|
926
|
+
* @param {sap.ushell.services.Navigation.Target[]} aTargets A list of navigation targets to be checked.
|
|
927
|
+
* @param {sap.ui.core.Component} [oComponent] The root component of the application.
|
|
928
|
+
* @returns {Promise<{ supported: boolean }[]>} A promise that resolves to an array of objects indicating
|
|
929
|
+
* whether the intent is supported or not. Each object has a
|
|
930
|
+
* property <code>supported</code> of type <code>boolean</code>.
|
|
931
|
+
*
|
|
932
|
+
* @since 1.119.0
|
|
933
|
+
* @public
|
|
934
|
+
*/
|
|
935
|
+
this.isNavigationSupported = async function (aTargets, oComponent) {
|
|
936
|
+
const aClonedIntents = deepClone(aTargets)
|
|
937
|
+
.map((oIntent) => {
|
|
938
|
+
const { intent } = this._extractInnerAppRoute(oIntent);
|
|
939
|
+
return this._getTargetWithCurrentSystem(intent, oComponent); // returns only shallow clone
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
const NavTargetResolution = await Container.getServiceAsync("NavTargetResolution");
|
|
943
|
+
|
|
944
|
+
return ushellUtils.promisify(NavTargetResolution.isNavigationSupported(aClonedIntents));
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Tells whether the given URL is supported for the current User.
|
|
949
|
+
*
|
|
950
|
+
* A URL is either supported if it is an intent and a target for the user exists or
|
|
951
|
+
* if it not recognized as a Fiori intent of the same launchpad:
|
|
952
|
+
* Examples for URLs qualified as "supported", e.g.:
|
|
953
|
+
* * a non-fiori url, e.g. <code>www.sap.com</code> <code>http://mycorp.com/sap/its/webgui</code>
|
|
954
|
+
* * a hash not recognized as an intent <code>#someotherhash</code>
|
|
955
|
+
* * a Fiori URL pointing to a different launchpad
|
|
956
|
+
*
|
|
957
|
+
* <pre>
|
|
958
|
+
* "https://www.sap.com" -> true, not rejected
|
|
959
|
+
* "#NotAFioriHash" -> true, not rejected
|
|
960
|
+
* "#PurchaseOrder-approve?POId=1899" -> true (if application is assigned to user)
|
|
961
|
+
* "#SystemSettings-change?par=critical_par" -> false (assuming application is not assigned to user)
|
|
962
|
+
* "https://some.other.system/Fiori#PurchaseOrder-approve?POId=1899" -> true, not rejected
|
|
963
|
+
* </pre>
|
|
964
|
+
*
|
|
965
|
+
* Note that this only disqualifies intents for the same Launchpad.
|
|
966
|
+
* It does not validate whether a URL is valid in general.
|
|
967
|
+
*
|
|
968
|
+
* @param {string} sUrl URL to test
|
|
969
|
+
* @returns {Promise} A promise which is resolved if the URL
|
|
970
|
+
* is supported and rejected if not. The promise does not return parameters.
|
|
971
|
+
*
|
|
972
|
+
* @since 1.119.0
|
|
973
|
+
* @private
|
|
974
|
+
*/
|
|
975
|
+
this.isUrlSupported = async function (sUrl) {
|
|
976
|
+
if (typeof sUrl !== "string") {
|
|
977
|
+
return Promise.reject();
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if (UrlParsing.isIntentUrl(sUrl)) {
|
|
981
|
+
const sHash = UrlParsing.getHash(sUrl);
|
|
982
|
+
const oTarget = {
|
|
983
|
+
target: {
|
|
984
|
+
shellHash: sHash
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
const oResult = await this.isNavigationSupported([oTarget]);
|
|
988
|
+
if (!oResult[0].supported) {
|
|
989
|
+
return Promise.reject();
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Resolves a given navigation intent (if valid) and returns the respective component instance for further processing.
|
|
996
|
+
*
|
|
997
|
+
* @param {string} sIntent Semantic object and action as a string with a "#" as prefix
|
|
998
|
+
* @param {object} [oComponentData={}] The componentData relevant for this component.
|
|
999
|
+
* <b>Note:</b> Please don't pass <code>startupParameters</code>, <code>config</code>
|
|
1000
|
+
* and <code>["sap-xapp-state"]</code>
|
|
1001
|
+
* @param {sap.ui.core.Component} [oOwnerComponent] If specified, the created component will be called within the context of the oOwnerComponent
|
|
1002
|
+
* (via oOwnerComponent.runAsOwner(fn))
|
|
1003
|
+
* @returns {Promise<sap.ui.core.Component>} A promise resolving the component instance.
|
|
1004
|
+
*
|
|
1005
|
+
* @since 1.119.0
|
|
1006
|
+
* @private
|
|
1007
|
+
* @ui5-restricted unified inbox
|
|
1008
|
+
*/
|
|
1009
|
+
this.createComponentInstance = async function (sIntent, oComponentData, oOwnerComponent) {
|
|
1010
|
+
const Ui5ComponentLoader = await Container.getServiceAsync("Ui5ComponentLoader");
|
|
1011
|
+
|
|
1012
|
+
let oModifiedComponentData = await this.createComponentInstantiationData(sIntent, oComponentData);
|
|
1013
|
+
oModifiedComponentData = await Ui5ComponentLoader.modifyComponentProperties(oModifiedComponentData, UI5ComponentType.Application);
|
|
1014
|
+
|
|
1015
|
+
async function createComponent (oAppProperties) {
|
|
1016
|
+
try {
|
|
1017
|
+
oAppProperties.loadDefaultDependencies = false;
|
|
1018
|
+
const oAppPropertiesWithComponentHandle = await Ui5ComponentLoader.instantiateComponent(oAppProperties);
|
|
1019
|
+
return oAppPropertiesWithComponentHandle.componentHandle.getInstance();
|
|
1020
|
+
} catch (oError) {
|
|
1021
|
+
Log.error(`Cannot create UI5 component: ${oError.toString()}`, oError.stack, "sap.ushell.services.Navigation");
|
|
1022
|
+
return Promise.reject(oError);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (oOwnerComponent) {
|
|
1027
|
+
return new Promise((resolve, reject) => {
|
|
1028
|
+
oOwnerComponent.runAsOwner(function () {
|
|
1029
|
+
createComponent(oModifiedComponentData)
|
|
1030
|
+
.then(resolve)
|
|
1031
|
+
.catch(reject);
|
|
1032
|
+
});
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
return createComponent(oModifiedComponentData);
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Resolves a given navigation intent (if valid) and returns the respective component data only for further processing.
|
|
1041
|
+
*
|
|
1042
|
+
* @param {string} sIntent Semantic object and action as a string with a "#" as prefix
|
|
1043
|
+
* @param {object} [oComponentData] The componentData relevant for this component.
|
|
1044
|
+
* <b>Note:</b> Please don't pass <code>startupParameters</code>, <code>config</code>
|
|
1045
|
+
* and <code>["sap-xapp-state"]</code>
|
|
1046
|
+
* @returns {Promise<object>} A promise resolving the instantiation data for the component.
|
|
1047
|
+
*
|
|
1048
|
+
* @since 1.119.0
|
|
1049
|
+
* @private
|
|
1050
|
+
* @ui5-restricted unified inbox
|
|
1051
|
+
*/
|
|
1052
|
+
this.createComponentInstantiationData = async function (sIntent, oComponentData) {
|
|
1053
|
+
const oConfig = {
|
|
1054
|
+
componentData: oComponentData
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1057
|
+
if (oConfig.componentData) {
|
|
1058
|
+
// cleanup componentData
|
|
1059
|
+
delete oConfig.componentData.startupParameters;
|
|
1060
|
+
delete oConfig.componentData.config;
|
|
1061
|
+
delete oConfig.componentData["sap-xapp-state"];
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
const sCanonicalIntent = UrlParsing.constructShellHash(UrlParsing.parseShellHash(sIntent));
|
|
1065
|
+
if (!sCanonicalIntent) {
|
|
1066
|
+
return Promise.reject("Navigation intent invalid!");
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
const NavTargetResolution = await Container.getServiceAsync("NavTargetResolution");
|
|
1070
|
+
|
|
1071
|
+
const oResolvedHashFragment = await NavTargetResolution.resolveHashFragment("#" + sCanonicalIntent);
|
|
1072
|
+
|
|
1073
|
+
function finalizeResult (oResultNew) {
|
|
1074
|
+
oResultNew = deepExtend({}, oResultNew, oConfig);
|
|
1075
|
+
|
|
1076
|
+
if (!oResultNew.ui5ComponentName) {
|
|
1077
|
+
if (oResultNew.additionalInformation) {
|
|
1078
|
+
oResultNew.ui5ComponentName = oResultNew.additionalInformation.replace(/^SAPUI5\.Component=/, "");
|
|
1079
|
+
} else if (oResultNew.name) {
|
|
1080
|
+
oResultNew.ui5ComponentName = oResultNew.name;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
return oResultNew;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
async function createComponentData (oResolvedHashFragment) {
|
|
1088
|
+
try {
|
|
1089
|
+
const Ui5ComponentLoader = await Container.getServiceAsync("Ui5ComponentLoader");
|
|
1090
|
+
|
|
1091
|
+
oResolvedHashFragment = finalizeResult(oResolvedHashFragment);
|
|
1092
|
+
oResolvedHashFragment.loadDefaultDependencies = false;
|
|
1093
|
+
return Ui5ComponentLoader.createComponentData(oResolvedHashFragment);
|
|
1094
|
+
} catch (oError) {
|
|
1095
|
+
Log.error("Cannot get UI5 component data: " + oError, oError.stack, "sap.ushell.services.CrossApplicationNavigation");
|
|
1096
|
+
return Promise.reject(oError);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// if my-inbox is running in cFLP inside an iframe, we need to
|
|
1101
|
+
// call app index to get the app info so it can be created embedded inside my-inbox.
|
|
1102
|
+
if (oResolvedHashFragment.applicationType === ApplicationType.URL.type &&
|
|
1103
|
+
oResolvedHashFragment.appCapabilities &&
|
|
1104
|
+
oResolvedHashFragment.appCapabilities.appFrameworkId === "UI5" &&
|
|
1105
|
+
Container.inAppRuntime()) {
|
|
1106
|
+
// do not change the ["require"] to .require. This is to avoid
|
|
1107
|
+
// adding dependencies for non cFLP scenario.
|
|
1108
|
+
const [AppLifeCycleAgent] = await ushellUtils.requireAsync(["sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent"]);
|
|
1109
|
+
let oAppInfo = await AppLifeCycleAgent.getAppInfo(oResolvedHashFragment.appCapabilities.technicalAppComponentId);
|
|
1110
|
+
if (oAppInfo.hasOwnProperty("oResolvedHashFragment")) {
|
|
1111
|
+
oAppInfo = oAppInfo.oResolvedHashFragment;
|
|
1112
|
+
}
|
|
1113
|
+
oAppInfo = finalizeResult(oAppInfo);
|
|
1114
|
+
if (oAppInfo.url && sIntent.indexOf("?") > 0) {
|
|
1115
|
+
oAppInfo.url += "?" + sIntent.split("?")[1];
|
|
1116
|
+
}
|
|
1117
|
+
// Create the component data and resolve the promise
|
|
1118
|
+
return createComponentData({
|
|
1119
|
+
ui5ComponentName: oResolvedHashFragment.appCapabilities.technicalAppComponentId,
|
|
1120
|
+
applicationDependencies: oAppInfo,
|
|
1121
|
+
url: oAppInfo.url
|
|
1122
|
+
});
|
|
1123
|
+
} else if (oResolvedHashFragment.applicationType !== ApplicationType.URL.type && !(/^SAPUI5\.Component=/.test(oResolvedHashFragment.additionalInformation))) {
|
|
1124
|
+
// If the application type equals "URL" and additionalInformation is undefined,
|
|
1125
|
+
// the promise will be rejected if additionalInformation is not checked for existence.
|
|
1126
|
+
return Promise.reject("The resolved target mapping is not of type UI5 component.");
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// Create the component data and resolve the promise
|
|
1130
|
+
return createComponentData(oResolvedHashFragment);
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Creates an empty app state object which acts as a parameter container for navigation.
|
|
1135
|
+
*
|
|
1136
|
+
* @param {sap.ui.core.Component} oAppComponent A UI5 component used as context for the app state.
|
|
1137
|
+
* @param {boolean} bTransientEnforced If set to <code>true</code> the appstate is not persisted on the backend. If set to
|
|
1138
|
+
* <code>false</code> or <code>undefined</code> the persistency location is determined by the global ushell configuration.
|
|
1139
|
+
* @param {string} sPersistencyMethod See sap/ushell/services/appstate/AppStatePersistencyMethod for possible values.
|
|
1140
|
+
* Support depends on the used platform.
|
|
1141
|
+
* @param {object} oPersistencySettings Persistency settings.
|
|
1142
|
+
* @returns {Promise<object>} A Promise resolving the app state container.
|
|
1143
|
+
*
|
|
1144
|
+
* @since 1.119.0
|
|
1145
|
+
* @private
|
|
1146
|
+
* @ui5-restricted SAP-internally public, must not be changed. Not part of public documentation.
|
|
1147
|
+
*/
|
|
1148
|
+
this.createEmptyAppState = async function (oAppComponent, bTransientEnforced, sPersistencyMethod, oPersistencySettings) {
|
|
1149
|
+
if (!BaseObject.isA(oAppComponent, "sap.ui.core.UIComponent")) {
|
|
1150
|
+
return Promise.reject("The passed oAppComponent must be a UI5 Component.");
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
const AppState = await Container.getServiceAsync("AppState");
|
|
1154
|
+
|
|
1155
|
+
return AppState.createEmptyAppState(oAppComponent, bTransientEnforced, sPersistencyMethod, oPersistencySettings);
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Get the app state object that was used for the current navigation
|
|
1160
|
+
*
|
|
1161
|
+
* @param {sap.ui.core.Component} oAppComponent - UI5 component, key will be extracted from component data.
|
|
1162
|
+
* @returns {Promise<object>} promise resolving the app state object.
|
|
1163
|
+
* Note that this is an unmodifiable container and its data must be copied into a writable container!
|
|
1164
|
+
* @since 1.119.0
|
|
1165
|
+
* @private
|
|
1166
|
+
* @ui5-restricted SAP-internally public, must not be changed. Not part of public documentation.
|
|
1167
|
+
*/
|
|
1168
|
+
this.getStartupAppState = function (oAppComponent) {
|
|
1169
|
+
this._checkComponent(oAppComponent);
|
|
1170
|
+
const sContainerKey = oAppComponent.getComponentData() && oAppComponent.getComponentData()["sap-xapp-state"] && oAppComponent.getComponentData()["sap-xapp-state"][0];
|
|
1171
|
+
return this.getAppState(oAppComponent, sContainerKey);
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Check that oAppComponent is of proper type.
|
|
1176
|
+
* Throws if not correct, returns undefined.
|
|
1177
|
+
*
|
|
1178
|
+
* @param {sap.ui.core.Component} oAppComponent application component
|
|
1179
|
+
*
|
|
1180
|
+
* @since 1.119.0
|
|
1181
|
+
* @private
|
|
1182
|
+
*/
|
|
1183
|
+
this._checkComponent = function (oAppComponent) {
|
|
1184
|
+
if (!BaseObject.isA(oAppComponent, "sap.ui.core.UIComponent")) {
|
|
1185
|
+
throw new Error("oComponent passed must be a UI5 Component");
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Get an app state object given a key.
|
|
1191
|
+
* A lookup for a cross user app state will be performed.
|
|
1192
|
+
*
|
|
1193
|
+
* @param {sap.ui.core.Component} oAppComponent UI5 component, key will be extracted from component data
|
|
1194
|
+
* @param {object} sAppStateKey the application state key.
|
|
1195
|
+
* @returns {Promise<object>} promise resolving the app state object.
|
|
1196
|
+
* <b>Note:</b> that this is an unmodifiable container and its data must be copied into a writable container!
|
|
1197
|
+
*
|
|
1198
|
+
* @since 1.119.0
|
|
1199
|
+
* @private
|
|
1200
|
+
* @ui5-restricted SAP-internally public, must not be changed. Not part of public documentation.
|
|
1201
|
+
*/
|
|
1202
|
+
this.getAppState = async function (oAppComponent, sAppStateKey) {
|
|
1203
|
+
// see stakeholders in SFIN etc.
|
|
1204
|
+
this._checkComponent(oAppComponent);
|
|
1205
|
+
|
|
1206
|
+
const AppState = await Container.getServiceAsync("AppState");
|
|
1207
|
+
|
|
1208
|
+
if (typeof sAppStateKey !== "string") {
|
|
1209
|
+
if (sAppStateKey !== undefined) {
|
|
1210
|
+
Log.error("Illegal Argument sAppStateKey ");
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
return AppState.createEmptyUnmodifiableAppState(oAppComponent);
|
|
1214
|
+
}
|
|
1215
|
+
return ushellUtils.promisify(AppState.getAppState(sAppStateKey));
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Get data of an AppStates data given a key.
|
|
1220
|
+
* A lookup for a cross user app state will be performed.
|
|
1221
|
+
* @param {string[]} aAppStateKeys Aa array of AppState see below.
|
|
1222
|
+
* @returns {Promise<object[]>} A promise resolving the list of AppState data.
|
|
1223
|
+
* Defaults empty object when the APpState could not be retrieved.
|
|
1224
|
+
*
|
|
1225
|
+
* This is interface exposed to platforms who need a serializable form of the application state data
|
|
1226
|
+
*
|
|
1227
|
+
* @since 1.119.0
|
|
1228
|
+
* @private
|
|
1229
|
+
* @ui5-restricted SAP-internally public, must not be changed. Not part of public documentation. (exposure to WebDynpro ABAP)
|
|
1230
|
+
*/
|
|
1231
|
+
this.getAppStateData = async function (aAppStateKeys) {
|
|
1232
|
+
const AppState = await Container.getServiceAsync("AppState");
|
|
1233
|
+
|
|
1234
|
+
return Promise.all(aAppStateKeys.map((sAppStateKey) => {
|
|
1235
|
+
if (typeof sAppStateKey !== "string") {
|
|
1236
|
+
if (sAppStateKey !== undefined) {
|
|
1237
|
+
Log.error("Illegal Argument sAppStateKey ");
|
|
1238
|
+
}
|
|
1239
|
+
return Promise.resolve({}); // default to empty object
|
|
1240
|
+
}
|
|
1241
|
+
return ushellUtils.promisify(AppState.getAppState(sAppStateKey))
|
|
1242
|
+
.then((oAppState) => {
|
|
1243
|
+
return oAppState.getData();
|
|
1244
|
+
})
|
|
1245
|
+
.catch(() => {
|
|
1246
|
+
return {}; // default to empty object
|
|
1247
|
+
});
|
|
1248
|
+
}));
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* persist multiple app states (in future potentially batched in a single roundtrip)
|
|
1253
|
+
*
|
|
1254
|
+
* @param {object[]} aAppStates Array of application States
|
|
1255
|
+
* @returns {Promise} A Promise,
|
|
1256
|
+
* in case of success an array of individual save promise objects is returned as argument
|
|
1257
|
+
* in case of a reject, individual responses are not available
|
|
1258
|
+
*
|
|
1259
|
+
* @since 1.119.0
|
|
1260
|
+
* @private
|
|
1261
|
+
* @ui5-restricted SAP-internally public, must not be changed. Not part of public documentation. (exposure to WebDynpro ABAP)
|
|
1262
|
+
*/
|
|
1263
|
+
this.saveAppStates = function (aAppStates) {
|
|
1264
|
+
const aPromises = aAppStates.map((oAppState) => {
|
|
1265
|
+
return ushellUtils.promisify(oAppState.save());
|
|
1266
|
+
});
|
|
1267
|
+
|
|
1268
|
+
return Promise.all(aPromises);
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Apply <code>params</code> to onto <code>shellHash</code> when feature flag <code>processParams</code> is set to true.
|
|
1273
|
+
* Parameters already set by the shellHash are ignored.
|
|
1274
|
+
* The processing happens in place.
|
|
1275
|
+
*
|
|
1276
|
+
* @param {sap.ushell.services.Navigation.Target} [oTarget] The navigation target to process
|
|
1277
|
+
*
|
|
1278
|
+
* @since 1.119.0
|
|
1279
|
+
* @private
|
|
1280
|
+
*/
|
|
1281
|
+
this._processShellHashWithParams = function (oTarget) {
|
|
1282
|
+
if (isPlainObject(oTarget)) {
|
|
1283
|
+
const bEnabled = !!oTarget.processParams;
|
|
1284
|
+
const sShellHash = ObjectPath.get("target.shellHash", oTarget);
|
|
1285
|
+
const oParams = oTarget.params;
|
|
1286
|
+
if (bEnabled && sShellHash && isPlainObject(oParams)) {
|
|
1287
|
+
const oHash = UrlParsing.parseShellHash(sShellHash);
|
|
1288
|
+
|
|
1289
|
+
oTarget.target = {
|
|
1290
|
+
semanticObject: oHash.semanticObject,
|
|
1291
|
+
action: oHash.action,
|
|
1292
|
+
contextRaw: oHash.contextRaw
|
|
1293
|
+
};
|
|
1294
|
+
oTarget.appSpecificRoute = oHash.appSpecificRoute;
|
|
1295
|
+
oTarget.params = Object.assign({}, oParams, oHash.params);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* Method to get an array of sap.ushell.services.AppStatePersistencyMethod.
|
|
1302
|
+
*
|
|
1303
|
+
* @returns {Promise<sap.ushell.services.AppStatePersistencyMethod[]>} Returns an array of sap.ushell.services.AppStatePersistencyMethod.
|
|
1304
|
+
* An empty array indicates that the platform does not support persistent states
|
|
1305
|
+
*
|
|
1306
|
+
* @since 1.119.0
|
|
1307
|
+
* @private
|
|
1308
|
+
*/
|
|
1309
|
+
this.getSupportedAppStatePersistencyMethods = async function () {
|
|
1310
|
+
const AppState = await Container.getServiceAsync("AppState");
|
|
1311
|
+
|
|
1312
|
+
return AppState.getSupportedPersistencyMethods();
|
|
1313
|
+
};
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* Method to set or modify the AppState's persistency method of a state identified by key
|
|
1317
|
+
*
|
|
1318
|
+
* @param {string} sKey the AppState key
|
|
1319
|
+
* @param {int} iPersistencyMethod The chosen persistency method
|
|
1320
|
+
* @param {object} oPersistencySettings The additional settings PersistencySettings
|
|
1321
|
+
*
|
|
1322
|
+
* @returns {Promise<string>} A promise resolving a new key
|
|
1323
|
+
*
|
|
1324
|
+
* @since 1.119.0
|
|
1325
|
+
* @private
|
|
1326
|
+
*/
|
|
1327
|
+
this.updateAppStatePersistencyMethodAndSave = async function (sKey, iPersistencyMethod, oPersistencySettings) {
|
|
1328
|
+
const AppState = await Container.getServiceAsync("AppState");
|
|
1329
|
+
|
|
1330
|
+
return ushellUtils.promisify(AppState.makeStatePersistent(sKey, iPersistencyMethod, oPersistencySettings));
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Resolves the URL hash fragment.
|
|
1335
|
+
* This function gets the hash part of the URL and returns the URL of the target application.
|
|
1336
|
+
*
|
|
1337
|
+
* @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>)!
|
|
1338
|
+
* Example: <code>#SemanticObject-action?P1=V1&P2=A%20B%20C</code>
|
|
1339
|
+
* @returns {Promise<{ url: string }>} A Promise resolving the intent.
|
|
1340
|
+
*
|
|
1341
|
+
* @since 1.119.0
|
|
1342
|
+
* @protected
|
|
1343
|
+
*/
|
|
1344
|
+
this.resolveIntent = async function (sHashFragment) {
|
|
1345
|
+
const NavTargetResolution = await Container.getServiceAsync("NavTargetResolution");
|
|
1346
|
+
|
|
1347
|
+
return ushellUtils.promisify(NavTargetResolution.resolveHashFragment(sHashFragment))
|
|
1348
|
+
.then((oResolvedHashFragment) => {
|
|
1349
|
+
return { url: oResolvedHashFragment.url };
|
|
1350
|
+
});
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
Navigation.hasNoAdapter = true;
|
|
1355
|
+
return Navigation;
|
|
1356
|
+
});
|