@sapui5/sap.ushell 1.119.3 → 1.120.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 (392) hide show
  1. package/package.json +1 -1
  2. package/src/main/js/sap/ushell/.library +3 -3
  3. package/src/main/js/sap/ushell/Container.js +272 -41
  4. package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
  5. package/src/main/js/sap/ushell/Fiori20AdapterTest.js +3 -2
  6. package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
  7. package/src/main/js/sap/ushell/SessionHandler.js +11 -6
  8. package/src/main/js/sap/ushell/TechnicalParameters.js +1 -1
  9. package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
  10. package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +1 -1
  11. package/src/main/js/sap/ushell/Ui5ServiceFactory.js +1 -1
  12. package/src/main/js/sap/ushell/User.js +26 -35
  13. package/src/main/js/sap/ushell/_ApplicationType/urlTemplateResolution.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 +15 -11
  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 +16 -11
  26. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
  27. package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +18 -0
  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/LaunchPageAdapter.js +1 -1
  37. package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
  38. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
  39. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
  40. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
  41. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
  42. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
  43. package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
  44. package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +1 -1
  45. package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +1 -1
  46. package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +1 -1
  47. package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
  48. package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +24 -18
  49. package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +1 -1
  50. package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -1
  51. package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
  52. package/src/main/js/sap/ushell/adapters/local/MenuAdapter.js +4 -7
  53. package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +17 -22
  54. package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
  55. package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
  56. package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
  57. package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +19 -0
  58. package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
  59. package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
  60. package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
  61. package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
  62. package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +11 -7
  63. package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +8 -8
  64. package/src/main/js/sap/ushell/api/RTA.js +47 -0
  65. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +12 -5
  66. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeContext.js +2 -2
  67. package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
  68. package/src/main/js/sap/ushell/bootstrap/SchedulingAgent.js +2 -2
  69. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
  70. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
  71. package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def-dev.js +6 -3
  72. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
  73. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ushell.js +3 -0
  74. package/src/main/js/sap/ushell/bootstrap/common/common.load.launchpad.js +1 -1
  75. package/src/main/js/sap/ushell/bootstrap/common/common.util.js +34 -2
  76. package/src/main/js/sap/ushell/bootstrap/sandbox2.js +7 -2
  77. package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
  78. package/src/main/js/sap/ushell/components/HomepageManager.js +5 -5
  79. package/src/main/js/sap/ushell/components/SharedComponentUtils.js +7 -10
  80. package/src/main/js/sap/ushell/components/_HeaderManager/ShellHeader.controller.js +3 -3
  81. package/src/main/js/sap/ushell/components/_HomepageManager/DashboardLoadingManager.js +5 -0
  82. package/src/main/js/sap/ushell/components/_HomepageManager/PagingManager.js +5 -0
  83. package/src/main/js/sap/ushell/components/_HomepageManager/PersistentPageOperationAdapter.js +5 -0
  84. package/src/main/js/sap/ushell/components/_HomepageManager/TransientPageOperationAdapter.js +5 -0
  85. package/src/main/js/sap/ushell/components/appfinder/AppFinderView.js +1 -1
  86. package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +1 -1
  87. package/src/main/js/sap/ushell/components/appfinder/EasyAccess.controller.js +3 -3
  88. package/src/main/js/sap/ushell/components/appfinder/EasyAccessView.js +0 -8
  89. package/src/main/js/sap/ushell/components/appfinder/HierarchyApps.controller.js +4 -4
  90. package/src/main/js/sap/ushell/components/appfinder/HierarchyFolders.controller.js +18 -16
  91. package/src/main/js/sap/ushell/components/appfinder/manifest.json +2 -2
  92. package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -2
  93. package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
  94. package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
  95. package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +2 -2
  96. package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +1 -1
  97. package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
  98. package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
  99. package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +1 -1
  100. package/src/main/js/sap/ushell/components/cards/Card.controller.js +2 -2
  101. package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +92 -71
  102. package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
  103. package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +1 -1
  104. package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
  105. package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
  106. package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
  107. package/src/main/js/sap/ushell/components/contentFinder/model/formatter.js +4 -4
  108. package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
  109. package/src/main/js/sap/ushell/components/homeApp/error/manifest.json +1 -1
  110. package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
  111. package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
  112. package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +1 -1
  113. package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +1 -1
  114. package/src/main/js/sap/ushell/components/homepage/manifest.json +2 -2
  115. package/src/main/js/sap/ushell/components/pages/ActionMode.js +5 -5
  116. package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
  117. package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
  118. package/src/main/js/sap/ushell/components/pages/StateManager.js +37 -24
  119. package/src/main/js/sap/ushell/components/pages/controller/ImportDialog.controller.js +1 -1
  120. package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +1 -1
  121. package/src/main/js/sap/ushell/components/pages/manifest.json +2 -2
  122. package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +7 -4
  123. package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
  124. package/src/main/js/sap/ushell/components/shell/MenuBar/controller/MenuBar.controller.js +6 -7
  125. package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +2 -2
  126. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +39 -13
  127. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +3 -3
  128. package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +5 -5
  129. package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +25 -45
  130. package/src/main/js/sap/ushell/components/shell/PostLoadingHeaderEnhancement/Component.js +2 -2
  131. package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
  132. package/src/main/js/sap/ushell/components/shell/Search/ESearch.js +1 -1
  133. package/src/main/js/sap/ushell/components/shell/Search/manifest.json +2 -2
  134. package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +2 -2
  135. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchCEP.controller.js +3 -3
  136. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
  137. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
  138. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
  139. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
  140. package/src/main/js/sap/ushell/components/shell/Settings/Component.js +4 -4
  141. package/src/main/js/sap/ushell/components/shell/Settings/ProfilingLoader.js +4 -0
  142. package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.controller.js +4 -0
  143. package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.view.xml +4 -3
  144. package/src/main/js/sap/ushell/components/shell/Settings/homepage/HomepageEntry.js +10 -13
  145. package/src/main/js/sap/ushell/components/shell/Settings/notifications/NotificationsSetting.controller.js +13 -22
  146. package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountSelector.controller.js +2 -2
  147. package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.controller.js +11 -14
  148. package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/manifest.json +1 -1
  149. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
  150. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/UserActionsMenu.controller.js +2 -2
  151. package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +2 -2
  152. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +4 -6
  153. package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +14 -18
  154. package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
  155. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
  156. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +16 -12
  157. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +1 -1
  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 +1 -1
  165. package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +3 -3
  166. package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
  167. package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -2
  168. package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
  169. package/src/main/js/sap/ushell/components/workPageRuntime/services/NavigationResolver.js +1 -1
  170. package/src/main/js/sap/ushell/components/workPageRuntime/services/WorkPage.js +1 -1
  171. package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
  172. package/src/main/js/sap/ushell/library.js +1 -1
  173. package/src/main/js/sap/ushell/navigationMode.js +1 -1
  174. package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
  175. package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
  176. package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
  177. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/AccessKeysHandler.js +1 -1
  178. package/src/main/js/sap/ushell/renderer/History.js +84 -0
  179. package/src/main/js/sap/ushell/renderer/LogonFrameProvider.js +96 -0
  180. package/src/main/js/sap/ushell/renderer/Renderer.js +2851 -0
  181. package/src/main/js/sap/ushell/renderer/Shell.controller.js +3155 -0
  182. package/src/main/js/sap/ushell/{renderers/fiori2/ShellAsync.view.js → renderer/Shell.view.js} +29 -18
  183. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/ShellLayout.js +3 -3
  184. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.controller.js +4 -4
  185. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.view.xml +1 -1
  186. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsKeyboardHandler.js +108 -0
  187. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsManager.js +453 -0
  188. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources.properties +4 -0
  189. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/Component.js +3 -3
  190. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/CEPSearchApp.controller.js +1 -1
  191. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/SearchApp.controller.js +1 -1
  192. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/manifest.json +2 -2
  193. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/CEPSearchApp.view.js +2 -2
  194. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/SearchApp.view.js +2 -2
  195. package/src/main/js/sap/ushell/renderers/fiori2/History.js +7 -68
  196. package/src/main/js/sap/ushell/renderers/fiori2/LogonFrameProvider.js +9 -79
  197. package/src/main/js/sap/ushell/renderers/fiori2/Renderer.js +101 -1882
  198. package/src/main/js/sap/ushell/renderers/fiori2/RendererExtensions.js +2 -3
  199. package/src/main/js/sap/ushell/renderers/fiori2/Shell.controller.js +8 -3130
  200. package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +7 -7
  201. package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsKeyboardHandler.js +7 -92
  202. package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsManager.js +8 -438
  203. package/src/main/js/sap/ushell/resources.js +1 -1
  204. package/src/main/js/sap/ushell/services/AllMyApps.js +16 -7
  205. package/src/main/js/sap/ushell/services/AppConfiguration.js +12 -0
  206. package/src/main/js/sap/ushell/services/AppLifeCycle.js +11 -14
  207. package/src/main/js/sap/ushell/services/AppState.js +12 -8
  208. package/src/main/js/sap/ushell/services/Bookmark.js +15 -13
  209. package/src/main/js/sap/ushell/services/BookmarkV2.js +919 -0
  210. package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +229 -241
  211. package/src/main/js/sap/ushell/services/CommonDataModel.js +14 -4
  212. package/src/main/js/sap/ushell/services/Configuration.js +12 -11
  213. package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +13 -10
  214. package/src/main/js/sap/ushell/services/Container.js +1 -1
  215. package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
  216. package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +8 -6
  217. package/src/main/js/sap/ushell/services/DarkModeSupport.js +16 -10
  218. package/src/main/js/sap/ushell/services/EndUserFeedback.js +1 -1
  219. package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +103 -0
  220. package/src/main/js/sap/ushell/services/Extension/Footer.js +61 -0
  221. package/src/main/js/sap/ushell/services/Extension/Header.js +193 -0
  222. package/src/main/js/sap/ushell/services/Extension/Item.js +195 -0
  223. package/src/main/js/sap/ushell/services/Extension/SidePane.js +155 -0
  224. package/src/main/js/sap/ushell/services/Extension/ToolArea.js +152 -0
  225. package/src/main/js/sap/ushell/services/Extension.js +381 -0
  226. package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
  227. package/src/main/js/sap/ushell/services/Menu.js +48 -59
  228. package/src/main/js/sap/ushell/services/Message.js +15 -14
  229. package/src/main/js/sap/ushell/services/MessageBroker.js +12 -12
  230. package/src/main/js/sap/ushell/services/NavTargetResolution.js +48 -70
  231. package/src/main/js/sap/ushell/services/Navigation/utils.js +565 -0
  232. package/src/main/js/sap/ushell/services/Navigation.js +152 -139
  233. package/src/main/js/sap/ushell/services/NavigationDataProvider.js +11 -8
  234. package/src/main/js/sap/ushell/services/Notifications.js +118 -1523
  235. package/src/main/js/sap/ushell/services/NotificationsV2.js +1872 -0
  236. package/src/main/js/sap/ushell/services/PageBuilding.js +11 -8
  237. package/src/main/js/sap/ushell/services/PagePersistence.js +11 -8
  238. package/src/main/js/sap/ushell/services/PageReferencing.js +11 -8
  239. package/src/main/js/sap/ushell/services/Pages.js +11 -15
  240. package/src/main/js/sap/ushell/services/Personalization.js +5 -3
  241. package/src/main/js/sap/ushell/services/PersonalizationV2/ContextContainer.js +410 -0
  242. package/src/main/js/sap/ushell/services/PersonalizationV2/Personalizer.js +109 -0
  243. package/src/main/js/sap/ushell/services/PersonalizationV2/TransientPersonalizer.js +57 -0
  244. package/src/main/js/sap/ushell/services/PersonalizationV2/Variant.js +180 -0
  245. package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSet.js +296 -0
  246. package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSetAdapter.js +125 -0
  247. package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapter.js +71 -0
  248. package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapterContainer.js +172 -0
  249. package/src/main/js/sap/ushell/services/PersonalizationV2/constants.js +23 -0
  250. package/src/main/js/sap/ushell/services/PersonalizationV2/constants.private.js +18 -0
  251. package/src/main/js/sap/ushell/services/PersonalizationV2/utils.js +233 -0
  252. package/src/main/js/sap/ushell/services/PersonalizationV2.js +641 -0
  253. package/src/main/js/sap/ushell/services/PluginManager.js +47 -55
  254. package/src/main/js/sap/ushell/services/ReferenceResolver.js +61 -54
  255. package/src/main/js/sap/ushell/services/Search.js +15 -2
  256. package/src/main/js/sap/ushell/services/SearchCEP.js +40 -44
  257. package/src/main/js/sap/ushell/services/SearchableContent.js +9 -9
  258. package/src/main/js/sap/ushell/services/ShellNavigation.js +14 -13
  259. package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
  260. package/src/main/js/sap/ushell/services/SpaceContent.js +9 -10
  261. package/src/main/js/sap/ushell/services/SupportTicket.js +14 -14
  262. package/src/main/js/sap/ushell/services/UITracer.js +31 -35
  263. package/src/main/js/sap/ushell/services/URLParsing.js +9 -11
  264. package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
  265. package/src/main/js/sap/ushell/services/URLTemplate.js +14 -13
  266. package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +29 -26
  267. package/src/main/js/sap/ushell/services/UsageAnalytics.js +6 -0
  268. package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +11 -7
  269. package/src/main/js/sap/ushell/services/UserDefaultParameters.js +20 -26
  270. package/src/main/js/sap/ushell/services/UserInfo.js +44 -23
  271. package/src/main/js/sap/ushell/services/UserRecents.js +13 -5
  272. package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +12 -9
  273. package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +10 -8
  274. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
  275. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
  276. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
  277. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
  278. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
  279. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
  280. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
  281. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +3 -4
  282. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +4 -4
  283. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
  284. package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
  285. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
  286. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
  287. package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +2 -1
  288. package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
  289. package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
  290. package/src/main/js/sap/ushell/services/_Personalization/ContextContainer.js +6 -0
  291. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainer.js +5 -1
  292. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariant.js +13 -9
  293. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariantSet.js +17 -13
  294. package/src/main/js/sap/ushell/services/_Personalization/Personalizer.js +5 -0
  295. package/src/main/js/sap/ushell/services/_Personalization/TransientPersonalizer.js +5 -1
  296. package/src/main/js/sap/ushell/services/_Personalization/Variant.js +4 -0
  297. package/src/main/js/sap/ushell/services/_Personalization/VariantSet.js +17 -9
  298. package/src/main/js/sap/ushell/services/_Personalization/VariantSetAdapter.js +4 -6
  299. package/src/main/js/sap/ushell/services/_Personalization/WindowAdapter.js +5 -44
  300. package/src/main/js/sap/ushell/services/_Personalization/WindowAdapterContainer.js +5 -101
  301. package/src/main/js/sap/ushell/services/_Personalization/constants.js +3 -0
  302. package/src/main/js/sap/ushell/services/_Personalization/constants.private.js +3 -0
  303. package/src/main/js/sap/ushell/services/_Personalization/utils.js +3 -0
  304. package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
  305. package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
  306. package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
  307. package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +29 -5
  308. package/src/main/js/sap/ushell/services/_UserRecents/UserRecentsBase.js +19 -27
  309. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstance.js +4 -0
  310. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceAbap.js +3 -0
  311. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceLink.js +1 -1
  312. package/src/main/js/sap/ushell/services/personalization/VariantSetAdapter.js +13 -15
  313. package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
  314. package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +4 -4
  315. package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +4 -4
  316. package/src/main/js/sap/ushell/themes/sap_horizon_hcb/ShellAppTitle.less +2 -2
  317. package/src/main/js/sap/ushell/themes/sap_horizon_hcw/ShellAppTitle.less +2 -2
  318. package/src/main/js/sap/ushell/ui/AppContainer.js +2 -2
  319. package/src/main/js/sap/ushell/ui/ContentNodeSelector.js +2 -2
  320. package/src/main/js/sap/ushell/ui/ShellHeader.js +2 -2
  321. package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
  322. package/src/main/js/sap/ushell/ui/footerbar/AddBookmarkButton.js +8 -12
  323. package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
  324. package/src/main/js/sap/ushell/ui/launchpad/Page.js +1 -1
  325. package/src/main/js/sap/ushell/ui/launchpad/Section.js +21 -8
  326. package/src/main/js/sap/ushell/ui/launchpad/TileState.js +0 -1
  327. package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
  328. package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +1 -1
  329. package/src/main/js/sap/ushell/ui/shell/ShellHeadItem.js +1 -1
  330. package/src/main/js/sap/ushell/ui/shell/SysInfoBar.js +1 -1
  331. package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
  332. package/src/main/js/sap/ushell/ui/utils.js +1 -1
  333. package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
  334. package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
  335. package/src/main/js/sap/ushell/ui5service/_ShellUIService/shelluiservice.class.factory.js +14 -26
  336. package/src/main/js/sap/ushell/utils/Deferred.js +88 -0
  337. package/src/main/js/sap/ushell/utils/UrlShortening.js +1 -1
  338. package/src/main/js/sap/ushell/utils/WindowUtils.js +8 -8
  339. package/src/main/js/sap/ushell/utils.js +31 -67
  340. package/src/test/js/sap/ushell/bootstrap/sandbox.js +7 -2
  341. package/ui5.yaml +8 -2
  342. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/HeadEndItemsOverflowPopover.fragment.xml +0 -0
  343. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ar.properties +0 -0
  344. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_bg.properties +0 -0
  345. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ca.properties +0 -0
  346. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cs.properties +0 -0
  347. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cy.properties +0 -0
  348. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_da.properties +0 -0
  349. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_de.properties +0 -0
  350. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_el.properties +0 -0
  351. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en.properties +0 -0
  352. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_GB.properties +0 -0
  353. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_sappsd.properties +0 -0
  354. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saprigi.properties +0 -0
  355. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saptrc.properties +0 -0
  356. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es.properties +0 -0
  357. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es_MX.properties +0 -0
  358. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_et.properties +0 -0
  359. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fi.properties +0 -0
  360. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr.properties +0 -0
  361. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr_CA.properties +0 -0
  362. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hi.properties +0 -0
  363. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hr.properties +0 -0
  364. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hu.properties +0 -0
  365. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_id.properties +0 -0
  366. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_it.properties +0 -0
  367. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_iw.properties +0 -0
  368. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ja.properties +0 -0
  369. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_kk.properties +0 -0
  370. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ko.properties +0 -0
  371. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lt.properties +0 -0
  372. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lv.properties +0 -0
  373. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ms.properties +0 -0
  374. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_nl.properties +0 -0
  375. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_no.properties +0 -0
  376. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pl.properties +0 -0
  377. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt.properties +0 -0
  378. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt_PT.properties +0 -0
  379. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ro.properties +0 -0
  380. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ru.properties +0 -0
  381. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sh.properties +0 -0
  382. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sk.properties +0 -0
  383. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sl.properties +0 -0
  384. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sv.properties +0 -0
  385. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_th.properties +0 -0
  386. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_tr.properties +0 -0
  387. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_uk.properties +0 -0
  388. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_vi.properties +0 -0
  389. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_CN.properties +0 -0
  390. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_TW.properties +0 -0
  391. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/util.js +0 -0
  392. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/utils.js +0 -0
