@sapui5/sap.ushell 1.119.2 → 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 (395) 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/neo/AppInfoService.js +154 -0
  66. package/src/main/js/sap/ushell/appRuntime/neo/AppRuntimeNeo.js +20 -0
  67. package/src/main/js/sap/ushell/appRuntime/neo/ProxyAppUtils.js +71 -0
  68. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +12 -5
  69. package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeContext.js +2 -2
  70. package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
  71. package/src/main/js/sap/ushell/bootstrap/SchedulingAgent.js +2 -2
  72. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
  73. package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
  74. package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def-dev.js +6 -3
  75. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
  76. package/src/main/js/sap/ushell/bootstrap/common/common.configure.ushell.js +3 -0
  77. package/src/main/js/sap/ushell/bootstrap/common/common.load.launchpad.js +1 -1
  78. package/src/main/js/sap/ushell/bootstrap/common/common.util.js +34 -2
  79. package/src/main/js/sap/ushell/bootstrap/sandbox2.js +7 -2
  80. package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
  81. package/src/main/js/sap/ushell/components/HomepageManager.js +5 -5
  82. package/src/main/js/sap/ushell/components/SharedComponentUtils.js +7 -10
  83. package/src/main/js/sap/ushell/components/_HeaderManager/ShellHeader.controller.js +3 -3
  84. package/src/main/js/sap/ushell/components/_HomepageManager/DashboardLoadingManager.js +5 -0
  85. package/src/main/js/sap/ushell/components/_HomepageManager/PagingManager.js +5 -0
  86. package/src/main/js/sap/ushell/components/_HomepageManager/PersistentPageOperationAdapter.js +5 -0
  87. package/src/main/js/sap/ushell/components/_HomepageManager/TransientPageOperationAdapter.js +5 -0
  88. package/src/main/js/sap/ushell/components/appfinder/AppFinderView.js +1 -1
  89. package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +1 -1
  90. package/src/main/js/sap/ushell/components/appfinder/EasyAccess.controller.js +3 -3
  91. package/src/main/js/sap/ushell/components/appfinder/EasyAccessView.js +0 -8
  92. package/src/main/js/sap/ushell/components/appfinder/HierarchyApps.controller.js +4 -4
  93. package/src/main/js/sap/ushell/components/appfinder/HierarchyFolders.controller.js +18 -16
  94. package/src/main/js/sap/ushell/components/appfinder/manifest.json +2 -2
  95. package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -2
  96. package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
  97. package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
  98. package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +2 -2
  99. package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +1 -1
  100. package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
  101. package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
  102. package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +1 -1
  103. package/src/main/js/sap/ushell/components/cards/Card.controller.js +2 -2
  104. package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +92 -71
  105. package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
  106. package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +1 -1
  107. package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
  108. package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
  109. package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
  110. package/src/main/js/sap/ushell/components/contentFinder/model/formatter.js +4 -4
  111. package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
  112. package/src/main/js/sap/ushell/components/homeApp/error/manifest.json +1 -1
  113. package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
  114. package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
  115. package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +1 -1
  116. package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +1 -1
  117. package/src/main/js/sap/ushell/components/homepage/manifest.json +2 -2
  118. package/src/main/js/sap/ushell/components/pages/ActionMode.js +5 -5
  119. package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
  120. package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
  121. package/src/main/js/sap/ushell/components/pages/StateManager.js +37 -24
  122. package/src/main/js/sap/ushell/components/pages/controller/ImportDialog.controller.js +1 -1
  123. package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +1 -1
  124. package/src/main/js/sap/ushell/components/pages/manifest.json +2 -2
  125. package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +7 -4
  126. package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
  127. package/src/main/js/sap/ushell/components/shell/MenuBar/controller/MenuBar.controller.js +6 -7
  128. package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +2 -2
  129. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +39 -13
  130. package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +3 -3
  131. package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +5 -5
  132. package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +25 -45
  133. package/src/main/js/sap/ushell/components/shell/PostLoadingHeaderEnhancement/Component.js +2 -2
  134. package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
  135. package/src/main/js/sap/ushell/components/shell/Search/ESearch.js +1 -1
  136. package/src/main/js/sap/ushell/components/shell/Search/manifest.json +2 -2
  137. package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +2 -2
  138. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchCEP.controller.js +3 -3
  139. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
  140. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
  141. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
  142. package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
  143. package/src/main/js/sap/ushell/components/shell/Settings/Component.js +4 -4
  144. package/src/main/js/sap/ushell/components/shell/Settings/ProfilingLoader.js +4 -0
  145. package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.controller.js +4 -0
  146. package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.view.xml +4 -3
  147. package/src/main/js/sap/ushell/components/shell/Settings/homepage/HomepageEntry.js +10 -13
  148. package/src/main/js/sap/ushell/components/shell/Settings/notifications/NotificationsSetting.controller.js +13 -22
  149. package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountSelector.controller.js +2 -2
  150. package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.controller.js +11 -14
  151. package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/manifest.json +1 -1
  152. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
  153. package/src/main/js/sap/ushell/components/shell/UserActionsMenu/UserActionsMenu.controller.js +2 -2
  154. package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +2 -2
  155. package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +4 -6
  156. package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +14 -18
  157. package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
  158. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
  159. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +16 -12
  160. package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +1 -1
  161. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
  162. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +1 -1
  163. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +1 -1
  164. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +1 -1
  165. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +1 -1
  166. package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +1 -1
  167. package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +1 -1
  168. package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +3 -3
  169. package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
  170. package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -2
  171. package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
  172. package/src/main/js/sap/ushell/components/workPageRuntime/services/NavigationResolver.js +1 -1
  173. package/src/main/js/sap/ushell/components/workPageRuntime/services/WorkPage.js +1 -1
  174. package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
  175. package/src/main/js/sap/ushell/library.js +1 -1
  176. package/src/main/js/sap/ushell/navigationMode.js +1 -1
  177. package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
  178. package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
  179. package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
  180. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/AccessKeysHandler.js +1 -1
  181. package/src/main/js/sap/ushell/renderer/History.js +84 -0
  182. package/src/main/js/sap/ushell/renderer/LogonFrameProvider.js +96 -0
  183. package/src/main/js/sap/ushell/renderer/Renderer.js +2851 -0
  184. package/src/main/js/sap/ushell/renderer/Shell.controller.js +3155 -0
  185. package/src/main/js/sap/ushell/{renderers/fiori2/ShellAsync.view.js → renderer/Shell.view.js} +29 -18
  186. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/ShellLayout.js +3 -3
  187. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.controller.js +4 -4
  188. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.view.xml +1 -1
  189. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsKeyboardHandler.js +108 -0
  190. package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsManager.js +453 -0
  191. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources.properties +4 -0
  192. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/Component.js +3 -3
  193. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/CEPSearchApp.controller.js +1 -1
  194. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/SearchApp.controller.js +1 -1
  195. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/manifest.json +2 -2
  196. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/CEPSearchApp.view.js +2 -2
  197. package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/SearchApp.view.js +2 -2
  198. package/src/main/js/sap/ushell/renderers/fiori2/History.js +7 -68
  199. package/src/main/js/sap/ushell/renderers/fiori2/LogonFrameProvider.js +9 -79
  200. package/src/main/js/sap/ushell/renderers/fiori2/Renderer.js +101 -1882
  201. package/src/main/js/sap/ushell/renderers/fiori2/RendererExtensions.js +2 -3
  202. package/src/main/js/sap/ushell/renderers/fiori2/Shell.controller.js +8 -3130
  203. package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +7 -7
  204. package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsKeyboardHandler.js +7 -92
  205. package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsManager.js +8 -438
  206. package/src/main/js/sap/ushell/resources.js +1 -1
  207. package/src/main/js/sap/ushell/services/AllMyApps.js +16 -7
  208. package/src/main/js/sap/ushell/services/AppConfiguration.js +12 -0
  209. package/src/main/js/sap/ushell/services/AppLifeCycle.js +11 -14
  210. package/src/main/js/sap/ushell/services/AppState.js +12 -8
  211. package/src/main/js/sap/ushell/services/Bookmark.js +15 -13
  212. package/src/main/js/sap/ushell/services/BookmarkV2.js +919 -0
  213. package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +229 -241
  214. package/src/main/js/sap/ushell/services/CommonDataModel.js +14 -4
  215. package/src/main/js/sap/ushell/services/Configuration.js +12 -11
  216. package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +13 -10
  217. package/src/main/js/sap/ushell/services/Container.js +1 -1
  218. package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
  219. package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +8 -6
  220. package/src/main/js/sap/ushell/services/DarkModeSupport.js +16 -10
  221. package/src/main/js/sap/ushell/services/EndUserFeedback.js +1 -1
  222. package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +103 -0
  223. package/src/main/js/sap/ushell/services/Extension/Footer.js +61 -0
  224. package/src/main/js/sap/ushell/services/Extension/Header.js +193 -0
  225. package/src/main/js/sap/ushell/services/Extension/Item.js +195 -0
  226. package/src/main/js/sap/ushell/services/Extension/SidePane.js +155 -0
  227. package/src/main/js/sap/ushell/services/Extension/ToolArea.js +152 -0
  228. package/src/main/js/sap/ushell/services/Extension.js +381 -0
  229. package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
  230. package/src/main/js/sap/ushell/services/Menu.js +48 -59
  231. package/src/main/js/sap/ushell/services/Message.js +15 -14
  232. package/src/main/js/sap/ushell/services/MessageBroker.js +12 -12
  233. package/src/main/js/sap/ushell/services/NavTargetResolution.js +48 -70
  234. package/src/main/js/sap/ushell/services/Navigation/utils.js +565 -0
  235. package/src/main/js/sap/ushell/services/Navigation.js +152 -139
  236. package/src/main/js/sap/ushell/services/NavigationDataProvider.js +11 -8
  237. package/src/main/js/sap/ushell/services/Notifications.js +118 -1523
  238. package/src/main/js/sap/ushell/services/NotificationsV2.js +1872 -0
  239. package/src/main/js/sap/ushell/services/PageBuilding.js +11 -8
  240. package/src/main/js/sap/ushell/services/PagePersistence.js +11 -8
  241. package/src/main/js/sap/ushell/services/PageReferencing.js +11 -8
  242. package/src/main/js/sap/ushell/services/Pages.js +11 -15
  243. package/src/main/js/sap/ushell/services/Personalization.js +5 -3
  244. package/src/main/js/sap/ushell/services/PersonalizationV2/ContextContainer.js +410 -0
  245. package/src/main/js/sap/ushell/services/PersonalizationV2/Personalizer.js +109 -0
  246. package/src/main/js/sap/ushell/services/PersonalizationV2/TransientPersonalizer.js +57 -0
  247. package/src/main/js/sap/ushell/services/PersonalizationV2/Variant.js +180 -0
  248. package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSet.js +296 -0
  249. package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSetAdapter.js +125 -0
  250. package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapter.js +71 -0
  251. package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapterContainer.js +172 -0
  252. package/src/main/js/sap/ushell/services/PersonalizationV2/constants.js +23 -0
  253. package/src/main/js/sap/ushell/services/PersonalizationV2/constants.private.js +18 -0
  254. package/src/main/js/sap/ushell/services/PersonalizationV2/utils.js +233 -0
  255. package/src/main/js/sap/ushell/services/PersonalizationV2.js +641 -0
  256. package/src/main/js/sap/ushell/services/PluginManager.js +47 -55
  257. package/src/main/js/sap/ushell/services/ReferenceResolver.js +61 -54
  258. package/src/main/js/sap/ushell/services/Search.js +15 -2
  259. package/src/main/js/sap/ushell/services/SearchCEP.js +40 -44
  260. package/src/main/js/sap/ushell/services/SearchableContent.js +9 -9
  261. package/src/main/js/sap/ushell/services/ShellNavigation.js +14 -13
  262. package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
  263. package/src/main/js/sap/ushell/services/SpaceContent.js +9 -10
  264. package/src/main/js/sap/ushell/services/SupportTicket.js +14 -14
  265. package/src/main/js/sap/ushell/services/UITracer.js +31 -35
  266. package/src/main/js/sap/ushell/services/URLParsing.js +9 -11
  267. package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
  268. package/src/main/js/sap/ushell/services/URLTemplate.js +14 -13
  269. package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +29 -26
  270. package/src/main/js/sap/ushell/services/UsageAnalytics.js +6 -0
  271. package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +11 -7
  272. package/src/main/js/sap/ushell/services/UserDefaultParameters.js +20 -26
  273. package/src/main/js/sap/ushell/services/UserInfo.js +44 -23
  274. package/src/main/js/sap/ushell/services/UserRecents.js +13 -5
  275. package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +12 -9
  276. package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +10 -8
  277. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
  278. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
  279. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
  280. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
  281. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
  282. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
  283. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
  284. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +3 -4
  285. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +4 -4
  286. package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
  287. package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
  288. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
  289. package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
  290. package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +2 -1
  291. package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
  292. package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
  293. package/src/main/js/sap/ushell/services/_Personalization/ContextContainer.js +6 -0
  294. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainer.js +5 -1
  295. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariant.js +13 -9
  296. package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariantSet.js +17 -13
  297. package/src/main/js/sap/ushell/services/_Personalization/Personalizer.js +5 -0
  298. package/src/main/js/sap/ushell/services/_Personalization/TransientPersonalizer.js +5 -1
  299. package/src/main/js/sap/ushell/services/_Personalization/Variant.js +4 -0
  300. package/src/main/js/sap/ushell/services/_Personalization/VariantSet.js +17 -9
  301. package/src/main/js/sap/ushell/services/_Personalization/VariantSetAdapter.js +4 -6
  302. package/src/main/js/sap/ushell/services/_Personalization/WindowAdapter.js +5 -44
  303. package/src/main/js/sap/ushell/services/_Personalization/WindowAdapterContainer.js +5 -101
  304. package/src/main/js/sap/ushell/services/_Personalization/constants.js +3 -0
  305. package/src/main/js/sap/ushell/services/_Personalization/constants.private.js +3 -0
  306. package/src/main/js/sap/ushell/services/_Personalization/utils.js +3 -0
  307. package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
  308. package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
  309. package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
  310. package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +29 -5
  311. package/src/main/js/sap/ushell/services/_UserRecents/UserRecentsBase.js +19 -27
  312. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstance.js +4 -0
  313. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceAbap.js +3 -0
  314. package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceLink.js +1 -1
  315. package/src/main/js/sap/ushell/services/personalization/VariantSetAdapter.js +13 -15
  316. package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
  317. package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +4 -4
  318. package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +4 -4
  319. package/src/main/js/sap/ushell/themes/sap_horizon_hcb/ShellAppTitle.less +2 -2
  320. package/src/main/js/sap/ushell/themes/sap_horizon_hcw/ShellAppTitle.less +2 -2
  321. package/src/main/js/sap/ushell/ui/AppContainer.js +2 -2
  322. package/src/main/js/sap/ushell/ui/ContentNodeSelector.js +2 -2
  323. package/src/main/js/sap/ushell/ui/ShellHeader.js +2 -2
  324. package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
  325. package/src/main/js/sap/ushell/ui/footerbar/AddBookmarkButton.js +8 -12
  326. package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
  327. package/src/main/js/sap/ushell/ui/launchpad/Page.js +1 -1
  328. package/src/main/js/sap/ushell/ui/launchpad/Section.js +21 -8
  329. package/src/main/js/sap/ushell/ui/launchpad/TileState.js +0 -1
  330. package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
  331. package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +1 -1
  332. package/src/main/js/sap/ushell/ui/shell/ShellHeadItem.js +1 -1
  333. package/src/main/js/sap/ushell/ui/shell/SysInfoBar.js +1 -1
  334. package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
  335. package/src/main/js/sap/ushell/ui/utils.js +1 -1
  336. package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
  337. package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
  338. package/src/main/js/sap/ushell/ui5service/_ShellUIService/shelluiservice.class.factory.js +14 -26
  339. package/src/main/js/sap/ushell/utils/Deferred.js +88 -0
  340. package/src/main/js/sap/ushell/utils/UrlShortening.js +1 -1
  341. package/src/main/js/sap/ushell/utils/WindowUtils.js +8 -8
  342. package/src/main/js/sap/ushell/utils.js +31 -67
  343. package/src/test/js/sap/ushell/bootstrap/sandbox.js +7 -2
  344. package/ui5.yaml +8 -2
  345. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/HeadEndItemsOverflowPopover.fragment.xml +0 -0
  346. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ar.properties +0 -0
  347. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_bg.properties +0 -0
  348. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ca.properties +0 -0
  349. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cs.properties +0 -0
  350. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cy.properties +0 -0
  351. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_da.properties +0 -0
  352. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_de.properties +0 -0
  353. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_el.properties +0 -0
  354. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en.properties +0 -0
  355. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_GB.properties +0 -0
  356. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_sappsd.properties +0 -0
  357. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saprigi.properties +0 -0
  358. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saptrc.properties +0 -0
  359. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es.properties +0 -0
  360. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es_MX.properties +0 -0
  361. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_et.properties +0 -0
  362. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fi.properties +0 -0
  363. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr.properties +0 -0
  364. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr_CA.properties +0 -0
  365. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hi.properties +0 -0
  366. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hr.properties +0 -0
  367. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hu.properties +0 -0
  368. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_id.properties +0 -0
  369. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_it.properties +0 -0
  370. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_iw.properties +0 -0
  371. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ja.properties +0 -0
  372. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_kk.properties +0 -0
  373. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ko.properties +0 -0
  374. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lt.properties +0 -0
  375. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lv.properties +0 -0
  376. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ms.properties +0 -0
  377. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_nl.properties +0 -0
  378. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_no.properties +0 -0
  379. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pl.properties +0 -0
  380. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt.properties +0 -0
  381. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt_PT.properties +0 -0
  382. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ro.properties +0 -0
  383. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ru.properties +0 -0
  384. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sh.properties +0 -0
  385. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sk.properties +0 -0
  386. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sl.properties +0 -0
  387. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sv.properties +0 -0
  388. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_th.properties +0 -0
  389. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_tr.properties +0 -0
  390. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_uk.properties +0 -0
  391. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_vi.properties +0 -0
  392. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_CN.properties +0 -0
  393. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_TW.properties +0 -0
  394. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/util.js +0 -0
  395. /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/utils.js +0 -0
