@sapui5/sap.ushell 1.121.1 → 1.122.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 +2 -2
- package/src/main/js/sap/ushell/.library +1 -1
- package/src/main/js/sap/ushell/CanvasShapesManager.js +5 -3
- package/src/main/js/sap/ushell/Container.js +14 -0
- package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
- package/src/main/js/sap/ushell/Fiori20AdapterTest.js +1 -1
- package/src/main/js/sap/ushell/Layout.js +1 -1
- package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
- package/src/main/js/sap/ushell/SessionHandler.js +14 -9
- package/src/main/js/sap/ushell/TechnicalParameters.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.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 +1 -1
- 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/util/AppForInbound.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +1 -1
- 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 +1 -1
- package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +8 -185
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionInternalAdapter.js +198 -0
- package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +6 -5
- package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +5 -4
- package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/FlpLaunchPageAdapter.js +27 -22
- package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +7 -193
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionInternalAdapter.js +205 -0
- package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +1 -1
- 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 -1
- package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
- package/src/main/js/sap/ushell/api/workpage/Designtime.js +24 -4
- package/src/main/js/sap/ushell/api/workpage/Runtime.js +45 -7
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +6 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/AppLifeCycleUtils.js +4 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/Renderer.js +17 -49
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/Component.js +13 -18
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/Component.js +24 -36
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +2 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/services/CrossApplicationNavigation.js +4 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolution.js +4 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolutionInternal.js +113 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Navigation.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigation.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigationInternal.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm.constants.js +1 -1
- 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 +3 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.read.ushell.config.from.url.js +2 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.util.js +17 -2
- package/src/main/js/sap/ushell/bootstrap/sandbox2/sandboxConfig.json +12 -3
- package/src/main/js/sap/ushell/bootstrap/sandbox2.js +54 -22
- package/src/main/js/sap/ushell/components/CatalogsManager.js +31 -11
- package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
- package/src/main/js/sap/ushell/components/HomepageManager.js +5 -3
- package/src/main/js/sap/ushell/components/appfinder/AppFinder.controller.js +2 -2
- package/src/main/js/sap/ushell/components/appfinder/Catalog.controller.js +1 -1
- package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +3 -4
- package/src/main/js/sap/ushell/components/appfinder/Component.js +5 -2
- package/src/main/js/sap/ushell/components/appfinder/HierarchyAppsView.js +3 -3
- package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -13
- package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +64 -8
- package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +67 -83
- 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 +1 -1
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/AdvancedFormatters.js +3 -3
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/appendStyleVars.js +3 -3
- package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/categories/Event.js +3 -3
- package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +4 -4
- package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +12 -5
- 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 +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/resources/resources.properties +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchBox.fragment.xml +3 -1
- package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
- package/src/main/js/sap/ushell/components/factsheet/factory/ThingInspector.js +37 -37
- package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.controller.js +2 -2
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +2 -2
- package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +2 -2
- package/src/main/js/sap/ushell/components/homepage/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/pages/ActionMode.js +1 -1
- 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/controller/PageRuntime.controller.js +1 -1
- package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
- 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/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 +1 -1
- 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 +525 -613
- package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.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 +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
- 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 -1
- package/src/main/js/sap/ushell/components/shell/Settings/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/appearance/Appearance.controller.js +4 -4
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/UserDefaultsEntry.js +3 -5
- 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/indicatorTileUtils/indicatorTileHelper.js +18 -18
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +1 -1
- package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +1 -1
- 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 +2 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +3 -3
- package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
- package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
- package/src/main/js/sap/ushell/library.js +9 -1
- package/src/main/js/sap/ushell/navigationMode.js +3 -3
- package/src/main/js/sap/ushell/performance/FesrEnhancer.js +33 -4
- package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
- package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
- package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
- package/src/main/js/sap/ushell/plugins/rta-personalize/Component.js +6 -254
- package/src/main/js/sap/ushell/plugins/rta-personalize/manifest.json +0 -102
- package/src/main/js/sap/ushell/renderer/AccessKeysHandler.js +0 -8
- package/src/main/js/sap/ushell/renderer/Renderer.js +2 -2
- package/src/main/js/sap/ushell/renderer/Shell.controller.js +7 -7
- package/src/main/js/sap/ushell/renderer/Shell.view.js +2 -10
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.controller.js +10 -11
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.view.xml +49 -70
- package/src/main/js/sap/ushell/renderer/resources/resources.properties +0 -2
- package/src/main/js/sap/ushell/renderer/search/searchComponent/manifest.json +1 -1
- package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +1 -1
- package/src/main/js/sap/ushell/services/AppLifeCycle.js +1 -1
- package/src/main/js/sap/ushell/services/AppState.js +1 -1
- package/src/main/js/sap/ushell/services/Bookmark.js +2 -2
- package/src/main/js/sap/ushell/services/BookmarkV2.js +2 -2
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +3 -3
- package/src/main/js/sap/ushell/services/CommonDataModel.js +3 -5
- package/src/main/js/sap/ushell/services/Configuration.js +1 -1
- package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +1 -1
- package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
- package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +20 -20
- package/src/main/js/sap/ushell/services/DarkModeSupport.js +3 -3
- package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/Footer.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/Header.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/Item.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/SidePane.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/ToolArea.js +1 -1
- package/src/main/js/sap/ushell/services/Extension.js +1 -1
- package/src/main/js/sap/ushell/services/FlpLaunchPage.js +1 -1
- package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
- package/src/main/js/sap/ushell/services/Menu.js +1 -1
- package/src/main/js/sap/ushell/services/Message.js +1 -1
- package/src/main/js/sap/ushell/services/MessageBroker.js +1 -1
- package/src/main/js/sap/ushell/services/NavTargetResolution.js +24 -995
- package/src/main/js/sap/ushell/services/NavTargetResolutionInternal.js +1272 -0
- package/src/main/js/sap/ushell/services/Navigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/Navigation.js +11 -11
- package/src/main/js/sap/ushell/services/NavigationDataProvider.js +1 -1
- package/src/main/js/sap/ushell/services/Notifications.js +0 -14
- package/src/main/js/sap/ushell/services/NotificationsV2.js +10 -34
- package/src/main/js/sap/ushell/services/PageBuilding.js +1 -1
- package/src/main/js/sap/ushell/services/PagePersistence.js +1 -1
- package/src/main/js/sap/ushell/services/PageReferencing.js +1 -1
- package/src/main/js/sap/ushell/services/Pages.js +1 -1
- package/src/main/js/sap/ushell/services/Personalization.js +1 -1
- package/src/main/js/sap/ushell/services/PersonalizationV2.js +1 -1
- package/src/main/js/sap/ushell/services/PluginManager.js +2 -2
- package/src/main/js/sap/ushell/services/ReferenceResolver.js +1 -1
- package/src/main/js/sap/ushell/services/Search.js +1 -1
- package/src/main/js/sap/ushell/services/SearchCEP.js +1 -1
- package/src/main/js/sap/ushell/services/SearchableContent.js +2 -2
- package/src/main/js/sap/ushell/services/ShellNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/ShellNavigationHashChanger.js +1 -1
- package/src/main/js/sap/ushell/services/ShellNavigationInternal.js +3 -2
- package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/SpaceContent.js +1 -1
- package/src/main/js/sap/ushell/services/UITracer.js +5 -5
- package/src/main/js/sap/ushell/services/URLParsing.js +2 -2
- package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
- package/src/main/js/sap/ushell/services/URLTemplate.js +1 -1
- package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +1 -1
- package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +1 -1
- package/src/main/js/sap/ushell/services/UserDefaultParameters.js +1 -1
- package/src/main/js/sap/ushell/services/UserInfo.js +1 -1
- package/src/main/js/sap/ushell/services/UserRecents.js +1 -1
- package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +1 -1
- package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +1 -1
- 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 +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
- 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 +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
- package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
- package/src/main/js/sap/ushell/services/_CommonDataModel/vizTypeDefaults/VizTypeDefaults.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 +1 -1
- package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
- package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +4 -4
- package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
- 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/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
- package/src/main/js/sap/ushell/themes/base/Catalog.less +12 -2
- package/src/main/js/sap/ushell/themes/base/SearchCEP.less +1 -1
- package/src/main/js/sap/ushell/themes/base/ShellAppTitle.less +15 -57
- package/src/main/js/sap/ushell/themes/base/WorkPageCell.less +0 -1
- package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-icon_120x120.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-retina_180x180.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-icon_152x152.png +0 -0
- package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-retina_167x167.png +0 -0
- package/src/main/js/sap/ushell/themes/sap_belize/ShellHeader.less +11 -36
- package/src/main/js/sap/ushell/themes/sap_fiori_3/ShellHeader.less +9 -31
- package/src/main/js/sap/ushell/themes/sap_fiori_3_dark/ShellHeader.less +9 -32
- package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +11 -39
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +11 -39
- package/src/main/js/sap/ushell/ui/appfinder/AppBox.js +3 -136
- package/src/main/js/sap/ushell/ui/appfinder/AppBoxInternal.js +161 -0
- package/src/main/js/sap/ushell/ui/appfinder/AppBoxRenderer.js +6 -0
- package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
- package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.controller.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/CatalogEntryContainer.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/Section.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/TileContainer.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/VizInstanceLaunchPage.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +7 -9
- package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -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/utils/UrlShortening.js +2 -2
- package/src/main/js/sap/ushell/utils/workpage/WorkPageHost.js +366 -0
- package/src/main/js/sap/ushell/utils/workpage/WorkPageService.js +1 -1
- package/src/main/js/sap/ushell/utils/workpage/WorkPageVizInstantiation.js +5 -2
- package/src/main/js/sap/ushell/utils/workpage/resources/resources.properties +157 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ar.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_bg.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ca.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_cs.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_cy.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_da.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_de.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_el.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_en.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_GB.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_sappsd.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saprigi.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saptrc.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_es.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_es_MX.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_et.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_fi.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr_CA.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_hi.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_hr.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_hu.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_id.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_it.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_iw.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ja.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_kk.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ko.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_lt.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_lv.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ms.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_nl.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_no.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_pl.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt_PT.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ro.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_ru.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_sh.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_sk.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_sl.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_sv.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_th.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_tr.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_uk.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_vi.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_CN.properties +78 -0
- package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_TW.properties +78 -0
- package/src/main/js/sap/ushell/utils.js +2 -2
- package/src/test/js/sap/ushell/bootstrap/sandbox.js +70 -60
- package/ui5.yaml +30 -2
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +0 -350
- package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n.properties +0 -38
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
// Copyright (c) 2009-2023 SAP SE, All Rights Reserved
|
|
2
2
|
|
|
3
3
|
sap.ui.define([
|
|
4
|
-
"sap/ui/Device",
|
|
5
|
-
"sap/ui/core/Element",
|
|
6
|
-
"sap/ushell/utils",
|
|
7
|
-
"sap/ushell/resources",
|
|
8
|
-
"sap/m/Text",
|
|
9
|
-
"sap/m/VBox",
|
|
10
|
-
"sap/m/CustomListItem",
|
|
11
|
-
"sap/ui/thirdparty/jquery",
|
|
12
|
-
"sap/ui/events/KeyCodes",
|
|
13
4
|
"sap/base/Log",
|
|
14
|
-
"sap/
|
|
15
|
-
"sap/m/MessageToast",
|
|
5
|
+
"sap/m/CustomListItem",
|
|
16
6
|
"sap/m/library",
|
|
7
|
+
"sap/m/MessageToast",
|
|
8
|
+
"sap/m/Text",
|
|
9
|
+
"sap/m/VBox",
|
|
10
|
+
"sap/ui/core/Element",
|
|
17
11
|
"sap/ui/core/library",
|
|
18
|
-
"sap/ui/core/mvc/Controller"
|
|
12
|
+
"sap/ui/core/mvc/Controller",
|
|
13
|
+
"sap/ui/Device",
|
|
14
|
+
"sap/ui/model/json/JSONModel",
|
|
15
|
+
"sap/ui/thirdparty/jquery",
|
|
16
|
+
"sap/ushell/Container",
|
|
17
|
+
"sap/ushell/resources",
|
|
18
|
+
"sap/ushell/utils"
|
|
19
19
|
], function (
|
|
20
|
-
Device,
|
|
21
|
-
Element,
|
|
22
|
-
utils,
|
|
23
|
-
resources,
|
|
24
|
-
Text,
|
|
25
|
-
VBox,
|
|
26
|
-
CustomListItem,
|
|
27
|
-
jQuery,
|
|
28
|
-
KeyCodes,
|
|
29
20
|
Log,
|
|
30
|
-
|
|
31
|
-
MessageToast,
|
|
21
|
+
CustomListItem,
|
|
32
22
|
mobileLibrary,
|
|
23
|
+
MessageToast,
|
|
24
|
+
Text,
|
|
25
|
+
VBox,
|
|
26
|
+
Element,
|
|
33
27
|
coreLibrary,
|
|
34
|
-
Controller
|
|
28
|
+
Controller,
|
|
29
|
+
Device,
|
|
30
|
+
JSONModel,
|
|
31
|
+
jQuery,
|
|
32
|
+
Container,
|
|
33
|
+
resources,
|
|
34
|
+
utils
|
|
35
35
|
) {
|
|
36
36
|
"use strict";
|
|
37
37
|
|
|
38
38
|
// shortcut for sap.ui.core.Priority
|
|
39
|
-
|
|
39
|
+
const Priority = coreLibrary.Priority;
|
|
40
40
|
|
|
41
41
|
// shortcut for sap.m.ListType
|
|
42
|
-
|
|
42
|
+
const ListType = mobileLibrary.ListType;
|
|
43
43
|
|
|
44
44
|
// shortcut for sap.m.FlexAlignItems
|
|
45
|
-
|
|
45
|
+
const FlexAlignItems = mobileLibrary.FlexAlignItems;
|
|
46
46
|
|
|
47
|
-
function _errorMessage (sText) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
47
|
+
async function _errorMessage (sText) {
|
|
48
|
+
const oMessageService = await Container.getServiceAsync("Message");
|
|
49
|
+
oMessageService.error(sText);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
Controller.extend("sap.ushell.components.shell.Notifications.Notifications", {
|
|
@@ -70,20 +69,20 @@ sap.ui.define([
|
|
|
70
69
|
* 3. Sets the first data buffer to the model
|
|
71
70
|
*/
|
|
72
71
|
onInit: function () {
|
|
73
|
-
|
|
72
|
+
const oInitialModelStructure = {};
|
|
74
73
|
|
|
75
74
|
if (Device.system.desktop) {
|
|
76
75
|
this.iMaxNotificationItemsForDevice = this.oPagingConfiguration.MAX_NOTIFICATION_ITEMS_DESKTOP;
|
|
77
76
|
} else {
|
|
78
77
|
this.iMaxNotificationItemsForDevice = this.oPagingConfiguration.MAX_NOTIFICATION_ITEMS_MOBILE;
|
|
79
78
|
}
|
|
79
|
+
const oView = this.getView();
|
|
80
80
|
|
|
81
81
|
// Container.getService use is allowed here. The service is already loaded by the notification component.
|
|
82
|
-
this.oNotificationsService =
|
|
82
|
+
this.oNotificationsService = oView.getViewData().notificationsService;
|
|
83
83
|
this.oSortingType = this.oNotificationsService.getOperationEnum();
|
|
84
84
|
|
|
85
85
|
oInitialModelStructure[this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING] = this.getInitialSortingModelStructure();
|
|
86
|
-
oInitialModelStructure[this.oSortingType.NOTIFICATIONS_BY_DATE_ASCENDING] = this.getInitialSortingModelStructure();
|
|
87
86
|
oInitialModelStructure[this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING] = this.getInitialSortingModelStructure();
|
|
88
87
|
oInitialModelStructure[this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING] = {};
|
|
89
88
|
|
|
@@ -93,12 +92,12 @@ sap.ui.define([
|
|
|
93
92
|
// For byType sorting: keeps the currently expended group/Notification type
|
|
94
93
|
this.sCurrentExpandedType = undefined;
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
const oModel = new JSONModel(oInitialModelStructure);
|
|
97
96
|
oModel.setSizeLimit(1500);
|
|
98
97
|
// Initializing the model with a branch for each sorting type
|
|
99
|
-
|
|
98
|
+
oView.setModel(oModel);
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
oView.setModel(resources.i18nModel, "i18n");
|
|
102
101
|
|
|
103
102
|
// Get the first buffer of notification items, byDate (descending)
|
|
104
103
|
this.getNextBuffer();
|
|
@@ -109,9 +108,9 @@ sap.ui.define([
|
|
|
109
108
|
onAfterRendering: function () {
|
|
110
109
|
this.removeTabIndexFromList(this.sCurrentSorting);
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
const oView = this.getView();
|
|
112
|
+
const oTabBarHeader = oView.byId("notificationIconTabBar--header");
|
|
113
113
|
if (oTabBarHeader) {
|
|
114
|
-
// TODO: remove this workaround when BCP 1970336135 is resolved
|
|
115
114
|
oTabBarHeader.getDomRef().classList.remove("sapContrastPlus"); // "sapContrastPlus" class is not removed with "removeStyleClass()" or "toggleStyleClass()"
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -121,18 +120,20 @@ sap.ui.define([
|
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
oView.$("-sapUshellNotificationIconTabByDate-text")
|
|
125
124
|
.attr("aria-label", resources.i18n.getText("Notifications.ByDateDescending.AriaLabel"));
|
|
126
|
-
|
|
125
|
+
oView.$("-sapUshellNotificationIconTabByType-text")
|
|
127
126
|
.attr("aria-label", resources.i18n.getText("Notifications.ByType.AriaLabel"));
|
|
128
|
-
|
|
127
|
+
oView.$("-sapUshellNotificationIconTabByPrio-text")
|
|
129
128
|
.attr("aria-label", resources.i18n.getText("Notifications.ByPriority.AriaLabel"));
|
|
130
129
|
},
|
|
131
130
|
|
|
132
131
|
// check if the get next buffer should fetch more notifications
|
|
133
132
|
shouldFetchMoreNotifications: function () {
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
const oView = this.getView();
|
|
134
|
+
const oModel = oView.getModel();
|
|
135
|
+
const bHasMoreItemsInBackend = oModel.getProperty(`/${this.sCurrentSorting}/hasMoreItemsInBackend`);
|
|
136
|
+
const bListMaxReached = oModel.getProperty(`/${this.sCurrentSorting}/listMaxReached`);
|
|
136
137
|
return bHasMoreItemsInBackend && !bListMaxReached;
|
|
137
138
|
},
|
|
138
139
|
|
|
@@ -140,19 +141,18 @@ sap.ui.define([
|
|
|
140
141
|
* Gets a buffer of notification items from notification service, according to the current sorting type
|
|
141
142
|
*/
|
|
142
143
|
getNextBuffer: function () {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
iNumberOfItemsToFetch;
|
|
144
|
+
const oView = this.getView();
|
|
145
|
+
const oModel = oView.getModel();
|
|
146
|
+
const aCurrentItems = this.getItemsFromModel(this.sCurrentSorting);
|
|
147
|
+
let iNumberOfItemsInModel;
|
|
148
148
|
|
|
149
149
|
if (!this.shouldFetchMoreNotifications()) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
iNumberOfItemsToFetch = this.getNumberOfItemsToFetchOnScroll(sCurrentSorting);
|
|
153
|
+
const iNumberOfItemsToFetch = this.getNumberOfItemsToFetchOnScroll(this.sCurrentSorting);
|
|
154
154
|
if (iNumberOfItemsToFetch === 0) {
|
|
155
|
-
|
|
155
|
+
oModel.setProperty(`/${this.sCurrentSorting}/hasMoreItems`, false);
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -161,62 +161,56 @@ sap.ui.define([
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
if (iNumberOfItemsInModel === 0) {
|
|
164
|
-
this.addBusyIndicatorToTabFilter(sCurrentSorting);
|
|
164
|
+
this.addBusyIndicatorToTabFilter(this.sCurrentSorting);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
oModel.setProperty(`/${this.sCurrentSorting}/inUpdate`, true);
|
|
168
168
|
|
|
169
169
|
// Fetch a buffer of notification items from notification service
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
}.bind(this));
|
|
170
|
+
this.oNotificationsService.getNotificationsBufferBySortingType(this.sCurrentSorting, iNumberOfItemsInModel, iNumberOfItemsToFetch)
|
|
171
|
+
.then((oResult) => {
|
|
172
|
+
const dNotificationsUserSettingsAvailability = this.oNotificationsService._getNotificationSettingsAvailability();
|
|
173
|
+
if (dNotificationsUserSettingsAvailability.state() === "pending") {
|
|
174
|
+
this.oNotificationsService._userSettingInitialization();
|
|
175
|
+
}
|
|
176
|
+
this.addBufferToModel(this.sCurrentSorting, oResult);
|
|
177
|
+
})
|
|
178
|
+
.catch((/*oResult*/) => {
|
|
179
|
+
if (iNumberOfItemsInModel === 0) {
|
|
180
|
+
this.removeBusyIndicatorToTabFilter(this.sCurrentSorting);
|
|
181
|
+
_errorMessage(resources.i18n.getText("errorOccurredMsg"));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
186
184
|
},
|
|
187
185
|
|
|
188
186
|
/**
|
|
189
187
|
* Gets a buffer of notification items of specific type from notification service
|
|
190
188
|
*/
|
|
191
189
|
getNextBufferForType: function () {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
190
|
+
const oView = this.getView();
|
|
191
|
+
const oModel = oView.getModel();
|
|
192
|
+
const selectedTypeId = this.sCurrentExpandedType;
|
|
193
|
+
const sSortingType = this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING;
|
|
194
|
+
const oGroup = this.getGroupFromModel(selectedTypeId);
|
|
195
|
+
const aCurrentItems = oGroup ? oGroup.aNotifications : undefined;
|
|
196
|
+
const iNumberOfItemsInModel = aCurrentItems && aCurrentItems.length || 0;
|
|
197
|
+
const bHasMoreItems = oGroup ? oGroup.hasMoreItems : true;
|
|
199
198
|
|
|
200
199
|
// If there are no more notification items (in the backend) for this sorting type - then return
|
|
201
200
|
if (!bHasMoreItems) {
|
|
202
201
|
return;
|
|
203
202
|
}
|
|
204
|
-
if (aCurrentItems !== undefined) {
|
|
205
|
-
iNumberOfItemsInModel = aCurrentItems.length;
|
|
206
|
-
}
|
|
207
203
|
|
|
208
|
-
|
|
204
|
+
oModel.setProperty(`/${sSortingType}/inUpdate`, true);
|
|
209
205
|
|
|
210
206
|
// Fetch a buffer of notification items from notification service
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
this.getNextBufferFailHandler(sSortingType);
|
|
219
|
-
}.bind(this));
|
|
207
|
+
this.oNotificationsService.getNotificationsBufferInGroup(selectedTypeId, iNumberOfItemsInModel, this.iMaxNotificationItemsForDevice)
|
|
208
|
+
.then((oResult) => {
|
|
209
|
+
this.addTypeBufferToModel(selectedTypeId, oResult, false);
|
|
210
|
+
})
|
|
211
|
+
.catch((/*oResult*/) => {
|
|
212
|
+
this.getNextBufferFailHandler(sSortingType);
|
|
213
|
+
});
|
|
220
214
|
},
|
|
221
215
|
|
|
222
216
|
/**
|
|
@@ -229,33 +223,33 @@ sap.ui.define([
|
|
|
229
223
|
* @param {object} oResult The data (notification items) to insert to the model
|
|
230
224
|
*/
|
|
231
225
|
addBufferToModel: function (sSortingType, oResult) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
226
|
+
const oView = this.getView();
|
|
227
|
+
const oModel = oView.getModel();
|
|
228
|
+
const aCurrentItems = this.getItemsFromModel(sSortingType);
|
|
229
|
+
const bHasMoreItems = oResult.length >= this.getNumberOfItemsToFetchOnScroll(sSortingType);
|
|
236
230
|
|
|
237
231
|
this._oTopNotificationData = undefined;
|
|
238
232
|
|
|
239
233
|
if (!oResult) {
|
|
240
|
-
|
|
234
|
+
oModel.setProperty(`/${sSortingType}/hasMoreItemsInBackend`, false);
|
|
241
235
|
return;
|
|
242
236
|
}
|
|
243
237
|
|
|
244
238
|
// If the number of returned items is smaller than the number that was requested -
|
|
245
239
|
// it means that there is no more data (i.e. notification items) in the backend that needs to be fetched for this sorting type
|
|
246
240
|
|
|
247
|
-
|
|
241
|
+
oModel.setProperty(`/${sSortingType}/hasMoreItemsInBackend`, bHasMoreItems);
|
|
248
242
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (
|
|
243
|
+
const aMergedArrays = aCurrentItems.concat(oResult);
|
|
244
|
+
oModel.setProperty(`/${sSortingType}/aNotifications`, aMergedArrays);
|
|
245
|
+
oModel.setProperty(`/${sSortingType}/inUpdate`, false);
|
|
246
|
+
if (aMergedArrays.length >= this.iMaxNotificationItemsForDevice) {
|
|
253
247
|
this.handleMaxReached(sSortingType);
|
|
254
248
|
}
|
|
255
249
|
|
|
256
250
|
// If this is the first time that items are fetched for this tab\sorting type (no old items) -
|
|
257
251
|
// then the busy indicator was rendered and now needs to be removed
|
|
258
|
-
if (
|
|
252
|
+
if (aCurrentItems.length === 0) {
|
|
259
253
|
this.removeBusyIndicatorToTabFilter(sSortingType);
|
|
260
254
|
}
|
|
261
255
|
},
|
|
@@ -270,10 +264,11 @@ sap.ui.define([
|
|
|
270
264
|
* @param {boolean} bOverwrite Overwrite the current buffer
|
|
271
265
|
*/
|
|
272
266
|
addTypeBufferToModel: function (sTypeId, oResult, bOverwrite) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
267
|
+
const oView = this.getView();
|
|
268
|
+
const oModel = oView.getModel();
|
|
269
|
+
const oGroup = this.getGroupFromModel(sTypeId);
|
|
270
|
+
const oGroupIndexInModel = this.getGroupIndexFromModel(sTypeId);
|
|
271
|
+
const aGroupHeaders = oModel.getProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`);
|
|
277
272
|
|
|
278
273
|
if (!oResult) {
|
|
279
274
|
return;
|
|
@@ -287,32 +282,12 @@ sap.ui.define([
|
|
|
287
282
|
if (!oGroup.aNotifications || bOverwrite) {
|
|
288
283
|
oGroup.aNotifications = [];
|
|
289
284
|
}
|
|
290
|
-
|
|
291
|
-
aGroupHeaders[oGroupIndexInModel].aNotifications =
|
|
285
|
+
const aMergedArrays = oGroup.aNotifications.concat(oResult);
|
|
286
|
+
aGroupHeaders[oGroupIndexInModel].aNotifications = aMergedArrays;
|
|
292
287
|
aGroupHeaders[oGroupIndexInModel].Busy = false;
|
|
293
288
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
keydownHandler: function (keyup) {
|
|
299
|
-
var jqElement,
|
|
300
|
-
nextElem,
|
|
301
|
-
closeBtn;
|
|
302
|
-
|
|
303
|
-
if (keyup.keyCode === KeyCodes.DELETE) {
|
|
304
|
-
jqElement = jQuery(document.activeElement);
|
|
305
|
-
if (jqElement.hasClass("sapUshellNotificationsListItem")) {
|
|
306
|
-
nextElem = jqElement.next();
|
|
307
|
-
closeBtn = jqElement.find(".sapMNLB-CloseButton")[0];
|
|
308
|
-
Element.getElementById(closeBtn.id).firePress();
|
|
309
|
-
|
|
310
|
-
// set focus on the next list item.
|
|
311
|
-
if (nextElem) {
|
|
312
|
-
nextElem.focus();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
289
|
+
oModel.setProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`, aGroupHeaders);
|
|
290
|
+
oModel.setProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}/inUpdate`, false);
|
|
316
291
|
},
|
|
317
292
|
|
|
318
293
|
/**
|
|
@@ -323,57 +298,54 @@ sap.ui.define([
|
|
|
323
298
|
* - Gets the updated notifications array and sets the model accordingly
|
|
324
299
|
*/
|
|
325
300
|
notificationsUpdateCallback: function () {
|
|
326
|
-
|
|
327
|
-
sCurrentSorting = this.sCurrentSorting,
|
|
328
|
-
aCurrentItems,
|
|
329
|
-
iNumberOfItemsInModel,
|
|
330
|
-
iNumberOfItemsToFetch;
|
|
331
|
-
|
|
332
|
-
if (sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING) {
|
|
301
|
+
if (this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING) {
|
|
333
302
|
this.notificationsUpdateCallbackForType();
|
|
334
303
|
return;
|
|
335
304
|
}
|
|
336
305
|
|
|
337
|
-
aCurrentItems = this.getItemsFromModel(sCurrentSorting);
|
|
338
|
-
|
|
339
|
-
iNumberOfItemsInModel = aCurrentItems.length;
|
|
340
|
-
}
|
|
306
|
+
const aCurrentItems = this.getItemsFromModel(this.sCurrentSorting);
|
|
307
|
+
const iNumberOfItemsInModel = aCurrentItems && aCurrentItems.length;
|
|
341
308
|
|
|
342
309
|
// On update, only the current tab/sorting should maintain its previous data,
|
|
343
310
|
// while other tabs (i.e. the model branch) should be emptied
|
|
344
311
|
this.cleanModel();
|
|
345
312
|
|
|
346
|
-
iNumberOfItemsToFetch = this.getNumberOfItemsToFetchOnUpdate(iNumberOfItemsInModel);
|
|
313
|
+
const iNumberOfItemsToFetch = this.getNumberOfItemsToFetchOnUpdate(iNumberOfItemsInModel);
|
|
347
314
|
|
|
348
|
-
this.oNotificationsService.getNotificationsBufferBySortingType(sCurrentSorting, 0, iNumberOfItemsToFetch)
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
315
|
+
this.oNotificationsService.getNotificationsBufferBySortingType(this.sCurrentSorting, 0, iNumberOfItemsToFetch)
|
|
316
|
+
.then((aNotifications) => {
|
|
317
|
+
if (!aNotifications) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
352
320
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
321
|
+
// Updating the model with the updated array of notification objects
|
|
322
|
+
this.replaceItemsInModel(this.sCurrentSorting, aNotifications, iNumberOfItemsToFetch);
|
|
323
|
+
})
|
|
324
|
+
.catch((data) => {
|
|
325
|
+
Log.error("Notifications control - call to notificationsService.getNotificationsBufferBySortingType failed: ",
|
|
326
|
+
data,
|
|
327
|
+
"sap.ushell.components.shell.Notifications.Notifications");
|
|
328
|
+
});
|
|
360
329
|
},
|
|
361
330
|
|
|
362
331
|
isMoreCircleExist: function (sSortingType) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
332
|
+
const oSelectedList = this.getNotificationList(sSortingType);
|
|
333
|
+
const aSelectedItems = oSelectedList.getItems();
|
|
334
|
+
const iItemsLength = aSelectedItems.length;
|
|
335
|
+
const oLastItem = aSelectedItems[iItemsLength - 1];
|
|
366
336
|
return !!iItemsLength && oLastItem.getMetadata().getName() === "sap.m.CustomListItem";
|
|
367
337
|
},
|
|
368
338
|
|
|
369
339
|
handleMaxReached: function (sSortingType) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
340
|
+
const oSelectedList = this.getNotificationList(sSortingType);
|
|
341
|
+
const iNotificationCount = Math.floor(this.oNotificationsService.getNotificationsCount());
|
|
342
|
+
const iMoreNotificationsNumber = iNotificationCount - this.iMaxNotificationItemsForDevice;
|
|
343
|
+
const bIsMoreCircleExist = this.isMoreCircleExist(sSortingType);
|
|
344
|
+
const oView = this.getView();
|
|
345
|
+
const oModel = oView.getModel();
|
|
346
|
+
|
|
347
|
+
oModel.setProperty(`/${this.sCurrentSorting}/moreNotificationCount`, iMoreNotificationsNumber);
|
|
348
|
+
oModel.setProperty(`/${this.sCurrentSorting}/listMaxReached`, iMoreNotificationsNumber >= 0);
|
|
377
349
|
if (iMoreNotificationsNumber > 0 && !bIsMoreCircleExist) {
|
|
378
350
|
oSelectedList.addItem(this.getMoreCircle(this.sCurrentSorting));
|
|
379
351
|
} else if (iMoreNotificationsNumber <= 0 && bIsMoreCircleExist) {
|
|
@@ -382,22 +354,24 @@ sap.ui.define([
|
|
|
382
354
|
},
|
|
383
355
|
|
|
384
356
|
reAddFailedGroup: function (oGroupToAdd) {
|
|
385
|
-
|
|
386
|
-
|
|
357
|
+
const oView = this.getView();
|
|
358
|
+
const oModel = oView.getModel();
|
|
359
|
+
const aGroups = oModel.getProperty("/notificationsByTypeDescending");
|
|
387
360
|
|
|
388
361
|
aGroups.splice(oGroupToAdd.removedGroupIndex, 0, oGroupToAdd.oGroup);
|
|
389
362
|
oModel.setProperty("/notificationsByTypeDescending", aGroups);
|
|
390
363
|
},
|
|
391
364
|
|
|
392
365
|
removeGroupFromModel: function (oGroupToDelete) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
366
|
+
const oView = this.getView();
|
|
367
|
+
const oModel = oView.getModel();
|
|
368
|
+
const aGroups = oModel.getProperty("/notificationsByTypeDescending");
|
|
369
|
+
const oRemovedGroup = {
|
|
370
|
+
oGroup: oGroupToDelete,
|
|
371
|
+
removedGroupIndex: undefined
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
aGroups.some((oGroup, iIndex) => {
|
|
401
375
|
if (oGroup.Id === oGroupToDelete.Id) {
|
|
402
376
|
oRemovedGroup.removedGroupIndex = iIndex;
|
|
403
377
|
aGroups.splice(iIndex, 1);
|
|
@@ -411,81 +385,80 @@ sap.ui.define([
|
|
|
411
385
|
},
|
|
412
386
|
|
|
413
387
|
updateGroupHeaders: function () {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
388
|
+
const oView = this.getView();
|
|
389
|
+
const oModel = oView.getModel();
|
|
390
|
+
const aGroups = oModel.getProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`);
|
|
391
|
+
this.oNotificationsService.getNotificationsGroupHeaders()
|
|
392
|
+
.then((notificationsByType) => {
|
|
393
|
+
const aTypes = JSON.parse(notificationsByType).value;
|
|
394
|
+
aTypes.forEach((item) => {
|
|
395
|
+
let bFound = false;
|
|
396
|
+
aGroups.forEach((group, iIndex) => {
|
|
397
|
+
if (group.Id === item.Id) {
|
|
398
|
+
aGroups[iIndex].GroupHeaderText = item.GroupHeaderText;
|
|
399
|
+
aGroups[iIndex].CreatedAt = item.CreatedAt;
|
|
400
|
+
bFound = true;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
if (!bFound) {
|
|
404
|
+
aGroups.unshift(item);
|
|
431
405
|
}
|
|
432
406
|
});
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
407
|
+
oModel.setProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`, aGroups);
|
|
408
|
+
})
|
|
409
|
+
.catch((data) => {
|
|
410
|
+
Log.error("Notifications control - call to notificationsService.updateGroupHeaders failed: ", data, "sap.ushell.components.shell.Notifications.Notifications");
|
|
436
411
|
});
|
|
437
|
-
that.getView().getModel().setProperty("/" + that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING, aGroups);
|
|
438
|
-
});
|
|
439
412
|
},
|
|
440
413
|
|
|
441
414
|
updateNotificationsByDate: function () {
|
|
442
|
-
|
|
415
|
+
const iTop = this.getNumberOfItemsToFetchOnScroll(this.sCurrentSorting);
|
|
443
416
|
|
|
444
417
|
this.oNotificationsService.getNotificationsBufferBySortingType(this.sCurrentSorting, 0, iTop)
|
|
445
|
-
.then(
|
|
446
|
-
this.getView()
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
418
|
+
.then((aNotifications) => {
|
|
419
|
+
const oView = this.getView();
|
|
420
|
+
const oModel = oView.getModel();
|
|
421
|
+
oModel.setProperty(`/${this.sCurrentSorting}/aNotifications`, aNotifications);
|
|
422
|
+
})
|
|
423
|
+
.catch((error) => {
|
|
450
424
|
Log.error("Notifications control - call to notificationsService.getNotificationsBufferBySortingType failed: ", error, "sap.ushell.components.shell.Notifications.Notifications");
|
|
425
|
+
})
|
|
426
|
+
.finally(() => {
|
|
451
427
|
this.removeBusyIndicatorToTabFilter(this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING);
|
|
452
|
-
}
|
|
428
|
+
});
|
|
453
429
|
},
|
|
454
430
|
|
|
455
431
|
reloadGroupHeaders: function () {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
432
|
+
this.oNotificationsService.getNotificationsGroupHeaders()
|
|
433
|
+
.then((notificationsByType) => {
|
|
434
|
+
const oView = this.getView();
|
|
435
|
+
const oModel = oView.getModel();
|
|
436
|
+
const aTypes = JSON.parse(notificationsByType).value;
|
|
437
|
+
const aResult = aTypes.filter((item) => {
|
|
438
|
+
if (item.IsGroupHeader) {
|
|
439
|
+
item.Collapsed = true;
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
return false;
|
|
443
|
+
});
|
|
444
|
+
oModel.setProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`, aResult);
|
|
445
|
+
})
|
|
446
|
+
.catch((data) => {
|
|
447
|
+
Log.error("Notifications control - call to notificationsService.getNotificationsGroupHeaders failed: ", data, "sap.ushell.components.shell.Notifications.Notifications");
|
|
448
|
+
})
|
|
449
|
+
.finally(() => {
|
|
450
|
+
this.removeBusyIndicatorToTabFilter(this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
|
|
471
451
|
});
|
|
472
|
-
that.getView().getModel().setProperty("/" + that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING, result);
|
|
473
|
-
that.removeBusyIndicatorToTabFilter(that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
|
|
474
|
-
});
|
|
475
452
|
},
|
|
476
453
|
|
|
477
454
|
markRead: function (sNotificationId) {
|
|
478
|
-
|
|
479
|
-
that = this;
|
|
480
|
-
oPromise.catch(function () {
|
|
455
|
+
this.oNotificationsService.markRead(sNotificationId).catch(() => {
|
|
481
456
|
_errorMessage(resources.i18n.getText("notificationsFailedMarkRead"));
|
|
482
|
-
|
|
457
|
+
this.setMarkReadOnModel(sNotificationId, false);
|
|
483
458
|
});
|
|
484
459
|
this.setMarkReadOnModel(sNotificationId, true);
|
|
485
460
|
},
|
|
486
461
|
|
|
487
|
-
onExit: function () { },
|
|
488
|
-
|
|
489
462
|
onBeforeRendering: function () {
|
|
490
463
|
if (!this._bDependencyCallbackRegistered) { // register once: the service registration is primitive and does not remove duplicates
|
|
491
464
|
this._bDependencyCallbackRegistered = true;
|
|
@@ -501,93 +474,87 @@ sap.ui.define([
|
|
|
501
474
|
},
|
|
502
475
|
|
|
503
476
|
executeBulkAction: function (sActionName, sActionText, oGroup, sPathToNotification) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
oPromise.catch(function (oResult) {
|
|
515
|
-
this.getView().getModel().setProperty(sPathToNotification + "/Busy", false);
|
|
516
|
-
|
|
517
|
-
if (oResult && oResult.succededNotifications && oResult.succededNotifications.length) {
|
|
518
|
-
oResult.succededNotifications.forEach(function (sNotificationId) {
|
|
519
|
-
this.removeNotificationFromModel(sNotificationId);
|
|
520
|
-
}.bind(this));
|
|
521
|
-
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
522
|
-
that.cleanModel();
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
if (oResult.succededNotifications.length === 1) {
|
|
526
|
-
sMessage = resources.i18n.getText("notificationsPartialSuccessExecuteBulkAction", [
|
|
527
|
-
sGroupActionText,
|
|
528
|
-
oResult.succededNotifications.length,
|
|
529
|
-
oResult.failedNotifications.length + oResult.succededNotifications.length,
|
|
530
|
-
sNotificationTypeDesc,
|
|
531
|
-
oResult.failedNotifications.length
|
|
477
|
+
const oThatGroup = oGroup;
|
|
478
|
+
let sMessage;
|
|
479
|
+
const oView = this.getView();
|
|
480
|
+
const oModel = oView.getModel();
|
|
481
|
+
const sNotificationTypeDesc = oModel.getProperty(`${sPathToNotification}/NotificationTypeDesc`) || oModel.getProperty(`${sPathToNotification}/NotificationTypeKey`);
|
|
482
|
+
|
|
483
|
+
return this.oNotificationsService.executeBulkAction(oGroup.Id, sActionName)
|
|
484
|
+
.then(() => {
|
|
485
|
+
sMessage = resources.i18n.getText("notificationsSuccessExecuteBulkAction", [
|
|
486
|
+
sActionText, sNotificationTypeDesc
|
|
532
487
|
]);
|
|
533
488
|
MessageToast.show(sMessage, { duration: 4000 });
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
489
|
+
this.removeGroupFromModel(oThatGroup);
|
|
490
|
+
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
491
|
+
this.cleanModel();
|
|
492
|
+
})
|
|
493
|
+
.catch((oResult) => {
|
|
494
|
+
oModel.setProperty(`${sPathToNotification}/Busy`, false);
|
|
495
|
+
|
|
496
|
+
if (oResult && oResult.succededNotifications && oResult.succededNotifications.length) {
|
|
497
|
+
oResult.succededNotifications.forEach((sNotificationId) => {
|
|
498
|
+
this.removeNotificationFromModel(sNotificationId);
|
|
499
|
+
});
|
|
500
|
+
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
501
|
+
this.cleanModel();
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
if (oResult.succededNotifications.length === 1) {
|
|
506
|
+
sMessage = resources.i18n.getText("notificationsPartialSuccessExecuteBulkAction", [
|
|
507
|
+
sActionText,
|
|
508
|
+
oResult.succededNotifications.length,
|
|
509
|
+
oResult.failedNotifications.length + oResult.succededNotifications.length,
|
|
510
|
+
sNotificationTypeDesc,
|
|
511
|
+
oResult.failedNotifications.length
|
|
512
|
+
]);
|
|
513
|
+
MessageToast.show(sMessage, { duration: 4000 });
|
|
514
|
+
} else if (oResult.succededNotifications.length > 1) {
|
|
515
|
+
sMessage = resources.i18n.getText("notificationsSingleSuccessExecuteBulkAction", [
|
|
516
|
+
sActionText,
|
|
517
|
+
oResult.succededNotifications.length,
|
|
518
|
+
oResult.failedNotifications.length + oResult.succededNotifications.length,
|
|
519
|
+
sNotificationTypeDesc,
|
|
520
|
+
oResult.failedNotifications.length
|
|
521
|
+
]);
|
|
522
|
+
MessageToast.show(sMessage, { duration: 4000 });
|
|
523
|
+
} else {
|
|
524
|
+
sMessage = resources.i18n.getText("notificationsFailedExecuteBulkAction");
|
|
525
|
+
_errorMessage(sMessage);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
558
528
|
},
|
|
559
529
|
|
|
560
530
|
dismissNotification: function (notificationId) {
|
|
561
531
|
// if the service call is successful, we will get the updated model from the service via the standard update.
|
|
562
532
|
// if the operation fails, the model won't be changed, so we just need to call "updateItems" on the list,
|
|
563
533
|
// since the model contains the dismissed notification.
|
|
564
|
-
|
|
565
|
-
oRemovedNotification = this.removeNotificationFromModel(notificationId),
|
|
566
|
-
oPromise = this.oNotificationsService.dismissNotification(notificationId);
|
|
534
|
+
const oRemovedNotification = this.removeNotificationFromModel(notificationId);
|
|
567
535
|
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
568
536
|
this.cleanModel();
|
|
569
|
-
|
|
537
|
+
this.oNotificationsService.dismissNotification(notificationId).catch(() => {
|
|
570
538
|
_errorMessage(resources.i18n.getText("notificationsFailedDismiss"));
|
|
571
|
-
|
|
539
|
+
this.addNotificationToModel(oRemovedNotification.obj, oRemovedNotification.index);
|
|
572
540
|
});
|
|
573
541
|
},
|
|
574
542
|
|
|
575
543
|
dismissBulkNotifications: function (oGroup) {
|
|
576
|
-
|
|
577
|
-
oPromise = this.oNotificationsService.dismissBulkNotifications(oGroup.Id);
|
|
544
|
+
const oRemovedGroup = this.removeGroupFromModel(oGroup);
|
|
578
545
|
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
579
546
|
this.cleanModel();
|
|
580
|
-
|
|
547
|
+
this.oNotificationsService.dismissBulkNotifications(oGroup.Id).catch(() => {
|
|
581
548
|
_errorMessage(resources.i18n.getText("notificationsFailedExecuteBulkAction"));
|
|
582
549
|
this.reAddFailedGroup(oRemovedGroup);
|
|
583
|
-
}
|
|
550
|
+
});
|
|
584
551
|
},
|
|
585
552
|
|
|
586
553
|
onListItemPress: function (sNotificationId, sSemanticObject, sAction, aParameters) {
|
|
587
554
|
if (sSemanticObject && sAction) {
|
|
588
|
-
|
|
589
|
-
if (
|
|
590
|
-
|
|
555
|
+
const oViewPortContainer = Element.getElementById("viewPortContainer");
|
|
556
|
+
if (oViewPortContainer) { // qUnits do not create the viewport container
|
|
557
|
+
oViewPortContainer.switchState("Center");
|
|
591
558
|
}
|
|
592
559
|
utils.toExternalWithParameters(sSemanticObject, sAction, aParameters);
|
|
593
560
|
}
|
|
@@ -598,54 +565,39 @@ sap.ui.define([
|
|
|
598
565
|
//******************************************* Scrolling ***************************************************
|
|
599
566
|
|
|
600
567
|
scrollToItem: function (oTopNotificationData) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
jqNotificationItem = jqNotificationItems[3],
|
|
606
|
-
itemHeight,
|
|
607
|
-
notificationIndex,
|
|
608
|
-
indexOffSet,
|
|
609
|
-
containerPadding,
|
|
610
|
-
notificationContainerOffSet;
|
|
568
|
+
const jqNotificationContainerContent = jQuery("#notificationIconTabBar-containerContent");
|
|
569
|
+
const jqNotificationsContent = jqNotificationContainerContent.children();
|
|
570
|
+
const jqNotificationsList = jqNotificationsContent.children();
|
|
571
|
+
const jqNotificationItem = jqNotificationContainerContent.find("li").eq(0);
|
|
611
572
|
|
|
612
573
|
if (jqNotificationContainerContent.length > 0
|
|
613
574
|
&& jqNotificationsContent.length > 0
|
|
614
575
|
&& jqNotificationsList.length > 0
|
|
615
576
|
&& jqNotificationItem.length > 0) {
|
|
616
|
-
itemHeight = jqNotificationItem.outerHeight(true) - window.parseInt(jqNotificationItem.css("margin-top").replace("px", ""));
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
indexOffSet = notificationIndex * itemHeight + window.parseInt(jqNotificationItem.css("margin-top").replace("px", ""));
|
|
577
|
+
const itemHeight = jqNotificationItem.outerHeight(true) - window.parseInt(jqNotificationItem.css("margin-top").replace("px", ""));
|
|
578
|
+
const iNotificationIndex = this.getIndexInModelByItemId(oTopNotificationData.topItemId) || 0;
|
|
579
|
+
const iOffset = iNotificationIndex * itemHeight + window.parseInt(jqNotificationItem.css("margin-top").replace("px", ""));
|
|
620
580
|
|
|
621
|
-
|
|
581
|
+
const iContainerPadding = window.parseInt(jqNotificationsContent.css("padding-top").replace("px", ""))
|
|
622
582
|
+ window.parseInt(jqNotificationsList.css("padding-top").replace("px", ""));
|
|
623
|
-
|
|
583
|
+
const iNotificationContainerOffset = jqNotificationContainerContent.offset().top;
|
|
624
584
|
|
|
625
|
-
jqNotificationContainerContent.scrollTop(
|
|
585
|
+
jqNotificationContainerContent.scrollTop(iOffset + iContainerPadding + iNotificationContainerOffset - oTopNotificationData.offSetTop);
|
|
626
586
|
}
|
|
627
587
|
this._oTopNotificationData = undefined;
|
|
628
588
|
},
|
|
629
589
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
return [jqNotificationContainerContent, jqNotificationsContent, jqNotificationsList, jqNotificationItem];
|
|
637
|
-
},
|
|
638
|
-
|
|
639
|
-
getTopOffSet: function () {
|
|
640
|
-
var topOffSet = 0,
|
|
641
|
-
jqContainerContent = this._getJqNotificationObjects()[0];
|
|
642
|
-
if (jqContainerContent.children().length > 0 && jqContainerContent.children().children().length > 0) {
|
|
590
|
+
getTopOffSet: function (jqNotificationContainerContent) {
|
|
591
|
+
let iTopOffset = 0;
|
|
592
|
+
const jqNotificationsContent = jqNotificationContainerContent.children();
|
|
593
|
+
const jqNotificationsList = jqNotificationsContent.children();
|
|
594
|
+
if (jqNotificationsContent.length > 0 && jqNotificationsList.length > 0) {
|
|
643
595
|
// Get the outer space/margin
|
|
644
|
-
|
|
596
|
+
iTopOffset += jqNotificationsContent.outerHeight() - jqNotificationsContent.height();
|
|
645
597
|
// Get the inner space/margin
|
|
646
|
-
|
|
598
|
+
iTopOffset += jqNotificationsList.outerHeight() - jqNotificationsList.height();
|
|
647
599
|
}
|
|
648
|
-
return
|
|
600
|
+
return iTopOffset;
|
|
649
601
|
},
|
|
650
602
|
|
|
651
603
|
/**
|
|
@@ -654,46 +606,37 @@ sap.ui.define([
|
|
|
654
606
|
*/
|
|
655
607
|
getTopItemOnTheScreen: function () {
|
|
656
608
|
// The notifications list control including top offset (until the tabs bar)
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
609
|
+
const jqNotificationContainerContent = jQuery("#notificationIconTabBar-containerContent");
|
|
610
|
+
const jqNotificationItems = jqNotificationContainerContent.find("li");
|
|
611
|
+
const iTopOffset = this.getTopOffSet(jqNotificationContainerContent);
|
|
612
|
+
let sItemId;
|
|
613
|
+
let itemOffsetTop = 0;
|
|
662
614
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
jqContainerContent.find("li").each(function () {
|
|
615
|
+
jqNotificationItems.each((index, item) => {
|
|
666
616
|
// The distance between the top of an item from the top of the screen
|
|
667
|
-
itemOffsetTop = jQuery(
|
|
617
|
+
itemOffsetTop = jQuery(item).offset().top;
|
|
668
618
|
// Check if this element is in the interested viewport, the first element whose itemOffsetTop is bigger then topOffSet -
|
|
669
619
|
// is the highest visible element in the list
|
|
670
|
-
if (itemOffsetTop >=
|
|
671
|
-
sItemId =
|
|
620
|
+
if (itemOffsetTop >= iTopOffset) {
|
|
621
|
+
sItemId = this.getItemNotificationId(item);
|
|
672
622
|
return false;
|
|
673
623
|
}
|
|
674
624
|
});
|
|
675
625
|
return { topItemId: sItemId, offSetTop: itemOffsetTop };
|
|
676
626
|
},
|
|
677
627
|
|
|
678
|
-
//*********************************************************************************************************
|
|
679
|
-
//***************************************** Error Handling ************************************************
|
|
680
|
-
|
|
681
|
-
handleError: function () {
|
|
682
|
-
_errorMessage(resources.i18n.getText("errorOccurredMsg"));
|
|
683
|
-
},
|
|
684
|
-
|
|
685
628
|
//*********************************************************************************************************
|
|
686
629
|
//****************************************** Busy Indicator ***********************************************
|
|
687
630
|
|
|
688
631
|
addBusyIndicatorToTabFilter: function (sSortingType) {
|
|
689
|
-
|
|
632
|
+
const oList = this.getNotificationList(sSortingType);
|
|
690
633
|
oList.setBusy(true);
|
|
691
634
|
// during the loading we don't need to show noData text, because the data is not still loaded
|
|
692
635
|
oList.setShowNoData(false);
|
|
693
636
|
},
|
|
694
637
|
|
|
695
638
|
removeBusyIndicatorToTabFilter: function (sSortingType) {
|
|
696
|
-
|
|
639
|
+
const oList = this.getNotificationList(sSortingType);
|
|
697
640
|
oList.setBusy(false);
|
|
698
641
|
oList.setShowNoData(true);
|
|
699
642
|
},
|
|
@@ -702,25 +645,23 @@ sap.ui.define([
|
|
|
702
645
|
//***************************************** Model functions ***********************************************
|
|
703
646
|
|
|
704
647
|
addNotificationToModel: function (oNotification, index) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
648
|
+
const oView = this.getView();
|
|
649
|
+
const oModel = oView.getModel();
|
|
650
|
+
const aNotifications = oModel.getProperty(`/${this.sCurrentSorting}/aNotifications`);
|
|
651
|
+
aNotifications.splice(index, 0, oNotification);
|
|
652
|
+
oModel.setProperty(`/${this.sCurrentSorting}/aNotifications`, aNotifications);
|
|
709
653
|
},
|
|
710
654
|
|
|
711
655
|
removeNotificationFromModel: function (notificationId) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
oRemovedNotification = {};
|
|
656
|
+
const oView = this.getView();
|
|
657
|
+
const oModel = oView.getModel();
|
|
658
|
+
let aNotifications;
|
|
659
|
+
const oRemovedNotification = {};
|
|
717
660
|
|
|
718
661
|
if (this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING ||
|
|
719
|
-
this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_DATE_ASCENDING ||
|
|
720
662
|
this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING) {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
notifications.some(function (notification, index, array) {
|
|
663
|
+
aNotifications = oModel.getProperty(`/${this.sCurrentSorting}/aNotifications`);
|
|
664
|
+
aNotifications.some((notification, index, array) => {
|
|
724
665
|
if (notification.Id && notification.Id === notificationId) {
|
|
725
666
|
oRemovedNotification.obj = array.splice(index, 1)[0];
|
|
726
667
|
oRemovedNotification.index = index;
|
|
@@ -728,18 +669,18 @@ sap.ui.define([
|
|
|
728
669
|
}
|
|
729
670
|
return false;
|
|
730
671
|
});
|
|
731
|
-
oModel.setProperty(
|
|
672
|
+
oModel.setProperty(`/${this.sCurrentSorting}/aNotifications`, aNotifications);
|
|
732
673
|
return oRemovedNotification;
|
|
733
674
|
}
|
|
734
675
|
|
|
735
|
-
aGroups = oModel.getProperty("/notificationsByTypeDescending");
|
|
736
|
-
for (
|
|
737
|
-
|
|
738
|
-
if (
|
|
739
|
-
if (
|
|
676
|
+
const aGroups = oModel.getProperty("/notificationsByTypeDescending");
|
|
677
|
+
for (let index = 0; index < aGroups.length; index++) {
|
|
678
|
+
aNotifications = aGroups[index].aNotifications;
|
|
679
|
+
if (aNotifications) {
|
|
680
|
+
if (aNotifications.length === 1 && aNotifications[0].Id === notificationId) {
|
|
740
681
|
aGroups.splice(index, 1);
|
|
741
682
|
} else {
|
|
742
|
-
|
|
683
|
+
aNotifications.some((notification, index, array) => {
|
|
743
684
|
if (notification.Id && notification.Id === notificationId) {
|
|
744
685
|
oRemovedNotification.obj = array.splice(index, 1)[0];
|
|
745
686
|
oRemovedNotification.index = index;
|
|
@@ -747,7 +688,7 @@ sap.ui.define([
|
|
|
747
688
|
}
|
|
748
689
|
return false;
|
|
749
690
|
});
|
|
750
|
-
aGroups[index].aNotifications =
|
|
691
|
+
aGroups[index].aNotifications = aNotifications;
|
|
751
692
|
}
|
|
752
693
|
}
|
|
753
694
|
}
|
|
@@ -763,18 +704,15 @@ sap.ui.define([
|
|
|
763
704
|
* @returns {int} the index of the notification item in the model
|
|
764
705
|
*/
|
|
765
706
|
getIndexInModelByItemId: function (sNotificationId) {
|
|
766
|
-
|
|
767
|
-
|
|
707
|
+
const oView = this.getView();
|
|
708
|
+
const oModel = oView.getModel();
|
|
709
|
+
const bByTypeDescending = this.notificationsByTypeDescending === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING;
|
|
710
|
+
const aNotifications = oModel.getProperty(`${bByTypeDescending ? this.sCurrentExpandedType : this.sCurrentSorting}/aNotifications`);
|
|
768
711
|
|
|
769
|
-
if (this.notificationsByTypeDescending === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING) {
|
|
770
|
-
aNotifications = this.getView().getModel().getProperty("/" + this.sCurrentExpandedType + "/aNotifications");
|
|
771
|
-
} else {
|
|
772
|
-
aNotifications = this.getView().getModel().getProperty("/" + this.sCurrentSorting + "/aNotifications");
|
|
773
|
-
}
|
|
774
712
|
if (aNotifications === undefined || aNotifications.length === 0) {
|
|
775
713
|
return 0;
|
|
776
714
|
}
|
|
777
|
-
for (index = 0; index < aNotifications.length; index++) {
|
|
715
|
+
for (let index = 0; index < aNotifications.length; index++) {
|
|
778
716
|
if (aNotifications[index].Id === sNotificationId) {
|
|
779
717
|
return index;
|
|
780
718
|
}
|
|
@@ -785,47 +723,46 @@ sap.ui.define([
|
|
|
785
723
|
* Initializes (i.e. empties) the branched in the model of the tabs/sorting which are not the current one
|
|
786
724
|
*/
|
|
787
725
|
cleanModel: function () {
|
|
788
|
-
|
|
789
|
-
|
|
726
|
+
const oView = this.getView();
|
|
727
|
+
const oModel = oView.getModel();
|
|
728
|
+
const oSortingTypesArray = oModel.getProperty("/");
|
|
790
729
|
|
|
791
|
-
Object.keys(oSortingTypesArray).forEach(
|
|
792
|
-
if (sSortKey !==
|
|
793
|
-
oSortingTypesArray[sSortKey] =
|
|
730
|
+
Object.keys(oSortingTypesArray).forEach((sSortKey) => {
|
|
731
|
+
if (sSortKey !== this.sCurrentSorting && sSortKey !== this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING) {
|
|
732
|
+
oSortingTypesArray[sSortKey] = this.getInitialSortingModelStructure();
|
|
794
733
|
}
|
|
795
734
|
});
|
|
796
735
|
|
|
797
|
-
|
|
736
|
+
oModel.setProperty("/", oSortingTypesArray);
|
|
798
737
|
},
|
|
799
738
|
|
|
800
739
|
replaceItemsInModel: function (sSortingType, oResult, iNumberOfItemsToFetch) {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
740
|
+
const oView = this.getView();
|
|
741
|
+
const oModel = oView.getModel();
|
|
742
|
+
const aCurrentItems = this.getItemsFromModel(sSortingType);
|
|
743
|
+
const iCurrentNumberOfItems = aCurrentItems.length;
|
|
744
|
+
const bHasMoreItemsToFetch = oResult.length >= iNumberOfItemsToFetch;
|
|
804
745
|
if (iCurrentNumberOfItems) {
|
|
805
746
|
this._oTopNotificationData = this.getTopItemOnTheScreen();
|
|
806
747
|
}
|
|
807
748
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
this.getView().getModel().setProperty("/" + sSortingType + "/inUpdate", false);
|
|
749
|
+
oModel.setProperty(`/${sSortingType}/hasMoreItemsInBackend`, bHasMoreItemsToFetch);
|
|
750
|
+
oModel.setProperty(`/${sSortingType}/aNotifications`, oResult);
|
|
751
|
+
oModel.setProperty(`/${sSortingType}/inUpdate`, false);
|
|
813
752
|
this.handleMaxReached(sSortingType);
|
|
814
753
|
},
|
|
815
754
|
|
|
816
755
|
setMarkReadOnModel: function (notificationId, bIsRead) {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
oData = oModel.getProperty(sPath);
|
|
756
|
+
const oView = this.getView();
|
|
757
|
+
const oModel = oView.getModel();
|
|
758
|
+
let sPath = `/${this.sCurrentSorting}`;
|
|
759
|
+
let bGroupFound;
|
|
760
|
+
|
|
761
|
+
const oData = oModel.getProperty(sPath);
|
|
825
762
|
if (this.sCurrentSorting === "notificationsByTypeDescending") {
|
|
826
|
-
for (i = 0; i < oData.length; i++) {
|
|
763
|
+
for (let i = 0; i < oData.length; i++) {
|
|
827
764
|
if (oData[i].Id === this.sCurrentExpandedType) {
|
|
828
|
-
sPath = sPath
|
|
765
|
+
sPath = `${sPath}/${i}`;
|
|
829
766
|
bGroupFound = true;
|
|
830
767
|
break;
|
|
831
768
|
}
|
|
@@ -834,10 +771,10 @@ sap.ui.define([
|
|
|
834
771
|
return;
|
|
835
772
|
}
|
|
836
773
|
}
|
|
837
|
-
sPath = sPath
|
|
774
|
+
sPath = `${sPath}/aNotifications`;
|
|
838
775
|
|
|
839
|
-
aNotifications = oModel.getProperty(sPath);
|
|
840
|
-
aNotifications.some(
|
|
776
|
+
const aNotifications = oModel.getProperty(sPath);
|
|
777
|
+
aNotifications.some((notification) => {
|
|
841
778
|
if (notification.Id === notificationId) {
|
|
842
779
|
notification.IsRead = bIsRead;
|
|
843
780
|
return true;
|
|
@@ -851,7 +788,8 @@ sap.ui.define([
|
|
|
851
788
|
//**************************************** Handler functions ***********************************************
|
|
852
789
|
|
|
853
790
|
onTabSelected: function (evt) {
|
|
854
|
-
|
|
791
|
+
const oView = this.getView();
|
|
792
|
+
const key = evt.getParameter("key");
|
|
855
793
|
|
|
856
794
|
if (key === "sapUshellNotificationIconTabByDate") { // Specification: By Date is sorted always by date descending
|
|
857
795
|
this.sCurrentSorting = this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING;
|
|
@@ -860,7 +798,7 @@ sap.ui.define([
|
|
|
860
798
|
this.sCurrentSorting = this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING;
|
|
861
799
|
this.addBusyIndicatorToTabFilter(this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
|
|
862
800
|
this.reloadGroupHeaders();
|
|
863
|
-
|
|
801
|
+
oView.byId("notificationIconTabBar").addStyleClass("sapUshellNotificationIconTabByTypeWithBusyIndicator");
|
|
864
802
|
} else { // by Priority
|
|
865
803
|
this.sCurrentSorting = this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING;
|
|
866
804
|
if (this.getItemsFromModel(this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING).length === 0) {
|
|
@@ -870,142 +808,131 @@ sap.ui.define([
|
|
|
870
808
|
this.oPreviousTabKey = key;
|
|
871
809
|
},
|
|
872
810
|
|
|
873
|
-
_changeDateListBinding: function (sSortingType, oTab) {
|
|
874
|
-
var oLoadListItem = new Promise(function (resolve, reject) {
|
|
875
|
-
sap.ui.require(["sap/ui/core/Fragment"], function (Fragment) {
|
|
876
|
-
Fragment.load({
|
|
877
|
-
name: "sap.ushell.components.shell.Notifications.NotificationsListItem",
|
|
878
|
-
type: "XML",
|
|
879
|
-
controller: this
|
|
880
|
-
}).then(resolve).catch(reject);
|
|
881
|
-
}.bind(this), reject);
|
|
882
|
-
}.bind(this));
|
|
883
|
-
|
|
884
|
-
if (sSortingType === this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING) {
|
|
885
|
-
oTab.$("text").attr("aria-label", resources.i18n.getText("Notifications.ByDateDescending.AriaLabel"));
|
|
886
|
-
|
|
887
|
-
oLoadListItem.then(function (fragment) {
|
|
888
|
-
this.getView().byId("sapUshellNotificationsListDate").bindItems(
|
|
889
|
-
"/notificationsByDateDescending/aNotifications",
|
|
890
|
-
fragment
|
|
891
|
-
);
|
|
892
|
-
}.bind(this));
|
|
893
|
-
} else {
|
|
894
|
-
oTab.$("text").attr("aria-label", resources.i18n.getText("Notifications.ByDateAscending.AriaLabel"));
|
|
895
|
-
|
|
896
|
-
oLoadListItem.then(function (fragment) {
|
|
897
|
-
this.getView().byId("sapUshellNotificationsListDate").bindItems(
|
|
898
|
-
"/notificationsByDateAscending/aNotifications",
|
|
899
|
-
fragment
|
|
900
|
-
);
|
|
901
|
-
}.bind(this));
|
|
902
|
-
}
|
|
903
|
-
},
|
|
904
|
-
|
|
905
811
|
onNotificationItemPress: function (oEvent) {
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
812
|
+
const oView = this.getView();
|
|
813
|
+
const oModel = oView.getModel();
|
|
814
|
+
const oItem = oEvent.getSource();
|
|
815
|
+
const oBindingContext = oItem.getBindingContext();
|
|
816
|
+
const sPath = oBindingContext.getPath();
|
|
817
|
+
const oModelPart = oModel.getProperty(sPath);
|
|
818
|
+
const sSemanticObject = oModelPart.NavigationTargetObject;
|
|
819
|
+
const sAction = oModelPart.NavigationTargetAction;
|
|
820
|
+
const aParameters = oModelPart.NavigationTargetParams;
|
|
821
|
+
const sNotificationId = oModelPart.Id;
|
|
912
822
|
this.onListItemPress(sNotificationId, sSemanticObject, sAction, aParameters);
|
|
913
823
|
},
|
|
914
824
|
|
|
915
825
|
onNotificationItemClose: function (oEvent) {
|
|
826
|
+
const oView = this.getView();
|
|
827
|
+
const oModel = oView.getModel();
|
|
916
828
|
this._retainFocus();
|
|
917
829
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
830
|
+
const oItem = oEvent.getSource();
|
|
831
|
+
const oBindingContext = oItem.getBindingContext();
|
|
832
|
+
const sPath = oBindingContext.getPath();
|
|
833
|
+
const oNotificationModelEntry = oModel.getProperty(sPath);
|
|
834
|
+
const sNotificationId = oNotificationModelEntry.Id;
|
|
921
835
|
this.dismissNotification(sNotificationId);
|
|
922
836
|
},
|
|
923
837
|
|
|
924
838
|
onNotificationItemButtonPress: function (oEvent) {
|
|
925
839
|
this._retainFocus();
|
|
926
840
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
oModel.
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
841
|
+
const oView = this.getView();
|
|
842
|
+
const oModel = oView.getModel();
|
|
843
|
+
const oItem = oEvent.getSource();
|
|
844
|
+
const oBindingContext = oItem.getBindingContext();
|
|
845
|
+
const sPath = oBindingContext.getPath();
|
|
846
|
+
const oNotificationModelPart = oModel.getProperty(sPath);
|
|
847
|
+
const aPathParts = sPath.split("/");
|
|
848
|
+
const bTypeTabSelected = this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING;
|
|
849
|
+
const sPathToNotification = bTypeTabSelected
|
|
850
|
+
? `/${aPathParts[1]}/${aPathParts[2]}/${aPathParts[3]}/${aPathParts[4]}`
|
|
851
|
+
: `/${aPathParts[1]}/${aPathParts[2]}/${aPathParts[3]}`;
|
|
852
|
+
const oNotificationModelEntry = oModel.getProperty(sPathToNotification);
|
|
853
|
+
const sNotificationId = oNotificationModelEntry.Id;
|
|
854
|
+
|
|
855
|
+
oModel.setProperty(`${sPathToNotification}/Busy`, true);
|
|
856
|
+
|
|
857
|
+
return this.executeAction(sNotificationId, oNotificationModelPart.ActionId)
|
|
858
|
+
.then((responseAck) => {
|
|
859
|
+
if (responseAck && responseAck.isSucessfull) {
|
|
943
860
|
if (responseAck.message && responseAck.message.length) {
|
|
944
861
|
MessageToast.show(responseAck.message, { duration: 4000 });
|
|
945
862
|
} else {
|
|
946
|
-
|
|
863
|
+
const sActionText = oNotificationModelPart.ActionText;
|
|
947
864
|
MessageToast.show(resources.i18n.getText("ActionAppliedToNotification", [sActionText]), { duration: 4000 });
|
|
948
865
|
}
|
|
949
|
-
});
|
|
950
866
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
867
|
+
// Notification should remain in the UI (after action executed) only if DeleteOnReturn flag exists, and equals false
|
|
868
|
+
if (responseAck.DeleteOnReturn !== false) {
|
|
869
|
+
this.removeNotificationFromModel(sNotificationId);
|
|
870
|
+
this.oNotificationsService._addDismissNotifications(sNotificationId);
|
|
955
871
|
|
|
956
|
-
|
|
957
|
-
|
|
872
|
+
// There is need to load again the other 2 tabs, therefore we need to "clean" other models.
|
|
873
|
+
this.cleanModel();
|
|
874
|
+
}
|
|
875
|
+
} else if (responseAck) {
|
|
876
|
+
_errorMessage(responseAck.message);
|
|
877
|
+
} else {
|
|
878
|
+
_errorMessage(resources.i18n.getText("notificationsFailedExecuteAction"));
|
|
958
879
|
}
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
} else {
|
|
880
|
+
})
|
|
881
|
+
.catch(() => {
|
|
962
882
|
_errorMessage(resources.i18n.getText("notificationsFailedExecuteAction"));
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
_errorMessage(resources.i18n.getText("notificationsFailedExecuteAction"));
|
|
968
|
-
});
|
|
883
|
+
})
|
|
884
|
+
.finally(() => {
|
|
885
|
+
oModel.setProperty(`${sPathToNotification}/Busy`, false);
|
|
886
|
+
});
|
|
969
887
|
},
|
|
970
888
|
|
|
971
889
|
onNotificationGroupItemClose: function (oEvent) {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
890
|
+
const oView = this.getView();
|
|
891
|
+
const oModel = oView.getModel();
|
|
892
|
+
const oGroup = oEvent.getSource();
|
|
893
|
+
const sPath = oGroup.getBindingContextPath();
|
|
894
|
+
const aPathParts = sPath.split("/");
|
|
895
|
+
const sPathToNotification = `/${aPathParts[1]}/${aPathParts[2]}`;
|
|
896
|
+
const oNotificationModelEntry = oModel.getProperty(sPathToNotification);
|
|
976
897
|
|
|
977
898
|
this.dismissBulkNotifications(oNotificationModelEntry);
|
|
978
899
|
},
|
|
979
900
|
|
|
980
901
|
onNotificationGroupItemCollapse: function (oEvent) {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
902
|
+
const oView = this.getView();
|
|
903
|
+
const oModel = oView.getModel();
|
|
904
|
+
const oGroup = oEvent.getSource();
|
|
905
|
+
const sPath = oGroup.getBindingContextPath();
|
|
906
|
+
if (!oGroup.getCollapsed()) {
|
|
907
|
+
oModel.setProperty(`${sPath}/Busy`, true);
|
|
908
|
+
this.expandedGroupIndex = sPath.substring(sPath.lastIndexOf("/") + 1);
|
|
909
|
+
this.onExpandGroup(oGroup);
|
|
987
910
|
}
|
|
988
911
|
},
|
|
989
912
|
|
|
990
913
|
onNotificationGroupItemButtonPress: function (oEvent) {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
914
|
+
const oView = this.getView();
|
|
915
|
+
const oModel = oView.getModel();
|
|
916
|
+
const oGroup = oEvent.getSource();
|
|
917
|
+
const sPath = oGroup.getBindingContextPath();
|
|
918
|
+
const oNotificationModelPart = oModel.getProperty(sPath);
|
|
919
|
+
const aPathParts = sPath.split("/");
|
|
920
|
+
const sPathToNotification = `/${aPathParts[1]}/${aPathParts[2]}`;
|
|
921
|
+
const oNotificationModelEntry = oModel.getProperty(sPathToNotification);
|
|
997
922
|
|
|
998
923
|
this._retainFocus();
|
|
999
924
|
|
|
1000
925
|
// mark the notification group as busy
|
|
1001
|
-
oModel.setProperty(sPathToNotification
|
|
926
|
+
oModel.setProperty(`${sPathToNotification}/Busy`, true);
|
|
1002
927
|
|
|
1003
|
-
this.executeBulkAction(oNotificationModelPart.ActionId,
|
|
928
|
+
this.executeBulkAction(oNotificationModelPart.ActionId, oGroup.getProperty("text"), oNotificationModelEntry, sPathToNotification);
|
|
1004
929
|
},
|
|
1005
930
|
|
|
1006
931
|
onListUpdateStarted: function (oEvent) {
|
|
932
|
+
const oView = this.getView();
|
|
933
|
+
const oModel = oView.getModel();
|
|
1007
934
|
if (oEvent.getParameter("reason") === "Growing") {
|
|
1008
|
-
if (!
|
|
935
|
+
if (!oModel.getProperty(`/${this.sCurrentSorting}/inUpdate`)) {
|
|
1009
936
|
this.getNextBuffer();
|
|
1010
937
|
}
|
|
1011
938
|
}
|
|
@@ -1015,10 +942,8 @@ sap.ui.define([
|
|
|
1015
942
|
//**************************************** Helper functions ***********************************************
|
|
1016
943
|
|
|
1017
944
|
getNumberOfItemsInScreen: function () {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
iItemsInScreen = (iHeight - this.oPagingConfiguration.TAB_BAR_HEIGHT) / this.oPagingConfiguration.NOTIFICATION_ITEM_HEIGHT;
|
|
945
|
+
const iHeight = jQuery(window).height();
|
|
946
|
+
const iItemsInScreen = (iHeight - this.oPagingConfiguration.TAB_BAR_HEIGHT) / this.oPagingConfiguration.NOTIFICATION_ITEM_HEIGHT;
|
|
1022
947
|
return Math.ceil(iItemsInScreen);
|
|
1023
948
|
},
|
|
1024
949
|
|
|
@@ -1026,10 +951,6 @@ sap.ui.define([
|
|
|
1026
951
|
return Math.max(this.getNumberOfItemsInScreen() * 3, this.oPagingConfiguration.MIN_NOTIFICATION_ITEMS_PER_BUFFER);
|
|
1027
952
|
},
|
|
1028
953
|
|
|
1029
|
-
getWindowSize: function () {
|
|
1030
|
-
return jQuery(window).height();
|
|
1031
|
-
},
|
|
1032
|
-
|
|
1033
954
|
/**
|
|
1034
955
|
* Calculates and returns the number of items that should be requested from notification service, as part of the paging policy.
|
|
1035
956
|
* The function performs the following:
|
|
@@ -1043,8 +964,8 @@ sap.ui.define([
|
|
|
1043
964
|
* @returns {int} Basic buffer size
|
|
1044
965
|
*/
|
|
1045
966
|
getNumberOfItemsToFetchOnScroll: function (sSortingType) {
|
|
1046
|
-
|
|
1047
|
-
|
|
967
|
+
const iCurrentNumberOfItems = (this.getItemsFromModel(sSortingType) || []).length;
|
|
968
|
+
const iBasicBufferSize = this.getBasicBufferSize();
|
|
1048
969
|
|
|
1049
970
|
if (iCurrentNumberOfItems >= this.iMaxNotificationItemsForDevice) {
|
|
1050
971
|
return 0;
|
|
@@ -1067,59 +988,51 @@ sap.ui.define([
|
|
|
1067
988
|
* 2. iMaxNotificationItemsForDevice
|
|
1068
989
|
*/
|
|
1069
990
|
getNumberOfItemsToFetchOnUpdate: function (iNumberOfItemsInModel) {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
iReturnedValue;
|
|
991
|
+
const iBasicBufferSize = this.getBasicBufferSize();
|
|
992
|
+
const iNumberOfRequiredBasicBuffers = Math.ceil(iNumberOfItemsInModel / iBasicBufferSize);
|
|
1073
993
|
|
|
1074
994
|
// If the number is less then one basic buffer - then one basic buffer is required
|
|
1075
|
-
iReturnedValue = iNumberOfRequiredBasicBuffers > 0 ? iNumberOfRequiredBasicBuffers * iBasicBufferSize : iBasicBufferSize;
|
|
995
|
+
const iReturnedValue = iNumberOfRequiredBasicBuffers > 0 ? iNumberOfRequiredBasicBuffers * iBasicBufferSize : iBasicBufferSize;
|
|
1076
996
|
|
|
1077
997
|
// Return no more then the maximum number of items for this device
|
|
1078
998
|
return iReturnedValue > this.iMaxNotificationItemsForDevice ? this.iMaxNotificationItemsForDevice : iReturnedValue;
|
|
1079
999
|
},
|
|
1080
1000
|
|
|
1081
1001
|
getItemsFromModel: function (sortingType) {
|
|
1002
|
+
const oView = this.getView();
|
|
1003
|
+
const oModel = oView.getModel();
|
|
1082
1004
|
if (sortingType === undefined) {
|
|
1083
1005
|
sortingType = this.sCurrentSorting;
|
|
1084
1006
|
}
|
|
1085
|
-
return
|
|
1086
|
-
},
|
|
1087
|
-
|
|
1088
|
-
getItemsOfTypeFromModel: function (sTypeHeader) {
|
|
1089
|
-
var oGroup = this.getGroupFromModel(sTypeHeader);
|
|
1090
|
-
if (oGroup) {
|
|
1091
|
-
return oGroup.aNotifications ? oGroup.aNotifications : [];
|
|
1092
|
-
}
|
|
1093
|
-
return [];
|
|
1007
|
+
return oModel.getProperty(`/${sortingType}/aNotifications`);
|
|
1094
1008
|
},
|
|
1095
1009
|
|
|
1096
1010
|
getGroupFromModel: function (sTypeHeader) {
|
|
1097
|
-
|
|
1098
|
-
|
|
1011
|
+
const oView = this.getView();
|
|
1012
|
+
const oModel = oView.getModel();
|
|
1013
|
+
const aGroupHeaders = oModel.getProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`);
|
|
1014
|
+
return aGroupHeaders.find((group) => {
|
|
1099
1015
|
return group.Id === sTypeHeader;
|
|
1100
1016
|
});
|
|
1101
1017
|
},
|
|
1102
1018
|
|
|
1103
1019
|
getGroupIndexFromModel: function (sTypeHeader) {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
aGroupHeaders.
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
return true;
|
|
1110
|
-
}
|
|
1020
|
+
const oView = this.getView();
|
|
1021
|
+
const oModel = oView.getModel();
|
|
1022
|
+
const aGroupHeaders = oModel.getProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}`);
|
|
1023
|
+
return aGroupHeaders.findIndex((group) => {
|
|
1024
|
+
return group.Id === sTypeHeader;
|
|
1111
1025
|
});
|
|
1112
|
-
return iIndex;
|
|
1113
1026
|
},
|
|
1114
1027
|
|
|
1115
1028
|
// Return the Notification Id of the given notification item
|
|
1116
1029
|
getItemNotificationId: function (elNotificationItem) {
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
return
|
|
1030
|
+
const oView = this.getView();
|
|
1031
|
+
const oModel = oView.getModel();
|
|
1032
|
+
const oItem = Element.getElementById(elNotificationItem.getAttribute("Id"));
|
|
1033
|
+
const oBindingContext = oItem.getBindingContext();
|
|
1034
|
+
const sPath = oBindingContext.getPath();
|
|
1035
|
+
return oModel.getProperty(`${sPath}/Id`);
|
|
1123
1036
|
},
|
|
1124
1037
|
|
|
1125
1038
|
getInitialSortingModelStructure: function () {
|
|
@@ -1133,68 +1046,61 @@ sap.ui.define([
|
|
|
1133
1046
|
},
|
|
1134
1047
|
|
|
1135
1048
|
onExpandGroup: function (groupElement) {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1049
|
+
const oView = this.getView();
|
|
1050
|
+
const oModel = oView.getModel();
|
|
1051
|
+
const oNotificationList = oView.byId("sapUshellNotificationsListType");
|
|
1052
|
+
const aListItems = oNotificationList.getItems();
|
|
1053
|
+
const sGroupElementId = groupElement.getId();
|
|
1054
|
+
const sPath = groupElement.getBindingContextPath();
|
|
1055
|
+
const oGroup = oModel.getProperty(sPath);
|
|
1056
|
+
this.sCurrentExpandedType = oGroup.Id;
|
|
1057
|
+
oModel.setProperty(`${sPath}/aNotifications`, []);
|
|
1058
|
+
oModel.setProperty(`${sPath}/hasMoreItems`, true);
|
|
1059
|
+
aListItems.forEach((oItem) => {
|
|
1060
|
+
if (oItem.getId() === sGroupElementId) {
|
|
1061
|
+
this.getNextBufferForType();
|
|
1062
|
+
} else if (oItem.getId() !== sGroupElementId && !oItem.getCollapsed()) {
|
|
1063
|
+
oItem.setCollapsed(true);
|
|
1064
|
+
oModel.setProperty(`${oItem.getBindingContextPath()}/hasMoreItems`, true);
|
|
1149
1065
|
}
|
|
1150
1066
|
});
|
|
1151
1067
|
},
|
|
1152
1068
|
|
|
1153
1069
|
notificationsUpdateCallbackForType: function () {
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
oPromise;
|
|
1070
|
+
const oView = this.getView();
|
|
1071
|
+
const oModel = oView.getModel();
|
|
1072
|
+
const selectedTypeId = this.sCurrentExpandedType;
|
|
1073
|
+
const oGroup = this.getGroupFromModel(selectedTypeId);
|
|
1074
|
+
const iNumberOfItemsInModel = oGroup && oGroup.aNotifications.length;
|
|
1160
1075
|
|
|
1161
|
-
|
|
1162
|
-
if (aCurrentItems !== undefined) {
|
|
1163
|
-
iNumberOfItemsInModel = aCurrentItems.length;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
this.getView().getModel().setProperty("/" + sSortingType + "/inUpdate", true);
|
|
1076
|
+
oModel.setProperty(`/${this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING}/inUpdate`, true);
|
|
1167
1077
|
|
|
1168
1078
|
// First Fetch the Groups Headers
|
|
1169
1079
|
this.updateGroupHeaders();
|
|
1170
1080
|
|
|
1171
1081
|
// Fetch a buffer of notification items from notification service
|
|
1172
1082
|
if (selectedTypeId) {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
this.getNextBufferFailHandler(oResult);
|
|
1181
|
-
}.bind(this));
|
|
1083
|
+
this.oNotificationsService.getNotificationsBufferInGroup(selectedTypeId, 0, this.getNumberOfItemsToFetchOnUpdate(iNumberOfItemsInModel))
|
|
1084
|
+
.then((oResult) => {
|
|
1085
|
+
this.addTypeBufferToModel(selectedTypeId, oResult, true);
|
|
1086
|
+
})
|
|
1087
|
+
.catch((oResult) => {
|
|
1088
|
+
this.getNextBufferFailHandler(oResult);
|
|
1089
|
+
});
|
|
1182
1090
|
}
|
|
1183
1091
|
},
|
|
1184
1092
|
|
|
1185
1093
|
getNotificationList: function (sSortingType) {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1094
|
+
const oView = this.getView();
|
|
1095
|
+
|
|
1096
|
+
switch (sSortingType) {
|
|
1097
|
+
case this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING:
|
|
1098
|
+
return oView.byId("sapUshellNotificationsListDate");
|
|
1099
|
+
case this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING:
|
|
1100
|
+
return oView.byId("sapUshellNotificationsListPriority");
|
|
1101
|
+
default:
|
|
1102
|
+
return oView.byId("sapUshellNotificationsListType");
|
|
1195
1103
|
}
|
|
1196
|
-
|
|
1197
|
-
return oList;
|
|
1198
1104
|
},
|
|
1199
1105
|
|
|
1200
1106
|
/**
|
|
@@ -1204,56 +1110,62 @@ sap.ui.define([
|
|
|
1204
1110
|
* See "oOperationEnum" from "sap/ushell/services/Notifications.js".
|
|
1205
1111
|
*/
|
|
1206
1112
|
removeTabIndexFromList: function (sSortingType) {
|
|
1207
|
-
|
|
1208
|
-
|
|
1113
|
+
const oListControl = this.getNotificationList(sSortingType);
|
|
1114
|
+
const oListTag = oListControl.$().children().get(1);
|
|
1209
1115
|
if (oListTag) {
|
|
1210
1116
|
oListTag.removeAttribute("tabindex");
|
|
1211
1117
|
}
|
|
1212
1118
|
},
|
|
1213
1119
|
|
|
1214
1120
|
getMoreCircle: function (sType) {
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1121
|
+
const oView = this.getView();
|
|
1122
|
+
const oModel = oView.getModel();
|
|
1123
|
+
const oListItem = new CustomListItem({
|
|
1124
|
+
type: ListType.Inactive,
|
|
1125
|
+
content: new VBox({
|
|
1126
|
+
items: [
|
|
1127
|
+
new VBox({
|
|
1128
|
+
items: [
|
|
1129
|
+
new Text({
|
|
1130
|
+
text: `{/${sType}/moreNotificationCount}`
|
|
1131
|
+
})
|
|
1132
|
+
.addStyleClass("sapUshellNotificationsMoreCircleCount")
|
|
1133
|
+
.setModel(oModel),
|
|
1134
|
+
new Text({
|
|
1135
|
+
text: resources.i18n.getText("moreNotifications")
|
|
1136
|
+
})
|
|
1137
|
+
],
|
|
1138
|
+
alignItems: FlexAlignItems.Center
|
|
1139
|
+
}).addStyleClass("sapUshellNotificationsMoreCircle"),
|
|
1140
|
+
new Text({
|
|
1141
|
+
text: resources.i18n.getText("moreNotificationsAvailable_message"),
|
|
1142
|
+
textAlign: "Center"
|
|
1143
|
+
}).addStyleClass("sapUshellNotificationsMoreHelpingText"),
|
|
1144
|
+
new Text({
|
|
1145
|
+
text: resources.i18n.getText("processNotifications_message"),
|
|
1146
|
+
textAlign: "Center"
|
|
1147
|
+
}).addStyleClass("sapUshellNotificationsMoreHelpingText")
|
|
1148
|
+
]
|
|
1149
|
+
}).addStyleClass("sapUshellNotificationsMoreVBox")
|
|
1150
|
+
}).addStyleClass("sapUshellNotificationsMoreListItem");
|
|
1240
1151
|
|
|
1152
|
+
this.oMoreListItem = oListItem;
|
|
1241
1153
|
return oListItem;
|
|
1242
1154
|
},
|
|
1243
1155
|
|
|
1244
1156
|
// When the notifications view is opened in a popup, keep focus on an active tab to avoid the popup close due to focus loss
|
|
1245
1157
|
_retainFocus: function () {
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
if (oItem.getKey() === sKey) {
|
|
1253
|
-
iSelected = index;
|
|
1254
|
-
}
|
|
1158
|
+
const oView = this.getView();
|
|
1159
|
+
const oIconTabBar = oView.byId("notificationIconTabBar");
|
|
1160
|
+
const sKey = oIconTabBar.getSelectedKey();
|
|
1161
|
+
const aItems = oIconTabBar.getItems();
|
|
1162
|
+
const iSelected = aItems.findIndex((oItem) => {
|
|
1163
|
+
return oItem.getKey() === sKey;
|
|
1255
1164
|
});
|
|
1256
|
-
aItems[iSelected]
|
|
1165
|
+
const oFocusableItem = aItems[iSelected];
|
|
1166
|
+
if (oFocusableItem) {
|
|
1167
|
+
oFocusableItem.focus();
|
|
1168
|
+
}
|
|
1257
1169
|
},
|
|
1258
1170
|
|
|
1259
1171
|
//*********************************************************************************************************
|