@@ -0,0 +1,125 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/services/PersonalizationV2/constants.private",
4
+ "sap/ushell/services/PersonalizationV2/VariantSet"
5
+ ], function (constants, VariantSet) {
6
+ "use strict";
7
+ /**
8
+ * VariantSetAdapter amends ContextContainer with functionality to
9
+ *
10
+ * Example: An application has two types of variants.
11
+ * Variant type 1 contains filter values for a query, which are stored in item 1 of
12
+ * the variant, and personalization data for a table, which are stored in item 2
13
+ * of the variant.
14
+ * Variant type 2 contains a setting (item 3) that is independent of
15
+ * the filtering and the table settings. It might be used for a different
16
+ * screen than the variants of type 1.
17
+ * In this example you would have 2 variant sets, one for each variant type.
18
+ *
19
+ * @param {object} oContextContainer Context
20
+ *
21
+ * @name sap.ushell.services.PersonalizationV2.VariantSetAdapter
22
+ * @class
23
+ * @classdesc Wrapper object to expose a variant interface on a ContextContainer object obtained from the PersonalizationV2 service:
24
+ * <pre>
25
+ * oPersonalizationV2Service.getContainer(...).then(function(oContainer) {
26
+ * that.oVariantSetContainer = new VariantSetAdapter(oContainer);
27
+ * });
28
+ * </pre>
29
+ *
30
+ * @since 1.120.0
31
+ * @public
32
+ */
33
+ function VariantSetAdapter (oContextContainer) {
34
+ this._oContextContainer = oContextContainer;
35
+ }
36
+
37
+ /**
38
+
39
+ * @returns {Promise} Resolves when the save was successful
40
+ */
41
+ VariantSetAdapter.prototype.save = function () {
42
+ return this._oContextContainer.save();
43
+ };
44
+
45
+ /**
46
+ * Returns an array with the keys of the variant sets in the container.
47
+ * @returns {string[]} variant set keys
48
+ *
49
+ * @since 1.120.0
50
+ * @public
51
+ */
52
+ VariantSetAdapter.prototype.getVariantSetKeys = function () {
53
+ const aPrefixVariantSetKeys = this._oContextContainer._getInternalKeys();
54
+ const aVariantSetKeys = aPrefixVariantSetKeys.map(function (sEntry) {
55
+ return sEntry.replace(constants.S_VARIANT_PREFIX, "", "");
56
+ });
57
+ return aVariantSetKeys;
58
+ };
59
+
60
+ /**
61
+ * Checks if a specific variant set is contained in the container.
62
+ * @param {string} sVariantSetKey variant set key
63
+ * @returns {boolean} <code>true</code> if the container contains a variant set with the key
64
+ *
65
+ * @since 1.120.0
66
+ * @public
67
+ */
68
+ VariantSetAdapter.prototype.containsVariantSet = function (sVariantSetKey) {
69
+ return this.getVariantSetKeys().indexOf(sVariantSetKey) >= 0;
70
+ };
71
+
72
+ /**
73
+ * Returns the variant set object from the container.
74
+ * @param {string} sVariantSetKey variant set key. The string length is restricted to 40 characters.
75
+ * @returns {sap.ushell.services.PersonalizationV2.VariantSet} In case the container does not contain a variant set with this key
76
+ * <code>undefined</code> is returned.
77
+ *
78
+ * @since 1.120.0
79
+ * @public
80
+ */
81
+ VariantSetAdapter.prototype.getVariantSet = function (sVariantSetKey) {
82
+ const oVariantSet = this._oContextContainer._getItemValueInternal(constants.S_VARIANT_PREFIX, sVariantSetKey);
83
+ if (!oVariantSet) {
84
+ return;
85
+ }
86
+ return new VariantSet(sVariantSetKey, this._oContextContainer);
87
+ };
88
+
89
+ /**
90
+ * Creates a new variant set in the container.
91
+ * In case a variant set with this key is already existing an exception is thrown.
92
+ * @param {string} sVariantSetKey variant set key
93
+ * @returns {sap.ushell.services.PersonalizationV2.VariantSet} The new VariantSet
94
+ *
95
+ * @since 1.120.0
96
+ * @public
97
+ */
98
+ VariantSetAdapter.prototype.addVariantSet = function (sVariantSetKey) {
99
+ if (this.containsVariantSet(sVariantSetKey)) {
100
+ throw new Error(`Container already contains a variant set with key '${sVariantSetKey}': sap.ushell.services.Personalization`);
101
+ }
102
+ const oEmptyValue = {
103
+ currentVariant: null,
104
+ variants: {}
105
+ };
106
+ this._oContextContainer._setItemValueInternal(constants.S_VARIANT_PREFIX, sVariantSetKey, oEmptyValue);
107
+ const oVariantSet = new VariantSet(sVariantSetKey, this._oContextContainer);
108
+ return oVariantSet;
109
+ };
110
+
111
+ /**
112
+ * Deletes a variant set from the container.
113
+ * In case the variant set does not exist nothing happens.
114
+ * @param {string} sVariantSetKey variant set key
115
+ *
116
+ * @since 1.120.0
117
+ * @public
118
+ */
119
+ VariantSetAdapter.prototype.deleteVariantSet = function (sVariantSetKey) {
120
+ // TODO check if deleting a non-existing variant set goes through
121
+ this._oContextContainer._delItemInternal(constants.S_VARIANT_PREFIX, sVariantSetKey);
122
+ };
123
+
124
+ return VariantSetAdapter;
125
+ });
@@ -0,0 +1,71 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ui/thirdparty/jquery",
4
+ "sap/ushell/services/PersonalizationV2/WindowAdapterContainer"
5
+ ], function (jQuery, WindowAdapterContainer) {
6
+ "use strict";
7
+
8
+ /**
9
+ * @name sap.ushell.services.PersonalizationV2.WindowAdapter
10
+ * @class
11
+ * Container for storage with window validity, data is stored in WindowAdapter.prototype.data
12
+ *
13
+ * @param {object} oPersonalizationService ignored
14
+ * @param {object} oBackendAdapter BackendAdapter -> may be undefined
15
+ *
16
+ * @since 1.120.0
17
+ * @private
18
+ */
19
+ function WindowAdapter (oPersonalizationService, oBackendAdapter) {
20
+ this._oBackendAdapter = oBackendAdapter;
21
+
22
+ if (oBackendAdapter) {
23
+ this.supportsGetWithoutSubsequentLoad = oBackendAdapter.supportsGetWithoutSubsequentLoad;
24
+ }
25
+ }
26
+
27
+ WindowAdapter.prototype.data = {};
28
+
29
+ /**
30
+ * @param {string} sContainerKey
31
+ * @param {sap.ushell.services.PersonalizationV2.Scope} oScope
32
+ * @param {string} sAppName
33
+ * @returns
34
+ *
35
+ * @since 1.120.0
36
+ * @private
37
+ */
38
+ WindowAdapter.prototype.getAdapterContainer = function (sContainerKey, oScope, sAppName) {
39
+ const oBackendContainer = this._oBackendAdapter && this._oBackendAdapter.getAdapterContainer(sContainerKey, oScope, sAppName);
40
+ return new WindowAdapterContainer(sContainerKey, oScope, oBackendContainer, WindowAdapter);
41
+ };
42
+
43
+ /**
44
+ * @param {string} sContainerKey
45
+ * @param {sap.ushell.services.PersonalizationV2.Scope} oScope
46
+ * @returns {Promise}
47
+ *
48
+ * @since 1.120.0
49
+ * @private
50
+ */
51
+ WindowAdapter.prototype.delAdapterContainer = function (sContainerKey, oScope) {
52
+ // todo clarify
53
+ const oDeferred = new jQuery.Deferred();
54
+ delete WindowAdapter.prototype.data[sContainerKey];
55
+ if (this._oBackendAdapter) {
56
+ this._oBackendAdapter.delAdapterContainer(sContainerKey, oScope)
57
+ .done(function () {
58
+ oDeferred.resolve();
59
+ })
60
+ .fail(function (sMsg) {
61
+ oDeferred.reject(sMsg);
62
+ });
63
+ } else {
64
+ oDeferred.resolve();
65
+ }
66
+ return oDeferred.promise();
67
+ };
68
+
69
+ return WindowAdapter;
70
+
71
+ });
@@ -0,0 +1,172 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/utils",
4
+ "sap/ushell/services/PersonalizationV2/utils",
5
+ "sap/ui/thirdparty/jquery"
6
+ ], function (ushellUtils, personalizationUtils, jQuery) {
7
+ "use strict";
8
+
9
+ /**
10
+ * @name sap.ushell.services.PersonalizationV2.WindowAdapter
11
+ * @class
12
+ * Container for storage with window validity, data is stored in sap.ushell.services.Personalization.WindowValidityPersistence
13
+ *
14
+ * @since 1.120.0
15
+ * @private
16
+ */
17
+ function WindowAdapterContainer (sContainerKey, oScope, oBackendContainer, WindowAdapter) {
18
+ this._oBackendContainer = oBackendContainer;
19
+ this._oItemMap = new ushellUtils.Map();
20
+ this._sContainerKey = sContainerKey;
21
+ this.WindowAdapter = WindowAdapter;
22
+ }
23
+
24
+ /**
25
+ *
26
+ * @param {*} oContainer
27
+ *
28
+ * @since 1.120.0
29
+ * @private
30
+ */
31
+ function clear (oContainer) {
32
+ let i;
33
+ const keys = oContainer.getItemKeys();
34
+ for (i = 0; i < keys.length; i = i + 1) {
35
+ oContainer.delItem(keys[i]);
36
+ }
37
+ }
38
+
39
+ /**
40
+ *
41
+ * @returns
42
+ *
43
+ * @since 1.120.0
44
+ * @private
45
+ */
46
+ WindowAdapterContainer.prototype.load = function () {
47
+ const oDeferred = new jQuery.Deferred();
48
+ let i,
49
+ keys;
50
+ //Check if found in window object
51
+ if (this.WindowAdapter.prototype.data[this._sContainerKey]) {
52
+ //load data from window
53
+ this._oItemMap.entries = personalizationUtils.clone(this.WindowAdapter.prototype.data[this._sContainerKey]);
54
+
55
+ if (this._oBackendContainer) {
56
+ clear(this._oBackendContainer);
57
+
58
+ //Copy all items to the backend container
59
+ keys = this.getItemKeys();
60
+ for (i = 0; i < keys.length; i = i + 1) {
61
+ this._oBackendContainer.setItemValue(keys[i], this._oItemMap.get(keys[i]));
62
+ }
63
+ }
64
+ oDeferred.resolve();
65
+ } else if (this._oBackendContainer) { // attempt load data from front-end server
66
+ const that = this;
67
+ this._oBackendContainer.load().done(function () {
68
+ //copy received data from oAdapter into this._oItemMap.entries
69
+ keys = that._oBackendContainer.getItemKeys();
70
+ for (i = 0; i < keys.length; i = i + 1) {
71
+ that.setItemValue(keys[i], that._oBackendContainer.getItemValue(keys[i]));
72
+ }
73
+ //store immediately in the window variable so that the second load is satisfied from the window
74
+ this.WindowAdapter.prototype.data[that._sContainerKey] = personalizationUtils.clone(that._oItemMap.entries);
75
+ oDeferred.resolve();
76
+ }.bind(this)).fail(function (sMsg) {
77
+ oDeferred.reject(sMsg);
78
+ });
79
+ } else {
80
+ this.WindowAdapter.prototype.data[this._sContainerKey] = {};
81
+ oDeferred.resolve();
82
+ }
83
+ return oDeferred.promise();
84
+ };
85
+
86
+ /**
87
+ *
88
+ * @returns
89
+ *
90
+ * @since 1.120.0
91
+ * @private
92
+ */
93
+ WindowAdapterContainer.prototype.save = function () {
94
+ const oDeferred = new jQuery.Deferred();
95
+ this.WindowAdapter.prototype.data[this._sContainerKey] = personalizationUtils.clone(this._oItemMap.entries);
96
+ if (this._oBackendContainer) {
97
+ this._oBackendContainer.save().done(function () {
98
+ oDeferred.resolve();
99
+ }).fail(function (sMsg) {
100
+ oDeferred.reject(sMsg);
101
+ });
102
+ } else {
103
+ oDeferred.resolve();
104
+ }
105
+ return oDeferred.promise();
106
+ };
107
+
108
+ /**
109
+ *
110
+ * @returns
111
+ *
112
+ * @since 1.120.0
113
+ * @private
114
+ */
115
+ WindowAdapterContainer.prototype.getItemKeys = function () {
116
+ return this._oItemMap.keys();
117
+ };
118
+
119
+ /**
120
+ *
121
+ * @param {*} sItemKey
122
+ *
123
+ * @since 1.120.0
124
+ * @private
125
+ */
126
+ WindowAdapterContainer.prototype.containsItem = function (sItemKey) {
127
+ this._oItemMap.containsKey(sItemKey);
128
+ };
129
+
130
+ /**
131
+ *
132
+ * @param {*} sItemKey
133
+ * @returns
134
+ *
135
+ * @since 1.120.0
136
+ * @private
137
+ */
138
+ WindowAdapterContainer.prototype.getItemValue = function (sItemKey) {
139
+ return this._oItemMap.get(sItemKey);
140
+ };
141
+
142
+ /**
143
+ *
144
+ * @param {*} sItemKey
145
+ * @param {*} oItemValue
146
+ *
147
+ * @since 1.120.0
148
+ * @private
149
+ */
150
+ WindowAdapterContainer.prototype.setItemValue = function (sItemKey, oItemValue) {
151
+ this._oItemMap.put(sItemKey, oItemValue);
152
+ if (this._oBackendContainer) {
153
+ this._oBackendContainer.setItemValue(sItemKey, oItemValue);
154
+ }
155
+ };
156
+
157
+ /**
158
+ *
159
+ * @param {*} sItemKey
160
+ *
161
+ * @since 1.120.0
162
+ * @private
163
+ */
164
+ WindowAdapterContainer.prototype.delItem = function (sItemKey) {
165
+ this._oItemMap.remove(sItemKey);
166
+ if (this._oBackendContainer) {
167
+ this._oBackendContainer.delItem(sItemKey);
168
+ }
169
+ };
170
+
171
+ return WindowAdapterContainer;
172
+ });
@@ -0,0 +1,23 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ ], function () {
4
+ "use strict";
5
+
6
+ // these constants are exposed through the Personalization prototype
7
+
8
+ /**
9
+ * @name sap.ushell.services.PersonalizationV2.constants
10
+ * @since 1.120.0
11
+ * @public
12
+ */
13
+ return {
14
+ keyCategory: {
15
+ FIXED_KEY: "FIXED_KEY",
16
+ GENERATED_KEY: "GENERATED_KEY"
17
+ },
18
+ writeFrequency: {
19
+ HIGH: "HIGH",
20
+ LOW: "LOW"
21
+ }
22
+ };
23
+ });
@@ -0,0 +1,18 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ ], function () {
4
+ "use strict";
5
+
6
+ // these constants are never exposed outside the Personalization module
7
+
8
+ return {
9
+ S_CONTAINER_PREFIX: "sap.ushell.personalization#",
10
+ S_ITEM_PREFIX: "ITEM#",
11
+ S_VARIANT_PREFIX: "VARIANTSET#",
12
+ S_ABAPTIMESTAMPFORMAT: "yyyyMMddHHmmss",
13
+ S_ADMIN_PREFIX: "ADMIN#",
14
+ S_ITEMKEY_SCOPE: "sap-ushell-container-scope",
15
+ S_ITEMKEY_STORAGE: "sap-ushell-container-storageUTCTimestamp",
16
+ S_ITEMKEY_EXPIRE: "sap-ushell-container-expireUTCTimestamp"
17
+ };
18
+ });
@@ -0,0 +1,233 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/services/PersonalizationV2/constants",
4
+ "sap/ushell/services/PersonalizationV2/constants.private",
5
+ "sap/ushell/utils",
6
+ "sap/ui/thirdparty/jquery",
7
+ "sap/base/Log"
8
+ ], function (oConstants, oPrivateConstants, ushellUtils, jQuery, Log) {
9
+ "use strict";
10
+
11
+ /**
12
+ * Checks if given value is part of enum
13
+ * @param {string} entry The entry to check
14
+ * @param {object} passedEnum The enum to check
15
+ * @returns {boolean} Whether the entry exists in the enum
16
+ *
17
+ * @since 1.120.0
18
+ * @private
19
+ */
20
+ function checkIfEntryExistsInEnum (entry, passedEnum) {
21
+ let enumElement;
22
+ for (enumElement in passedEnum) {
23
+ if (typeof passedEnum[enumElement] !== "function") {
24
+ if (passedEnum.hasOwnProperty(enumElement)) {
25
+ if (enumElement === entry) {
26
+ return true;
27
+ }
28
+ }
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+
34
+ /**
35
+ * Adds a prefix to the container key
36
+ * @param {string} sContainerKey The container key
37
+ * @returns {string} The prefixed container key
38
+ *
39
+ * @since 1.120.0
40
+ * @private
41
+ */
42
+ function addContainerPrefix (sContainerKey) {
43
+ if (sContainerKey.length > 40) {
44
+ Log.error("Personalization Service container key (\"" + sContainerKey + "\") should be less than 40 characters [current :" + sContainerKey.length + "]");
45
+ }
46
+
47
+ return oPrivateConstants.S_CONTAINER_PREFIX + sContainerKey;
48
+ }
49
+
50
+ /**
51
+ * Chooses one adapter based on the given scope.
52
+ *
53
+ * @param {object} oOriginalScope
54
+ * The original, unadjusted scope.
55
+ * @param {object} oTransientAdapter
56
+ * An adapter that stores transient data.
57
+ * @param {object} oPersistentAdapter
58
+ * An adapter that persists data.
59
+ *
60
+ * @returns {variant}
61
+ * A loaded or not-yet-loaded adapter. If the adapter is not loaded, the
62
+ * return value is a function that when called returns a promise - that
63
+ * resolves to the adapter.
64
+ *
65
+ * @see #loadAdapter
66
+ *
67
+ * @since 1.120.0
68
+ * @private
69
+ */
70
+ function pickAdapter (oOriginalScope, oTransientAdapter, oPersistentAdapter) {
71
+ if (oOriginalScope && oOriginalScope.validity === 0) {
72
+ return oTransientAdapter;
73
+ }
74
+
75
+ return oPersistentAdapter;
76
+ }
77
+
78
+ /**
79
+ * Construct a cleansed scope object, returning only valid recognized parameters
80
+ * This functionality is used to cleanse user input
81
+ *
82
+ * @param {object} oScope The original scope
83
+ *
84
+ * @returns {object} The adjusted scope
85
+ *
86
+ * @since 1.120.0
87
+ * @private
88
+ */
89
+ function adjustScope (oScope) {
90
+ const oAdjustedScope = {
91
+ validity: Infinity,
92
+ keyCategory: oConstants.keyCategory.GENERATED_KEY,
93
+ writeFrequency: oConstants.writeFrequency.HIGH,
94
+ clientStorageAllowed: false
95
+ };
96
+
97
+ if (oScope) {
98
+ oAdjustedScope.validity = oScope.validity;
99
+ if (oAdjustedScope.validity === null || oAdjustedScope.validity === undefined || typeof oAdjustedScope.validity !== "number") {
100
+ oAdjustedScope.validity = Infinity;
101
+ }
102
+ if (!(typeof oAdjustedScope.validity === "number" && ((oAdjustedScope.validity >= 0 && oAdjustedScope.validity < 1000) || oAdjustedScope.validity === Infinity))) {
103
+ oAdjustedScope.liftime = Infinity;
104
+ }
105
+
106
+ oAdjustedScope.keyCategory = checkIfEntryExistsInEnum(oScope.keyCategory, oConstants.keyCategory) ? oScope.keyCategory : oAdjustedScope.keyCategory;
107
+ oAdjustedScope.writeFrequency = checkIfEntryExistsInEnum(oScope.writeFrequency, oConstants.writeFrequency) ? oScope.writeFrequency : oAdjustedScope.writeFrequency;
108
+ if (typeof oScope.clientStorageAllowed === "boolean" && (oScope.clientStorageAllowed === true || oScope.clientStorageAllowed === false)) {
109
+ oAdjustedScope.clientStorageAllowed = oScope.clientStorageAllowed;
110
+ }
111
+
112
+ // todo: check comment below
113
+ //Combination of FixKey & CrossUserRead is an illegal combination because the user who was creating the container is no longer available
114
+ //The other users have no chance to write on that container
115
+ //if (oAdjustedScope.keyCategory === oConstants.keyCategory.FIXED_KEY && oAdjustedScope.access === oConstants.access.CROSS_USER_READ) {
116
+ // throw new utils.Error("Wrong defined scope. FixKey and CrossUserRead is an illegal combination: sap.ushell.services.Personalization", " ");
117
+ // }
118
+ }
119
+
120
+ return oAdjustedScope;
121
+ }
122
+
123
+ /**
124
+ * Loads the chosen adapter.
125
+ *
126
+ * @param {variant} oAdapter
127
+ * An object like: <pre>{
128
+ * lazy: <boolean>,
129
+ * instance: <function> or <object>
130
+ * }</pre>
131
+ *
132
+ * @returns {Promise<object>}
133
+ * A promise that resolves with a loaded adapter or rejects with an error
134
+ * message in case something went wrong while the adapter was being
135
+ * loaded.
136
+ *
137
+ * @since 1.120.0
138
+ * @private
139
+ */
140
+ function loadAdapter (oAdapter) {
141
+ if (!oAdapter.lazy) {
142
+ return ushellUtils.promisify(jQuery.when(oAdapter.instance));
143
+ }
144
+
145
+ try {
146
+ return ushellUtils.promisify(oAdapter.create.call(null));
147
+ } catch (oError) {
148
+ return Promise.reject(oError);
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Detects whether a given app component is an app variant based on the
154
+ * component manifest.
155
+ *
156
+ * @param {sap.ui.core.Component} [oComponent] The application component.
157
+ *
158
+ * @returns {boolean} Whether this application is an AppVariant
159
+ *
160
+ * @since 1.120.0
161
+ * @private
162
+ */
163
+ function isAppVariant (oComponent) {
164
+ if (!oComponent) {
165
+ return false;
166
+ }
167
+
168
+ const oAppManifest = oComponent.getManifestObject();
169
+ if (!oAppManifest) {
170
+ return false;
171
+ }
172
+
173
+ const sAppVarId = oAppManifest.getEntry("/sap.ui5/appVariantId");
174
+ if (!sAppVarId) {
175
+ return false;
176
+ }
177
+
178
+ const sComponentName = oAppManifest.getComponentName();
179
+ if (sAppVarId === sComponentName) {
180
+ return false;
181
+ }
182
+
183
+ return true;
184
+ }
185
+
186
+ /**
187
+ * Tries to parse json string
188
+ * @param {string} sJson A stringified JSON object
189
+ * @returns {object} the parsed object or undefined
190
+ *
191
+ * @since 1.120.0
192
+ * @private
193
+ */
194
+ function cloneToObject (sJson) {
195
+ if (sJson === undefined) {
196
+ return undefined;
197
+ }
198
+ try {
199
+ return JSON.parse(sJson);
200
+ } catch (e) {
201
+ return undefined;
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Basic clone
207
+ * @param {object} oObject the object to clone
208
+ * @returns {object} the cloned object or undefined
209
+ *
210
+ * @since 1.120.0
211
+ * @private
212
+ */
213
+ function clone (oObject) {
214
+ if (oObject === undefined) {
215
+ return undefined;
216
+ }
217
+ try {
218
+ return JSON.parse(JSON.stringify(oObject));
219
+ } catch (e) {
220
+ return undefined;
221
+ }
222
+ }
223
+
224
+ return {
225
+ adjustScope: adjustScope,
226
+ cloneToObject: cloneToObject,
227
+ clone: clone,
228
+ addContainerPrefix: addContainerPrefix,
229
+ pickAdapter: pickAdapter,
230
+ isAppVariant: isAppVariant,
231
+ loadAdapter: loadAdapter
232
+ };
233
+ });