@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.
- package/package.json +1 -1
- package/src/main/js/sap/ushell/.library +3 -3
- package/src/main/js/sap/ushell/Container.js +272 -41
- package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
- package/src/main/js/sap/ushell/Fiori20AdapterTest.js +3 -2
- package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
- package/src/main/js/sap/ushell/SessionHandler.js +11 -6
- package/src/main/js/sap/ushell/TechnicalParameters.js +1 -1
- package/src/main/js/sap/ushell/URLTemplateProcessor.js +1 -1
- package/src/main/js/sap/ushell/Ui5NativeServiceFactory.js +1 -1
- package/src/main/js/sap/ushell/Ui5ServiceFactory.js +1 -1
- package/src/main/js/sap/ushell/User.js +26 -35
- package/src/main/js/sap/ushell/_ApplicationType/urlTemplateResolution.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DefinitionParameterSetBuilder.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/DependencyGraph.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Functions.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/Resolvers.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/TemplateParameterParser.js +1 -1
- package/src/main/js/sap/ushell/_URLTemplateProcessor/utils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ClientSideTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +15 -11
- package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +16 -11
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +18 -0
- package/src/main/js/sap/ushell/adapters/cdm/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/modifyHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/_LaunchPage/uri.transform.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/util/AppForInbound.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/util/cdmSiteUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/AdapterBase.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cflp/UserDefaultParameterPersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AdapterContainer.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/AppStateAdapter.js +24 -18
- package/src/main/js/sap/ushell/adapters/local/ClientSideTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/MenuAdapter.js +4 -7
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +17 -22
- package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +19 -0
- package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +11 -7
- package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +8 -8
- package/src/main/js/sap/ushell/api/RTA.js +47 -0
- package/src/main/js/sap/ushell/appRuntime/neo/AppInfoService.js +154 -0
- package/src/main/js/sap/ushell/appRuntime/neo/AppRuntimeNeo.js +20 -0
- package/src/main/js/sap/ushell/appRuntime/neo/ProxyAppUtils.js +71 -0
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +12 -5
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntimeContext.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/SchedulingAgent.js +2 -2
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/logger.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/_SchedulingAgent/state.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm-def-dev.js +6 -3
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ushell.js +3 -0
- package/src/main/js/sap/ushell/bootstrap/common/common.load.launchpad.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.util.js +34 -2
- package/src/main/js/sap/ushell/bootstrap/sandbox2.js +7 -2
- package/src/main/js/sap/ushell/components/ComponentKeysHandler.js +1 -1
- package/src/main/js/sap/ushell/components/HomepageManager.js +5 -5
- package/src/main/js/sap/ushell/components/SharedComponentUtils.js +7 -10
- package/src/main/js/sap/ushell/components/_HeaderManager/ShellHeader.controller.js +3 -3
- package/src/main/js/sap/ushell/components/_HomepageManager/DashboardLoadingManager.js +5 -0
- package/src/main/js/sap/ushell/components/_HomepageManager/PagingManager.js +5 -0
- package/src/main/js/sap/ushell/components/_HomepageManager/PersistentPageOperationAdapter.js +5 -0
- package/src/main/js/sap/ushell/components/_HomepageManager/TransientPageOperationAdapter.js +5 -0
- package/src/main/js/sap/ushell/components/appfinder/AppFinderView.js +1 -1
- package/src/main/js/sap/ushell/components/appfinder/CatalogView.js +1 -1
- package/src/main/js/sap/ushell/components/appfinder/EasyAccess.controller.js +3 -3
- package/src/main/js/sap/ushell/components/appfinder/EasyAccessView.js +0 -8
- package/src/main/js/sap/ushell/components/appfinder/HierarchyApps.controller.js +4 -4
- package/src/main/js/sap/ushell/components/appfinder/HierarchyFolders.controller.js +18 -16
- package/src/main/js/sap/ushell/components/appfinder/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/applicationIntegration/AppLifeCycle.js +2 -2
- package/src/main/js/sap/ushell/components/applicationIntegration/application/Application.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/application/BlueBoxHandler.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/application/PostMessageAPI.js +2 -2
- package/src/main/js/sap/ushell/components/applicationIntegration/configuration/AppMeta.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/elements/model.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedServices/RelatedServices.js +1 -1
- package/src/main/js/sap/ushell/components/applicationIntegration/relatedShellElements/RelatedShellElements.js +1 -1
- package/src/main/js/sap/ushell/components/cards/Card.controller.js +2 -2
- package/src/main/js/sap/ushell/components/container/ApplicationContainer.js +92 -71
- package/src/main/js/sap/ushell/components/contentFinder/Component.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/AppSearch.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/ContentFinderDialog.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/controller/WidgetGallery.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/model/formatter.js +4 -4
- package/src/main/js/sap/ushell/components/factsheet/Component.js +1 -1
- package/src/main/js/sap/ushell/components/homeApp/error/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/homepage/ActionMode.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardContent.view.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardGroupsBox.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/DashboardUIActions.js +1 -1
- package/src/main/js/sap/ushell/components/homepage/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/pages/ActionMode.js +5 -5
- package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
- package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
- package/src/main/js/sap/ushell/components/pages/StateManager.js +37 -24
- package/src/main/js/sap/ushell/components/pages/controller/ImportDialog.controller.js +1 -1
- package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +1 -1
- package/src/main/js/sap/ushell/components/pages/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +7 -4
- package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/MenuBar/controller/MenuBar.controller.js +6 -7
- package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +39 -13
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +3 -3
- package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +5 -5
- package/src/main/js/sap/ushell/components/shell/Notifications/Notifications.controller.js +25 -45
- package/src/main/js/sap/ushell/components/shell/PostLoadingHeaderEnhancement/Component.js +2 -2
- package/src/main/js/sap/ushell/components/shell/ProductSwitch/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Search/ESearch.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Search/manifest.json +2 -2
- package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +2 -2
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchCEP.controller.js +3 -3
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/Component.js +4 -4
- package/src/main/js/sap/ushell/components/shell/Settings/ProfilingLoader.js +4 -0
- package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.controller.js +4 -0
- package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.view.xml +4 -3
- package/src/main/js/sap/ushell/components/shell/Settings/homepage/HomepageEntry.js +10 -13
- package/src/main/js/sap/ushell/components/shell/Settings/notifications/NotificationsSetting.controller.js +13 -22
- package/src/main/js/sap/ushell/components/shell/Settings/userAccount/UserAccountSelector.controller.js +2 -2
- package/src/main/js/sap/ushell/components/shell/Settings/userActivities/UserActivitiesSetting.controller.js +11 -14
- package/src/main/js/sap/ushell/components/shell/Settings/userDefaults/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/UserActionsMenu.controller.js +2 -2
- package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +2 -2
- package/src/main/js/sap/ushell/components/tiles/indicatorTileUtils/smartBusinessUtil.js +4 -6
- package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +14 -18
- package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +16 -12
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageHost.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +3 -3
- package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +1 -2
- package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/services/NavigationResolver.js +1 -1
- package/src/main/js/sap/ushell/components/workPageRuntime/services/WorkPage.js +1 -1
- package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
- package/src/main/js/sap/ushell/library.js +1 -1
- package/src/main/js/sap/ushell/navigationMode.js +1 -1
- package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
- package/src/main/js/sap/ushell/performance/StatisticalRecord.js +1 -1
- package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/AccessKeysHandler.js +1 -1
- package/src/main/js/sap/ushell/renderer/History.js +84 -0
- package/src/main/js/sap/ushell/renderer/LogonFrameProvider.js +96 -0
- package/src/main/js/sap/ushell/renderer/Renderer.js +2851 -0
- package/src/main/js/sap/ushell/renderer/Shell.controller.js +3155 -0
- package/src/main/js/sap/ushell/{renderers/fiori2/ShellAsync.view.js → renderer/Shell.view.js} +29 -18
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/ShellLayout.js +3 -3
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.controller.js +4 -4
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/allMyApps/AllMyApps.view.xml +1 -1
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsKeyboardHandler.js +108 -0
- package/src/main/js/sap/ushell/renderer/allMyApps/AllMyAppsManager.js +453 -0
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources.properties +4 -0
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/Component.js +3 -3
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/CEPSearchApp.controller.js +1 -1
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/controller/SearchApp.controller.js +1 -1
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/manifest.json +2 -2
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/CEPSearchApp.view.js +2 -2
- package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/searchComponent/view/SearchApp.view.js +2 -2
- package/src/main/js/sap/ushell/renderers/fiori2/History.js +7 -68
- package/src/main/js/sap/ushell/renderers/fiori2/LogonFrameProvider.js +9 -79
- package/src/main/js/sap/ushell/renderers/fiori2/Renderer.js +101 -1882
- package/src/main/js/sap/ushell/renderers/fiori2/RendererExtensions.js +2 -3
- package/src/main/js/sap/ushell/renderers/fiori2/Shell.controller.js +8 -3130
- package/src/main/js/sap/ushell/renderers/fiori2/Shell.view.js +7 -7
- package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsKeyboardHandler.js +7 -92
- package/src/main/js/sap/ushell/renderers/fiori2/allMyApps/AllMyAppsManager.js +8 -438
- package/src/main/js/sap/ushell/resources.js +1 -1
- package/src/main/js/sap/ushell/services/AllMyApps.js +16 -7
- package/src/main/js/sap/ushell/services/AppConfiguration.js +12 -0
- package/src/main/js/sap/ushell/services/AppLifeCycle.js +11 -14
- package/src/main/js/sap/ushell/services/AppState.js +12 -8
- package/src/main/js/sap/ushell/services/Bookmark.js +15 -13
- package/src/main/js/sap/ushell/services/BookmarkV2.js +919 -0
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +229 -241
- package/src/main/js/sap/ushell/services/CommonDataModel.js +14 -4
- package/src/main/js/sap/ushell/services/Configuration.js +12 -11
- package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +13 -10
- package/src/main/js/sap/ushell/services/Container.js +1 -1
- package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
- package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +8 -6
- package/src/main/js/sap/ushell/services/DarkModeSupport.js +16 -10
- package/src/main/js/sap/ushell/services/EndUserFeedback.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/FloatingContainer.js +103 -0
- package/src/main/js/sap/ushell/services/Extension/Footer.js +61 -0
- package/src/main/js/sap/ushell/services/Extension/Header.js +193 -0
- package/src/main/js/sap/ushell/services/Extension/Item.js +195 -0
- package/src/main/js/sap/ushell/services/Extension/SidePane.js +155 -0
- package/src/main/js/sap/ushell/services/Extension/ToolArea.js +152 -0
- package/src/main/js/sap/ushell/services/Extension.js +381 -0
- package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
- package/src/main/js/sap/ushell/services/Menu.js +48 -59
- package/src/main/js/sap/ushell/services/Message.js +15 -14
- package/src/main/js/sap/ushell/services/MessageBroker.js +12 -12
- package/src/main/js/sap/ushell/services/NavTargetResolution.js +48 -70
- package/src/main/js/sap/ushell/services/Navigation/utils.js +565 -0
- package/src/main/js/sap/ushell/services/Navigation.js +152 -139
- package/src/main/js/sap/ushell/services/NavigationDataProvider.js +11 -8
- package/src/main/js/sap/ushell/services/Notifications.js +118 -1523
- package/src/main/js/sap/ushell/services/NotificationsV2.js +1872 -0
- package/src/main/js/sap/ushell/services/PageBuilding.js +11 -8
- package/src/main/js/sap/ushell/services/PagePersistence.js +11 -8
- package/src/main/js/sap/ushell/services/PageReferencing.js +11 -8
- package/src/main/js/sap/ushell/services/Pages.js +11 -15
- package/src/main/js/sap/ushell/services/Personalization.js +5 -3
- package/src/main/js/sap/ushell/services/PersonalizationV2/ContextContainer.js +410 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/Personalizer.js +109 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/TransientPersonalizer.js +57 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/Variant.js +180 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSet.js +296 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/VariantSetAdapter.js +125 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapter.js +71 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/WindowAdapterContainer.js +172 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/constants.js +23 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/constants.private.js +18 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2/utils.js +233 -0
- package/src/main/js/sap/ushell/services/PersonalizationV2.js +641 -0
- package/src/main/js/sap/ushell/services/PluginManager.js +47 -55
- package/src/main/js/sap/ushell/services/ReferenceResolver.js +61 -54
- package/src/main/js/sap/ushell/services/Search.js +15 -2
- package/src/main/js/sap/ushell/services/SearchCEP.js +40 -44
- package/src/main/js/sap/ushell/services/SearchableContent.js +9 -9
- package/src/main/js/sap/ushell/services/ShellNavigation.js +14 -13
- package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/SpaceContent.js +9 -10
- package/src/main/js/sap/ushell/services/SupportTicket.js +14 -14
- package/src/main/js/sap/ushell/services/UITracer.js +31 -35
- package/src/main/js/sap/ushell/services/URLParsing.js +9 -11
- package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
- package/src/main/js/sap/ushell/services/URLTemplate.js +14 -13
- package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +29 -26
- package/src/main/js/sap/ushell/services/UsageAnalytics.js +6 -0
- package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +11 -7
- package/src/main/js/sap/ushell/services/UserDefaultParameters.js +20 -26
- package/src/main/js/sap/ushell/services/UserInfo.js +44 -23
- package/src/main/js/sap/ushell/services/UserRecents.js +13 -5
- package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +12 -9
- package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +10 -8
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Formatter.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundIndex.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/InboundProvider.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/PrelaunchOperations.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Search.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/StagedLogger.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/SystemContext.js +1 -1
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/Utils.js +3 -4
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/VirtualInbounds.js +4 -4
- package/src/main/js/sap/ushell/services/_ClientSideTargetResolution/XAppStateProcessing.js +1 -1
- package/src/main/js/sap/ushell/services/_CommonDataModel/SiteConverter.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +2 -1
- package/src/main/js/sap/ushell/services/_MessageBroker/MessageBrokerEngine.js +1 -1
- package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
- package/src/main/js/sap/ushell/services/_Personalization/ContextContainer.js +6 -0
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainer.js +5 -1
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariant.js +13 -9
- package/src/main/js/sap/ushell/services/_Personalization/PersonalizationContainerVariantSet.js +17 -13
- package/src/main/js/sap/ushell/services/_Personalization/Personalizer.js +5 -0
- package/src/main/js/sap/ushell/services/_Personalization/TransientPersonalizer.js +5 -1
- package/src/main/js/sap/ushell/services/_Personalization/Variant.js +4 -0
- package/src/main/js/sap/ushell/services/_Personalization/VariantSet.js +17 -9
- package/src/main/js/sap/ushell/services/_Personalization/VariantSetAdapter.js +4 -6
- package/src/main/js/sap/ushell/services/_Personalization/WindowAdapter.js +5 -44
- package/src/main/js/sap/ushell/services/_Personalization/WindowAdapterContainer.js +5 -101
- package/src/main/js/sap/ushell/services/_Personalization/constants.js +3 -0
- package/src/main/js/sap/ushell/services/_Personalization/constants.private.js +3 -0
- package/src/main/js/sap/ushell/services/_Personalization/utils.js +3 -0
- package/src/main/js/sap/ushell/services/_PluginManager/Extensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/HeaderExtensions.js +1 -1
- package/src/main/js/sap/ushell/services/_PluginManager/MenuExtensions.js +1 -1
- package/src/main/js/sap/ushell/services/_Ui5ComponentLoader/utils.js +29 -5
- package/src/main/js/sap/ushell/services/_UserRecents/UserRecentsBase.js +19 -27
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstance.js +4 -0
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceAbap.js +3 -0
- package/src/main/js/sap/ushell/services/_VisualizationInstantiation/VizInstanceLink.js +1 -1
- package/src/main/js/sap/ushell/services/personalization/VariantSetAdapter.js +13 -15
- package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
- package/src/main/js/sap/ushell/themes/sap_horizon/ShellAppTitle.less +4 -4
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellAppTitle.less +4 -4
- package/src/main/js/sap/ushell/themes/sap_horizon_hcb/ShellAppTitle.less +2 -2
- package/src/main/js/sap/ushell/themes/sap_horizon_hcw/ShellAppTitle.less +2 -2
- package/src/main/js/sap/ushell/ui/AppContainer.js +2 -2
- package/src/main/js/sap/ushell/ui/ContentNodeSelector.js +2 -2
- package/src/main/js/sap/ushell/ui/ShellHeader.js +2 -2
- package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
- package/src/main/js/sap/ushell/ui/footerbar/AddBookmarkButton.js +8 -12
- package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/Page.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/Section.js +21 -8
- package/src/main/js/sap/ushell/ui/launchpad/TileState.js +0 -1
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ShellHeadItem.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/SysInfoBar.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ToolAreaItem.js +1 -1
- package/src/main/js/sap/ushell/ui/utils.js +1 -1
- package/src/main/js/sap/ushell/ui5service/ShellUIService.js +1 -1
- package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
- package/src/main/js/sap/ushell/ui5service/_ShellUIService/shelluiservice.class.factory.js +14 -26
- package/src/main/js/sap/ushell/utils/Deferred.js +88 -0
- package/src/main/js/sap/ushell/utils/UrlShortening.js +1 -1
- package/src/main/js/sap/ushell/utils/WindowUtils.js +8 -8
- package/src/main/js/sap/ushell/utils.js +31 -67
- package/src/test/js/sap/ushell/bootstrap/sandbox.js +7 -2
- package/ui5.yaml +8 -2
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/HeadEndItemsOverflowPopover.fragment.xml +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ar.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_bg.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ca.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cs.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_cy.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_da.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_de.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_el.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_GB.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_sappsd.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saprigi.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_en_US_saptrc.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_es_MX.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_et.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fi.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_fr_CA.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hi.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hr.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_hu.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_id.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_it.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_iw.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ja.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_kk.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ko.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lt.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_lv.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ms.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_nl.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_no.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pl.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_pt_PT.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ro.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_ru.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sh.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sk.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sl.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_sv.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_th.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_tr.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_uk.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_vi.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_CN.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/resources/resources_zh_TW.properties +0 -0
- /package/src/main/js/sap/ushell/{renderers/fiori2 → renderer}/search/util.js +0 -0
- /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
|
+
});
|