@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.
Files changed (351) hide show
  1. package/package.json +2 -2
  2. package/src/main/js/sap/ushell/.library +1 -1
  3. package/src/main/js/sap/ushell/CanvasShapesManager.js +5 -3
  4. package/src/main/js/sap/ushell/Container.js +14 -0
  5. package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
  6. package/src/main/js/sap/ushell/Fiori20AdapterTest.js +1 -1
  7. package/src/main/js/sap/ushell/Layout.js +1 -1
  8. package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
  9. package/src/main/js/sap/ushell/SessionHandler.js +14 -9
  10. package/src/main/js/sap/ushell/TechnicalParameters.js +1 -1
  11. package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
  12. package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +1 -1
  13. package/src/main/js/sap/ushell/Ui5ServiceFactory.js +1 -1
  14. package/src/main/js/sap/ushell/_URLTemplateProcessor/DefinitionParameterSetBuilder.js +1 -1
  15. package/src/main/js/sap/ushell/_URLTemplateProcessor/DependencyGraph.js +1 -1
  16. package/src/main/js/sap/ushell/_URLTemplateProcessor/Functions.js +1 -1
  17. package/src/main/js/sap/ushell/_URLTemplateProcessor/Resolvers.js +1 -1
  18. package/src/main/js/sap/ushell/_URLTemplateProcessor/TemplateParameterParser.js +1 -1
  19. package/src/main/js/sap/ushell/_URLTemplateProcessor/utils.js +1 -1
  20. package/src/main/js/sap/ushell/adapters/cdm/ClientSideTargetResolutionAdapter.js +1 -1
  21. package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +1 -1
  22. package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
  23. package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -1
  24. package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +1 -1
  25. package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +1 -1
  26. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
  27. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +1 -1
  28. package/src/main/js/sap/ushell/adapters/cdm/Ui5ComponentLoaderAdapter.js +1 -1
  29. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/modifyHome.js +1 -1
  30. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readCatalogs.js +1 -1
  31. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readHome.js +1 -1
  32. package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/uri.transform.js +1 -1
  33. package/src/main/js/sap/ushell/adapters/cdm/util/AppForInbound.js +1 -1
  34. package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +1 -1
  35. package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +1 -1
  36. package/src/main/js/sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter.js +1 -1
  37. package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +1 -1
  38. package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
  39. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
  40. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
  41. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
  42. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
  43. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
  44. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
  45. package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +1 -1
  46. package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +8 -185
  47. package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionInternalAdapter.js +198 -0
  48. package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +1 -1
  49. package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +1 -1
  50. package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
  51. package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +6 -5
  52. package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +5 -4
  53. package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -1
  54. package/src/main/js/sap/ushell/adapters/local/FlpLaunchPageAdapter.js +27 -22
  55. package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
  56. package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +7 -193
  57. package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionInternalAdapter.js +205 -0
  58. package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
  59. package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
  60. package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
  61. package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +1 -1
  62. package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
  63. package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
  64. package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
  65. package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
  66. package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +1 -1
  67. package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
  68. package/src/main/js/sap/ushell/api/workpage/Designtime.js +24 -4
  69. package/src/main/js/sap/ushell/api/workpage/Runtime.js +45 -7
  70. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +6 -0
  71. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/AppLifeCycleUtils.js +4 -4
  72. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/Renderer.js +17 -49
  73. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaAgent/Component.js +13 -18
  74. package/src/main/js/sap/ushell/appRuntime/ui5/plugins/rtaShell/Component.js +24 -36
  75. package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +2 -3
  76. package/src/main/js/sap/ushell/appRuntime/ui5/services/CrossApplicationNavigation.js +4 -4
  77. package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolution.js +4 -5
  78. package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolutionInternal.js +113 -0
  79. package/src/main/js/sap/ushell/appRuntime/ui5/services/Navigation.js +2 -2
  80. package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigation.js +1 -1
  81. package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigationInternal.js +1 -1
  82. package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
  83. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
  84. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
  85. package/src/main/js/sap/ushell/bootstrap/cdm/cdm.constants.js +1 -1
  86. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
  87. package/src/main/js/sap/ushell/bootstrap/common/common.create.configcontract.core.js +3 -1
  88. package/src/main/js/sap/ushell/bootstrap/common/common.read.ushell.config.from.url.js +2 -1
  89. package/src/main/js/sap/ushell/bootstrap/common/common.util.js +17 -2
  90. package/src/main/js/sap/ushell/bootstrap/sandbox2/sandboxConfig.json +12 -3
  91. package/src/main/js/sap/ushell/bootstrap/sandbox2.js +54 -22
  92. package/src/main/js/sap/ushell/components/CatalogsManager.js +31 -11
  93. package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
  94. package/src/main/js/sap/ushell/components/HomepageManager.js +5 -3
  95. package/src/main/js/sap/ushell/components/appfinder/AppFinder.controller.js +2 -2
  96. package/src/main/js/sap/ushell/components/appfinder/Catalog.controller.js +1 -1
  97. package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +3 -4
  98. package/src/main/js/sap/ushell/components/appfinder/Component.js +5 -2
  99. package/src/main/js/sap/ushell/components/appfinder/HierarchyAppsView.js +3 -3
  100. package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
  101. package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -13
  102. package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
  103. package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
  104. package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +64 -8
  105. package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +67 -83
  106. package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
  107. package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
  108. package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +1 -1
  109. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/AdvancedFormatters.js +3 -3
  110. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/appendStyleVars.js +3 -3
  111. package/src/main/js/sap/ushell/components/cepsearchresult/app/util/controls/categories/Event.js +3 -3
  112. package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +4 -4
  113. package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
  114. package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +12 -5
  115. package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
  116. package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
  117. package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
  118. package/src/main/js/sap/ushell/components/contentFinder/resources/resources.properties +1 -1
  119. package/src/main/js/sap/ushell/components/contentFinder/view/AppSearchBox.fragment.xml +3 -1
  120. package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
  121. package/src/main/js/sap/ushell/components/factsheet/factory/ThingInspector.js +37 -37
  122. package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
  123. package/src/main/js/sap/ushell/components/homepage/DashboardContent.controller.js +2 -2
  124. package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
  125. package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +2 -2
  126. package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +2 -2
  127. package/src/main/js/sap/ushell/components/homepage/manifest.json +1 -1
  128. package/src/main/js/sap/ushell/components/pages/ActionMode.js +1 -1
  129. package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
  130. package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
  131. package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +1 -1
  132. package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
  133. package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +1 -1
  134. package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
  135. package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +1 -1
  136. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +1 -1
  137. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +1 -1
  138. package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +1 -1
  139. package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +525 -613
  140. package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
  141. package/src/main/js/sap/ushell/components/shell/Search/manifest.json +1 -1
  142. package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +1 -1
  143. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
  144. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
  145. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
  146. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
  147. package/src/main/js/sap/ushell/components/shell/Settings/Component.js +1 -1
  148. package/src/main/js/sap/ushell/components/shell/Settings/appearance/Appearance.controller.js +4 -4
  149. package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/UserDefaultsEntry.js +3 -5
  150. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
  151. package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +1 -1
  152. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/indicatorTileHelper.js +18 -18
  153. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +1 -1
  154. package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +1 -1
  155. package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
  156. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
  157. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +2 -2
  158. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
  159. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +1 -1
  160. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +1 -1
  161. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +1 -1
  162. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +1 -1
  163. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +1 -1
  164. package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +3 -3
  165. package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
  166. package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -1
  167. package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
  168. package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
  169. package/src/main/js/sap/ushell/library.js +9 -1
  170. package/src/main/js/sap/ushell/navigationMode.js +3 -3
  171. package/src/main/js/sap/ushell/performance/FesrEnhancer.js +33 -4
  172. package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
  173. package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
  174. package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
  175. package/src/main/js/sap/ushell/plugins/rta-personalize/Component.js +6 -254
  176. package/src/main/js/sap/ushell/plugins/rta-personalize/manifest.json +0 -102
  177. package/src/main/js/sap/ushell/renderer/AccessKeysHandler.js +0 -8
  178. package/src/main/js/sap/ushell/renderer/Renderer.js +2 -2
  179. package/src/main/js/sap/ushell/renderer/Shell.controller.js +7 -7
  180. package/src/main/js/sap/ushell/renderer/Shell.view.js +2 -10
  181. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.controller.js +10 -11
  182. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyApps.view.xml +49 -70
  183. package/src/main/js/sap/ushell/renderer/resources/resources.properties +0 -2
  184. package/src/main/js/sap/ushell/renderer/search/searchComponent/manifest.json +1 -1
  185. package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +1 -1
  186. package/src/main/js/sap/ushell/services/AppLifeCycle.js +1 -1
  187. package/src/main/js/sap/ushell/services/AppState.js +1 -1
  188. package/src/main/js/sap/ushell/services/Bookmark.js +2 -2
  189. package/src/main/js/sap/ushell/services/BookmarkV2.js +2 -2
  190. package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +3 -3
  191. package/src/main/js/sap/ushell/services/CommonDataModel.js +3 -5
  192. package/src/main/js/sap/ushell/services/Configuration.js +1 -1
  193. package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +1 -1
  194. package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
  195. package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +20 -20
  196. package/src/main/js/sap/ushell/services/DarkModeSupport.js +3 -3
  197. package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +1 -1
  198. package/src/main/js/sap/ushell/services/Extension/Footer.js +1 -1
  199. package/src/main/js/sap/ushell/services/Extension/Header.js +1 -1
  200. package/src/main/js/sap/ushell/services/Extension/Item.js +1 -1
  201. package/src/main/js/sap/ushell/services/Extension/SidePane.js +1 -1
  202. package/src/main/js/sap/ushell/services/Extension/ToolArea.js +1 -1
  203. package/src/main/js/sap/ushell/services/Extension.js +1 -1
  204. package/src/main/js/sap/ushell/services/FlpLaunchPage.js +1 -1
  205. package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
  206. package/src/main/js/sap/ushell/services/Menu.js +1 -1
  207. package/src/main/js/sap/ushell/services/Message.js +1 -1
  208. package/src/main/js/sap/ushell/services/MessageBroker.js +1 -1
  209. package/src/main/js/sap/ushell/services/NavTargetResolution.js +24 -995
  210. package/src/main/js/sap/ushell/services/NavTargetResolutionInternal.js +1272 -0
  211. package/src/main/js/sap/ushell/services/Navigation/utils.js +1 -1
  212. package/src/main/js/sap/ushell/services/Navigation.js +11 -11
  213. package/src/main/js/sap/ushell/services/NavigationDataProvider.js +1 -1
  214. package/src/main/js/sap/ushell/services/Notifications.js +0 -14
  215. package/src/main/js/sap/ushell/services/NotificationsV2.js +10 -34
  216. package/src/main/js/sap/ushell/services/PageBuilding.js +1 -1
  217. package/src/main/js/sap/ushell/services/PagePersistence.js +1 -1
  218. package/src/main/js/sap/ushell/services/PageReferencing.js +1 -1
  219. package/src/main/js/sap/ushell/services/Pages.js +1 -1
  220. package/src/main/js/sap/ushell/services/Personalization.js +1 -1
  221. package/src/main/js/sap/ushell/services/PersonalizationV2.js +1 -1
  222. package/src/main/js/sap/ushell/services/PluginManager.js +2 -2
  223. package/src/main/js/sap/ushell/services/ReferenceResolver.js +1 -1
  224. package/src/main/js/sap/ushell/services/Search.js +1 -1
  225. package/src/main/js/sap/ushell/services/SearchCEP.js +1 -1
  226. package/src/main/js/sap/ushell/services/SearchableContent.js +2 -2
  227. package/src/main/js/sap/ushell/services/ShellNavigation.js +1 -1
  228. package/src/main/js/sap/ushell/services/ShellNavigationHashChanger.js +1 -1
  229. package/src/main/js/sap/ushell/services/ShellNavigationInternal.js +3 -2
  230. package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
  231. package/src/main/js/sap/ushell/services/SpaceContent.js +1 -1
  232. package/src/main/js/sap/ushell/services/UITracer.js +5 -5
  233. package/src/main/js/sap/ushell/services/URLParsing.js +2 -2
  234. package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
  235. package/src/main/js/sap/ushell/services/URLTemplate.js +1 -1
  236. package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +1 -1
  237. package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +1 -1
  238. package/src/main/js/sap/ushell/services/UserDefaultParameters.js +1 -1
  239. package/src/main/js/sap/ushell/services/UserInfo.js +1 -1
  240. package/src/main/js/sap/ushell/services/UserRecents.js +1 -1
  241. package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +1 -1
  242. package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +1 -1
  243. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
  244. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
  245. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
  246. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
  247. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
  248. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
  249. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
  250. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +1 -1
  251. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +1 -1
  252. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
  253. package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
  254. package/src/main/js/sap/ushell/services/_CommonDataModel/vizTypeDefaults/VizTypeDefaults.js +1 -1
  255. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
  256. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
  257. package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +1 -1
  258. package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
  259. package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +4 -4
  260. package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
  261. package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
  262. package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
  263. package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +1 -1
  264. package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
  265. package/src/main/js/sap/ushell/themes/base/Catalog.less +12 -2
  266. package/src/main/js/sap/ushell/themes/base/SearchCEP.less +1 -1
  267. package/src/main/js/sap/ushell/themes/base/ShellAppTitle.less +15 -57
  268. package/src/main/js/sap/ushell/themes/base/WorkPageCell.less +0 -1
  269. package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-icon_120x120.png +0 -0
  270. package/src/main/js/sap/ushell/themes/base/img/launchicons/phone-retina_180x180.png +0 -0
  271. package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-icon_152x152.png +0 -0
  272. package/src/main/js/sap/ushell/themes/base/img/launchicons/tablet-retina_167x167.png +0 -0
  273. package/src/main/js/sap/ushell/themes/sap_belize/ShellHeader.less +11 -36
  274. package/src/main/js/sap/ushell/themes/sap_fiori_3/ShellHeader.less +9 -31
  275. package/src/main/js/sap/ushell/themes/sap_fiori_3_dark/ShellHeader.less +9 -32
  276. package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +11 -39
  277. package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +11 -39
  278. package/src/main/js/sap/ushell/ui/appfinder/AppBox.js +3 -136
  279. package/src/main/js/sap/ushell/ui/appfinder/AppBoxInternal.js +161 -0
  280. package/src/main/js/sap/ushell/ui/appfinder/AppBoxRenderer.js +6 -0
  281. package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
  282. package/src/main/js/sap/ushell/ui/footerbar/SaveAsTile.controller.js +1 -1
  283. package/src/main/js/sap/ushell/ui/launchpad/CatalogEntryContainer.js +1 -1
  284. package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
  285. package/src/main/js/sap/ushell/ui/launchpad/Section.js +1 -1
  286. package/src/main/js/sap/ushell/ui/launchpad/TileContainer.js +1 -1
  287. package/src/main/js/sap/ushell/ui/launchpad/VizInstanceLaunchPage.js +1 -1
  288. package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
  289. package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +7 -9
  290. package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
  291. package/src/main/js/sap/ushell/ui/utils.js +1 -1
  292. package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
  293. package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
  294. package/src/main/js/sap/ushell/utils/UrlShortening.js +2 -2
  295. package/src/main/js/sap/ushell/utils/workpage/WorkPageHost.js +366 -0
  296. package/src/main/js/sap/ushell/utils/workpage/WorkPageService.js +1 -1
  297. package/src/main/js/sap/ushell/utils/workpage/WorkPageVizInstantiation.js +5 -2
  298. package/src/main/js/sap/ushell/utils/workpage/resources/resources.properties +157 -0
  299. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ar.properties +78 -0
  300. package/src/main/js/sap/ushell/utils/workpage/resources/resources_bg.properties +78 -0
  301. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ca.properties +78 -0
  302. package/src/main/js/sap/ushell/utils/workpage/resources/resources_cs.properties +78 -0
  303. package/src/main/js/sap/ushell/utils/workpage/resources/resources_cy.properties +78 -0
  304. package/src/main/js/sap/ushell/utils/workpage/resources/resources_da.properties +78 -0
  305. package/src/main/js/sap/ushell/utils/workpage/resources/resources_de.properties +78 -0
  306. package/src/main/js/sap/ushell/utils/workpage/resources/resources_el.properties +78 -0
  307. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en.properties +78 -0
  308. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_GB.properties +78 -0
  309. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_sappsd.properties +78 -0
  310. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saprigi.properties +78 -0
  311. package/src/main/js/sap/ushell/utils/workpage/resources/resources_en_US_saptrc.properties +78 -0
  312. package/src/main/js/sap/ushell/utils/workpage/resources/resources_es.properties +78 -0
  313. package/src/main/js/sap/ushell/utils/workpage/resources/resources_es_MX.properties +78 -0
  314. package/src/main/js/sap/ushell/utils/workpage/resources/resources_et.properties +78 -0
  315. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fi.properties +78 -0
  316. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr.properties +78 -0
  317. package/src/main/js/sap/ushell/utils/workpage/resources/resources_fr_CA.properties +78 -0
  318. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hi.properties +78 -0
  319. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hr.properties +78 -0
  320. package/src/main/js/sap/ushell/utils/workpage/resources/resources_hu.properties +78 -0
  321. package/src/main/js/sap/ushell/utils/workpage/resources/resources_id.properties +78 -0
  322. package/src/main/js/sap/ushell/utils/workpage/resources/resources_it.properties +78 -0
  323. package/src/main/js/sap/ushell/utils/workpage/resources/resources_iw.properties +78 -0
  324. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ja.properties +78 -0
  325. package/src/main/js/sap/ushell/utils/workpage/resources/resources_kk.properties +78 -0
  326. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ko.properties +78 -0
  327. package/src/main/js/sap/ushell/utils/workpage/resources/resources_lt.properties +78 -0
  328. package/src/main/js/sap/ushell/utils/workpage/resources/resources_lv.properties +78 -0
  329. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ms.properties +78 -0
  330. package/src/main/js/sap/ushell/utils/workpage/resources/resources_nl.properties +78 -0
  331. package/src/main/js/sap/ushell/utils/workpage/resources/resources_no.properties +78 -0
  332. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pl.properties +78 -0
  333. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt.properties +78 -0
  334. package/src/main/js/sap/ushell/utils/workpage/resources/resources_pt_PT.properties +78 -0
  335. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ro.properties +78 -0
  336. package/src/main/js/sap/ushell/utils/workpage/resources/resources_ru.properties +78 -0
  337. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sh.properties +78 -0
  338. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sk.properties +78 -0
  339. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sl.properties +78 -0
  340. package/src/main/js/sap/ushell/utils/workpage/resources/resources_sv.properties +78 -0
  341. package/src/main/js/sap/ushell/utils/workpage/resources/resources_th.properties +78 -0
  342. package/src/main/js/sap/ushell/utils/workpage/resources/resources_tr.properties +78 -0
  343. package/src/main/js/sap/ushell/utils/workpage/resources/resources_uk.properties +78 -0
  344. package/src/main/js/sap/ushell/utils/workpage/resources/resources_vi.properties +78 -0
  345. package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_CN.properties +78 -0
  346. package/src/main/js/sap/ushell/utils/workpage/resources/resources_zh_TW.properties +78 -0
  347. package/src/main/js/sap/ushell/utils.js +2 -2
  348. package/src/test/js/sap/ushell/bootstrap/sandbox.js +70 -60
  349. package/ui5.yaml +30 -2
  350. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +0 -350
  351. package/src/main/js/sap/ushell/plugins/rta-personalize/i18n/i18n.properties +0 -38