@@ -0,0 +1,109 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/utils",
4
+ "sap/base/Log"
5
+ ], function (ushellUtils, Log) {
6
+ "use strict";
7
+
8
+ /**
9
+ * To be called by the personalization service getPersonalizer method.
10
+ *
11
+ * @name sap.ushell.services.PersonalizationV2.Personalizer
12
+ * @class The Unified Shell personalizer providing set get delete
13
+ * methods to access the persisted personalization data in direct mode.
14
+ *
15
+ * @since 1.120.0
16
+ * @public
17
+ */
18
+ function Personalizer (oService, oAdapter, oPersId, oScope, oComponent) {
19
+ this._sPersContainer = "";
20
+ this._sPersItem = "";
21
+ this._sPersVariant = null;
22
+ this._oAdapter = oAdapter;
23
+ this._oPersonalizationService = oService;
24
+ this._oScope = oScope;
25
+ this._oComponent = oComponent;
26
+
27
+ if (!oPersId || !oPersId.container || !oPersId.item || typeof oPersId.container !== "string" || typeof oPersId.item !== "string") {
28
+ throw new Error("Invalid input for oPersId: sap.ushell.services.Personalization");
29
+ }
30
+ this._sPersContainer = oPersId.container; // prefix is added in container constructor
31
+ this._sPersItem = oPersId.item;
32
+ }
33
+
34
+ /**
35
+ * todo: jsdoc
36
+ * @param {string} sPersContainer
37
+ * @returns {Promise<object>}
38
+ *
39
+ * @since 1.120.0
40
+ * @private
41
+ */
42
+ Personalizer.prototype._getContainer = function (sPersContainer) {
43
+ if (!this._oGetContainerPromise) {
44
+ this._oGetContainerPromise = this._oPersonalizationService.getContainer(sPersContainer, this._oScope, this._oComponent);
45
+ }
46
+ return this._oGetContainerPromise;
47
+ };
48
+
49
+ /**
50
+ * Gets a personalization data value.
51
+ *
52
+ * @returns {Promise<object>} Resolves the data
53
+ *
54
+ * @since 1.120.0
55
+ * @public
56
+ */
57
+ Personalizer.prototype.getPersData = function () {
58
+ return this._getContainer(this._sPersContainer)
59
+ .then((oContainer) => {
60
+ return oContainer.getItemValue(this._sPersItem);
61
+ })
62
+ .catch((oError)=> {
63
+ Log.error("Fail to get Personalization data for Personalizer container: " + this._sPersContainer, oError);
64
+ return Promise.reject();
65
+ });
66
+ };
67
+
68
+ /**
69
+ * Sets a personalization data value.
70
+ *
71
+ * @param {object} oValue JSON object containing the personalization value.
72
+ * @returns {Promise} Resolves if save was successful
73
+ *
74
+ * @since 1.120.0
75
+ * @public
76
+ */
77
+ Personalizer.prototype.setPersData = function (oValue) {
78
+ return this._getContainer(this._sPersContainer)
79
+ .then((oContainer) => {
80
+ oContainer.setItemValue(this._sPersItem, oValue);
81
+ return ushellUtils.promisify(oContainer.save());
82
+ })
83
+ .catch((oError)=> {
84
+ Log.error("Fail to get Personalization data for Personalizer container: " + this._sPersContainer, oError);
85
+ return Promise.reject();
86
+ });
87
+ };
88
+ /**
89
+ * Deletes a personalization data value.
90
+ *
91
+ * @returns {Promise} Resolves if delete was successful
92
+ *
93
+ * @since 1.120.0
94
+ * @public
95
+ */
96
+ Personalizer.prototype.deletePersData = function () {
97
+ return this._getContainer(this._sPersContainer)
98
+ .then((oContainer) => {
99
+ oContainer.deleteItem(this._sPersItem);
100
+ return ushellUtils.promisify(oContainer.save());
101
+ })
102
+ .catch((oError)=> {
103
+ Log.error("Fail to delete Personalization data for Personalizer container: " + this._sPersContainer, oError);
104
+ return Promise.reject();
105
+ });
106
+ };
107
+
108
+ return Personalizer;
109
+ });
@@ -0,0 +1,57 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ ], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * @name sap.ushell.services.PersonalizationV2.TransientPersonalizer
8
+ * @class
9
+ * @classdesc The transient personalizer shall be used in container mode for table personalization.
10
+ * To be called by the personalization service getTransientPersonalizer method.
11
+ *
12
+ * @since 1.120.0
13
+ * @public
14
+ */
15
+ function TransientPersonalizer () {
16
+ this._oValue = undefined;
17
+ }
18
+
19
+ /**
20
+ * Gets a personalization data value.
21
+ * @returns {Promise<object>} Resolves the data.
22
+ *
23
+ * @since 1.120.0
24
+ * @public
25
+ */
26
+ TransientPersonalizer.prototype.getPersData = async function () {
27
+ return this._oValue;
28
+ };
29
+
30
+ /**
31
+ * Sets a personalization data value.
32
+ *
33
+ * @param {object} oValue JSON object containing the personalization value.
34
+ * @returns {Promise} Resolves if save was successful.
35
+ *
36
+ * @since 1.120.0
37
+ * @public
38
+ */
39
+ TransientPersonalizer.prototype.setPersData = async function (oValue) {
40
+ this._oValue = oValue;
41
+ };
42
+
43
+ /**
44
+ * Deletes a personalization data value.
45
+ *
46
+ * @returns {Promise} Resolves if delete was successful.
47
+ *
48
+ * @since 1.120.0
49
+ * @public
50
+ */
51
+ TransientPersonalizer.prototype.deletePersData = async function () {
52
+ this._oValue = undefined;
53
+ };
54
+
55
+ return TransientPersonalizer;
56
+
57
+ });
@@ -0,0 +1,180 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/services/PersonalizationV2/utils"
4
+ ], function (personalizationUtils) {
5
+ "use strict";
6
+
7
+ /**
8
+ * To be instantiated via Personalization.VariantSet add / get Variant only
9
+ *
10
+ * @name sap.ushell.services.PersonalizationV2.Variant
11
+ * @class The personalization variant contains personalization data.
12
+ * It is used in the personalization container mode.
13
+ *
14
+ * @since 1.120.0
15
+ * @public
16
+ */
17
+ function Variant (oVariantSet, sVariantKey, sVariantName) {
18
+ if (typeof sVariantKey !== "string") {
19
+ throw new Error("Parameter value of sVariantKey is not a string: sap.ushell.services.Personalization");
20
+ }
21
+ if (typeof sVariantName !== "string") {
22
+ throw new Error("Parameter value of sVariantName is not a string: sap.ushell.services.Personalization");
23
+ }
24
+ this._oVariantSet = oVariantSet;
25
+ this._sVariantKey = sVariantKey;
26
+ this._sVariantName = sVariantName;
27
+ }
28
+
29
+ /**
30
+ * Returns the key of this variant.
31
+ * @returns {string} variant key.
32
+ *
33
+ * @since 1.120.0
34
+ * @public
35
+ */
36
+ Variant.prototype.getVariantKey = function () {
37
+ return this._sVariantKey;
38
+ };
39
+
40
+ /**
41
+ * Returns the name of this variant.
42
+ * @returns {string} variant name.
43
+ *
44
+ * @since 1.120.0
45
+ * @public
46
+ */
47
+ Variant.prototype.getVariantName = function () {
48
+ return this._sVariantName;
49
+ };
50
+
51
+ /**
52
+ * Sets the name of the variant.
53
+ *
54
+ * In case a variant with <code>sVariantName</code> is already existing in the corresponding variant set an exception is thrown.
55
+ *
56
+ * @param {string} sVariantName variant name
57
+ *
58
+ * @since 1.120.0
59
+ * @public
60
+ */
61
+ Variant.prototype.setVariantName = function (sVariantName) {
62
+ const oVariantSetData = this._oVariantSet._getVariantSet();
63
+
64
+ if (typeof sVariantName !== "string") {
65
+ throw new Error("Parameter value of sVariantName is not a string: sap.ushell.services.Personalization");
66
+ }
67
+ if (this._oVariantSet.getVariantKeyByName(sVariantName) !== undefined) {
68
+ throw new Error(`Variant with name '${sVariantName}' already exists in variant set '${this._oVariantSet._sVariantSetKey}': sap.ushell.services.Personalization"`);
69
+ }
70
+
71
+ if (Object.hasOwn(oVariantSetData, "variants") && Object.hasOwn(oVariantSetData.variants, this._sVariantKey)) {
72
+ const oVariantData = oVariantSetData.variants[this._sVariantKey];
73
+ oVariantData.name = sVariantName;
74
+ this._sVariantName = sVariantName;
75
+ this._oVariantSet._serialize();
76
+ } else {
77
+ throw new Error("Variant does not longer exist");
78
+ }
79
+ };
80
+
81
+ /**
82
+ * Returns the value for an item in this variant.
83
+ * @param {string} sItemKey item key
84
+ * @returns {object}
85
+ * item value (JSON object). In case the variant does not contain an item with this key
86
+ * <code>undefined</code> is returned.
87
+ *
88
+ * @since 1.120.0
89
+ * @public
90
+ */
91
+ Variant.prototype.getItemValue = function (sItemKey) {
92
+ if (typeof sItemKey !== "string") {
93
+ return;
94
+ }
95
+ const variantData = this._oVariantSet._getVariantSet().variants[this._sVariantKey].variantData;
96
+ if (!Object.hasOwn(variantData, sItemKey)) {
97
+ return;
98
+ }
99
+ return personalizationUtils.clone(variantData[sItemKey]);
100
+ };
101
+
102
+ /**
103
+ * Sets the value for an item in this variant.
104
+ * @param {string} sItemKey item key
105
+ * @param {object} oItemValue value (JSON object)
106
+ *
107
+ * @since 1.120.0
108
+ * @public
109
+ */
110
+ Variant.prototype.setItemValue = function (sItemKey, oItemValue) {
111
+ if (typeof sItemKey !== "string") {
112
+ throw new Error("Parameter value of sItemKey is not a string: sap.ushell.services.Personalization");
113
+ }
114
+ const variant = this._oVariantSet._getVariantSet().variants && this._oVariantSet._getVariantSet().variants[this._sVariantKey];
115
+ if (!variant) {
116
+ throw new Error("Variant does not longer exist");
117
+ }
118
+ if (!variant.variantData) {
119
+ variant.variantData = {};
120
+ }
121
+ const variantData = variant.variantData;
122
+ variantData[sItemKey] = personalizationUtils.clone(oItemValue);
123
+ this._oVariantSet._serialize();
124
+ };
125
+
126
+ /**
127
+ * Checks if a specific item is contained in this variant.
128
+ * @param {string} sItemKey item key
129
+ * @returns {boolean} <code>true</code> if the variant contains an item with the key
130
+ *
131
+ * @since 1.120.0
132
+ * @public
133
+ */
134
+ Variant.prototype.containsItem = function (sItemKey) {
135
+ if (typeof sItemKey !== "string") {
136
+ return undefined;
137
+ }
138
+ const variantData = this._oVariantSet._getVariantSet().variants[this._sVariantKey].variantData;
139
+ return Object.hasOwn(variantData, sItemKey);
140
+ };
141
+
142
+ /**
143
+ * Returns an array with the keys of all items in this variant.
144
+ * @returns {string[]} item keys
145
+ *
146
+ * @since 1.120.0
147
+ * @public
148
+ */
149
+ Variant.prototype.getItemKeys = function () {
150
+ const variantData = this._oVariantSet._getVariantSet().variants[this._sVariantKey].variantData;
151
+ let sItemKey;
152
+ const aItemKeys = [];
153
+ for (sItemKey in variantData) {
154
+ if (Object.hasOwn(variantData, sItemKey)) {
155
+ aItemKeys.push(sItemKey);
156
+ }
157
+ }
158
+ aItemKeys.sort();
159
+ return aItemKeys;
160
+ };
161
+
162
+ /**
163
+ * Deletes an item from this variant.
164
+ * In case the item does not exist, nothing happens.
165
+ * @param {string} sItemKey item key
166
+ *
167
+ * @since 1.120.0
168
+ * @public
169
+ */
170
+ Variant.prototype.deleteItem = function (sItemKey) {
171
+ if (typeof sItemKey !== "string") {
172
+ return;
173
+ }
174
+ const variantData = this._oVariantSet._getVariantSet().variants[this._sVariantKey].variantData;
175
+ delete variantData[sItemKey];
176
+ this._oVariantSet._serialize();
177
+ };
178
+
179
+ return Variant;
180
+ });
@@ -0,0 +1,296 @@
1
+ // Copyright (c) 2009-2023 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/ushell/utils",
4
+ "sap/ushell/services/PersonalizationV2/constants.private",
5
+ "sap/ushell/services/PersonalizationV2/Variant"
6
+ ], function (ushellUtils, constants, Variant) {
7
+ "use strict";
8
+
9
+ /**
10
+ * A VariantSet is a class representing a collection of
11
+ * Variants (identified by a key and name)
12
+ * and a member variable indicating the
13
+ * "current variable"
14
+ *
15
+ * When manipulating the underlying data, additional constraints are enforced.
16
+ *
17
+ * To be called by the personalization container.
18
+ *
19
+ * @name sap.ushell.services.Personalization.VariantSet
20
+ * @class The personalization variant set contains variants of personalization data.
21
+ * It is used in the personalization container mode.
22
+ *
23
+ * @since 1.120.0
24
+ * @public
25
+ */
26
+
27
+ function VariantSet (sVariantSetKey, oContextContainer) {
28
+ let sVariantKey;
29
+ const oVariantNameMap = new ushellUtils.Map();
30
+ this._oContextContainer = oContextContainer;
31
+ this._sVariantSetKey = sVariantSetKey;
32
+ this._oVariantSetData = this._oContextContainer._getItemValueInternal(constants.S_VARIANT_PREFIX, this._sVariantSetKey);
33
+
34
+ if (!Object.hasOwn(this._oVariantSetData, "currentVariant")) {
35
+ throw new Error("Corrupt variant set data: sap.ushell.services.Personalization");
36
+ // TODO variant set name + container
37
+ }
38
+ if (Object.hasOwn(this._oVariantSetData, "variants")) {
39
+ for (sVariantKey in this._oVariantSetData.variants) {
40
+ if (Object.hasOwn(this._oVariantSetData.variants, sVariantKey)) {
41
+ const sVariantName = this._oVariantSetData.variants[sVariantKey].name;
42
+ const oVariantData = this._oVariantSetData.variants[sVariantKey].variantData;
43
+ if (oVariantNameMap.containsKey(sVariantName)) {
44
+ throw new Error("Variant name already exists: sap.ushell.services.Personalization");
45
+ // TODO skip? log instead error
46
+ } else {
47
+ // validate variant
48
+ if (typeof sVariantKey !== "string") {
49
+ throw new Error("Parameter value of sVariantKey is not a string: sap.ushell.services.Personalization");
50
+ }
51
+ if (typeof sVariantName !== "string") {
52
+ throw new Error("Parameter value of sVariantName is not a string: sap.ushell.services.Personalization");
53
+ }
54
+ if (oVariantData && typeof oVariantData !== "object") {
55
+
56
+ throw Error("Parameter value of sVariantName is not a string: sap.ushell.services.Personalization");
57
+ }
58
+ oVariantNameMap.put(sVariantName, sVariantKey);
59
+ }
60
+ }
61
+ }
62
+ } else {
63
+ throw new Error("Corrupt variant set data: sap.ushell.services.Personalization");
64
+ }
65
+ return this;
66
+ }
67
+
68
+ /**
69
+ * todo: jsdoc
70
+ * @returns {*}
71
+ *
72
+ * @since 1.120.0
73
+ * @public
74
+ */
75
+ VariantSet.prototype._getVariantSet = function () {
76
+ return this._oVariantSetData;
77
+ };
78
+
79
+ /**
80
+ * todo: jsdoc
81
+ *
82
+ * @since 1.120.0
83
+ * @public
84
+ */
85
+ VariantSet.prototype._serialize = function () {
86
+ this._oContextContainer._setItemValueInternal(constants.S_VARIANT_PREFIX, this._sVariantSetKey, this._oVariantSetData);
87
+ };
88
+
89
+ /**
90
+ * Returns the current variant key.
91
+ * @returns {string} current variant key. In case the current variant was never set <code>null</code> is returned.
92
+ *
93
+ * @since 1.120.0
94
+ * @public
95
+ */
96
+ VariantSet.prototype.getCurrentVariantKey = function () {
97
+ return this._getVariantSet().currentVariant;
98
+ };
99
+
100
+ /**
101
+ * Sets the current variant key.
102
+ * @param {string} sVariantKey There is no validity check for the variant key.
103
+ *
104
+ * @since 1.120.0
105
+ * @public
106
+ */
107
+ VariantSet.prototype.setCurrentVariantKey = function (sVariantKey) {
108
+ this._getVariantSet().currentVariant = sVariantKey;
109
+ this._serialize();
110
+ };
111
+
112
+ /**
113
+ * Returns an array with the keys of the variants in the variant set.
114
+ * @returns {string[]} variant keys
115
+ *
116
+ * @since 1.120.0
117
+ * @public
118
+ */
119
+ VariantSet.prototype.getVariantKeys = function () {
120
+ const oVariantMap = new ushellUtils.Map();
121
+ const oVariantSetData = this._getVariantSet(this._sVariantSetKey);
122
+ let sVariantKey;
123
+ if (Object.hasOwn(oVariantSetData, "variants")) {
124
+ for (sVariantKey in oVariantSetData.variants) {
125
+ if (Object.hasOwn(oVariantSetData.variants, sVariantKey)) {
126
+ oVariantMap.put(sVariantKey, "dummy");
127
+ }
128
+ }
129
+ } else {
130
+ throw new Error("Corrupt variant set data: sap.ushell.services.Personalization");
131
+ }
132
+ return oVariantMap.keys();
133
+ };
134
+
135
+ /**
136
+ * todo: jsdoc
137
+ * @returns {*}
138
+ *
139
+ * @since 1.120.0
140
+ * @public
141
+ */
142
+ VariantSet.prototype.getVariantNamesAndKeys = function () {
143
+ const oVariantNameMap = new ushellUtils.Map();
144
+ const oVariantMap = new ushellUtils.Map();
145
+ const oVariantSetData = this._getVariantSet(this._sVariantSetKey);
146
+ let sVariantKey;
147
+ if (Object.hasOwn(oVariantSetData, "variants")) {
148
+ for (sVariantKey in oVariantSetData.variants) {
149
+ if (Object.hasOwn(oVariantSetData.variants, sVariantKey)) {
150
+ const sVariantName = oVariantSetData.variants[sVariantKey].name;
151
+ if (oVariantNameMap.containsKey(sVariantName)) {
152
+ throw new Error("Variant name already exists: sap.ushell.services.Personalization");
153
+ // TODO skip? log instead error
154
+ } else {
155
+ oVariantNameMap.put(sVariantName, sVariantKey);
156
+ }
157
+ oVariantMap.put(sVariantKey, "dummy");
158
+ }
159
+ }
160
+ } else {
161
+ throw new Error("Corrupt variant set data: sap.ushell.services.Personalization");
162
+ }
163
+ return oVariantNameMap.entries;
164
+ };
165
+
166
+ /**
167
+ * Returns a variant object.
168
+ * @param {string} sVariantKey variant key
169
+ * @returns {sap.ushell.services.PersonalizationV2.Variant}
170
+ * In case the variant set does not contain a variant with this key
171
+ * <code>undefined</code> is returned.
172
+ *
173
+ * @since 1.120.0
174
+ * @public
175
+ */
176
+ VariantSet.prototype.getVariant = function (sVariantKey) {
177
+ if (typeof sVariantKey !== "string") {
178
+ return undefined;
179
+ }
180
+ const oVariantSetData = this._getVariantSet(this._sVariantSetKey);
181
+
182
+ if (Object.hasOwn(oVariantSetData, "variants") && Object.hasOwn(oVariantSetData.variants, sVariantKey)) {
183
+ const sVariantName = oVariantSetData.variants[sVariantKey].name;
184
+ const oVariantData = oVariantSetData.variants[sVariantKey].variantData;
185
+
186
+ const oVariant = new Variant(this, sVariantKey, sVariantName, oVariantData);
187
+ return oVariant;
188
+ }
189
+ return undefined;
190
+ };
191
+
192
+ /**
193
+ * Returns the variant key corresponding to a variant name.
194
+ * @param {string} sVariantName variant name
195
+ * @returns {string} variant key. In case the variant set does not contain a variant with this name
196
+ * <code>undefined</code> is returned.
197
+ *
198
+ * @since 1.120.0
199
+ * @public
200
+ */
201
+ VariantSet.prototype.getVariantKeyByName = function (sVariantName) {
202
+ if (typeof sVariantName !== "string") {
203
+ return undefined;
204
+ }
205
+ const oVariantSetData = this._getVariantSet(this._sVariantSetKey);
206
+ let sVariantKey;
207
+ if (Object.hasOwn(oVariantSetData, "variants")) {
208
+ for (sVariantKey in oVariantSetData.variants) {
209
+ if (Object.hasOwn(oVariantSetData.variants, sVariantKey)) {
210
+ if (sVariantName === oVariantSetData.variants[sVariantKey].name) {
211
+ return sVariantKey;
212
+ }
213
+ }
214
+ }
215
+ } else {
216
+ throw new Error("Corrupt variant set data: sap.ushell.services.Personalization");
217
+ }
218
+ return undefined;
219
+ };
220
+
221
+ /**
222
+ * Checks if a specific variant is contained in the variant set.
223
+ * @param {string} sVariantKey variant key
224
+ * @returns {boolean} <code>true</code> if the variant set contains a variant with the key
225
+ *
226
+ * @since 1.120.0
227
+ * @public
228
+ */
229
+ VariantSet.prototype.containsVariant = function (sVariantKey) {
230
+ const oVariantSetData = this._getVariantSet();
231
+ if (typeof sVariantKey !== "string") {
232
+ return undefined;
233
+ }
234
+ return Object.hasOwn(oVariantSetData, "variants") && Object.hasOwn(oVariantSetData.variants, sVariantKey);
235
+ };
236
+
237
+ /**
238
+ * Creates a new variant in the variant set.
239
+ * In case a variant with this name is already existing an exception is thrown.
240
+ * @param {string} sVariantName variant set name
241
+ * @returns {sap.ushell.services.PersonalizationV2.Variant}
242
+ *
243
+ * @since 1.120.0
244
+ * @public
245
+ */
246
+ VariantSet.prototype.addVariant = function (sVariantName) {
247
+ const aKeys = this.getVariantKeys();
248
+ // generate a new "unique" key not yet present in aKeys
249
+ const iMaxKey = parseInt(aKeys.sort(function (a, b) {
250
+ return a - b;
251
+ }).reverse()[0], 10); // get the highest key; in case of an empty
252
+ // variant set -> NaN
253
+ const sVariantKey = isNaN(iMaxKey) ? "0" : (iMaxKey + 1).toString();
254
+ // tested for up to 1 mio variants
255
+ if (aKeys.indexOf(sVariantKey) >= 0) {
256
+ throw new Error(`Variant key '${sVariantKey}' already exists in variant set '${this._sVariantSetKey}': sap.ushell.services.Personalization`);
257
+ }
258
+ if (typeof sVariantName !== "string") {
259
+ throw new Error("Parameter value of sVariantName is not a string: sap.ushell.services.Personalization");
260
+ }
261
+ if (this.getVariantKeyByName(sVariantName) !== undefined) {
262
+ const sDetails = `(Old key: '${this.getVariantKeyByName(sVariantName)}' New key: '${sVariantKey}')`;
263
+ throw new Error(`Variant name '${sVariantName}' already exists in variant set '${this._sVariantSetKey}' ${sDetails}: sap.ushell.services.Personalization`);
264
+ }
265
+ const oVariant = new Variant(this, sVariantKey, sVariantName);
266
+ this._getVariantSet(this._sVariantSetKey).variants[sVariantKey] = {
267
+ name: sVariantName,
268
+ variantData: {}
269
+ };
270
+ this._serialize();
271
+ return oVariant;
272
+ };
273
+
274
+
275
+
276
+ /**
277
+ * Deletes a variant from the variant set.
278
+ * In case the variant does not exist nothing happens.
279
+ * @param {string} sVariantKey variant key
280
+ *
281
+ * @since 1.120.0
282
+ * @public
283
+ */
284
+ VariantSet.prototype.deleteVariant = function (sVariantKey) {
285
+ if (typeof sVariantKey !== "string") {
286
+ return;
287
+ }
288
+ const oVariantSetData = this._getVariantSet();
289
+ if (oVariantSetData && oVariantSetData.variants) {
290
+ delete this._oVariantSetData.variants[sVariantKey];
291
+ }
292
+ this._serialize();
293
+ };
294
+
295
+ return VariantSet;
296
+ });