@@ -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/ui/model/json/JSONModel",
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
- JSONModel,
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
- var Priority = coreLibrary.Priority;
39
+ const Priority = coreLibrary.Priority;
40
40
 
41
41
  // shortcut for sap.m.ListType
42
- var ListType = mobileLibrary.ListType;
42
+ const ListType = mobileLibrary.ListType;
43
43
 
44
44
  // shortcut for sap.m.FlexAlignItems
45
- var FlexAlignItems = mobileLibrary.FlexAlignItems;
45
+ const FlexAlignItems = mobileLibrary.FlexAlignItems;
46
46
 
47
- function _errorMessage (sText) {
48
- sap.ushell.Container.getServiceAsync("Message").then(function (oMessageService) {
49
- oMessageService.error(sText);
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
- var oInitialModelStructure = {};
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 = this.getView().getViewData().notificationsService;
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
- var oModel = new JSONModel(oInitialModelStructure);
95
+ const oModel = new JSONModel(oInitialModelStructure);
97
96
  oModel.setSizeLimit(1500);
98
97
  // Initializing the model with a branch for each sorting type
99
- this.getView().setModel(oModel);
98
+ oView.setModel(oModel);
100
99
 
101
- this.getView().setModel(resources.i18nModel, "i18n");
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
- var oTabBarHeader = this.getView().byId("notificationIconTabBar--header");
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
- this.getView().$("-sapUshellNotificationIconTabByDate-text")
123
+ oView.$("-sapUshellNotificationIconTabByDate-text")
125
124
  .attr("aria-label", resources.i18n.getText("Notifications.ByDateDescending.AriaLabel"));
126
- this.getView().$("-sapUshellNotificationIconTabByType-text")
125
+ oView.$("-sapUshellNotificationIconTabByType-text")
127
126
  .attr("aria-label", resources.i18n.getText("Notifications.ByType.AriaLabel"));
128
- this.getView().$("-sapUshellNotificationIconTabByPrio-text")
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
- var bHasMoreItemsInBackend = this.getView().getModel().getProperty("/" + this.sCurrentSorting + "/hasMoreItemsInBackend"),
135
- bListMaxReached = this.getView().getModel().getProperty("/" + this.sCurrentSorting + "/listMaxReached");
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
- var sCurrentSorting = this.sCurrentSorting,
144
- aCurrentItems = this.getItemsFromModel(sCurrentSorting),
145
- iNumberOfItemsInModel,
146
- oPromise,
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
- this.getView().getModel().setProperty("/" + sCurrentSorting + "/hasMoreItems", false);
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
- this.getView().getModel().setProperty("/" + sCurrentSorting + "/inUpdate", true);
167
+ oModel.setProperty(`/${this.sCurrentSorting}/inUpdate`, true);
168
168
 
169
169
  // Fetch a buffer of notification items from notification service
170
- oPromise = this.oNotificationsService.getNotificationsBufferBySortingType(sCurrentSorting, iNumberOfItemsInModel, iNumberOfItemsToFetch);
171
-
172
- oPromise.then(function (oResult) {
173
- var dNotificationsUserSettingsAvailability = this.oNotificationsService._getNotificationSettingsAvailability();
174
- if (dNotificationsUserSettingsAvailability.state() === "pending") {
175
- this.oNotificationsService._userSettingInitialization();
176
- }
177
- this.addBufferToModel(sCurrentSorting, oResult);
178
- }.bind(this));
179
-
180
- oPromise.catch(function (/*oResult*/) {
181
- if (iNumberOfItemsInModel === 0) {
182
- this.removeBusyIndicatorToTabFilter(sCurrentSorting);
183
- this.handleError();
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
- var selectedTypeId = this.sCurrentExpandedType,
193
- sSortingType = this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING,
194
- oGroup = this.getGroupFromModel(selectedTypeId),
195
- aCurrentItems = oGroup ? oGroup.aNotifications : undefined,
196
- iNumberOfItemsInModel = 0,
197
- oPromise,
198
- bHasMoreItems = oGroup ? oGroup.hasMoreItems : true;
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
- this.getView().getModel().setProperty("/" + sSortingType + "/inUpdate", true);
204
+ oModel.setProperty(`/${sSortingType}/inUpdate`, true);
209
205
 
210
206
  // Fetch a buffer of notification items from notification service
211
- oPromise = this.oNotificationsService.getNotificationsBufferInGroup(selectedTypeId, iNumberOfItemsInModel, this.iMaxNotificationItemsForDevice);
212
-
213
- oPromise.then(function (oResult) {
214
- this.addTypeBufferToModel(selectedTypeId, oResult, false);
215
- }.bind(this));
216
-
217
- oPromise.catch(function (/*oResult*/) {
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
- var aCurrentItems = this.getItemsFromModel(sSortingType),
233
- iCurrentNumberOfItems = aCurrentItems.length,
234
- mergedArrays,
235
- hasMoreItems = oResult.length >= this.getNumberOfItemsToFetchOnScroll(sSortingType);
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
- this.getView().getModel().setProperty("/" + sSortingType + "/hasMoreItemsInBackend", false);
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
- this.getView().getModel().setProperty("/" + sSortingType + "/hasMoreItemsInBackend", hasMoreItems);
241
+ oModel.setProperty(`/${sSortingType}/hasMoreItemsInBackend`, bHasMoreItems);
248
242
 
249
- mergedArrays = aCurrentItems.concat(oResult);
250
- this.getView().getModel().setProperty("/" + sSortingType + "/aNotifications", mergedArrays);
251
- this.getView().getModel().setProperty("/" + sSortingType + "/inUpdate", false);
252
- if (mergedArrays.length >= this.iMaxNotificationItemsForDevice) {
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 (iCurrentNumberOfItems === 0) {
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
- var oGroup = this.getGroupFromModel(sTypeId),
274
- oGroupIndexInModel = this.getGroupIndexFromModel(sTypeId),
275
- aGroupHeaders = this.getView().getModel().getProperty("/" + this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING),
276
- mergedArrays;
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
- mergedArrays = oGroup.aNotifications.concat(oResult);
291
- aGroupHeaders[oGroupIndexInModel].aNotifications = mergedArrays;
285
+ const aMergedArrays = oGroup.aNotifications.concat(oResult);
286
+ aGroupHeaders[oGroupIndexInModel].aNotifications = aMergedArrays;
292
287
  aGroupHeaders[oGroupIndexInModel].Busy = false;
293
288
 
294
- this.getView().getModel().setProperty("/" + this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING, aGroupHeaders);
295
- this.getView().getModel().setProperty("/" + this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING + "/inUpdate", false);
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
- var that = this,
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
- if (aCurrentItems !== undefined) {
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).then(function (aNotifications) {
349
- if (!aNotifications) {
350
- return;
351
- }
315
+ this.oNotificationsService.getNotificationsBufferBySortingType(this.sCurrentSorting, 0, iNumberOfItemsToFetch)
316
+ .then((aNotifications) => {
317
+ if (!aNotifications) {
318
+ return;
319
+ }
352
320
 
353
- // Updating the model with the updated array of notification objects
354
- that.replaceItemsInModel(sCurrentSorting, aNotifications, iNumberOfItemsToFetch);
355
- }).catch(function (data) {
356
- Log.error("Notifications control - call to notificationsService.getNotificationsBufferBySortingType failed: ",
357
- data,
358
- "sap.ushell.components.shell.Notifications.Notifications");
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
- var oSelectedList = this.getNotificationList(sSortingType),
364
- iItemsLength = oSelectedList.getItems().length,
365
- oLastItem = oSelectedList.getItems()[iItemsLength - 1];
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
- var oSelectedList = this.getNotificationList(sSortingType),
371
- iNotificationCount = Math.floor(this.oNotificationsService.getNotificationsCount()),
372
- iMoreNotificationsNumber = iNotificationCount - this.iMaxNotificationItemsForDevice,
373
- bIsMoreCircleExist = this.isMoreCircleExist(sSortingType);
374
-
375
- this.getView().getModel().setProperty("/" + this.sCurrentSorting + "/moreNotificationCount", iMoreNotificationsNumber);
376
- this.getView().getModel().setProperty("/" + this.sCurrentSorting + "/listMaxReached", iMoreNotificationsNumber >= 0);
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
- var oModel = this.getView().getModel(),
386
- aGroups = oModel.getProperty("/notificationsByTypeDescending");
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
- var oModel = this.getView().getModel(),
394
- aGroups = oModel.getProperty("/notificationsByTypeDescending"),
395
- oRemovedGroup = {
396
- oGroup: oGroupToDelete,
397
- removedGroupIndex: undefined
398
- };
399
-
400
- aGroups.some(function (oGroup, iIndex) {
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
- var oPromise = this.oNotificationsService.getNotificationsGroupHeaders(),
415
- that = this,
416
- aGroups = that.getView().getModel().getProperty("/" + that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
417
- oPromise.catch(function (data) {
418
- Log.error("Notifications control - call to notificationsService.updateGroupHeaders failed: ", data, "sap.ushell.components.shell.Notifications.Notifications");
419
- });
420
- oPromise.then(function (notificationsByType) {
421
- var oJson = JSON.parse(notificationsByType),
422
- arr = oJson.value;
423
-
424
- arr.forEach(function (item) {
425
- var bFound = false;
426
- aGroups.forEach(function (group, iIndex) {
427
- if (group.Id === item.Id) {
428
- aGroups[iIndex].GroupHeaderText = item.GroupHeaderText;
429
- aGroups[iIndex].CreatedAt = item.CreatedAt;
430
- bFound = true;
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
- if (!bFound) {
434
- aGroups.unshift(item);
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
- var iTop = this.getNumberOfItemsToFetchOnScroll(this.sCurrentSorting);
415
+ const iTop = this.getNumberOfItemsToFetchOnScroll(this.sCurrentSorting);
443
416
 
444
417
  this.oNotificationsService.getNotificationsBufferBySortingType(this.sCurrentSorting, 0, iTop)
445
- .then(function (aNotifications) {
446
- this.getView().getModel().setProperty("/" + this.sCurrentSorting + "/aNotifications", aNotifications);
447
- this.removeBusyIndicatorToTabFilter(this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING);
448
- }.bind(this))
449
- .catch(function (error) {
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
- }.bind(this));
428
+ });
453
429
  },
454
430
 
455
431
  reloadGroupHeaders: function () {
456
- var oPromise = this.oNotificationsService.getNotificationsGroupHeaders(),
457
- that = this;
458
- oPromise.catch(function (data) {
459
- Log.error("Notifications control - call to notificationsService.getNotificationsGroupHeaders failed: ", data, "sap.ushell.components.shell.Notifications.Notifications");
460
- that.removeBusyIndicatorToTabFilter(that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
461
- });
462
- oPromise.then(function (notificationsByType) {
463
- var oJson = JSON.parse(notificationsByType),
464
- arr = oJson.value,
465
- result = [];
466
- arr.forEach(function (item) {
467
- if (item.IsGroupHeader) {
468
- item.Collapsed = true;
469
- result.push(item);
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
- var oPromise = this.oNotificationsService.markRead(sNotificationId),
479
- that = this;
480
- oPromise.catch(function () {
455
+ this.oNotificationsService.markRead(sNotificationId).catch(() => {
481
456
  _errorMessage(resources.i18n.getText("notificationsFailedMarkRead"));
482
- that.setMarkReadOnModel(sNotificationId, false);
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
- var oThatGroup = oGroup,
505
- oPromise = this.oNotificationsService.executeBulkAction(oGroup.Id, sActionName),
506
- sMessage,
507
- sGroupActionText = sActionText,
508
- sNotificationTypeDesc = this.getView().getModel().getProperty(sPathToNotification + "/NotificationTypeDesc"),
509
- that = this;
510
-
511
- if (sNotificationTypeDesc === "") {
512
- sNotificationTypeDesc = this.getView().getModel().getProperty(sPathToNotification + "/NotificationTypeKey");
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
- } else if (oResult.succededNotifications.length > 1) {
535
- sMessage = resources.i18n.getText("notificationsSingleSuccessExecuteBulkAction", [
536
- sGroupActionText,
537
- oResult.succededNotifications.length,
538
- oResult.failedNotifications.length + oResult.succededNotifications.length,
539
- sNotificationTypeDesc,
540
- oResult.failedNotifications.length
541
- ]);
542
- MessageToast.show(sMessage, { duration: 4000 });
543
- } else {
544
- sMessage = resources.i18n.getText("notificationsFailedExecuteBulkAction");
545
- _errorMessage(sMessage);
546
- }
547
- }.bind(this));
548
-
549
- oPromise.then(function () {
550
- sMessage = resources.i18n.getText("notificationsSuccessExecuteBulkAction", [
551
- sGroupActionText, sNotificationTypeDesc
552
- ]);
553
- MessageToast.show(sMessage, { duration: 4000 });
554
- this.removeGroupFromModel(oThatGroup);
555
- // There is need to load again the other 2 tabs, therefore we need to "clean" other models.
556
- this.cleanModel();
557
- }.bind(this));
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
- var that = this,
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
- oPromise.catch(function () {
537
+ this.oNotificationsService.dismissNotification(notificationId).catch(() => {
570
538
  _errorMessage(resources.i18n.getText("notificationsFailedDismiss"));
571
- that.addNotificationToModel(oRemovedNotification.obj, oRemovedNotification.index);
539
+ this.addNotificationToModel(oRemovedNotification.obj, oRemovedNotification.index);
572
540
  });
573
541
  },
574
542
 
575
543
  dismissBulkNotifications: function (oGroup) {
576
- var oRemovedGroup = this.removeGroupFromModel(oGroup),
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
- oPromise.catch(function () {
547
+ this.oNotificationsService.dismissBulkNotifications(oGroup.Id).catch(() => {
581
548
  _errorMessage(resources.i18n.getText("notificationsFailedExecuteBulkAction"));
582
549
  this.reAddFailedGroup(oRemovedGroup);
583
- }.bind(this));
550
+ });
584
551
  },
585
552
 
586
553
  onListItemPress: function (sNotificationId, sSemanticObject, sAction, aParameters) {
587
554
  if (sSemanticObject && sAction) {
588
- var viewPortContainer = Element.getElementById("viewPortContainer");
589
- if (viewPortContainer) { // qUnits do not create the viewport container
590
- viewPortContainer.switchState("Center");
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
- var jqNotificationItems = this._getJqNotificationObjects(),
602
- jqNotificationContainerContent = jqNotificationItems[0],
603
- jqNotificationsContent = jqNotificationItems[1],
604
- jqNotificationsList = jqNotificationItems[2],
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
- notificationIndex = this.getIndexInModelByItemId(oTopNotificationData.topItemId);
618
- notificationIndex = notificationIndex || 0;
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
- containerPadding = window.parseInt(jqNotificationsContent.css("padding-top").replace("px", ""))
581
+ const iContainerPadding = window.parseInt(jqNotificationsContent.css("padding-top").replace("px", ""))
622
582
  + window.parseInt(jqNotificationsList.css("padding-top").replace("px", ""));
623
- notificationContainerOffSet = jqNotificationContainerContent.offset().top;
583
+ const iNotificationContainerOffset = jqNotificationContainerContent.offset().top;
624
584
 
625
- jqNotificationContainerContent.scrollTop(indexOffSet + containerPadding + notificationContainerOffSet - oTopNotificationData.offSetTop);
585
+ jqNotificationContainerContent.scrollTop(iOffset + iContainerPadding + iNotificationContainerOffset - oTopNotificationData.offSetTop);
626
586
  }
627
587
  this._oTopNotificationData = undefined;
628
588
  },
629
589
 
630
- _getJqNotificationObjects: function () {
631
- var jqNotificationContainerContent = jQuery("#notificationIconTabBar-containerContent"),
632
- jqNotificationsContent = jqNotificationContainerContent.children(),
633
- jqNotificationsList = jqNotificationsContent.children(),
634
- jqNotificationItem = jqNotificationContainerContent.find("li").eq(0);
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
- topOffSet += jqContainerContent.children().outerHeight() - jqContainerContent.children().height();
596
+ iTopOffset += jqNotificationsContent.outerHeight() - jqNotificationsContent.height();
645
597
  // Get the inner space/margin
646
- topOffSet += jqContainerContent.children().children().outerHeight() - jqContainerContent.children().children().height();
598
+ iTopOffset += jqNotificationsList.outerHeight() - jqNotificationsList.height();
647
599
  }
648
- return topOffSet;
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
- var jqContainerContent = this._getJqNotificationObjects()[0],
658
- topOffSet = 0,
659
- sItemId,
660
- itemOffsetTop = 0,
661
- that = this;
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
- topOffSet = this.getTopOffSet();
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(this).offset().top;
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 >= topOffSet) {
671
- sItemId = that.getItemNotificationId(this);
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
- var oList = this.getNotificationList(sSortingType);
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
- var oList = this.getNotificationList(sSortingType);
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
- var oModel = this.getView().getModel(),
706
- notifications = oModel.getProperty("/" + this.sCurrentSorting + "/aNotifications");
707
- notifications.splice(index, 0, oNotification);
708
- oModel.setProperty("/" + this.sCurrentSorting + "/aNotifications", notifications);
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
- var oModel = this.getView().getModel(),
713
- aGroups,
714
- notifications,
715
- sNotificationsModelPath,
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
- sNotificationsModelPath = "/" + this.sCurrentSorting + "/aNotifications";
722
- notifications = oModel.getProperty(sNotificationsModelPath);
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(sNotificationsModelPath, notifications);
672
+ oModel.setProperty(`/${this.sCurrentSorting}/aNotifications`, aNotifications);
732
673
  return oRemovedNotification;
733
674
  }
734
675
 
735
- aGroups = oModel.getProperty("/notificationsByTypeDescending");
736
- for (var index = 0; index < aGroups.length; index++) {
737
- notifications = aGroups[index].aNotifications;
738
- if (notifications) {
739
- if (notifications.length === 1 && notifications[0].Id === notificationId) {
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
- notifications.some(function (notification, index, array) {
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 = notifications;
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
- var aNotifications,
767
- index;
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
- var that = this,
789
- oSortingTypesArray = this.getView().getModel().getProperty("/");
726
+ const oView = this.getView();
727
+ const oModel = oView.getModel();
728
+ const oSortingTypesArray = oModel.getProperty("/");
790
729
 
791
- Object.keys(oSortingTypesArray).forEach(function (sSortKey) {
792
- if (sSortKey !== that.sCurrentSorting && sSortKey !== that.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING) {
793
- oSortingTypesArray[sSortKey] = that.getInitialSortingModelStructure();
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
- this.getView().getModel().setProperty("/", oSortingTypesArray);
736
+ oModel.setProperty("/", oSortingTypesArray);
798
737
  },
799
738
 
800
739
  replaceItemsInModel: function (sSortingType, oResult, iNumberOfItemsToFetch) {
801
- var aCurrentItems = this.getItemsFromModel(sSortingType),
802
- iCurrentNumberOfItems = aCurrentItems.length,
803
- hasMoreItemsToFetch = oResult.length >= iNumberOfItemsToFetch;
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
- this.getView().getModel().setProperty("/" + sSortingType + "/hasMoreItemsInBackend", hasMoreItemsToFetch);
809
-
810
- this.getView().getModel().setProperty("/" + sSortingType + "/aNotifications", oResult);
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
- var oModel = this.getView().getModel(),
818
- sPath = "/" + this.sCurrentSorting,
819
- aNotifications,
820
- oData,
821
- bGroupFound,
822
- i;
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 + "/" + i;
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 + "/aNotifications";
774
+ sPath = `${sPath}/aNotifications`;
838
775
 
839
- aNotifications = oModel.getProperty(sPath);
840
- aNotifications.some(function (notification) {
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
- var key = evt.getParameter("key");
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
- this.getView().byId("notificationIconTabBar").addStyleClass("sapUshellNotificationIconTabByTypeWithBusyIndicator");
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
- var oModelPath = oEvent.getSource().getBindingContextPath(),
907
- oModelPart = this.getView().getModel().getProperty(oModelPath),
908
- sSemanticObject = oModelPart.NavigationTargetObject,
909
- sAction = oModelPart.NavigationTargetAction,
910
- aParameters = oModelPart.NavigationTargetParams,
911
- sNotificationId = oModelPart.Id;
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
- var sNotificationPathInModel = oEvent.getSource().getBindingContextPath(),
919
- oNotificationModelEntry = this.getView().getModel().getProperty(sNotificationPathInModel),
920
- sNotificationId = oNotificationModelEntry.Id;
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
- var sNotificationPathInModel = oEvent.getSource().getBindingContext().getPath(),
928
- oModel = this.getView().getModel(),
929
- oNotificationModelPart = oModel.getProperty(sNotificationPathInModel),
930
- aPathParts = sNotificationPathInModel.split("/"),
931
- bTypeTabSelected = this.sCurrentSorting === this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING,
932
- sPathToNotification = bTypeTabSelected
933
- ? "/" + aPathParts[1] + "/" + aPathParts[2] + "/" + aPathParts[3] + "/" + aPathParts[4]
934
- : "/" + aPathParts[1] + "/" + aPathParts[2] + "/" + aPathParts[3],
935
- oNotificationModelEntry = oModel.getProperty(sPathToNotification),
936
- sNotificationId = oNotificationModelEntry.Id;
937
-
938
- oModel.setProperty(sPathToNotification + "/Busy", true);
939
-
940
- this.executeAction(sNotificationId, oNotificationModelPart.ActionId).then(function (responseAck) {
941
- if (responseAck && responseAck.isSucessfull) {
942
- sap.ui.require(["sap/m/MessageToast"], function (MessageToast) {
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
- var sActionText = oNotificationModelPart.ActionText;
863
+ const sActionText = oNotificationModelPart.ActionText;
947
864
  MessageToast.show(resources.i18n.getText("ActionAppliedToNotification", [sActionText]), { duration: 4000 });
948
865
  }
949
- });
950
866
 
951
- // Notification should remain in the UI (after action executed) only if DeleteOnReturn flag exists, and equals false
952
- if (responseAck.DeleteOnReturn !== false) {
953
- this.removeNotificationFromModel(sNotificationId);
954
- this.oNotificationsService._addDismissNotifications(sNotificationId);
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
- // There is need to load again the other 2 tabs, therefore we need to "clean" other models.
957
- this.cleanModel();
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
- } else if (responseAck) {
960
- _errorMessage(responseAck.message);
961
- } else {
880
+ })
881
+ .catch(() => {
962
882
  _errorMessage(resources.i18n.getText("notificationsFailedExecuteAction"));
963
- }
964
- oModel.setProperty(sPathToNotification + "/Busy", false);
965
- }.bind(this)).catch(function () {
966
- oModel.setProperty(sPathToNotification + "/Busy", false);
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
- var sNotificationPathInModel = oEvent.getSource().getBindingContext().getPath(),
973
- aPathParts = sNotificationPathInModel.split("/"),
974
- sPathToNotification = "/" + aPathParts[1] + "/" + aPathParts[2],
975
- oNotificationModelEntry = this.getView().getModel().getProperty(sPathToNotification);
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
- var group = oEvent.getSource(),
982
- path = group.getBindingContext().getPath();
983
- if (!group.getCollapsed()) {
984
- this.getView().getModel().setProperty(path + "/Busy", true);
985
- this.expandedGroupIndex = path.substring(path.lastIndexOf("/") + 1);
986
- this.onExpandGroup(group);
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
- var oModel = this.getView().getModel(),
992
- sNotificationPathInModel = oEvent.getSource().getBindingContext().getPath(),
993
- oNotificationModelPart = oModel.getProperty(sNotificationPathInModel),
994
- aPathParts = sNotificationPathInModel.split("/"),
995
- sPathToNotification = "/" + aPathParts[1] + "/" + aPathParts[2],
996
- oNotificationModelEntry = oModel.getProperty(sPathToNotification);
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 + "/Busy", true);
926
+ oModel.setProperty(`${sPathToNotification}/Busy`, true);
1002
927
 
1003
- this.executeBulkAction(oNotificationModelPart.ActionId, oEvent.getSource().getProperty("text"), oNotificationModelEntry, sPathToNotification);
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 (!this.getView().getModel().getProperty("/" + this.sCurrentSorting + "/inUpdate")) {
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
- var iItemsInScreen,
1019
- iHeight = this.getWindowSize();
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
- var iCurrentNumberOfItems = (this.getItemsFromModel(sSortingType) || []).length,
1047
- iBasicBufferSize = this.getBasicBufferSize();
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
- var iBasicBufferSize = this.getBasicBufferSize(),
1071
- iNumberOfRequiredBasicBuffers = Math.ceil(iNumberOfItemsInModel / iBasicBufferSize),
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 this.getView().getModel().getProperty("/" + sortingType + "/aNotifications");
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
- var aGroupHeaders = this.getView().getModel().getProperty("/" + this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING);
1098
- return aGroupHeaders.find(function (group) {
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
- var aGroupHeaders = this.getView().getModel().getProperty("/" + this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING),
1105
- iIndex;
1106
- aGroupHeaders.forEach(function (group, index) {
1107
- if (group.Id === sTypeHeader) {
1108
- iIndex = index;
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
- var sItemModelPath,
1118
- sItemNotificationId;
1119
- sItemModelPath = Element.getElementById(elNotificationItem.getAttribute("Id")).getBindingContext().sPath;
1120
-
1121
- sItemNotificationId = this.getView().getModel().getProperty(sItemModelPath + "/Id");
1122
- return sItemNotificationId;
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
- var listItems = this.getView().byId("sapUshellNotificationsListType").getItems(),
1137
- groupElementId = groupElement.getId(),
1138
- oGroup = this.getView().getModel().getProperty(groupElement.getBindingContextPath()),
1139
- that = this;
1140
- that.sCurrentExpandedType = oGroup.Id;
1141
- that.getView().getModel().setProperty(groupElement.getBindingContextPath() + "/aNotifications", []);
1142
- that.getView().getModel().setProperty(groupElement.getBindingContextPath() + "/hasMoreItems", true);
1143
- listItems.forEach(function (item, index) {
1144
- if (item.getId() === groupElementId) {
1145
- that.getNextBufferForType();
1146
- } else if (item.getId() !== groupElementId && !item.getCollapsed()) {
1147
- item.setCollapsed(true);
1148
- that.getView().getModel().setProperty(item.getBindingContextPath() + "/hasMoreItems", true);
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
- var selectedTypeId = this.sCurrentExpandedType,
1155
- sSortingType = this.oSortingType.NOTIFICATIONS_BY_TYPE_DESCENDING,
1156
- oGroup = this.getGroupFromModel(selectedTypeId),
1157
- aCurrentItems = oGroup ? oGroup.aNotifications : undefined,
1158
- iNumberOfItemsInModel = 0,
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
- oPromise = this.oNotificationsService.getNotificationsBufferInGroup(selectedTypeId, 0, this.getNumberOfItemsToFetchOnUpdate(iNumberOfItemsInModel));
1174
-
1175
- oPromise.then(function (oResult) {
1176
- this.addTypeBufferToModel(selectedTypeId, oResult, true);
1177
- }.bind(this));
1178
-
1179
- oPromise.catch(function (oResult) {
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
- var oList;
1187
-
1188
- if (sSortingType === this.oSortingType.NOTIFICATIONS_BY_DATE_DESCENDING ||
1189
- sSortingType === this.oSortingType.NOTIFICATIONS_BY_DATE_ASCENDING) {
1190
- oList = this.getView().byId("sapUshellNotificationsListDate");
1191
- } else if (sSortingType === this.oSortingType.NOTIFICATIONS_BY_PRIORITY_DESCENDING) {
1192
- oList = this.getView().byId("sapUshellNotificationsListPriority");
1193
- } else {
1194
- oList = this.getView().byId("sapUshellNotificationsListType");
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
- var oListControl = this.getNotificationList(sSortingType);
1208
- var oListTag = oListControl.$().children().get(1);
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
- var oMoreText = new Text({ text: resources.i18n.getText("moreNotifications") }),
1216
- oNotificationCountText = new Text({ text: "" }).addStyleClass("sapUshellNotificationsMoreCircleCount"),
1217
- oMoreCircle = new VBox({
1218
- items: [oNotificationCountText, oMoreText],
1219
- alignItems: FlexAlignItems.Center
1220
- }).addStyleClass("sapUshellNotificationsMoreCircle"),
1221
- oBelowCircleTextPart1 = new Text({
1222
- text: resources.i18n.getText("moreNotificationsAvailable_message"),
1223
- textAlign: "Center"
1224
- }).addStyleClass("sapUshellNotificationsMoreHelpingText"),
1225
- oBelowCircleTextPart2 = new Text({
1226
- text: resources.i18n.getText("processNotifications_message"),
1227
- textAlign: "Center"
1228
- }).addStyleClass("sapUshellNotificationsMoreHelpingText"),
1229
- oVBox = new VBox({
1230
- items: [oMoreCircle, oBelowCircleTextPart1, oBelowCircleTextPart2]
1231
- }).addStyleClass("sapUshellNotificationsMoreVBox"),
1232
- oListItem = new CustomListItem({
1233
- type: ListType.Inactive,
1234
- content: oVBox
1235
- }).addStyleClass("sapUshellNotificationsMoreListItem");
1236
-
1237
- oNotificationCountText.setModel(this.getView().getModel());
1238
- oNotificationCountText.bindText("/" + sType + "/moreNotificationCount");
1239
- this.oMoreListItem = oListItem;
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
- var oIconTabBar = this.getView().byId("notificationIconTabBar"),
1247
- sKey = oIconTabBar.getSelectedKey(),
1248
- aItems = oIconTabBar.getItems(),
1249
- iSelected = 0;
1250
-
1251
- aItems.forEach(function (oItem, index) {
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].focus();
1165
+ const oFocusableItem = aItems[iSelected];
1166
+ if (oFocusableItem) {
1167
+ oFocusableItem.focus();
1168
+ }
1257
1169
  },
1258
1170
 
1259
1171
  //*********************************************************************************************************