@sapui5/sap.ushell 1.141.3 → 1.142.1
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 +1 -7
- package/src/main/js/sap/ushell/ApplicationType/UrlPostProcessing.js +7 -11
- package/src/main/js/sap/ushell/ApplicationType/wdaResolution.js +18 -0
- package/src/main/js/sap/ushell/Fiori20Adapter.js +1 -1
- package/src/main/js/sap/ushell/Fiori20AdapterTest.js +1 -1
- package/src/main/js/sap/ushell/NWBCInterface.js +1 -1
- package/src/main/js/sap/ushell/TechnicalParameters.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/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/adapters/cdm/ClientSideTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/CommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/LaunchPageAdapter.js +1 -3
- package/src/main/js/sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/Settings/UserLanguageAndRegion/UserLanguageAndRegion.view.xml +5 -12
- 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 -2
- package/src/main/js/sap/ushell/adapters/cdm/v3/FlpLaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/StaticGroupsAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readApplications.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readCatalogs.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readHome.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readPages.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils.js +1 -1
- package/src/main/js/sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/MenuAdapter.js +41 -24
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/cep/NavTargetResolutionInternalAdapter.js +3 -2
- package/src/main/js/sap/ushell/adapters/cep/SearchCEPAdapter.js +22 -16
- 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 +1 -1
- 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/FlpLaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/NavTargetResolutionInternalAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PagePersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SearchCEPAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/UserDefaultParameterPersistenceAdapter.js +1 -1
- package/src/main/js/sap/ushell/adapters/local/UserInfoAdapter.js +1 -1
- package/src/main/js/sap/ushell/appIntegration/AppLifeCycle.js +4 -7
- package/src/main/js/sap/ushell/appIntegration/ApplicationContainer.js +43 -20
- package/src/main/js/sap/ushell/appIntegration/ApplicationContainerRenderer.js +0 -11
- package/src/main/js/sap/ushell/appIntegration/IframeApplicationContainer.js +89 -32
- package/src/main/js/sap/ushell/appIntegration/IframeApplicationContainerRenderer.js +53 -52
- package/src/main/js/sap/ushell/appIntegration/PostMessageHandler/NWBCHandler.js +1 -1
- package/src/main/js/sap/ushell/appIntegration/PostMessageManager.js +52 -15
- package/src/main/js/sap/ushell/appIntegration/PostMessagePluginInterface.js +4 -0
- package/src/main/js/sap/ushell/appIntegration/UI5ApplicationContainer.js +15 -28
- package/src/main/js/sap/ushell/appIntegration/contracts/EmbeddedUI5Handler.js +15 -26
- package/src/main/js/sap/ushell/appIntegration/contracts/StatefulContainerV2Handler.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/AppRuntime.js +2 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/plugins/baseRta/Trigger.js +11 -4
- package/src/main/js/sap/ushell/appRuntime/ui5/renderers/fiori2/RendererExtensions.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppConfiguration.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycle.js +20 -3
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppLifeCycleAgent.js +41 -6
- package/src/main/js/sap/ushell/appRuntime/ui5/services/AppState.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Bookmark.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/BookmarkV2.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/CommonDataModel.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Container.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/CrossApplicationNavigation.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Extension/Item.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Extension.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/FlpLaunchPage.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/FrameBoundExtension.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/LaunchPage.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/MessageBroker.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolution.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/NavTargetResolutionInternal.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/Navigation.js +2 -2
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ReferenceResolver.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigation.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellNavigationInternal.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/ShellUIService.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/UserInfo.js +1 -1
- package/src/main/js/sap/ushell/appRuntime/ui5/services/adapters/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/SchedulingAgent/StepConfiguration.json +14 -17
- package/src/main/js/sap/ushell/bootstrap/SchedulingAgent/logger.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/SchedulingAgent/state.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/cdm/cdm.constants.js +0 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.configure.ui5datetimeformat.js +1 -1
- package/src/main/js/sap/ushell/bootstrap/common/common.create.configcontract.core.js +18 -5
- package/src/main/js/sap/ushell/bootstrap/sandbox2.js +1 -1
- package/src/main/js/sap/ushell/components/appfinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/CatalogService.js +1 -1
- 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/dialog/Component.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/dialog/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/contentFinder/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/contentFinderStandalone/Component.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinderStandalone/controller/ContentFinderStandalone.controller.js +1 -1
- package/src/main/js/sap/ushell/components/contentFinderStandalone/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/factsheet/Component.js +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 +2 -2
- 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 +1 -1
- package/src/main/js/sap/ushell/components/pages/ActionMode.js +1 -1
- package/src/main/js/sap/ushell/components/pages/Component.js +1 -1
- package/src/main/js/sap/ushell/components/pages/MyHomeImport.js +1 -1
- package/src/main/js/sap/ushell/components/pages/controller/PageRuntime.controller.js +2 -2
- package/src/main/js/sap/ushell/components/pages/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/runtimeSwitcher/controller/RuntimeSwitcher.controller.js +1 -1
- package/src/main/js/sap/ushell/components/runtimeSwitcher/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/FloatingContainer/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/MenuBar/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenu.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/controller/NavigationBarMenuButton.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/NavigationBarMenu/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/Notifications/Component.js +25 -50
- package/src/main/js/sap/ushell/components/shell/Notifications/NotificationsList.controller.js +1 -1
- package/src/main/js/sap/ushell/components/shell/Notifications/NotificationsListPopoverContent.view.xml +2 -2
- package/src/main/js/sap/ushell/components/shell/Notifications/NotificationsListPopoverHeader.fragment.xml +1 -1
- package/src/main/js/sap/ushell/components/shell/Notifications/NotificationsModule.js +169 -0
- 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/Component.js +6 -2
- package/src/main/js/sap/ushell/components/shell/Search/SearchModule.js +58 -0
- package/src/main/js/sap/ushell/components/shell/Search/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/FrequentActivityProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/RecentSearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEP/SearchProviders/SearchServiceProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/Component.js +30 -21
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/SearchProviders/FrequentActivityProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/SearchProviders/RecentSearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/SearchProviders/SearchProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/SearchProviders/SearchServiceProvider.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SearchCEPNew/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/Settings/Component.js +2 -2
- package/src/main/js/sap/ushell/components/shell/Settings/UserSettings.view.xml +0 -1
- package/src/main/js/sap/ushell/components/shell/ShellBar/controller/ShellBar.controller.js +11 -18
- package/src/main/js/sap/ushell/components/shell/ShellBar/manifest.json +1 -1
- package/src/main/js/sap/ushell/components/shell/ShellBar/view/ShellBar.view.xml +23 -18
- package/src/main/js/sap/ushell/components/shell/SideNavigation/Component.js +1 -1
- package/src/main/js/sap/ushell/components/shell/SideNavigation/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 +5 -5
- package/src/main/js/sap/ushell/components/shell/UserActionsMenu/UserActionsMenu.fragment.xml +2 -2
- package/src/main/js/sap/ushell/components/shell/UserImage/Component.js +1 -1
- package/src/main/js/sap/ushell/components/visualizationOrganizer/Component.js +1 -1
- package/src/main/js/sap/ushell/designtime/ApplicationContainer.designtime.js +1 -1
- package/src/main/js/sap/ushell/library.js +1 -8
- package/src/main/js/sap/ushell/modules/BaseAPI.js +107 -0
- package/src/main/js/sap/ushell/modules/BaseProvider.js +43 -0
- package/src/main/js/sap/ushell/modules/Notifications/NotificationsAPI.js +253 -0
- package/src/main/js/sap/ushell/modules/Notifications/NotificationsProvider.js +50 -0
- package/src/main/js/sap/ushell/modules/Notifications.js +53 -0
- package/src/main/js/sap/ushell/modules/Search/SearchAPI.js +271 -0
- package/src/main/js/sap/ushell/modules/Search/SearchProvider.js +50 -0
- package/src/main/js/sap/ushell/modules/Search.js +55 -0
- package/src/main/js/sap/ushell/modules/loader/AbstractLoader.js +95 -0
- package/src/main/js/sap/ushell/modules/loader/NotificationsLoader.js +148 -0
- package/src/main/js/sap/ushell/modules/loader/SearchLoader.js +153 -0
- package/src/main/js/sap/ushell/navigationMode.js +1 -1
- package/src/main/js/sap/ushell/performance/FesrEnhancer.js +136 -40
- package/src/main/js/sap/ushell/performance/ShellAnalytics.js +1 -1
- package/src/main/js/sap/ushell/performance/StatisticalRecord.js +26 -1
- package/src/main/js/sap/ushell/plugins/appwarmup/Component.js +1 -1
- package/src/main/js/sap/ushell/plugins/ghostapp/FakeModel.js +19 -14
- package/src/main/js/sap/ushell/renderer/Renderer.js +4 -4
- package/src/main/js/sap/ushell/renderer/Shell.controller.js +108 -3
- package/src/main/js/sap/ushell/renderer/Shell.view.js +2 -2
- package/src/main/js/sap/ushell/renderer/rendererTargetWrapper/RendererTarget.controller.js +1 -1
- package/src/main/js/sap/ushell/renderer/resources/resources.properties +6 -8
- package/src/main/js/sap/ushell/renderer/resources/resources_ar.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_bg.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ca.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_cnr.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_cs.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_cy.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_da.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_de.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_el.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_en.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_en_GB.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_en_US_saprigi.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_es.properties +1 -2
- package/src/main/js/sap/ushell/renderer/resources/resources_es_MX.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_et.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_fi.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_fr.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_fr_CA.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_hi.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_hr.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_hu.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_id.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_it.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_iw.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ja.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_kk.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ko.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_lt.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_lv.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_mk.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ms.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_nl.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_no.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_pl.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_pt.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_pt_PT.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ro.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_ru.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_sh.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_sk.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_sl.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_sr.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_sv.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_th.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_tr.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_uk.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_vi.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_zh_CN.properties +0 -1
- package/src/main/js/sap/ushell/renderer/resources/resources_zh_TW.properties +0 -1
- package/src/main/js/sap/ushell/renderer/search/searchComponent/manifest.json +1 -1
- package/src/main/js/sap/ushell/services/AppLifeCycle.js +44 -36
- package/src/main/js/sap/ushell/services/AppState.js +1 -1
- package/src/main/js/sap/ushell/services/Bookmark.js +1 -1
- package/src/main/js/sap/ushell/services/BookmarkV2.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/Formatter.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/InboundIndex.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/InboundProvider.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/PrelaunchOperations.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/Search.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/StagedLogger.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/SystemContext.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/Utils.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/VirtualInbounds.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution/XAppStateProcessing.js +1 -1
- package/src/main/js/sap/ushell/services/ClientSideTargetResolution.js +2 -1
- package/src/main/js/sap/ushell/services/CommonDataModel/SiteConverter.js +1 -1
- package/src/main/js/sap/ushell/services/CommonDataModel/vizTypeDefaults/VizTypeDefaults.js +1 -1
- package/src/main/js/sap/ushell/services/CommonDataModel.js +1 -1
- package/src/main/js/sap/ushell/services/Configuration.js +1 -1
- package/src/main/js/sap/ushell/services/ConfigurationDefaults.js +1 -1
- package/src/main/js/sap/ushell/services/ContentExtensionAdapterFactory.js +1 -1
- package/src/main/js/sap/ushell/services/CrossApplicationNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/DarkModeSupport.js +1 -1
- package/src/main/js/sap/ushell/services/Extension/Item.js +1 -1
- package/src/main/js/sap/ushell/services/Extension.js +15 -3
- package/src/main/js/sap/ushell/services/FlpLaunchPage.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/FloatingContainer.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/Footer.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/Item.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/SidePane.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/ToolArea.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension/UserSettingsEntry.js +1 -1
- package/src/main/js/sap/ushell/services/FrameBoundExtension.js +21 -8
- package/src/main/js/sap/ushell/services/LaunchPage.js +1 -1
- package/src/main/js/sap/ushell/services/Menu.js +1 -181
- package/src/main/js/sap/ushell/services/Message.js +1 -1
- package/src/main/js/sap/ushell/services/MessageBroker/MessageBrokerEngine.js +1 -1
- package/src/main/js/sap/ushell/services/MessageBroker.js +1 -1
- package/src/main/js/sap/ushell/services/MessageInternal.js +1 -1
- package/src/main/js/sap/ushell/services/Navigation/compatibility.js +1 -1
- package/src/main/js/sap/ushell/services/Navigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/Navigation.js +1 -1
- package/src/main/js/sap/ushell/services/NavigationDataProvider.js +1 -1
- package/src/main/js/sap/ushell/services/PageBuilding.js +1 -1
- package/src/main/js/sap/ushell/services/PagePersistence.js +1 -1
- package/src/main/js/sap/ushell/services/PageReferencing.js +1 -1
- package/src/main/js/sap/ushell/services/Pages.js +1 -1
- package/src/main/js/sap/ushell/services/Personalization.js +1 -1
- package/src/main/js/sap/ushell/services/PersonalizationV2.js +1 -1
- package/src/main/js/sap/ushell/services/PluginManager/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/PluginManager/SimpleExpression.js +1 -1
- package/src/main/js/sap/ushell/services/PluginManager.js +1 -2
- package/src/main/js/sap/ushell/services/ReferenceResolver.js +1 -1
- package/src/main/js/sap/ushell/services/Search.js +1 -1
- package/src/main/js/sap/ushell/services/SearchCEP.js +1 -1
- package/src/main/js/sap/ushell/services/SearchableContent.js +1 -1
- package/src/main/js/sap/ushell/services/ShellNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/SmartNavigation.js +1 -1
- package/src/main/js/sap/ushell/services/SpaceContent.js +1 -1
- package/src/main/js/sap/ushell/services/UITracer.js +1 -1
- package/src/main/js/sap/ushell/services/URLShortening.js +1 -1
- package/src/main/js/sap/ushell/services/URLTemplate.js +1 -1
- package/src/main/js/sap/ushell/services/Ui5ComponentLoader.js +5 -35
- package/src/main/js/sap/ushell/services/UserDefaultParameterPersistence.js +1 -1
- package/src/main/js/sap/ushell/services/UserDefaultParameters.js +1 -1
- package/src/main/js/sap/ushell/services/UserInfo.js +1 -1
- package/src/main/js/sap/ushell/services/UserRecents.js +1 -1
- package/src/main/js/sap/ushell/services/VisualizationDataProvider.js +1 -1
- package/src/main/js/sap/ushell/services/VisualizationInstantiation.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/ContentExtensionAdapterConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_ContentExtensionAdapterFactory/FeaturedGroupConfig.js +1 -1
- package/src/main/js/sap/ushell/services/_CrossApplicationNavigation/utils.js +1 -1
- package/src/main/js/sap/ushell/services/_PageReferencing/PageReferencer.js +1 -1
- package/src/main/js/sap/ushell/state/StateManager.js +5 -1
- package/src/main/js/sap/ushell/state/StateRules.js +10 -1
- package/src/main/js/sap/ushell/state/modules/BackNavigation.js +8 -3
- package/src/main/js/sap/ushell/state/modules/ContentDensity.js +1 -1
- package/src/main/js/sap/ushell/state/modules/Favicon.js +1 -1
- package/src/main/js/sap/ushell/state/modules/HeaderLogo.js +1 -1
- package/src/main/js/sap/ushell/support/plugins/flpConfig/FlpConfigurationPlugin.js +1 -1
- package/src/main/js/sap/ushell/themes/sap_horizon/ShellHeader.less +27 -26
- package/src/main/js/sap/ushell/themes/sap_horizon_dark/ShellHeader.less +27 -26
- package/src/main/js/sap/ushell/themes/sap_horizon_hcb/ShellHeader.less +22 -21
- package/src/main/js/sap/ushell/themes/sap_horizon_hcw/ShellHeader.less +22 -21
- package/src/main/js/sap/ushell/ui/cards/RecentActivitiesExtension.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/ExtendedChangeDetection.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/Section.js +1 -1
- package/src/main/js/sap/ushell/ui/launchpad/VizInstance.js +113 -22
- package/src/main/js/sap/ushell/ui/launchpad/VizInstanceCdm.js +0 -2
- package/src/main/js/sap/ushell/ui/launchpad/section/CompactArea.js +1 -1
- package/src/main/js/sap/ushell/ui/shell/ShellAppTitle.js +0 -8
- 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/ShellUIServiceFactory.js +1 -1
- package/src/main/js/sap/ushell/ui5service/UserStatus.js +1 -1
- package/src/main/js/sap/ushell/utils/SmartBusiness.js +102 -0
- package/src/main/js/sap/ushell/utils/UrlShortening.js +1 -1
- package/src/main/js/sap/ushell/utils/workpage/WorkPageHost.js +1 -1
- package/src/main/js/sap/ushell/utils/workpage/WorkPageService.js +1 -1
- package/src/main/js/sap/ushell/utils/workpage/WorkPageVizInstantiation.js +1 -1
- package/src/main/js/sap/ushell/utils.js +11 -35
- package/src/test/js/sap/ushell/bootstrap/sandbox.js +1 -1
- package/ui5.yaml +19 -32
- package/src/main/js/sap/ushell/components/workPageBuilder/Component.js +0 -228
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility.js +0 -277
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js +0 -2128
- package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.layout.js +0 -462
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPage.js +0 -182
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageButton.js +0 -135
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageCell.js +0 -400
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumn.js +0 -345
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnRenderer.js +0 -103
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageColumnResizer.js +0 -147
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRenderer.js +0 -60
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRow.js +0 -277
- package/src/main/js/sap/ushell/components/workPageBuilder/controls/WorkPageRowRenderer.js +0 -96
- package/src/main/js/sap/ushell/components/workPageBuilder/manifest.json +0 -59
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources.properties +0 -177
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ar.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_bg.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ca.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cnr.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cs.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_cy.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_da.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_de.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_el.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_GB.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_sappsd.properties +0 -79
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_saprigi.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_en_US_saptrc.properties +0 -90
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_es.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_es_MX.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_et.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fi.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fr.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_fr_CA.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hi.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hr.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_hu.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_id.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_it.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_iw.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ja.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_kk.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ko.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_lt.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_lv.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_mk.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ms.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_nl.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_no.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pl.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pt.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_pt_PT.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ro.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_ru.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sh.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sk.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sl.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sr.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_sv.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_th.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_tr.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_uk.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_vi.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_zh_CN.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/resources/resources_zh_TW.properties +0 -93
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageBuilder.view.xml +0 -248
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageCellDeleteDialog.fragment.xml +0 -25
- package/src/main/js/sap/ushell/components/workPageBuilder/view/WorkPageRowDeleteDialog.fragment.xml +0 -25
- package/src/main/js/sap/ushell/components/workPageRuntime/Component.js +0 -67
- package/src/main/js/sap/ushell/components/workPageRuntime/controller/WorkPageRuntime.controller.js +0 -176
- package/src/main/js/sap/ushell/components/workPageRuntime/manifest.json +0 -50
- package/src/main/js/sap/ushell/components/workPageRuntime/view/WorkPageRuntime.view.xml +0 -37
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/Avatar.js +0 -119
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/Button.js +0 -219
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/Label.js +0 -75
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/ListItem.js +0 -76
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/ListItemBase.js +0 -39
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/ListItemGroup.js +0 -153
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/Menu.js +0 -185
- package/src/main/js/sap/ushell/gen/ui5/webcomponents/dist/MenuItem.js +0 -198
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-base.js +0 -576
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/IllustratedMessage.js +0 -98
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/NotificationList.js +0 -135
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/NotificationListGroupItem.js +0 -91
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/NotificationListItem.js +0 -134
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/NotificationListItemBase.js +0 -55
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/Search.js +0 -163
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/SearchItem.js +0 -83
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/SearchItemGroup.js +0 -36
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/SearchMessageArea.js +0 -53
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/SearchScope.js +0 -55
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/ShellBar.js +0 -380
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/ShellBarBranding.js +0 -78
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/ShellBarItem.js +0 -88
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/ShellBarSearch.js +0 -157
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/ShellBarSpacer.js +0 -49
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/UserMenu.js +0 -197
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/UserMenuAccount.js +0 -83
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori/dist/UserMenuItem.js +0 -42
- package/src/main/js/sap/ushell/gen/ui5/webcomponents-fiori.js +0 -1652
- package/src/main/js/sap/ushell/gen/ui5/webcomponents.js +0 -2823
- package/src/main/js/sap/ushell/thirdparty/AccessibilityTextsHelper.js +0 -13
- package/src/main/js/sap/ushell/thirdparty/Avatar.js +0 -453
- package/src/main/js/sap/ushell/thirdparty/BusyIndicator.js +0 -233
- package/src/main/js/sap/ushell/thirdparty/Button.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/Button2.js +0 -656
- package/src/main/js/sap/ushell/thirdparty/FocusableElements.js +0 -10
- package/src/main/js/sap/ushell/thirdparty/Icon.js +0 -313
- package/src/main/js/sap/ushell/thirdparty/Icons.js +0 -234
- package/src/main/js/sap/ushell/thirdparty/IllustratedMessage.js +0 -1297
- package/src/main/js/sap/ushell/thirdparty/Label.js +0 -115
- package/src/main/js/sap/ushell/thirdparty/Link.js +0 -316
- package/src/main/js/sap/ushell/thirdparty/List.js +0 -1253
- package/src/main/js/sap/ushell/thirdparty/ListBoxItemGroupTemplate.js +0 -14
- package/src/main/js/sap/ushell/thirdparty/ListItemAdditionalText.css.js +0 -10
- package/src/main/js/sap/ushell/thirdparty/ListItemBase.js +0 -251
- package/src/main/js/sap/ushell/thirdparty/ListItemCustom.js +0 -1689
- package/src/main/js/sap/ushell/thirdparty/ListItemGroup.js +0 -637
- package/src/main/js/sap/ushell/thirdparty/Menu.js +0 -389
- package/src/main/js/sap/ushell/thirdparty/MenuItem.js +0 -10
- package/src/main/js/sap/ushell/thirdparty/MenuItem2.js +0 -762
- package/src/main/js/sap/ushell/thirdparty/NotificationList.js +0 -291
- package/src/main/js/sap/ushell/thirdparty/NotificationListGroupItem.js +0 -310
- package/src/main/js/sap/ushell/thirdparty/NotificationListItem.js +0 -534
- package/src/main/js/sap/ushell/thirdparty/NotificationListItemBase.js +0 -98
- package/src/main/js/sap/ushell/thirdparty/ResponsivePopover.js +0 -2312
- package/src/main/js/sap/ushell/thirdparty/SearchItem.js +0 -157
- package/src/main/js/sap/ushell/thirdparty/SearchItemGroup.js +0 -44
- package/src/main/js/sap/ushell/thirdparty/SearchMessageArea.js +0 -49
- package/src/main/js/sap/ushell/thirdparty/SearchScope.js +0 -39
- package/src/main/js/sap/ushell/thirdparty/ShellBar.js +0 -1809
- package/src/main/js/sap/ushell/thirdparty/ShellBarBranding.js +0 -119
- package/src/main/js/sap/ushell/thirdparty/ShellBarItem.js +0 -89
- package/src/main/js/sap/ushell/thirdparty/ShellBarSearch.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/ShellBarSearch2.js +0 -3453
- package/src/main/js/sap/ushell/thirdparty/ShellBarSpacer.js +0 -40
- package/src/main/js/sap/ushell/thirdparty/Tag.js +0 -302
- package/src/main/js/sap/ushell/thirdparty/Text.js +0 -127
- package/src/main/js/sap/ushell/thirdparty/Title.js +0 -167
- package/src/main/js/sap/ushell/thirdparty/UserMenu.js +0 -950
- package/src/main/js/sap/ushell/thirdparty/UserMenuAccount.js +0 -114
- package/src/main/js/sap/ushell/thirdparty/UserMenuItem.js +0 -61
- package/src/main/js/sap/ushell/thirdparty/ValueState.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/WrappingType.js +0 -24
- package/src/main/js/sap/ushell/thirdparty/_dynamics/InputComposition.js +0 -35
- package/src/main/js/sap/ushell/thirdparty/_dynamics/InputSuggestions.js +0 -397
- package/src/main/js/sap/ushell/thirdparty/_dynamics/ListItemStandardExpandableTextTemplate.js +0 -193
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons-TNT.js +0 -585
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons-TNT2.js +0 -585
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons-business-suite.js +0 -1194
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons-business-suite2.js +0 -1194
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons.js +0 -2509
- package/src/main/js/sap/ushell/thirdparty/_dynamics/SAP-icons2.js +0 -2509
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ar.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ar2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_bg.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_bg2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ca.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ca2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cnr.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cnr2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cs.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cs2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cy.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_cy2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_da.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_da2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_de.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_de2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_el.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_el2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_GB.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_GB2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_sappsd.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_sappsd2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_saprigi.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_saprigi2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_saptrc.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_en_US_saptrc2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_es.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_es2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_es_MX.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_es_MX2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_et.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_et2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fi.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fi2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fr.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fr2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fr_CA.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_fr_CA2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hi.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hi2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hr.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hr2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hu.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_hu2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_id.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_id2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_it.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_it2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_iw.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_iw2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ja.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ja2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_kk.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_kk2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ko.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ko2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_lt.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_lt2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_lv.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_lv2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_mk.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_mk2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ms.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ms2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_nl.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_nl2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_no.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_no2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pl.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pl2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pt.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pt2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pt_PT.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_pt_PT2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ro.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ro2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ru.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_ru2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sh.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sh2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sk.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sk2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sl.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sl2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sr.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sr2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sv.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_sv2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_th.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_th2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_tr.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_tr2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_uk.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_uk2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_vi.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_vi2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_zh_CN.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_zh_CN2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_zh_TW.js +0 -866
- package/src/main/js/sap/ushell/thirdparty/_dynamics/messagebundle_zh_TW2.js +0 -611
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css10.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css11.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css12.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css13.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css14.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css15.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css16.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css17.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css18.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css19.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css20.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css21.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css22.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css23.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css24.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css25.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css26.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css27.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css4.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css5.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css6.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css7.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css8.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/_dynamics/parameters-bundle.css9.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/encodeXML.js +0 -87
- package/src/main/js/sap/ushell/thirdparty/event-strict.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/generateHighlightedMarkup.js +0 -9
- package/src/main/js/sap/ushell/thirdparty/i18n-defaults.js +0 -115
- package/src/main/js/sap/ushell/thirdparty/i18n-defaults2.js +0 -159
- package/src/main/js/sap/ushell/thirdparty/information.js +0 -100
- package/src/main/js/sap/ushell/thirdparty/information2.js +0 -13
- package/src/main/js/sap/ushell/thirdparty/overflow.js +0 -25
- package/src/main/js/sap/ushell/thirdparty/parameters-bundle.css.js +0 -11
- package/src/main/js/sap/ushell/thirdparty/parameters-bundle.css2.js +0 -44
- package/src/main/js/sap/ushell/thirdparty/parameters-bundle.css3.js +0 -8
- package/src/main/js/sap/ushell/thirdparty/query.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/slim-arrow-down.js +0 -44
- package/src/main/js/sap/ushell/thirdparty/sys-enter-2.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/toLowercaseEnumValue.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/ui5/webcomponents-icons/AllIcons.js +0 -26
- package/src/main/js/sap/ushell/thirdparty/ui5/webcomponents-icons-business-suite/AllIcons.js +0 -26
- package/src/main/js/sap/ushell/thirdparty/ui5/webcomponents-icons-tnt/AllIcons.js +0 -26
- package/src/main/js/sap/ushell/thirdparty/webcomponents-base.js +0 -4301
- package/src/main/js/sap/ushell/thirdparty/webcomponents-base2.js +0 -7
- package/src/main/js/sap/ushell/thirdparty/webcomponents-fiori.js +0 -146
- package/src/main/js/sap/ushell/thirdparty/webcomponents.js +0 -170
- package/src/main/js/sap/ushell/thirdparty/willShowContent.js +0 -7
package/src/main/js/sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.controller.js
DELETED
|
@@ -1,2128 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2009-2025 SAP SE, All Rights Reserved
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file WorkPageBuilder controller for WorkPageBuilder view
|
|
5
|
-
* @version 1.141.3
|
|
6
|
-
*/
|
|
7
|
-
sap.ui.define([
|
|
8
|
-
"sap/base/Log",
|
|
9
|
-
"sap/base/i18n/Localization",
|
|
10
|
-
"sap/base/util/ObjectPath",
|
|
11
|
-
"sap/base/util/deepExtend",
|
|
12
|
-
"sap/f/GridContainerItemLayoutData",
|
|
13
|
-
"sap/m/library",
|
|
14
|
-
"sap/ui/core/Element",
|
|
15
|
-
"sap/ui/core/Fragment",
|
|
16
|
-
"sap/ui/core/InvisibleMessage",
|
|
17
|
-
"sap/ui/core/library",
|
|
18
|
-
"sap/ui/core/mvc/Controller",
|
|
19
|
-
"sap/ui/integration/ActionDefinition",
|
|
20
|
-
"sap/ushell/utils/workpage/WorkPageHost",
|
|
21
|
-
"sap/ui/integration/widgets/Card",
|
|
22
|
-
"sap/ui/model/json/JSONModel",
|
|
23
|
-
"sap/ushell/adapters/cdm/v3/_LaunchPage/readUtils",
|
|
24
|
-
"sap/ushell/adapters/cdm/v3/_LaunchPage/readVisualizations",
|
|
25
|
-
"sap/ushell/adapters/cdm/v3/utilsCdm",
|
|
26
|
-
"sap/ushell/ui/launchpad/VizInstanceCdm",
|
|
27
|
-
"sap/ushell/utils",
|
|
28
|
-
"sap/ushell/utils/workpage/WorkPageVizInstantiation",
|
|
29
|
-
"sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.accessibility",
|
|
30
|
-
"sap/ushell/components/workPageBuilder/controller/WorkPageBuilder.layout",
|
|
31
|
-
"sap/ui/integration/library"
|
|
32
|
-
], (
|
|
33
|
-
Log,
|
|
34
|
-
Localization,
|
|
35
|
-
ObjectPath,
|
|
36
|
-
deepExtend,
|
|
37
|
-
GridContainerItemLayoutData,
|
|
38
|
-
mLibrary,
|
|
39
|
-
Element,
|
|
40
|
-
Fragment,
|
|
41
|
-
InvisibleMessage,
|
|
42
|
-
coreLibrary,
|
|
43
|
-
Controller,
|
|
44
|
-
ActionDefinition,
|
|
45
|
-
WorkPageHost,
|
|
46
|
-
Card,
|
|
47
|
-
JSONModel,
|
|
48
|
-
readUtils,
|
|
49
|
-
readVisualizations,
|
|
50
|
-
utilsCdm,
|
|
51
|
-
VizInstanceCdm,
|
|
52
|
-
utils,
|
|
53
|
-
WorkPageVizInstantiation,
|
|
54
|
-
WorkPageBuilderAccessibility,
|
|
55
|
-
WorkPageBuilderLayoutHelper,
|
|
56
|
-
integrationLibrary
|
|
57
|
-
) => {
|
|
58
|
-
"use strict";
|
|
59
|
-
|
|
60
|
-
// shortcut for sap.ui.core.ValueState
|
|
61
|
-
const ValueState = coreLibrary.ValueState;
|
|
62
|
-
|
|
63
|
-
// PR: Provider, CO: (Content) Administrator, PG: Page Administrator, US: End User
|
|
64
|
-
// US is commented for now, because we do not have personalization yet.
|
|
65
|
-
const CONFIGURATION_LEVELS = ["PR", "CO", "PG" /* , "US" */];
|
|
66
|
-
const MIN_GRID_COLUMN_WIDTH = 6;
|
|
67
|
-
const MAX_GRID_COLUMN_WIDTH = 24;
|
|
68
|
-
const STEP_SIZE = 2;
|
|
69
|
-
const MAX_COLUMNS_PER_ROW = 4;
|
|
70
|
-
|
|
71
|
-
const LoadState = mLibrary.LoadState;
|
|
72
|
-
const InvisibleMessageMode = coreLibrary.InvisibleMessageMode;
|
|
73
|
-
|
|
74
|
-
const CardPreviewMode = integrationLibrary.CardPreviewMode;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Controller of the WorkPageBuilder view.
|
|
78
|
-
*
|
|
79
|
-
* @param {string} sId Controller id
|
|
80
|
-
* @param {object} oParams Controller parameters
|
|
81
|
-
* @class
|
|
82
|
-
* @assigns sap.ui.core.mvc.Controller
|
|
83
|
-
* @private
|
|
84
|
-
* @since 1.99.0
|
|
85
|
-
* @alias sap.ushell.components.workPageBuilder.controller.WorkPages
|
|
86
|
-
*/
|
|
87
|
-
return Controller.extend("sap.ushell.components.workPageBuilder.controller.WorkPageBuilder", /** @lends sap.ushell.components.workPageBuilder.controller.WorkPageBuilder.prototype */ {
|
|
88
|
-
|
|
89
|
-
onInit: async function () {
|
|
90
|
-
const oWorkPage = this.byId("workPage");
|
|
91
|
-
this._fnDeleteRowHandler = this.deleteRow.bind(this);
|
|
92
|
-
this._fnDeleteCellHandler = this.deleteCell.bind(this);
|
|
93
|
-
this._fnSaveCardConfiguration = this._onSaveCardEditor.bind(this);
|
|
94
|
-
this._fnResetCardConfiguration = this._onResetCardConfigurations.bind(this);
|
|
95
|
-
|
|
96
|
-
this.oModel = new JSONModel({
|
|
97
|
-
maxColumns: MAX_COLUMNS_PER_ROW,
|
|
98
|
-
editMode: false,
|
|
99
|
-
previewMode: false,
|
|
100
|
-
loaded: false,
|
|
101
|
-
navigationDisabled: false,
|
|
102
|
-
showFooter: false,
|
|
103
|
-
showPageTitle: true,
|
|
104
|
-
data: {
|
|
105
|
-
workPage: null,
|
|
106
|
-
visualizations: [],
|
|
107
|
-
usedVisualizations: []
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
this.oModel.setSizeLimit(Infinity);
|
|
111
|
-
this._saveHost();
|
|
112
|
-
|
|
113
|
-
oWorkPage.bindElement({
|
|
114
|
-
path: "/data/workPage"
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
this.oWorkPageBuilderAccessibility = new WorkPageBuilderAccessibility();
|
|
118
|
-
this.oWorkPageVizInstantiation = await WorkPageVizInstantiation.getInstance();
|
|
119
|
-
|
|
120
|
-
this.getView().setModel(this.oModel);
|
|
121
|
-
|
|
122
|
-
WorkPageBuilderLayoutHelper.register(oWorkPage);
|
|
123
|
-
this.getView().setModel(WorkPageBuilderLayoutHelper.getModel(), "viewSettings");
|
|
124
|
-
|
|
125
|
-
this.oContentFinderPromise = new Promise((fnResolve) => {
|
|
126
|
-
this.fnContentFinderPromiseResolve = fnResolve;
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* handler for the "visualizationFilterApplied" event .
|
|
131
|
-
* @param {sap.ui.base.Event} oAppliedEvent The "visualizationFilterApplied" event.
|
|
132
|
-
* @private
|
|
133
|
-
*/
|
|
134
|
-
_onVisualizationFilterApplied: function (oAppliedEvent) {
|
|
135
|
-
this.getOwnerComponent().fireEvent("visualizationFilterApplied", oAppliedEvent.getParameters());
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
onExit: function () {
|
|
139
|
-
WorkPageBuilderLayoutHelper.deregister();
|
|
140
|
-
|
|
141
|
-
if (this.oContentFinderPromise) {
|
|
142
|
-
this.oContentFinderPromise.then((oComponent) => {
|
|
143
|
-
oComponent.destroy();
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (this.oCardEditorDialogPromise) {
|
|
148
|
-
this.oCardEditorDialogPromise.then((oDialog) => {
|
|
149
|
-
oDialog.destroy();
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
if (this.oCardResetDialogPromise) {
|
|
153
|
-
this.oCardResetDialogPromise.then((oDialog) => {
|
|
154
|
-
oDialog.destroy();
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (this.oDeleteCell) {
|
|
158
|
-
this.oDeleteCell.then((oDialog) => {
|
|
159
|
-
oDialog.destroy();
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (this.oLoadDeleteDialog) {
|
|
164
|
-
this.oLoadDeleteDialog.then((oDialog) => {
|
|
165
|
-
oDialog.destroy();
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Handler for the "borderReached" event of the GridContainer.
|
|
172
|
-
* Calculates which GridContainer in the given direction is the nearest to the currently focused one.
|
|
173
|
-
* Afterwards shifts the focus to the found GridContainer. If none is found nothing happens and the focus stays with the current one.
|
|
174
|
-
*
|
|
175
|
-
* @param {sap.ui.base.Event} oEvent The "borderReached" event of the GridContainer
|
|
176
|
-
*/
|
|
177
|
-
onGridContainerBorderReached: function (oEvent) {
|
|
178
|
-
const oWorkPage = this.byId("workPage");
|
|
179
|
-
this.oWorkPageBuilderAccessibility._handleBorderReached(oEvent, oWorkPage);
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Handler for the "addColumn" event of the WorkPageColumn.
|
|
184
|
-
* Creates an empty column on the left or the right of the event source and calculates
|
|
185
|
-
* the new width of the neighboring columns.
|
|
186
|
-
*
|
|
187
|
-
* @param {sap.ui.base.Event} oEvent The "addColumn" event.
|
|
188
|
-
*/
|
|
189
|
-
onAddColumn: function (oEvent) {
|
|
190
|
-
const oModel = this.getView().getModel();
|
|
191
|
-
const oColumnControl = oEvent.getSource();
|
|
192
|
-
const oRow = oColumnControl.getParent();
|
|
193
|
-
const iColumnIndex = oRow.indexOfAggregation("columns", oColumnControl);
|
|
194
|
-
const sRowBindingContextPath = oRow.getBindingContext().getPath();
|
|
195
|
-
const sColumnPath = `${sRowBindingContextPath}/columns/`;
|
|
196
|
-
const sColumnColumnWidthPath = `${oColumnControl.getBindingContext().getPath()}/descriptor/value/columnWidth`;
|
|
197
|
-
const aColumnsData = oModel.getProperty(sColumnPath);
|
|
198
|
-
const iColumnCount = aColumnsData.length;
|
|
199
|
-
const bAddToLeft = oEvent.getParameter("left");
|
|
200
|
-
if (iColumnCount >= MAX_COLUMNS_PER_ROW) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
const iColumnWidth = oColumnControl.getProperty("columnWidth");
|
|
204
|
-
const iColSize = Math.floor(iColumnWidth / 2) >= MIN_GRID_COLUMN_WIDTH ? Math.floor(iColumnWidth / 2) : MIN_GRID_COLUMN_WIDTH;
|
|
205
|
-
const iModulo = iColSize % 2;
|
|
206
|
-
oModel.setProperty(sColumnColumnWidthPath, iColSize + iModulo);
|
|
207
|
-
|
|
208
|
-
const iIndex = oRow.indexOfAggregation("columns", oColumnControl) + (bAddToLeft === true ? 0 : 1);
|
|
209
|
-
const oNewColumn = this._createEmptyColumn(iColSize - iModulo);
|
|
210
|
-
|
|
211
|
-
// Insert the new column by creating a new array to avoid mutation of the original array.
|
|
212
|
-
const aNewColumnsData = [aColumnsData.slice(0, iIndex), oNewColumn, aColumnsData.slice(iIndex)].flat();
|
|
213
|
-
|
|
214
|
-
const iTotalColumns = aNewColumnsData.reduce((iAccumulator, oSingleColumn) => {
|
|
215
|
-
return iAccumulator + this._getColumnWidth(oSingleColumn);
|
|
216
|
-
}, 0);
|
|
217
|
-
|
|
218
|
-
if (iTotalColumns > MAX_GRID_COLUMN_WIDTH) {
|
|
219
|
-
this._calculateColWidths(aNewColumnsData, iColumnIndex, iTotalColumns);
|
|
220
|
-
}
|
|
221
|
-
oModel.setProperty(sColumnPath, aNewColumnsData);
|
|
222
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Sets the focus on the first item in the first GridContainer on the WorkPage.
|
|
227
|
-
*
|
|
228
|
-
* @param {sap.ui.base.Event} oEvent The afterRendering event.
|
|
229
|
-
* @since 1.116.0
|
|
230
|
-
* @private
|
|
231
|
-
*/
|
|
232
|
-
focusFirstItem: function (oEvent) {
|
|
233
|
-
const oWorkPage = oEvent.getSource();
|
|
234
|
-
this.oWorkPageBuilderAccessibility.focusFirstItem(oWorkPage);
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Set the editMode to true or false
|
|
239
|
-
* @param {boolean} bEditMode true or false
|
|
240
|
-
*
|
|
241
|
-
* @private
|
|
242
|
-
* @since 1.109.0
|
|
243
|
-
*/
|
|
244
|
-
setEditMode: function (bEditMode) {
|
|
245
|
-
this.oModel.setProperty("/editMode", !!bEditMode);
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Set the previewMode to true or false
|
|
250
|
-
* @param {boolean} bPreviewMode true or false
|
|
251
|
-
*
|
|
252
|
-
* @private
|
|
253
|
-
* @since 1.116.0
|
|
254
|
-
*/
|
|
255
|
-
setPreviewMode: function (bPreviewMode) {
|
|
256
|
-
this.oModel.setProperty("/previewMode", !!bPreviewMode);
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Get the previewMode property from the model
|
|
261
|
-
* @returns {boolean} the previewMode property value
|
|
262
|
-
* @private
|
|
263
|
-
* @since 1.116.0
|
|
264
|
-
*/
|
|
265
|
-
getPreviewMode: function () {
|
|
266
|
-
return this.oModel.getProperty("/previewMode");
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Get the editMode property from the model
|
|
271
|
-
* @returns {boolean} the editMode property value
|
|
272
|
-
* @private
|
|
273
|
-
* @since 1.109.0
|
|
274
|
-
*/
|
|
275
|
-
getEditMode: function () {
|
|
276
|
-
return this.oModel.getProperty("/editMode");
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Set the showFooter property to true or false
|
|
281
|
-
* @param {boolean} bVisible true or false
|
|
282
|
-
*
|
|
283
|
-
* @private
|
|
284
|
-
* @since 1.110.0
|
|
285
|
-
*/
|
|
286
|
-
setShowFooter: function (bVisible) {
|
|
287
|
-
this.oModel.setProperty("/showFooter", !!bVisible);
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Set the showPageTitle property to true or false
|
|
292
|
-
* @param {boolean} bVisible true or false
|
|
293
|
-
*
|
|
294
|
-
* @private
|
|
295
|
-
* @since 1.116.0
|
|
296
|
-
*/
|
|
297
|
-
setShowPageTitle: function (bVisible) {
|
|
298
|
-
this.oModel.setProperty("/showPageTitle", !!bVisible);
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Set the model data with the WorkPage data
|
|
303
|
-
* @param {{workPage: object, usedVisualizations: object[]}} oPageData WorkPage data object
|
|
304
|
-
*
|
|
305
|
-
* @private
|
|
306
|
-
* @since 1.109.0
|
|
307
|
-
*/
|
|
308
|
-
setPageData: function (oPageData) {
|
|
309
|
-
let oMappedVisualizations = {};
|
|
310
|
-
const aUsedVisualizations = ObjectPath.get("workPage.usedVisualizations.nodes", oPageData);
|
|
311
|
-
const oWorkPageContents = ObjectPath.get("workPage.contents", oPageData);
|
|
312
|
-
|
|
313
|
-
if (aUsedVisualizations && aUsedVisualizations.length > 0) {
|
|
314
|
-
// create a map for the usedVisualizations using the id as a key.
|
|
315
|
-
oMappedVisualizations = aUsedVisualizations.reduce((oAcc, oViz) => {
|
|
316
|
-
oAcc[oViz.id] = oViz;
|
|
317
|
-
return oAcc;
|
|
318
|
-
}, {});
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
this.oModel.setProperty("/data/usedVisualizations", oMappedVisualizations);
|
|
322
|
-
this.oModel.setProperty("/data/workPage", oWorkPageContents);
|
|
323
|
-
this.oModel.setProperty("/loaded", true);
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Get the WorkPage data from the model.
|
|
328
|
-
* It must also include the usedVisualizations array, because of the reuse scenario.
|
|
329
|
-
* It is necessary that the same data structure is returned that is put into setPageData.
|
|
330
|
-
*
|
|
331
|
-
* @returns {{workPage: {contents: object, usedVisualizations: {nodes: object[]} }}} The WorkPage data to save.
|
|
332
|
-
* @private
|
|
333
|
-
* @since 1.109.0
|
|
334
|
-
*/
|
|
335
|
-
getPageData: function () {
|
|
336
|
-
const oMappedVisualizations = this.oModel.getProperty("/data/usedVisualizations") || {};
|
|
337
|
-
return {
|
|
338
|
-
workPage: {
|
|
339
|
-
contents: this.oModel.getProperty("/data/workPage"),
|
|
340
|
-
usedVisualizations: {
|
|
341
|
-
nodes: Object.values(oMappedVisualizations)
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Set the paginated visualization data for the ContentFinder.
|
|
349
|
-
*
|
|
350
|
-
* @param {{visualizations: {nodes: object[]}}} oVizNodes an Array of Visualizations' objects
|
|
351
|
-
* @returns {Promise} A promise resolving when the data has been set to the contentFinder
|
|
352
|
-
*
|
|
353
|
-
* @private
|
|
354
|
-
* @since 1.115.0
|
|
355
|
-
*/
|
|
356
|
-
setVisualizationData: function (oVizNodes) {
|
|
357
|
-
return this.oContentFinderPromise.then((oContentFinder) => {
|
|
358
|
-
oContentFinder.setVisualizationData(oVizNodes);
|
|
359
|
-
});
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* @typedef {Object} CatalogItem
|
|
364
|
-
* @property {string} id The ID of the catalog.
|
|
365
|
-
* @property {string} title The title of the catalog.
|
|
366
|
-
*/
|
|
367
|
-
/**
|
|
368
|
-
* @typedef {Object} CategoryTreeItem
|
|
369
|
-
* @property {string|undefined} id The ID of the category node.
|
|
370
|
-
* @property {string} title The title of the category node.$
|
|
371
|
-
* @property {boolean} inactive Indicates if the category node is inactive.
|
|
372
|
-
* @property {number} [$count] The count of catalogs inside the node.
|
|
373
|
-
* @property {CatalogItem[]} [nodes] The child nodes of the category node.
|
|
374
|
-
*/
|
|
375
|
-
/**
|
|
376
|
-
* Sets the category tree data for the Content Finder model.
|
|
377
|
-
* The category tree does not support pagination. All tree data must be set at once.
|
|
378
|
-
*
|
|
379
|
-
* @param {CategoryTreeItem[]|undefined} aCategoryTree A tree of category objects, undefined to hide the category tree or empty array to show message in DT.
|
|
380
|
-
* @returns {Promise} A promise resolving when the data was set.
|
|
381
|
-
*
|
|
382
|
-
* @since 1.130.0
|
|
383
|
-
* @private
|
|
384
|
-
*/
|
|
385
|
-
setCategoryTree: function (aCategoryTree) {
|
|
386
|
-
return this.oContentFinderPromise.then((oContentFinder) => {
|
|
387
|
-
oContentFinder.setCategoryTree(aCategoryTree);
|
|
388
|
-
});
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Called if the amount of grid columns in the GridContainer of a WorkPageCell changes.
|
|
393
|
-
* Sets all the cards in the cell to the new amount of columns.
|
|
394
|
-
*
|
|
395
|
-
* @param {sap.ui.base.Event} oEvent The gridColumnsChange event.
|
|
396
|
-
*/
|
|
397
|
-
onGridColumnsChange: function (oEvent) {
|
|
398
|
-
const iColumnCount = oEvent.getParameter("columns");
|
|
399
|
-
const oCell = oEvent.getSource();
|
|
400
|
-
|
|
401
|
-
oCell.getWidgets().filter((oItem) => {
|
|
402
|
-
return oItem.isA("sap.ui.integration.widgets.Card");
|
|
403
|
-
}).forEach((oCard) => {
|
|
404
|
-
oCard.setLayoutData(new GridContainerItemLayoutData({
|
|
405
|
-
columns: iColumnCount,
|
|
406
|
-
minRows: 1
|
|
407
|
-
}));
|
|
408
|
-
});
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Handler for the "removeColumn" event of the WorkPageColumn.
|
|
413
|
-
* Removes the column that issues the event and calculates the width of the remaining columns.
|
|
414
|
-
*
|
|
415
|
-
* @param {sap.ui.base.Event} oEvent The "removeColumn" event.
|
|
416
|
-
*/
|
|
417
|
-
onDeleteColumn: function (oEvent) {
|
|
418
|
-
const oModel = this.getView().getModel();
|
|
419
|
-
const oColumn = oEvent.getSource();
|
|
420
|
-
const iColumnWidth = oColumn.getColumnWidth();
|
|
421
|
-
const oRow = oColumn.getParent();
|
|
422
|
-
const iColumnIndex = oRow.indexOfAggregation("columns", oColumn);
|
|
423
|
-
const sRowBindingContextPath = oRow.getBindingContext().getPath();
|
|
424
|
-
const sColumnPath = `${sRowBindingContextPath}/columns/`;
|
|
425
|
-
const aColumns = oModel.getProperty(sColumnPath);
|
|
426
|
-
|
|
427
|
-
// filter out the column at the iColumnIndex instead of splicing to avoid mutation of the original array.
|
|
428
|
-
const aNewColumns = aColumns.filter((oCol, iIndex) => {
|
|
429
|
-
return iIndex !== iColumnIndex;
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
// split the columnWidth among remaining cols
|
|
433
|
-
let iLoopCount = (iColumnWidth / 2);
|
|
434
|
-
let iIndex = iColumnIndex - 1 < 0 ? iColumnIndex : iColumnIndex - 1;
|
|
435
|
-
while (iLoopCount > 0) {
|
|
436
|
-
const oCurrentColumn = aNewColumns[iIndex];
|
|
437
|
-
this._setColumnWidth(oCurrentColumn, (this._getColumnWidth(oCurrentColumn)) + STEP_SIZE);
|
|
438
|
-
iIndex = ++iIndex >= aNewColumns.length ? 0 : iIndex++;
|
|
439
|
-
iLoopCount--;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
oModel.setProperty(sColumnPath, aNewColumns);
|
|
443
|
-
// Invalidate row to render correct css class for amount of columns.
|
|
444
|
-
oRow.invalidate();
|
|
445
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Handler for the "Add Row" button on an empty WorkPage.
|
|
450
|
-
* Creates an array with an empty row and sets it to the model.
|
|
451
|
-
*
|
|
452
|
-
*/
|
|
453
|
-
onAddFirstRow: function () {
|
|
454
|
-
const sRowsPath = "/data/workPage/rows/";
|
|
455
|
-
this.getView().getModel().setProperty(sRowsPath, [this._createEmptyRow()]);
|
|
456
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Handler for the "Add Row" button on a WorkPageRow.
|
|
461
|
-
* Creates a new empty row and adds it to the existing rows.
|
|
462
|
-
*
|
|
463
|
-
* @param {sap.ui.base.Event} oEvent The "addRow" event.
|
|
464
|
-
*/
|
|
465
|
-
onAddRow: function (oEvent) {
|
|
466
|
-
const oModel = this.getView().getModel();
|
|
467
|
-
const oRow = oEvent.getSource();
|
|
468
|
-
const oPage = this.byId("workPage");
|
|
469
|
-
const sRowsPath = "/data/workPage/rows/";
|
|
470
|
-
const aRows = oModel.getProperty(sRowsPath);
|
|
471
|
-
const oNewRow = this._createEmptyRow();
|
|
472
|
-
|
|
473
|
-
const iIndex = oPage.indexOfAggregation("rows", oRow) + (oEvent.getParameter("bottom") === true ? 1 : 0);
|
|
474
|
-
|
|
475
|
-
// Insert the new row into the array by creating a new array to avoid mutation.
|
|
476
|
-
const aNewRows = [aRows.slice(0, iIndex), oNewRow, aRows.slice(iIndex)].flat();
|
|
477
|
-
|
|
478
|
-
oModel.setProperty(sRowsPath, aNewRows);
|
|
479
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Handler for the "columnResized" event issued by the WorkPageColumn.
|
|
484
|
-
* Calculates the required resize steps left or right and updates the model accordingly.
|
|
485
|
-
*
|
|
486
|
-
* @param {sap.ui.base.Event} oEvent The "columnResized" event.
|
|
487
|
-
*/
|
|
488
|
-
onResize: function (oEvent) {
|
|
489
|
-
const iDiff = oEvent.getParameter("posXDiff");
|
|
490
|
-
const oColumn = oEvent.getSource();
|
|
491
|
-
const oRow = oColumn.getParent();
|
|
492
|
-
const iSingleColumnWidthPx = oRow.getSingleColumnWidth();
|
|
493
|
-
|
|
494
|
-
if (iSingleColumnWidthPx <= 0) { return; }
|
|
495
|
-
|
|
496
|
-
const bRtl = Localization.getRTL();
|
|
497
|
-
const fDeltaFromOrigin = iDiff / iSingleColumnWidthPx;
|
|
498
|
-
|
|
499
|
-
if (fDeltaFromOrigin > -1 && fDeltaFromOrigin < 1) { return; }
|
|
500
|
-
|
|
501
|
-
const iColumnsDelta = fDeltaFromOrigin < 0 ? Math.floor(iDiff / iSingleColumnWidthPx) : Math.ceil(iDiff / iSingleColumnWidthPx);
|
|
502
|
-
const sDragDirection = iColumnsDelta >= 0 ? "right" : "left";
|
|
503
|
-
let iFlexStep = sDragDirection === "right" ? STEP_SIZE : -STEP_SIZE;
|
|
504
|
-
const iRightColumnIndex = oRow.indexOfAggregation("columns", oColumn);
|
|
505
|
-
const iLeftColumnIndex = iRightColumnIndex - 1;
|
|
506
|
-
const aColumnFlexValues = oRow.getColumnFlexValues();
|
|
507
|
-
|
|
508
|
-
iFlexStep = bRtl ? iFlexStep : -iFlexStep;
|
|
509
|
-
|
|
510
|
-
if (!this._resizeAllowed(
|
|
511
|
-
aColumnFlexValues.length,
|
|
512
|
-
aColumnFlexValues[iLeftColumnIndex],
|
|
513
|
-
aColumnFlexValues[iRightColumnIndex],
|
|
514
|
-
iFlexStep
|
|
515
|
-
)) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
aColumnFlexValues[iLeftColumnIndex] -= iFlexStep;
|
|
520
|
-
aColumnFlexValues[iRightColumnIndex] += iFlexStep;
|
|
521
|
-
|
|
522
|
-
oRow.setGridLayoutString(aColumnFlexValues);
|
|
523
|
-
this._updateModelWithColumnWidths(oRow, iLeftColumnIndex, iRightColumnIndex, aColumnFlexValues[iLeftColumnIndex], aColumnFlexValues[iRightColumnIndex]);
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Checks if WorkPageColumn resize is allowed based on the given input parameters.
|
|
528
|
-
*
|
|
529
|
-
* @param {int} iColumnCount The count of WorkPageColumns in this row.
|
|
530
|
-
* @param {int} iLeftFlex The old flex value of the left column.
|
|
531
|
-
* @param {int} iRightFlex The old flex value of the right column.
|
|
532
|
-
* @param {int} iFlexStep The step to decrease / increase both columns.
|
|
533
|
-
* @returns {boolean} The result.
|
|
534
|
-
* @private
|
|
535
|
-
* @since 1.118.0
|
|
536
|
-
*/
|
|
537
|
-
_resizeAllowed: function (iColumnCount, iLeftFlex, iRightFlex, iFlexStep) {
|
|
538
|
-
const oViewSettingsModel = this.getView().getModel("viewSettings");
|
|
539
|
-
const iColumnMinFlex = oViewSettingsModel.getProperty("/currentBreakpoint/columnMinFlex");
|
|
540
|
-
|
|
541
|
-
// resize to left would result in too small column on the left
|
|
542
|
-
if (iLeftFlex - iFlexStep < iColumnMinFlex) { return false; }
|
|
543
|
-
|
|
544
|
-
// resize to right would result in too small column on the right
|
|
545
|
-
if (iRightFlex + iFlexStep < iColumnMinFlex) { return false; }
|
|
546
|
-
|
|
547
|
-
const iMaxColumnsPerRow = oViewSettingsModel.getProperty("/currentBreakpoint/maxColumnsPerRow");
|
|
548
|
-
|
|
549
|
-
// no resize allowed if there is a line break for WorkPageRows
|
|
550
|
-
if (iColumnCount > iMaxColumnsPerRow) { return false; }
|
|
551
|
-
|
|
552
|
-
return true;
|
|
553
|
-
},
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Handler for the "columnResizeCompleted" event issued by the WorkPageColumn.
|
|
557
|
-
* Fires the "workPageEdited" event to indicate that there was a data change.
|
|
558
|
-
*
|
|
559
|
-
*/
|
|
560
|
-
onResizeCompleted: function () {
|
|
561
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
562
|
-
},
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Handler for the "press" event in the WorkPageCell OverflowToolbar button.
|
|
566
|
-
* Opens a confirmation dialog for widgets, except cards.
|
|
567
|
-
*
|
|
568
|
-
* @param {sap.ui.base.Event} oEvent The button click event.
|
|
569
|
-
* @returns {Promise} A promise resolving when the dialog was opened or the card was deleted.
|
|
570
|
-
*/
|
|
571
|
-
onDeleteCell: function (oEvent) {
|
|
572
|
-
const oCell = oEvent.getSource().getParent().getParent();
|
|
573
|
-
|
|
574
|
-
// No dialog is shown if the ell contains only a card.
|
|
575
|
-
const aWidgets = oCell.getWidgets();
|
|
576
|
-
if (aWidgets?.[0] && aWidgets.length === 1 && aWidgets[0].isA("sap.ui.integration.widgets.Card")) {
|
|
577
|
-
return this.deleteCell(oEvent, {
|
|
578
|
-
cell: oCell,
|
|
579
|
-
dialog: false
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// Show dialog for all other widgets.
|
|
584
|
-
if (!this.oDeleteCell) {
|
|
585
|
-
const oRootView = this.getOwnerComponent().getRootControl();
|
|
586
|
-
this.oDeleteCell = Fragment.load({
|
|
587
|
-
id: oRootView.createId("cellDeleteDialog"),
|
|
588
|
-
name: "sap.ushell.components.workPageBuilder.view.WorkPageCellDeleteDialog",
|
|
589
|
-
controller: this
|
|
590
|
-
}).then((oDialog) => {
|
|
591
|
-
oDialog.setModel(this.getView().getModel("i18n"), "i18n");
|
|
592
|
-
return oDialog;
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
return this.oDeleteCell.then((oDialog) => {
|
|
597
|
-
oDialog.getBeginButton().detachEvent("press", this._fnDeleteCellHandler);
|
|
598
|
-
oDialog.getBeginButton().attachEvent("press", {
|
|
599
|
-
cell: oCell,
|
|
600
|
-
dialog: true
|
|
601
|
-
}, this._fnDeleteCellHandler);
|
|
602
|
-
oDialog.open();
|
|
603
|
-
});
|
|
604
|
-
},
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* Deletes the provided cell.
|
|
608
|
-
*
|
|
609
|
-
* @param {sap.ui.base.Event} oEvent The "press" event.
|
|
610
|
-
* @param {object} cellData Object containing the cell to delete.
|
|
611
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell} cellData.cell The cell to delete.
|
|
612
|
-
* @param {boolean} cellData.dialog True if a dialog is shown to confirm the deletion.
|
|
613
|
-
* @returns {Promise} A promise resolving when the cell has been deleted.
|
|
614
|
-
*/
|
|
615
|
-
deleteCell: function (oEvent, cellData) {
|
|
616
|
-
const oCell = cellData.cell;
|
|
617
|
-
const oModel = this.getView().getModel();
|
|
618
|
-
const oColumn = oCell.getParent();
|
|
619
|
-
const iCellIndex = oColumn.indexOfAggregation("cells", oCell);
|
|
620
|
-
const sCellsPath = `${oColumn.getBindingContext().getPath()}/cells`;
|
|
621
|
-
const aCells = oModel.getProperty(sCellsPath);
|
|
622
|
-
|
|
623
|
-
// Filter out the cell at iCellIndex instead of splicing to avoid mutation of the original array.
|
|
624
|
-
const aNewCells = aCells.filter((oOriginalCell, iIndex) => {
|
|
625
|
-
return iIndex !== iCellIndex;
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
oModel.setProperty(sCellsPath, aNewCells);
|
|
629
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
630
|
-
if (cellData.dialog) {
|
|
631
|
-
return this.oDeleteCell.then((oDialog) => {
|
|
632
|
-
oDialog.close();
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
return Promise.resolve();
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Handler for the "deleteVisualization" event issued by the VizInstance.
|
|
640
|
-
* Deletes the visualization from the model.
|
|
641
|
-
*
|
|
642
|
-
* @param {sap.ushell.ui.launchpad.VizInstanceCdm|sap.ushell.ui.launchpad.VizInstanceLink} oVizInstance the viz instance.
|
|
643
|
-
*/
|
|
644
|
-
_deleteVisualization: function (oVizInstance) {
|
|
645
|
-
const oCell = oVizInstance.getParent().getParent();
|
|
646
|
-
const oVizInstanceContext = oVizInstance.getBindingContext();
|
|
647
|
-
const sVizInstancePath = oVizInstanceContext.getPath();
|
|
648
|
-
const oModel = this.getView().getModel();
|
|
649
|
-
const sWidgetsPath = sVizInstancePath.substring(0, sVizInstancePath.lastIndexOf("/"));
|
|
650
|
-
const iWidgetIndex = oCell.indexOfAggregation("widgets", oVizInstance);
|
|
651
|
-
const aWidgets = oModel.getProperty(sWidgetsPath);
|
|
652
|
-
|
|
653
|
-
// Filter out the widget at iWidgetIndex instead of splicing to avoid mutation of the original array.
|
|
654
|
-
const aNewWidgets = aWidgets.filter((oWidget, iIndex) => {
|
|
655
|
-
return iIndex !== iWidgetIndex;
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
oModel.setProperty(sWidgetsPath, aNewWidgets);
|
|
659
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
660
|
-
},
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Handler for the "change" event of the edit title input.
|
|
664
|
-
* Set the dirty flag
|
|
665
|
-
*/
|
|
666
|
-
onEditTitle: function () {
|
|
667
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* Handler for the "addWidget" event of the ContentFinderDialog.
|
|
672
|
-
* Set the dirty flag
|
|
673
|
-
*/
|
|
674
|
-
onWidgetAdded: function () {
|
|
675
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Called when the ContentFinder component was created.
|
|
680
|
-
*
|
|
681
|
-
* Defines the ContentFinder on the controller and attaches the required event handling.
|
|
682
|
-
*
|
|
683
|
-
* @param {sap.ui.base.Event} oEvent The 'componentCreated' event.
|
|
684
|
-
* @returns {Promise} A Promise that resolves the ContentFinderComponent
|
|
685
|
-
*
|
|
686
|
-
* @since 1.132.0
|
|
687
|
-
* @private
|
|
688
|
-
*/
|
|
689
|
-
onContentFinderComponentCreated: async function (oEvent) {
|
|
690
|
-
const oContentFinder = oEvent.getParameter("component");
|
|
691
|
-
oContentFinder.attachContentFinderClosed(null, function () {
|
|
692
|
-
oContentFinder?.detachVisualizationsAdded(this._onAddVisualization, this);
|
|
693
|
-
oContentFinder?.detachVisualizationFilterApplied(this._onVisualizationFilterApplied, this);
|
|
694
|
-
oContentFinder?.setContextData({ restrictedVisualizations: [] });
|
|
695
|
-
}, this);
|
|
696
|
-
this.fnContentFinderPromiseResolve(oContentFinder);
|
|
697
|
-
},
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* Opens the ContentFinder.
|
|
701
|
-
*
|
|
702
|
-
* @param {sap.base.Event} oEvent The "addWidget" event.
|
|
703
|
-
* @returns {Promise} When resolved, opens the ContentFinder dialog.
|
|
704
|
-
*
|
|
705
|
-
* @since 1.132.0
|
|
706
|
-
* @public
|
|
707
|
-
*/
|
|
708
|
-
openContentFinder: function (oEvent) {
|
|
709
|
-
const oSource = oEvent.getSource(); // WorkPageColumn
|
|
710
|
-
const oResourceBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
711
|
-
|
|
712
|
-
return this.oContentFinderPromise.then((oContentFinderComponent) => {
|
|
713
|
-
oContentFinderComponent.attachVisualizationsAdded(oSource, this._onAddVisualization, this);
|
|
714
|
-
oContentFinderComponent.attachVisualizationFilterApplied(oSource, this._onVisualizationFilterApplied, this);
|
|
715
|
-
oContentFinderComponent.show({
|
|
716
|
-
visualizationFilters: {
|
|
717
|
-
displayed: ["tiles", "cards"],
|
|
718
|
-
selected: "tiles",
|
|
719
|
-
available: [
|
|
720
|
-
{
|
|
721
|
-
key: "tiles",
|
|
722
|
-
title: oResourceBundle.getText("ContentFinder.AppSearch.VisualizationsFilter.Tiles"),
|
|
723
|
-
types: ["sap.ushell.StaticAppLauncher", "sap.ushell.DynamicAppLauncher"]
|
|
724
|
-
},
|
|
725
|
-
{
|
|
726
|
-
key: "cards",
|
|
727
|
-
title: oResourceBundle.getText("ContentFinder.AppSearch.VisualizationsFilter.Cards"),
|
|
728
|
-
types: ["sap.card"]
|
|
729
|
-
}
|
|
730
|
-
]
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
/**
|
|
737
|
-
* Open ContentFinder's AppSearch view
|
|
738
|
-
* @param {sap.ui.base.Event} oEvent The "addApplications" event
|
|
739
|
-
* @returns {Promise} Promise that resolves the ContentFinder Component
|
|
740
|
-
*
|
|
741
|
-
* @since 1.113.0
|
|
742
|
-
* @public
|
|
743
|
-
*/
|
|
744
|
-
openTilesAppSearch: function (oEvent) {
|
|
745
|
-
const oSource = oEvent.getSource().getParent().getParent(); // WorkPageCell
|
|
746
|
-
const oResourceBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
747
|
-
|
|
748
|
-
return this.oContentFinderPromise.then((oContentFinderComponent) => {
|
|
749
|
-
oContentFinderComponent.setContextData({ restrictedVisualizations: this._getRestrictedVisualizationIds(oSource) });
|
|
750
|
-
oContentFinderComponent.attachVisualizationsAdded(oSource, this._onAddVisualization, this);
|
|
751
|
-
oContentFinderComponent.attachVisualizationFilterApplied(oSource, this._onVisualizationFilterApplied, this);
|
|
752
|
-
oContentFinderComponent.show({
|
|
753
|
-
visualizationFilters: {
|
|
754
|
-
displayed: ["tiles"],
|
|
755
|
-
selected: "tiles",
|
|
756
|
-
available: [
|
|
757
|
-
{
|
|
758
|
-
key: "tiles",
|
|
759
|
-
title: oResourceBundle.getText("ContentFinder.AppSearch.VisualizationsFilter.Tiles"),
|
|
760
|
-
types: ["sap.ushell.StaticAppLauncher", "sap.ushell.DynamicAppLauncher"]
|
|
761
|
-
}
|
|
762
|
-
]
|
|
763
|
-
}
|
|
764
|
-
});
|
|
765
|
-
});
|
|
766
|
-
},
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* Returns an array of Widget's VizRefIds. The Widgets are contained in the WorkPageCell
|
|
770
|
-
*
|
|
771
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell} oCell The WorkPageCell control.
|
|
772
|
-
* @returns {string[]} The VizRefIds array
|
|
773
|
-
*
|
|
774
|
-
* @since 1.113.0
|
|
775
|
-
* @private
|
|
776
|
-
*/
|
|
777
|
-
_getRestrictedVisualizationIds: function (oCell) {
|
|
778
|
-
return oCell.getWidgets().map((oWidget) => {
|
|
779
|
-
if (oWidget.isA("sap.ushell.ui.launchpad.VizInstanceCdm")) {
|
|
780
|
-
return oWidget.getProperty("vizRefId");
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
},
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* Add Visualization to the WorkPageColum or WorkPageCell
|
|
787
|
-
* @param {sap.ui.base.Event} oEvent The "addApplications" event.
|
|
788
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell|sap.ushell.components.workPageBuilder.controls.WorkPageColumn} oSource The WorkPageColumn or WorkPageCell control
|
|
789
|
-
*
|
|
790
|
-
* @since 1.113.0
|
|
791
|
-
* @private
|
|
792
|
-
*/
|
|
793
|
-
_onAddVisualization: function (oEvent, oSource) {
|
|
794
|
-
const oModel = this.getView().getModel();
|
|
795
|
-
const aSelectedVisualizations = oEvent.getParameter("visualizations");
|
|
796
|
-
|
|
797
|
-
if (aSelectedVisualizations.length > 0) {
|
|
798
|
-
aSelectedVisualizations.forEach((oVisualization) => {
|
|
799
|
-
const sVizSelectedItemPath = `/data/usedVisualizations/${oVisualization.id}`;
|
|
800
|
-
if (!oModel.getProperty(sVizSelectedItemPath)) {
|
|
801
|
-
oModel.setProperty(sVizSelectedItemPath, oVisualization.vizData);
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
const aWidgetData = this._instantiateWidgetData(aSelectedVisualizations);
|
|
806
|
-
|
|
807
|
-
if (oSource.isA("sap.ushell.components.workPageBuilder.controls.WorkPageCell")) {
|
|
808
|
-
this._setCellData(oSource, aWidgetData);
|
|
809
|
-
}
|
|
810
|
-
if (oSource.isA("sap.ushell.components.workPageBuilder.controls.WorkPageColumn")) {
|
|
811
|
-
this._setColumnData(oSource, aWidgetData);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
},
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* For each selected visualization in the ContentFinder, instantiate the initial WidgetData
|
|
818
|
-
* @param {object[]} aSelectedVisualizations The ContentFinder's selected visualizations
|
|
819
|
-
* @returns {object[]} The WidgetData array
|
|
820
|
-
*
|
|
821
|
-
* @since 1.113.0
|
|
822
|
-
* @private
|
|
823
|
-
*/
|
|
824
|
-
_instantiateWidgetData: function (aSelectedVisualizations) {
|
|
825
|
-
let aIds = [];
|
|
826
|
-
let sId;
|
|
827
|
-
|
|
828
|
-
return aSelectedVisualizations.map((oTile) => {
|
|
829
|
-
sId = this._generateUniqueId(aIds);
|
|
830
|
-
aIds = aIds.concat([sId]);
|
|
831
|
-
return {
|
|
832
|
-
id: sId,
|
|
833
|
-
visualization: {
|
|
834
|
-
id: oTile.vizData.id
|
|
835
|
-
}
|
|
836
|
-
};
|
|
837
|
-
});
|
|
838
|
-
},
|
|
839
|
-
|
|
840
|
-
/**
|
|
841
|
-
* Add Widgets into the WorkPageCell's Widgets aggregation
|
|
842
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell} oCell The WorkPageCell control.
|
|
843
|
-
* @param {object[]} aWidgetData The WidgetData array
|
|
844
|
-
*
|
|
845
|
-
* @since 1.113.0
|
|
846
|
-
* @private
|
|
847
|
-
*/
|
|
848
|
-
_setCellData: function (oCell, aWidgetData) {
|
|
849
|
-
const oModel = this.getView().getModel();
|
|
850
|
-
const sCellPath = oCell.getBindingContext().getPath();
|
|
851
|
-
const oCellData = Object.assign({}, oModel.getProperty(sCellPath));
|
|
852
|
-
|
|
853
|
-
oCellData.widgets = oCellData.widgets.concat(aWidgetData);
|
|
854
|
-
|
|
855
|
-
oModel.setProperty(sCellPath, oCellData);
|
|
856
|
-
this.onWidgetAdded();
|
|
857
|
-
},
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* Add Widgets into WorkPageColumn's Cell aggregation
|
|
861
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageColumn} oColumn The WorkPageCell control.
|
|
862
|
-
* @param {object[]} aWidgetData The WidgetData array
|
|
863
|
-
* @param {int|undefined} iPosition The position where the new Cell should be placed. Defaults to the end if undefined
|
|
864
|
-
*
|
|
865
|
-
* @since 1.113.0
|
|
866
|
-
* @private
|
|
867
|
-
*/
|
|
868
|
-
_setColumnData: function (oColumn, aWidgetData, iPosition) {
|
|
869
|
-
const oModel = this.getView().getModel();
|
|
870
|
-
const sColumnPath = oColumn.getBindingContext().getPath();
|
|
871
|
-
const oColumnData = Object.assign({}, oModel.getProperty(sColumnPath));
|
|
872
|
-
const oNewCellData = {
|
|
873
|
-
id: this._generateUniqueId(),
|
|
874
|
-
descriptor: {
|
|
875
|
-
value: {},
|
|
876
|
-
schemaVersion: "3.2.0"
|
|
877
|
-
},
|
|
878
|
-
widgets: aWidgetData.concat([])
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
if (!oColumnData.cells) {
|
|
882
|
-
oColumnData.cells = [];
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
if (iPosition === undefined || iPosition > oColumnData.cells.length) {
|
|
886
|
-
iPosition = oColumnData.cells.length;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
const aCellCopy = oColumnData.cells.concat([]);
|
|
890
|
-
aCellCopy.splice(iPosition, 0, oNewCellData);
|
|
891
|
-
oColumnData.cells = aCellCopy;
|
|
892
|
-
|
|
893
|
-
oModel.setProperty(sColumnPath, oColumnData);
|
|
894
|
-
this.onWidgetAdded();
|
|
895
|
-
},
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* Handler for the "press" event in the WorkPageRow OverflowToolbar button.
|
|
899
|
-
* Opens a confirmation dialog.
|
|
900
|
-
* @returns {Promise} A promise resolving when the dialog was opened.
|
|
901
|
-
* @param {sap.ui.base.Event} oEvent The "deleteRow" event.
|
|
902
|
-
*/
|
|
903
|
-
onDeleteRow: function (oEvent) {
|
|
904
|
-
const oRootView = this.getOwnerComponent().getRootControl();
|
|
905
|
-
const oWorkPageRowContext = oEvent.getSource().getBindingContext();
|
|
906
|
-
|
|
907
|
-
if (!this.oLoadDeleteDialog) {
|
|
908
|
-
this.oLoadDeleteDialog = Fragment.load({
|
|
909
|
-
id: oRootView.createId("rowDeleteDialog"),
|
|
910
|
-
name: "sap.ushell.components.workPageBuilder.view.WorkPageRowDeleteDialog",
|
|
911
|
-
controller: this
|
|
912
|
-
}).then((oDialog) => {
|
|
913
|
-
oDialog.setModel(this.getView().getModel("i18n"), "i18n");
|
|
914
|
-
return oDialog;
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
return this.oLoadDeleteDialog.then((oDialog) => {
|
|
919
|
-
oDialog.getBeginButton().detachEvent("press", this._fnDeleteRowHandler);
|
|
920
|
-
oDialog.getBeginButton().attachEvent("press", {
|
|
921
|
-
rowContext: oWorkPageRowContext
|
|
922
|
-
}, this._fnDeleteRowHandler);
|
|
923
|
-
oDialog.open();
|
|
924
|
-
});
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
/**
|
|
928
|
-
* Deletes the row with the context given in oRowData.
|
|
929
|
-
*
|
|
930
|
-
* @returns {Promise} A promise resolving when the row has been deleted.
|
|
931
|
-
*
|
|
932
|
-
* @param {sap.ui.base.Event} oEvent The "press" event.
|
|
933
|
-
* @param {object} oRowData Object containing the WorkPageRow context to delete.
|
|
934
|
-
*/
|
|
935
|
-
deleteRow: function (oEvent, oRowData) {
|
|
936
|
-
const oModel = this.getView().getModel();
|
|
937
|
-
const oWorkPageRowContext = oRowData.rowContext;
|
|
938
|
-
const aRows = oModel.getProperty("/data/workPage/rows");
|
|
939
|
-
const oRowContextData = oWorkPageRowContext.getObject();
|
|
940
|
-
|
|
941
|
-
// Filter out the row with the given id to avoid mutation of the original array.
|
|
942
|
-
const aFilteredRows = aRows.filter((oRow) => {
|
|
943
|
-
return oRow.id !== oRowContextData.id;
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
oModel.setProperty("/data/workPage/rows", aFilteredRows);
|
|
947
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
948
|
-
return this.oLoadDeleteDialog.then((oDialog) => {
|
|
949
|
-
oDialog.close();
|
|
950
|
-
});
|
|
951
|
-
},
|
|
952
|
-
|
|
953
|
-
/**
|
|
954
|
-
* Called when the "Cancel" button is pressed on the RowDelete dialog.
|
|
955
|
-
* @returns {Promise} A promise resolving when the dialog has been closed
|
|
956
|
-
*/
|
|
957
|
-
onRowDeleteCancel: function () {
|
|
958
|
-
return this.oLoadDeleteDialog.then((oDialog) => {
|
|
959
|
-
oDialog.close();
|
|
960
|
-
});
|
|
961
|
-
},
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* Called when the "Cancel" button is pressed on the cell delete dialog.
|
|
965
|
-
*
|
|
966
|
-
* @returns {Promise} A promise resolving when the dialog has been closed
|
|
967
|
-
*/
|
|
968
|
-
onCellDeleteCancel: function () {
|
|
969
|
-
return this.oDeleteCell.then((oDialog) => {
|
|
970
|
-
oDialog.close();
|
|
971
|
-
});
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* Returns a GenericTile control instance to render in error case.
|
|
976
|
-
*
|
|
977
|
-
* @returns {sap.m.GenericTile} A GenericTile with state: failed
|
|
978
|
-
* @private
|
|
979
|
-
*/
|
|
980
|
-
_createErrorTile: function () {
|
|
981
|
-
return new VizInstanceCdm({
|
|
982
|
-
state: LoadState.Failed
|
|
983
|
-
})
|
|
984
|
-
.attachPress(this.onVisualizationPress, this)
|
|
985
|
-
.bindEditable("/editMode")
|
|
986
|
-
.bindSizeBehavior("viewSettings>/currentBreakpoint/sizeBehavior")
|
|
987
|
-
.setLayoutData(new GridContainerItemLayoutData({
|
|
988
|
-
columns: 2,
|
|
989
|
-
rows: 2
|
|
990
|
-
}));
|
|
991
|
-
},
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Creates a widget based on the given widgetContext.
|
|
995
|
-
*
|
|
996
|
-
* @param {string} sWidgetId The id for the widget.
|
|
997
|
-
* @param {sap.ui.model.Context} oWidgetContext The widget context.
|
|
998
|
-
* @returns {sap.ushell.ui.launchpad.VizInstance|sap.m.GenericTile|sap.ui.integration.widgets.Card} The resulting control.
|
|
999
|
-
*/
|
|
1000
|
-
widgetFactory: function (sWidgetId, oWidgetContext) {
|
|
1001
|
-
const sVizId = oWidgetContext.getProperty("visualization/id");
|
|
1002
|
-
|
|
1003
|
-
if (!sVizId) {
|
|
1004
|
-
Log.error("No vizId found in widget context.");
|
|
1005
|
-
return this._createErrorTile();
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
const oVizData = this.getView().getModel().getProperty(`/data/usedVisualizations/${sVizId}`);
|
|
1009
|
-
|
|
1010
|
-
if (!oVizData || !oVizData.type) {
|
|
1011
|
-
Log.error(`No viz or vizType found for vizId ${sVizId}`);
|
|
1012
|
-
return this._createErrorTile();
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
const aWidgetConfigurations = oWidgetContext.getProperty("configurations") || [];
|
|
1016
|
-
const aVizConfigurations = oVizData.configurations || [];
|
|
1017
|
-
const aMergedAndSortedConfigurations = this._getMergedAndSortedConfigurations(aWidgetConfigurations, aVizConfigurations);
|
|
1018
|
-
const sWidgetContextPath = oWidgetContext.getPath();
|
|
1019
|
-
|
|
1020
|
-
switch (oVizData.type) {
|
|
1021
|
-
case "sap.card":
|
|
1022
|
-
return this._createCard(oVizData, aWidgetConfigurations, aMergedAndSortedConfigurations, sWidgetContextPath);
|
|
1023
|
-
case "sap.ushell.StaticAppLauncher":
|
|
1024
|
-
case "sap.ushell.DynamicAppLauncher":
|
|
1025
|
-
case "ssuite.smartbusiness.tiles.dual":
|
|
1026
|
-
case "ssuite.smartbusiness.tiles.numeric":
|
|
1027
|
-
case "ssuite.smartbusiness.tiles.contribution":
|
|
1028
|
-
case "ssuite.smartbusiness.tiles.deviation":
|
|
1029
|
-
case "ssuite.smartbusiness.tiles.trend":
|
|
1030
|
-
case "ssuite.smartbusiness.tiles.comparison":
|
|
1031
|
-
return this._createVizInstance(oVizData);
|
|
1032
|
-
default:
|
|
1033
|
-
Log.error(`Unknown type for widget ${oVizData.type}`);
|
|
1034
|
-
return this._createErrorTile();
|
|
1035
|
-
}
|
|
1036
|
-
},
|
|
1037
|
-
|
|
1038
|
-
/**
|
|
1039
|
-
* @typedef {object} Configuration A configuration entry.
|
|
1040
|
-
* @property {string} id the id of the configuration entry.
|
|
1041
|
-
* @property {string} level the level of the configuration entry.
|
|
1042
|
-
* @property {object} settings map of values that the configuration entry overrides.
|
|
1043
|
-
*/
|
|
1044
|
-
|
|
1045
|
-
/**
|
|
1046
|
-
* Group the widget configurations and the visualization configurations by level and then merge settings for each level.
|
|
1047
|
-
* The widget configurations override the viz configurations.
|
|
1048
|
-
*
|
|
1049
|
-
* @since 1.114.0
|
|
1050
|
-
* @param {Configuration[]} aWidgetConfigurations The widget configuration items.
|
|
1051
|
-
* @param {Configuration[]} aVizConfigurations The viz configuration items.
|
|
1052
|
-
* @returns {object[]} The merged array of configurations, sorted by level.
|
|
1053
|
-
* @private
|
|
1054
|
-
*/
|
|
1055
|
-
_getMergedAndSortedConfigurations: function (aWidgetConfigurations, aVizConfigurations) {
|
|
1056
|
-
// No configurations -> return
|
|
1057
|
-
if (aWidgetConfigurations.length === 0 && aVizConfigurations.length === 0) {
|
|
1058
|
-
return [];
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
// First, widget configurations and viz configurations are merged for each level in CONFIGURATION_LEVELS
|
|
1062
|
-
// Second, the merged configurations are sorted
|
|
1063
|
-
const oConfigurations = CONFIGURATION_LEVELS.reduce((oMergedConfigurations, sLevel) => {
|
|
1064
|
-
const oWidgetConfigByLevel = aWidgetConfigurations.find((oWidgetConfig) => {
|
|
1065
|
-
return oWidgetConfig.level === sLevel;
|
|
1066
|
-
});
|
|
1067
|
-
const oVizConfigByLevel = aVizConfigurations.find((oVizConfig) => {
|
|
1068
|
-
return oVizConfig.level === sLevel;
|
|
1069
|
-
});
|
|
1070
|
-
|
|
1071
|
-
const oMergedConfigurationsByLevel = deepExtend({}, oVizConfigByLevel, oWidgetConfigByLevel);
|
|
1072
|
-
|
|
1073
|
-
if (Object.keys(oMergedConfigurationsByLevel).length > 0) {
|
|
1074
|
-
oMergedConfigurations[sLevel] = oMergedConfigurationsByLevel;
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
return oMergedConfigurations;
|
|
1078
|
-
}, {});
|
|
1079
|
-
|
|
1080
|
-
return this._sortConfigurations(Object.values(oConfigurations));
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
/**
|
|
1084
|
-
* Sort the widget's configuration by level: PR: Provider, CO: (Content) Administrator, PG: Page Administrator, US: End User
|
|
1085
|
-
*
|
|
1086
|
-
* @since 1.114.0
|
|
1087
|
-
* @param {Configuration[]} aConfigurations The configurations.
|
|
1088
|
-
* @returns {Configuration[]} The configurations sorted by level.
|
|
1089
|
-
* @private
|
|
1090
|
-
*/
|
|
1091
|
-
|
|
1092
|
-
_sortConfigurations: function (aConfigurations) {
|
|
1093
|
-
const oSortedConfigurations = aConfigurations && aConfigurations.sort((oWidgetConfigA, oWidgetConfigB) => {
|
|
1094
|
-
return CONFIGURATION_LEVELS.indexOf(oWidgetConfigA.level) - CONFIGURATION_LEVELS.indexOf(oWidgetConfigB.level);
|
|
1095
|
-
});
|
|
1096
|
-
|
|
1097
|
-
// PR —> CO —> PG —> US
|
|
1098
|
-
return oSortedConfigurations.map((oWidgetConfiguration) => {
|
|
1099
|
-
return oWidgetConfiguration.settings.value;
|
|
1100
|
-
});
|
|
1101
|
-
},
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Creates a VizInstance with given vizData using the VizInstantiation service.
|
|
1105
|
-
*
|
|
1106
|
-
* @since 1.110.0
|
|
1107
|
-
* @param {object} oVizData VisualizationData for the visualization.
|
|
1108
|
-
* @returns {sap.ushell.ui.launchpad.VizInstance|sap.m.GenericTile} The CDM VizInstance.
|
|
1109
|
-
* @private
|
|
1110
|
-
*/
|
|
1111
|
-
_createVizInstance: function (oVizData) {
|
|
1112
|
-
const oExtendedVizData = deepExtend({}, oVizData, {
|
|
1113
|
-
preview: this.oModel.getProperty("/previewMode")
|
|
1114
|
-
});
|
|
1115
|
-
|
|
1116
|
-
if (this.oModel.getProperty("/navigationDisabled") && oExtendedVizData._siteData) {
|
|
1117
|
-
delete oExtendedVizData._siteData.target;
|
|
1118
|
-
delete oExtendedVizData._siteData.targetURL;
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
const oVizInstance = this.oWorkPageVizInstantiation.createVizInstance(oExtendedVizData);
|
|
1122
|
-
|
|
1123
|
-
if (!oVizInstance) {
|
|
1124
|
-
Log.error("No VizInstance was created.");
|
|
1125
|
-
return this._createErrorTile();
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
return oVizInstance
|
|
1129
|
-
.setActive(true)
|
|
1130
|
-
.bindPreview("/previewMode")
|
|
1131
|
-
.attachPress(this.onVisualizationPress, this)
|
|
1132
|
-
.bindEditable("/editMode")
|
|
1133
|
-
.bindSizeBehavior("viewSettings>/currentBreakpoint/sizeBehavior")
|
|
1134
|
-
.bindClickable({
|
|
1135
|
-
path: "/navigationDisabled",
|
|
1136
|
-
formatter: function (bValue) {
|
|
1137
|
-
return !bValue;
|
|
1138
|
-
}
|
|
1139
|
-
})
|
|
1140
|
-
.setLayoutData(new GridContainerItemLayoutData(oVizInstance.getLayout()));
|
|
1141
|
-
},
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Returns the aria label for a WorkPageRow (section).
|
|
1145
|
-
*
|
|
1146
|
-
* If there is a title, the title will be returned in a translated string.
|
|
1147
|
-
* If there is no tile, the translated string for unnamed sections will be returned, including the position of the section.
|
|
1148
|
-
*
|
|
1149
|
-
* @param {string} sId The section dom id.
|
|
1150
|
-
* @param {object[]} aRows The rows array of the work page.
|
|
1151
|
-
* @param {string} sTitle The title of the section.
|
|
1152
|
-
* @returns {string} The string to be used as aria-label attribute.
|
|
1153
|
-
*/
|
|
1154
|
-
formatRowAriaLabel: function (sId, aRows = [], sTitle) {
|
|
1155
|
-
const i18nBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
1156
|
-
|
|
1157
|
-
if (sTitle) { return i18nBundle.getText("WorkPage.Row.Named.AriaLabel", [sTitle]); }
|
|
1158
|
-
|
|
1159
|
-
const iIndex = aRows.findIndex((oRow) => oRow.id === sId);
|
|
1160
|
-
if (iIndex < 0) { return ""; }
|
|
1161
|
-
|
|
1162
|
-
return i18nBundle.getText("WorkPage.Row.Unnamed.AriaLabel", [iIndex + 1]);
|
|
1163
|
-
},
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* Called if a vizInstance was pressed and proceeds to delete it from the data.
|
|
1167
|
-
*
|
|
1168
|
-
* @param {sap.ui.base.Event} oEvent The press event.
|
|
1169
|
-
*/
|
|
1170
|
-
onVisualizationPress: function (oEvent) {
|
|
1171
|
-
const sScope = oEvent.getParameter("scope");
|
|
1172
|
-
const sAction = oEvent.getParameter("action");
|
|
1173
|
-
|
|
1174
|
-
if (sScope === "Actions" && sAction === "Remove") {
|
|
1175
|
-
this._deleteVisualization(oEvent.getSource());
|
|
1176
|
-
}
|
|
1177
|
-
},
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Creates a new Card.
|
|
1181
|
-
*
|
|
1182
|
-
* @since 1.110.0
|
|
1183
|
-
* @param {object} oViz The visualization data. Defaults to {}.
|
|
1184
|
-
* @param {Configuration[]} aWidgetConfigurations The configurations on widget level. Defaults to [].
|
|
1185
|
-
* @param {object[]} aManifestChangesToApply The configurations to apply to the card. Defaults. to [].
|
|
1186
|
-
* @param {string} sWidgetContextPath The widget configurations path. Defaults to "".
|
|
1187
|
-
* @returns {sap.ui.integration.widgets.Card} The card instance.
|
|
1188
|
-
* @private
|
|
1189
|
-
*/
|
|
1190
|
-
_createCard: function (oViz = {}, aWidgetConfigurations = [], aManifestChangesToApply = [], sWidgetContextPath = "") {
|
|
1191
|
-
const oOptions = {};
|
|
1192
|
-
const bHasDescriptor = oViz.descriptor && oViz.descriptor.value && oViz.descriptor.value["sap.card"];
|
|
1193
|
-
const bHasDescriptorResources = oViz.descriptorResources && (oViz.descriptorResources.baseUrl || oViz.descriptorResources.descriptorPath);
|
|
1194
|
-
const bPgLevelConfigurationsExist = aWidgetConfigurations.some((oConfig) => { return oConfig.level === "PG"; });
|
|
1195
|
-
let bIsConfigurable;
|
|
1196
|
-
|
|
1197
|
-
if (!bHasDescriptor && !bHasDescriptorResources) {
|
|
1198
|
-
Log.error("No descriptor or descriptorResources for Card");
|
|
1199
|
-
return new Card().setLayoutData(new GridContainerItemLayoutData({
|
|
1200
|
-
columns: 2,
|
|
1201
|
-
rows: 2
|
|
1202
|
-
}));
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
if (bHasDescriptor) {
|
|
1206
|
-
oOptions.manifest = oViz.descriptor.value;
|
|
1207
|
-
bIsConfigurable = !!ObjectPath.get(["descriptor", "value", "sap.card", "configuration"], oViz);
|
|
1208
|
-
|
|
1209
|
-
if (bHasDescriptorResources) {
|
|
1210
|
-
oOptions.baseUrl = oViz.descriptorResources.baseUrl + oViz.descriptorResources.descriptorPath;
|
|
1211
|
-
}
|
|
1212
|
-
} else if (bHasDescriptorResources) {
|
|
1213
|
-
oOptions.manifest = oViz.descriptorResources.baseUrl + oViz.descriptorResources.descriptorPath;
|
|
1214
|
-
|
|
1215
|
-
if (!oOptions.manifest.endsWith(".json")) {
|
|
1216
|
-
oOptions.manifest += "/manifest.json";
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
oOptions.referenceId = oViz?.provider?.id;
|
|
1221
|
-
|
|
1222
|
-
// Ensure trailing slash for base url
|
|
1223
|
-
if (oOptions.baseUrl && oOptions.baseUrl.substr(-1) !== "/") {
|
|
1224
|
-
oOptions.baseUrl += "/";
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
const oCard = new Card(oOptions);
|
|
1228
|
-
|
|
1229
|
-
if (bIsConfigurable) {
|
|
1230
|
-
const oConfigureActionDefinition = this._createCardConfigurationActionDefinition(
|
|
1231
|
-
oCard,
|
|
1232
|
-
sWidgetContextPath,
|
|
1233
|
-
this._openCardConfigurationEditor.bind(this)
|
|
1234
|
-
);
|
|
1235
|
-
oCard.addActionDefinition(oConfigureActionDefinition);
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
if (bPgLevelConfigurationsExist) {
|
|
1239
|
-
const oResetActionDefinition = this._createCardResetActionDefinition(
|
|
1240
|
-
aWidgetConfigurations,
|
|
1241
|
-
sWidgetContextPath,
|
|
1242
|
-
this._openResetCardConfigurationDialog.bind(this)
|
|
1243
|
-
);
|
|
1244
|
-
oCard.addActionDefinition(oResetActionDefinition);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
return oCard
|
|
1248
|
-
.setModel(this.oModel, "workPageModel")
|
|
1249
|
-
.bindProperty("previewMode", {
|
|
1250
|
-
path: "workPageModel>/previewMode",
|
|
1251
|
-
formatter: function (bValue) {
|
|
1252
|
-
return bValue ? CardPreviewMode.MockData : CardPreviewMode.Off;
|
|
1253
|
-
}
|
|
1254
|
-
})
|
|
1255
|
-
.setManifestChanges(aManifestChangesToApply)
|
|
1256
|
-
.addStyleClass("workpageCellWidget")
|
|
1257
|
-
.setHost(this.oHost)
|
|
1258
|
-
.setLayoutData(new GridContainerItemLayoutData({
|
|
1259
|
-
columns: 16,
|
|
1260
|
-
minRows: 1
|
|
1261
|
-
}));
|
|
1262
|
-
},
|
|
1263
|
-
|
|
1264
|
-
/**
|
|
1265
|
-
* Create an ActionDefinition to enable the user to configure the card with the CardEditor.
|
|
1266
|
-
*
|
|
1267
|
-
* @since 1.114.0
|
|
1268
|
-
* @param {sap.ui.integration.widgets.Card} oCard The card to configure.
|
|
1269
|
-
* @param {string} sWidgetContextPath The card to configure.
|
|
1270
|
-
* @param {function} fnOnPress Handler function, called when the ActionDefinition button is pressed.
|
|
1271
|
-
*
|
|
1272
|
-
* @returns {sap.ui.integration.ActionDefinition} The ActionDefinition item.
|
|
1273
|
-
* @private
|
|
1274
|
-
*/
|
|
1275
|
-
_createCardConfigurationActionDefinition: function (oCard, sWidgetContextPath, fnOnPress) {
|
|
1276
|
-
const sActionDefinitionText = this.getView().getModel("i18n").getResourceBundle().getText("WorkPage.Card.ActionDefinition.Configure");
|
|
1277
|
-
const oActionDefinition = new ActionDefinition({
|
|
1278
|
-
type: "Custom",
|
|
1279
|
-
visible: "{/editMode}",
|
|
1280
|
-
buttonType: "Transparent",
|
|
1281
|
-
text: sActionDefinitionText
|
|
1282
|
-
});
|
|
1283
|
-
|
|
1284
|
-
oActionDefinition.setModel(this.oModel);
|
|
1285
|
-
oActionDefinition.attachPress({
|
|
1286
|
-
card: oCard,
|
|
1287
|
-
widgetContextPath: sWidgetContextPath
|
|
1288
|
-
}, fnOnPress);
|
|
1289
|
-
return oActionDefinition;
|
|
1290
|
-
},
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Create an ActionDefinition to enable the user to reset the card when some configuration was made.
|
|
1294
|
-
*
|
|
1295
|
-
* @since 1.117.0
|
|
1296
|
-
* @param {Configuration[]} aWidgetConfigurations The widget configuration items.
|
|
1297
|
-
* @param {string} sWidgetContextPath The path of the card data in the model.
|
|
1298
|
-
* @param {function} fnOnPress Handler function, called when the ActionDefinition button is pressed.
|
|
1299
|
-
*
|
|
1300
|
-
* @returns {sap.ui.integration.ActionDefinition} The ActionDefinition item.
|
|
1301
|
-
* @private
|
|
1302
|
-
*/
|
|
1303
|
-
_createCardResetActionDefinition: function (aWidgetConfigurations, sWidgetContextPath, fnOnPress) {
|
|
1304
|
-
const sActionDefinitionText = this.getView().getModel("i18n").getResourceBundle().getText("WorkPage.Card.ActionDefinition.Reset");
|
|
1305
|
-
const oActionDefinition = new ActionDefinition({
|
|
1306
|
-
type: "Custom",
|
|
1307
|
-
visible: "{/editMode}",
|
|
1308
|
-
buttonType: "Transparent",
|
|
1309
|
-
text: sActionDefinitionText
|
|
1310
|
-
});
|
|
1311
|
-
|
|
1312
|
-
oActionDefinition.setModel(this.oModel);
|
|
1313
|
-
oActionDefinition.attachPress({
|
|
1314
|
-
widgetContextPath: sWidgetContextPath,
|
|
1315
|
-
widgetConfigurations: aWidgetConfigurations
|
|
1316
|
-
}, fnOnPress);
|
|
1317
|
-
return oActionDefinition;
|
|
1318
|
-
},
|
|
1319
|
-
|
|
1320
|
-
/**
|
|
1321
|
-
* Adds the CardEditor into the Dialog and opens it.
|
|
1322
|
-
*
|
|
1323
|
-
* @since 1.113.0
|
|
1324
|
-
* @param {sap.ui.base.Event} oEvent The event object.
|
|
1325
|
-
* @param {{card: sap.ui.integration.widgets.Card, widgetContextPath: string}} oContextData The context data.
|
|
1326
|
-
* @returns {Promise} Promise that will resolve the Dialog
|
|
1327
|
-
* @private
|
|
1328
|
-
*/
|
|
1329
|
-
_openCardConfigurationEditor: function (oEvent, oContextData) {
|
|
1330
|
-
if (!this.oCardEditorDialogPromise) {
|
|
1331
|
-
this.oCardEditorDialogPromise = this._createCardEditorDialog(oContextData.card);
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
const oCardEditorPromise = this._createCardEditor(oContextData.card);
|
|
1335
|
-
|
|
1336
|
-
return Promise.all([oCardEditorPromise, this.oCardEditorDialogPromise]).then((aInstances) => {
|
|
1337
|
-
this.oCardEditorDialog = aInstances[1];
|
|
1338
|
-
this.oCardEditorDialog.removeAllContent();
|
|
1339
|
-
this.oCardEditorDialog.getBeginButton()
|
|
1340
|
-
.detachPress(this._fnSaveCardConfiguration)
|
|
1341
|
-
.attachPress(oContextData.widgetContextPath, this._fnSaveCardConfiguration);
|
|
1342
|
-
this._setCardDialogTitle(this.oCardEditorDialog, oContextData.card);
|
|
1343
|
-
this.oCardEditorDialog.addContent(aInstances[0]);
|
|
1344
|
-
this.oCardEditorDialog.open();
|
|
1345
|
-
});
|
|
1346
|
-
},
|
|
1347
|
-
|
|
1348
|
-
/**
|
|
1349
|
-
* Opens the card reset dialog and attaches the reset button handler.
|
|
1350
|
-
*
|
|
1351
|
-
* @since 1.117.0
|
|
1352
|
-
* @param {sap.ui.base.Event} oEvent The press event.
|
|
1353
|
-
* @param { {
|
|
1354
|
-
* card: sap.ui.integration.widgets.Card,
|
|
1355
|
-
* widgetContextPath: string,
|
|
1356
|
-
* widgetConfigurations: Configuration[],
|
|
1357
|
-
* vizConfigurations: Configuration[]
|
|
1358
|
-
* } } oContextData The required context data.
|
|
1359
|
-
* @returns {Promise} A promise resolving when the card dialog was opened.
|
|
1360
|
-
* @private
|
|
1361
|
-
*/
|
|
1362
|
-
_openResetCardConfigurationDialog: function (oEvent, oContextData) {
|
|
1363
|
-
if (!this.oCardResetDialogPromise) {
|
|
1364
|
-
this.oCardResetDialogPromise = this._createResetCardConfigurationDialog();
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
return this.oCardResetDialogPromise.then((oCardResetDialog) => {
|
|
1368
|
-
this.oCardResetDialog = oCardResetDialog;
|
|
1369
|
-
this.getView().addDependent(this.oCardResetDialog);
|
|
1370
|
-
this.oCardResetDialog.getBeginButton()
|
|
1371
|
-
.detachPress(this._fnResetCardConfiguration)
|
|
1372
|
-
.attachPress(oContextData, this._fnResetCardConfiguration);
|
|
1373
|
-
this.oCardResetDialog.open();
|
|
1374
|
-
});
|
|
1375
|
-
},
|
|
1376
|
-
|
|
1377
|
-
/**
|
|
1378
|
-
*
|
|
1379
|
-
* @param {sap.ui.base.Event} oEvent The press event.
|
|
1380
|
-
* @param {{ widgetContextPath: string, widgetConfigurations: Configuration[] }} oContextData The context data object.
|
|
1381
|
-
* @since 1.117.0
|
|
1382
|
-
* @private
|
|
1383
|
-
*/
|
|
1384
|
-
_onResetCardConfigurations: function (oEvent, oContextData) {
|
|
1385
|
-
const oDialog = oEvent.getSource().getParent();
|
|
1386
|
-
const aWidgetConfigurations = oContextData.widgetConfigurations;
|
|
1387
|
-
const sWidgetConfigurationsPath = `${oContextData.widgetContextPath}/configurations`;
|
|
1388
|
-
const aRemainingConfigurations = aWidgetConfigurations.filter((oConfig) => {
|
|
1389
|
-
return oConfig.level !== "PG";
|
|
1390
|
-
});
|
|
1391
|
-
|
|
1392
|
-
this.oModel.setProperty(sWidgetConfigurationsPath, aRemainingConfigurations);
|
|
1393
|
-
|
|
1394
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
1395
|
-
|
|
1396
|
-
oDialog.close();
|
|
1397
|
-
},
|
|
1398
|
-
|
|
1399
|
-
/**
|
|
1400
|
-
* Resets the configuration of the card after confirming a failsafe dialog.
|
|
1401
|
-
* @returns {Promise<sap.m.Dialog>} A Promise resolving the the sap.m.Dialog control.
|
|
1402
|
-
*
|
|
1403
|
-
* @since 1.117.0
|
|
1404
|
-
* @private
|
|
1405
|
-
*/
|
|
1406
|
-
_createResetCardConfigurationDialog: function () {
|
|
1407
|
-
const oI18nBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
1408
|
-
const sDialogTitle = oI18nBundle.getText("WorkPage.CardEditor.DeleteConfigurationDialog.Title");
|
|
1409
|
-
const sDialogContent = oI18nBundle.getText("WorkPage.CardEditor.DeleteConfigurationDialog.Content");
|
|
1410
|
-
const sBeginButtonText = oI18nBundle.getText("WorkPage.CardEditor.DeleteConfigurationDialog.Accept");
|
|
1411
|
-
const sEndButtonText = oI18nBundle.getText("WorkPage.CardEditor.DeleteConfigurationDialog.Deny");
|
|
1412
|
-
|
|
1413
|
-
return new Promise((resolve, reject) => {
|
|
1414
|
-
sap.ui.require(["sap/m/Dialog", "sap/m/Button", "sap/m/Text"], (Dialog, Button, Text) => {
|
|
1415
|
-
const oDialog = new Dialog({
|
|
1416
|
-
id: this.createId("cardConfigurationResetDialog"),
|
|
1417
|
-
type: mLibrary.DialogType.Message,
|
|
1418
|
-
state: ValueState.Warning,
|
|
1419
|
-
title: sDialogTitle,
|
|
1420
|
-
content: new Text({
|
|
1421
|
-
text: sDialogContent
|
|
1422
|
-
}),
|
|
1423
|
-
beginButton: new Button({
|
|
1424
|
-
type: mLibrary.ButtonType.Emphasized,
|
|
1425
|
-
text: sBeginButtonText
|
|
1426
|
-
}),
|
|
1427
|
-
endButton: new Button({
|
|
1428
|
-
text: sEndButtonText,
|
|
1429
|
-
press: function () {
|
|
1430
|
-
oDialog.close();
|
|
1431
|
-
}
|
|
1432
|
-
})
|
|
1433
|
-
});
|
|
1434
|
-
resolve(oDialog);
|
|
1435
|
-
}, reject);
|
|
1436
|
-
});
|
|
1437
|
-
},
|
|
1438
|
-
|
|
1439
|
-
/**
|
|
1440
|
-
*
|
|
1441
|
-
* @param {sap.m.Dialog} oDialog The dialog control.
|
|
1442
|
-
* @param {sap.ui.integration.widgets.Card} oCard The card control.
|
|
1443
|
-
* @private
|
|
1444
|
-
*/
|
|
1445
|
-
_setCardDialogTitle: function (oDialog, oCard) {
|
|
1446
|
-
const oI18nBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
1447
|
-
const sCardEditorTitle = this._getCardTitle(oCard)
|
|
1448
|
-
? oI18nBundle.getText("WorkPage.CardEditor.Title", [this._getCardTitle(oCard)])
|
|
1449
|
-
: oI18nBundle.getText("WorkPage.CardEditor.Title.NoCardTitle");
|
|
1450
|
-
oDialog.setTitle(sCardEditorTitle);
|
|
1451
|
-
},
|
|
1452
|
-
|
|
1453
|
-
/**
|
|
1454
|
-
* Creates and returns the CardEditor.
|
|
1455
|
-
* @param {sap.ui.integration.widgets.Card} oCard The card control.
|
|
1456
|
-
* @since 1.114.0
|
|
1457
|
-
*
|
|
1458
|
-
* @returns {sap.ui.integration.designtime.editor.CardEditor} The CardEditor instance.
|
|
1459
|
-
* @private
|
|
1460
|
-
*/
|
|
1461
|
-
_createCardEditor: function (oCard) {
|
|
1462
|
-
return new Promise((fResolve, fReject) => {
|
|
1463
|
-
sap.ui.require(["sap-ui-integration-card-editor"],
|
|
1464
|
-
() => {
|
|
1465
|
-
sap.ui.require(["sap/ui/integration/designtime/editor/CardEditor"], (CardEditor) => {
|
|
1466
|
-
fResolve(
|
|
1467
|
-
new CardEditor({
|
|
1468
|
-
previewPosition: "right",
|
|
1469
|
-
card: oCard,
|
|
1470
|
-
mode: "content"
|
|
1471
|
-
})
|
|
1472
|
-
);
|
|
1473
|
-
},
|
|
1474
|
-
fReject
|
|
1475
|
-
);
|
|
1476
|
-
},
|
|
1477
|
-
fReject
|
|
1478
|
-
);
|
|
1479
|
-
});
|
|
1480
|
-
},
|
|
1481
|
-
|
|
1482
|
-
/**
|
|
1483
|
-
* Creates a dialog to be used with the CardEditor.
|
|
1484
|
-
* @since 1.114.0
|
|
1485
|
-
* @param {sap.ui.integration.widgets.Card} oCard The card control instance.
|
|
1486
|
-
* @returns {Promise<sap.m.Dialog>} Promise that will resolve the Dialog
|
|
1487
|
-
* @private
|
|
1488
|
-
*/
|
|
1489
|
-
_createCardEditorDialog: function (oCard) {
|
|
1490
|
-
const oI18nBundle = this.getView().getModel("i18n").getResourceBundle();
|
|
1491
|
-
const sCardEditorSaveText = oI18nBundle.getText("WorkPage.CardEditor.Save");
|
|
1492
|
-
const sCardEditorCancelText = oI18nBundle.getText("WorkPage.CardEditor.Cancel");
|
|
1493
|
-
|
|
1494
|
-
return new Promise((resolve, reject) => {
|
|
1495
|
-
sap.ui.require(["sap/m/Dialog", "sap/m/Button"], (Dialog, Button) => {
|
|
1496
|
-
const oDialog = new Dialog({
|
|
1497
|
-
id: this.createId("cardEditorDialog"),
|
|
1498
|
-
contentWidth: "40rem",
|
|
1499
|
-
beginButton: new Button({
|
|
1500
|
-
text: sCardEditorSaveText,
|
|
1501
|
-
type: mLibrary.ButtonType.Emphasized
|
|
1502
|
-
}),
|
|
1503
|
-
endButton: new Button({
|
|
1504
|
-
text: sCardEditorCancelText,
|
|
1505
|
-
press: function () {
|
|
1506
|
-
oDialog.close();
|
|
1507
|
-
}
|
|
1508
|
-
})
|
|
1509
|
-
});
|
|
1510
|
-
resolve(oDialog);
|
|
1511
|
-
}, reject);
|
|
1512
|
-
});
|
|
1513
|
-
},
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* Returns the card title. First checks if the card has a header title, falls back to the manifest title.
|
|
1517
|
-
*
|
|
1518
|
-
* @param {sap.ui.integration.widgets.Card} oCard The card control instance.
|
|
1519
|
-
* @returns {string} The card title.
|
|
1520
|
-
* @since 1.114.0
|
|
1521
|
-
*/
|
|
1522
|
-
_getCardTitle: function (oCard) {
|
|
1523
|
-
if (oCard.getCardHeader() && oCard.getCardHeader().getTitle()) {
|
|
1524
|
-
return oCard.getCardHeader().getTitle();
|
|
1525
|
-
}
|
|
1526
|
-
},
|
|
1527
|
-
|
|
1528
|
-
/**
|
|
1529
|
-
* Saves the card's new configuration
|
|
1530
|
-
* @since 1.114.0
|
|
1531
|
-
* @param {sap.ui.base.Event} oEvent The event object.
|
|
1532
|
-
* @param {string} sWidgetContextPath The path to the card.
|
|
1533
|
-
* @private
|
|
1534
|
-
*/
|
|
1535
|
-
_onSaveCardEditor: function (oEvent, sWidgetContextPath) {
|
|
1536
|
-
const oDialog = oEvent.getSource().getParent();
|
|
1537
|
-
const oCardEditor = oDialog.getContent()[0];
|
|
1538
|
-
const oCard = oCardEditor.getCard();
|
|
1539
|
-
const sWidgetConfigurationsPath = `${sWidgetContextPath}/configurations`;
|
|
1540
|
-
const oCurrentSettings = oCardEditor.getCurrentSettings();
|
|
1541
|
-
let aWidgetConfigurations = this.oModel.getProperty(sWidgetConfigurationsPath) || [];
|
|
1542
|
-
|
|
1543
|
-
let oWidgetConfiguration = aWidgetConfigurations.find((oConfiguration) => {
|
|
1544
|
-
return oConfiguration.level === "PG";
|
|
1545
|
-
});
|
|
1546
|
-
|
|
1547
|
-
if (!oWidgetConfiguration) {
|
|
1548
|
-
oWidgetConfiguration = {};
|
|
1549
|
-
oWidgetConfiguration.id = this._generateUniqueId();
|
|
1550
|
-
oWidgetConfiguration.level = "PG";
|
|
1551
|
-
oWidgetConfiguration.settings = {
|
|
1552
|
-
value: oCurrentSettings,
|
|
1553
|
-
schemaVersion: "3.2.0"
|
|
1554
|
-
};
|
|
1555
|
-
aWidgetConfigurations.push(oWidgetConfiguration);
|
|
1556
|
-
} else {
|
|
1557
|
-
aWidgetConfigurations = aWidgetConfigurations.map((oConfiguration) => {
|
|
1558
|
-
if (oConfiguration.level === "PG") {
|
|
1559
|
-
oConfiguration.settings.value = deepExtend({}, oConfiguration.settings.value, oCurrentSettings);
|
|
1560
|
-
}
|
|
1561
|
-
return oConfiguration;
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
this.oModel.setProperty(sWidgetConfigurationsPath, aWidgetConfigurations);
|
|
1566
|
-
|
|
1567
|
-
oCard.setManifestChanges([oCurrentSettings]);
|
|
1568
|
-
|
|
1569
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
1570
|
-
|
|
1571
|
-
oDialog.close();
|
|
1572
|
-
},
|
|
1573
|
-
|
|
1574
|
-
/**
|
|
1575
|
-
* Close the edit mode and request to save changes by firing the "closeEditMode" event. The edit mode needs to be managed
|
|
1576
|
-
* the outer component to also handle the UserAction Menu button for edit mode.´
|
|
1577
|
-
*/
|
|
1578
|
-
saveEditChanges: function () {
|
|
1579
|
-
this.getOwnerComponent().fireEvent("closeEditMode", {
|
|
1580
|
-
saveChanges: true
|
|
1581
|
-
});
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1584
|
-
/**
|
|
1585
|
-
* Close the edit mode and request to cancel changes by firing the "closeEditMode" event. The edit mode needs to be managed
|
|
1586
|
-
* the outer component to also handle the UserAction Menu button for edit mode.´
|
|
1587
|
-
*/
|
|
1588
|
-
cancelEditChanges: function () {
|
|
1589
|
-
this.getOwnerComponent().fireEvent("closeEditMode", {
|
|
1590
|
-
saveChanges: false
|
|
1591
|
-
});
|
|
1592
|
-
},
|
|
1593
|
-
|
|
1594
|
-
/**
|
|
1595
|
-
* Called if a WorkPageCell is dropped before or after another WorkPageCell in a WorkPageColumn.
|
|
1596
|
-
*
|
|
1597
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1598
|
-
*
|
|
1599
|
-
* @since 1.116.0
|
|
1600
|
-
* @private
|
|
1601
|
-
*/
|
|
1602
|
-
onCellDrop: function (oEvent) {
|
|
1603
|
-
const oSourceCell = oEvent.getParameter("draggedControl");
|
|
1604
|
-
const oTargetCell = oEvent.getParameter("droppedControl");
|
|
1605
|
-
const sDropPosition = oEvent.getParameter("dropPosition");
|
|
1606
|
-
const oSourceColumn = oSourceCell.getParent();
|
|
1607
|
-
const oTargetColumn = oTargetCell.getParent();
|
|
1608
|
-
|
|
1609
|
-
const iSourceIndex = oSourceColumn.indexOfAggregation("cells", oSourceCell);
|
|
1610
|
-
let iTargetIndex = oTargetColumn.indexOfAggregation("cells", oTargetCell);
|
|
1611
|
-
|
|
1612
|
-
// Increase the drop position if the dragged element is moved below the target element.
|
|
1613
|
-
if (sDropPosition === "After") {
|
|
1614
|
-
iTargetIndex++;
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
this._moveCell(oSourceColumn, oTargetColumn, iSourceIndex, iTargetIndex);
|
|
1618
|
-
},
|
|
1619
|
-
|
|
1620
|
-
/**
|
|
1621
|
-
* Called if a WorkPageCell is dropped on an empty WorkPageColumn.
|
|
1622
|
-
*
|
|
1623
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1624
|
-
*
|
|
1625
|
-
* @since 1.116.0
|
|
1626
|
-
* @private
|
|
1627
|
-
*/
|
|
1628
|
-
onCellDropOnEmptyColumn: function (oEvent) {
|
|
1629
|
-
const oSourceCell = oEvent.getParameter("draggedControl");
|
|
1630
|
-
const oTargetColumn = oEvent.getParameter("droppedControl");
|
|
1631
|
-
const oSourceColumn = oSourceCell.getParent();
|
|
1632
|
-
|
|
1633
|
-
const iSourceIndex = oSourceColumn.indexOfAggregation("cells", oSourceCell);
|
|
1634
|
-
const iTargetIndex = 0;
|
|
1635
|
-
|
|
1636
|
-
this._moveCell(oSourceColumn, oTargetColumn, iSourceIndex, iTargetIndex);
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
* Called if a Visualization is dropped between Cells (e.g. a tile is dropped between two cards)
|
|
1641
|
-
*
|
|
1642
|
-
* @param {sap.ui.base.Event} oEvent The drop event
|
|
1643
|
-
*
|
|
1644
|
-
* @since 1.118.0
|
|
1645
|
-
* @private
|
|
1646
|
-
*/
|
|
1647
|
-
onVisualizationDropBetweenCells: function (oEvent) {
|
|
1648
|
-
const oSourceVisualization = oEvent.getParameter("draggedControl");
|
|
1649
|
-
const oTargetCell = oEvent.getParameter("droppedControl");
|
|
1650
|
-
const sDropPosition = oEvent.getParameter("dropPosition");
|
|
1651
|
-
const oSourceCell = oSourceVisualization.getParent().getParent();
|
|
1652
|
-
const oTargetColumn = oTargetCell.getParent();
|
|
1653
|
-
let iPositionInTargetColumn = oTargetColumn.indexOfAggregation("cells", oTargetCell);
|
|
1654
|
-
|
|
1655
|
-
if (sDropPosition === "After") {
|
|
1656
|
-
iPositionInTargetColumn++;
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
this._moveVisualizationToCellOrColumn(oSourceVisualization, oSourceCell, oTargetColumn, iPositionInTargetColumn);
|
|
1660
|
-
},
|
|
1661
|
-
|
|
1662
|
-
/**
|
|
1663
|
-
* Called when a Visualization is dropped on top of a Cell (e.g. a tile is dropped on top of an empty cells illustrated message)
|
|
1664
|
-
*
|
|
1665
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1666
|
-
*
|
|
1667
|
-
* @since 1.118.0
|
|
1668
|
-
* @private
|
|
1669
|
-
*/
|
|
1670
|
-
onVisualizationDropOnCell: function (oEvent) {
|
|
1671
|
-
const oSourceVisualization = oEvent.getParameter("draggedControl");
|
|
1672
|
-
const oTargetColumn = oEvent.getParameter("droppedControl");
|
|
1673
|
-
const oSourceCell = oSourceVisualization.getParent().getParent();
|
|
1674
|
-
const iPositionInTargetColumn = 0;
|
|
1675
|
-
|
|
1676
|
-
this._moveVisualizationToCellOrColumn(oSourceVisualization, oSourceCell, oTargetColumn, iPositionInTargetColumn);
|
|
1677
|
-
},
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Called when a Visualization is dropped on an empty Widget Container
|
|
1681
|
-
*
|
|
1682
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1683
|
-
*
|
|
1684
|
-
* @since 1.118.0
|
|
1685
|
-
* @private
|
|
1686
|
-
*/
|
|
1687
|
-
onVisualizationDropOnEmptyWidgetContainer: function (oEvent) {
|
|
1688
|
-
const oSourceVisualization = oEvent.getParameter("draggedControl");
|
|
1689
|
-
const oTargetCell = oEvent.getParameter("droppedControl");
|
|
1690
|
-
const oSourceCell = oSourceVisualization.getParent().getParent();
|
|
1691
|
-
|
|
1692
|
-
this._moveVisualizationToCellOrColumn(oSourceVisualization, oSourceCell, oTargetCell);
|
|
1693
|
-
},
|
|
1694
|
-
|
|
1695
|
-
/**
|
|
1696
|
-
* Moves a visualization to an empty spot in a Column or into an empty Cell
|
|
1697
|
-
*
|
|
1698
|
-
* @param {object} oVisualization The Visualization
|
|
1699
|
-
* @param {object} oSourceCell The Cell where the tile was initially
|
|
1700
|
-
* @param {object} oTargetControl The target control (Column or empty Cell)
|
|
1701
|
-
* @param {int} [iPositionInTargetColumn] The position in the target column. Only needed when target control is a WorkPageColumn
|
|
1702
|
-
*
|
|
1703
|
-
* @since 1.118.0
|
|
1704
|
-
* @private
|
|
1705
|
-
*/
|
|
1706
|
-
_moveVisualizationToCellOrColumn: function (oVisualization, oSourceCell, oTargetControl, iPositionInTargetColumn) {
|
|
1707
|
-
const oModel = this.getView().getModel();
|
|
1708
|
-
const sCellWidgetsPath = `${oSourceCell.getBindingContext().getPath()}/widgets`;
|
|
1709
|
-
const aCellWidgets = oModel.getProperty(sCellWidgetsPath);
|
|
1710
|
-
const iIndexInSourceCell = oSourceCell.indexOfAggregation("widgets", oVisualization);
|
|
1711
|
-
const sSourceVisPath = oVisualization.getBindingContext().getPath();
|
|
1712
|
-
const oSourceVisWidgetData = oModel.getProperty(sSourceVisPath);
|
|
1713
|
-
|
|
1714
|
-
aCellWidgets.splice(iIndexInSourceCell, 1);
|
|
1715
|
-
|
|
1716
|
-
// Insert the dragged object into a new target array to avoid mutation.
|
|
1717
|
-
const aNewCellWidgets = [].concat(aCellWidgets);
|
|
1718
|
-
|
|
1719
|
-
oModel.setProperty(sCellWidgetsPath, aNewCellWidgets);
|
|
1720
|
-
if (oTargetControl.isA("sap.ushell.components.workPageBuilder.controls.WorkPageCell")) {
|
|
1721
|
-
this._setCellData(oTargetControl, [oSourceVisWidgetData]);
|
|
1722
|
-
} else if (oTargetControl.isA("sap.ushell.components.workPageBuilder.controls.WorkPageColumn")) {
|
|
1723
|
-
this._setColumnData(oTargetControl, [oSourceVisWidgetData], iPositionInTargetColumn);
|
|
1724
|
-
}
|
|
1725
|
-
InvisibleMessage.getInstance().announce(this.getView().getModel("i18n").getResourceBundle().getText("WorkPage.Message.WidgetMoved"), InvisibleMessageMode.Assertive);
|
|
1726
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
1727
|
-
},
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Moves a cell between two columns and updates the model accordingly.
|
|
1731
|
-
*
|
|
1732
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageColumn} oSourceColumn The column from where the cell originates from
|
|
1733
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageColumn} oTargetColumn The column where the cell will be moved to
|
|
1734
|
-
* @param {int} iSourceIndex The position in the column where the cell originates from
|
|
1735
|
-
* @param {int} iTargetIndex The position in the column where the cell will be moved to
|
|
1736
|
-
*
|
|
1737
|
-
* @private
|
|
1738
|
-
* @since 1.116.0
|
|
1739
|
-
*/
|
|
1740
|
-
_moveCell: function (oSourceColumn, oTargetColumn, iSourceIndex, iTargetIndex) {
|
|
1741
|
-
const oModel = this.getView().getModel();
|
|
1742
|
-
|
|
1743
|
-
const bSameContainer = oTargetColumn.getId() === oSourceColumn.getId();
|
|
1744
|
-
|
|
1745
|
-
const sSourceColumnCellsPath = `${oSourceColumn.getBindingContext().getPath()}/cells`;
|
|
1746
|
-
const sTargetColumnCellsPath = `${oTargetColumn.getBindingContext().getPath()}/cells`;
|
|
1747
|
-
|
|
1748
|
-
const aSourceColumnCells = oModel.getProperty(sSourceColumnCellsPath);
|
|
1749
|
-
let aTargetColumnCells = oModel.getProperty(sTargetColumnCellsPath);
|
|
1750
|
-
|
|
1751
|
-
if (bSameContainer) {
|
|
1752
|
-
// Decrease drop position if the dragged element is taken from before the drop position in the same container.
|
|
1753
|
-
if (iSourceIndex < iTargetIndex) {
|
|
1754
|
-
iTargetIndex--;
|
|
1755
|
-
}
|
|
1756
|
-
// Return if the result is the same for drag position and drop position in the same container (and prevent the MessageToast).
|
|
1757
|
-
if (iSourceIndex === iTargetIndex) {
|
|
1758
|
-
return;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
// Filter the dragged item from the source array instead of splicing to avoid mutation.
|
|
1763
|
-
const aNewDragColumnCells = aSourceColumnCells.filter((oWidget, iIndex) => {
|
|
1764
|
-
return iIndex !== iSourceIndex;
|
|
1765
|
-
});
|
|
1766
|
-
|
|
1767
|
-
// If dnd happened in the same cell, the drop cells become the dragged cells without the dragged object.
|
|
1768
|
-
if (bSameContainer) {
|
|
1769
|
-
aTargetColumnCells = aNewDragColumnCells;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
// Insert the dragged object into a new target array to avoid mutation.
|
|
1773
|
-
const aNewDropColumnCells = [aTargetColumnCells.slice(0, iTargetIndex), aSourceColumnCells[iSourceIndex], aTargetColumnCells.slice(iTargetIndex)].flat();
|
|
1774
|
-
|
|
1775
|
-
oModel.setProperty(sSourceColumnCellsPath, aNewDragColumnCells);
|
|
1776
|
-
oModel.setProperty(sTargetColumnCellsPath, aNewDropColumnCells);
|
|
1777
|
-
|
|
1778
|
-
InvisibleMessage.getInstance().announce(this.getView().getModel("i18n").getResourceBundle().getText("WorkPage.Message.WidgetMoved"), InvisibleMessageMode.Assertive);
|
|
1779
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
1780
|
-
},
|
|
1781
|
-
|
|
1782
|
-
/**
|
|
1783
|
-
* Called if a widget is dropped on the WorkPageCell.
|
|
1784
|
-
* @since 1.116.0
|
|
1785
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1786
|
-
*/
|
|
1787
|
-
onWidgetOnCellDrop: function (oEvent) {
|
|
1788
|
-
const oDragged = oEvent.getParameter("draggedControl");
|
|
1789
|
-
const oSourceCell = oDragged.getParent().getParent();
|
|
1790
|
-
const oTargetCell = oEvent.getParameter("droppedControl");
|
|
1791
|
-
const iDragPosition = oSourceCell.indexOfAggregation("widgets", oDragged);
|
|
1792
|
-
const iDropPosition = oTargetCell.getBindingContext().getProperty("widgets").length;
|
|
1793
|
-
|
|
1794
|
-
this._moveVisualization(oSourceCell, oTargetCell, iDragPosition, iDropPosition);
|
|
1795
|
-
},
|
|
1796
|
-
|
|
1797
|
-
/**
|
|
1798
|
-
* Called when a Widget is dragged over a Cell. Prevents the drop for Cells with tiles or based on conditions defined by the parameters.
|
|
1799
|
-
* Note: The Tile drop event is prevented here because it is handled by a different drag/drop option via the GridContainer
|
|
1800
|
-
*
|
|
1801
|
-
* @param {sap.ui.base.Event} oEvent The dragEnter event.
|
|
1802
|
-
* @param {object} bEmptyCellExpected Determines whether it is expected that Widgets are already present in the target Cell
|
|
1803
|
-
*/
|
|
1804
|
-
onWidgetOnCellDragEnter: function (oEvent, bEmptyCellExpected) {
|
|
1805
|
-
const oCell = oEvent.getParameter("target");
|
|
1806
|
-
const bWidgetsPresent = !!oCell.getBindingContext().getProperty("widgets").length;
|
|
1807
|
-
if (oCell.getTileMode() && bWidgetsPresent || bEmptyCellExpected === bWidgetsPresent) {
|
|
1808
|
-
oEvent.preventDefault();
|
|
1809
|
-
}
|
|
1810
|
-
},
|
|
1811
|
-
|
|
1812
|
-
/**
|
|
1813
|
-
* Called if a widget is dropped to a certain position in the GridContainer.
|
|
1814
|
-
* @since 1.110.0
|
|
1815
|
-
* @param {sap.ui.base.Event} oEvent The drop event.
|
|
1816
|
-
*/
|
|
1817
|
-
onGridDrop: function (oEvent) {
|
|
1818
|
-
const oTargetCell = oEvent.getSource();
|
|
1819
|
-
const oDragged = oEvent.getParameter("draggedControl");
|
|
1820
|
-
const oDropped = oEvent.getParameter("droppedControl");
|
|
1821
|
-
const sInsertPosition = oEvent.getParameter("dropPosition");
|
|
1822
|
-
const oSourceCell = oDragged.getParent().getParent();
|
|
1823
|
-
|
|
1824
|
-
const iDragPosition = oSourceCell.indexOfAggregation("widgets", oDragged);
|
|
1825
|
-
let iDropPosition = oTargetCell.indexOfAggregation("widgets", oDropped);
|
|
1826
|
-
|
|
1827
|
-
const bSameContainer = oTargetCell.getId() === oSourceCell.getId();
|
|
1828
|
-
|
|
1829
|
-
// Increase the drop position if the dragged element is moved to the right.
|
|
1830
|
-
if (sInsertPosition === "After") {
|
|
1831
|
-
iDropPosition++;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
if (bSameContainer) {
|
|
1835
|
-
// Decrease drop position if the dragged element is taken from before the drop position in the same container.
|
|
1836
|
-
if (iDragPosition < iDropPosition) {
|
|
1837
|
-
iDropPosition--;
|
|
1838
|
-
}
|
|
1839
|
-
// Return if the result is the same for drag position and drop position in the same container (and prevent the MessageToast).
|
|
1840
|
-
if (iDragPosition === iDropPosition) {
|
|
1841
|
-
return;
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
this._moveVisualization(oSourceCell, oTargetCell, iDragPosition, iDropPosition);
|
|
1846
|
-
},
|
|
1847
|
-
|
|
1848
|
-
/**
|
|
1849
|
-
* Updates the model according to the new positions.
|
|
1850
|
-
* Removes the widget data from the widgets in the source cell at the drag position.
|
|
1851
|
-
* Inserts the object into the widgets array in the target cell at the drop position.
|
|
1852
|
-
*
|
|
1853
|
-
* @since 1.110.0
|
|
1854
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell} oSourceCell The cell from which the widget was dragged.
|
|
1855
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageCell} oTargetCell The cell into which the widget was dropped.
|
|
1856
|
-
* @param {int} iDragPosition The position the widget was dragged from.
|
|
1857
|
-
* @param {int} iDropPosition The position the widget was dropped to.
|
|
1858
|
-
* @private
|
|
1859
|
-
*/
|
|
1860
|
-
_moveVisualization: function (oSourceCell, oTargetCell, iDragPosition, iDropPosition) {
|
|
1861
|
-
const oModel = this.getView().getModel();
|
|
1862
|
-
|
|
1863
|
-
const sDragContainerWidgetsPath = `${oSourceCell.getBindingContext().getPath()}/widgets`;
|
|
1864
|
-
const sDropContainerWidgetsPath = `${oTargetCell.getBindingContext().getPath()}/widgets`;
|
|
1865
|
-
const bSameCell = sDragContainerWidgetsPath === sDropContainerWidgetsPath;
|
|
1866
|
-
|
|
1867
|
-
const aDragContainerWidgets = oModel.getProperty(sDragContainerWidgetsPath);
|
|
1868
|
-
let aDropContainerWidgets = oModel.getProperty(sDropContainerWidgetsPath);
|
|
1869
|
-
|
|
1870
|
-
const oDraggedObject = aDragContainerWidgets[iDragPosition];
|
|
1871
|
-
|
|
1872
|
-
// Filter the dragged item from the source array instead of splicing to avoid mutation.
|
|
1873
|
-
const aNewDragContainerWidgets = aDragContainerWidgets.filter((oWidget, iIndex) => {
|
|
1874
|
-
return iIndex !== iDragPosition;
|
|
1875
|
-
});
|
|
1876
|
-
|
|
1877
|
-
// If dnd happened in the same cell, the drop widgets become the dragged widgets without the dragged object.
|
|
1878
|
-
if (bSameCell) {
|
|
1879
|
-
aDropContainerWidgets = aNewDragContainerWidgets;
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
// Insert the dragged object into a new target array to avoid mutation.
|
|
1883
|
-
const aNewDropContainerWidgets = [aDropContainerWidgets.slice(0, iDropPosition), oDraggedObject, aDropContainerWidgets.slice(iDropPosition)].flat();
|
|
1884
|
-
|
|
1885
|
-
oModel.setProperty(sDragContainerWidgetsPath, aNewDragContainerWidgets);
|
|
1886
|
-
oModel.setProperty(sDropContainerWidgetsPath, aNewDropContainerWidgets);
|
|
1887
|
-
|
|
1888
|
-
InvisibleMessage.getInstance().announce(this.getView().getModel("i18n").getResourceBundle().getText("WorkPage.Message.WidgetMoved"), InvisibleMessageMode.Assertive);
|
|
1889
|
-
this.getOwnerComponent().fireEvent("workPageEdited");
|
|
1890
|
-
},
|
|
1891
|
-
|
|
1892
|
-
/**
|
|
1893
|
-
* Returns true if the aWidgets array does not contain cards.
|
|
1894
|
-
*
|
|
1895
|
-
* @param {sap.ui.core.Control[]} aWidgets The array of widget controls.
|
|
1896
|
-
* @returns {boolean} The result indicating if tileMode is active.
|
|
1897
|
-
*/
|
|
1898
|
-
tileMode: function (aWidgets) {
|
|
1899
|
-
const oModel = this.getView().getModel();
|
|
1900
|
-
let oUsedViz;
|
|
1901
|
-
|
|
1902
|
-
return !!aWidgets && (aWidgets.length > 1 || !aWidgets.some((oWidget) => {
|
|
1903
|
-
oUsedViz = oModel.getProperty(`/data/usedVisualizations/${ObjectPath.get("visualization.id", oWidget)}`);
|
|
1904
|
-
return ObjectPath.get("type", oUsedViz) === "sap.card";
|
|
1905
|
-
}));
|
|
1906
|
-
},
|
|
1907
|
-
|
|
1908
|
-
/**
|
|
1909
|
-
* Formatter for the appsearch button. Returns true if the cell is in tileMode and editMode is active.
|
|
1910
|
-
*
|
|
1911
|
-
* @param {object[]} aWidgets The widgets array.
|
|
1912
|
-
* @param {boolean} bEditMode The editMode flag
|
|
1913
|
-
* @returns {boolean} The result.
|
|
1914
|
-
*/
|
|
1915
|
-
showAppSearchButton: function (aWidgets, bEditMode) {
|
|
1916
|
-
return this.tileMode(aWidgets) && bEditMode;
|
|
1917
|
-
},
|
|
1918
|
-
|
|
1919
|
-
/**
|
|
1920
|
-
* Updates the model with the columnWidths.
|
|
1921
|
-
*
|
|
1922
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageRow} oRow The surrounding row.
|
|
1923
|
-
* @param {int} iLeftColumnIndex The index of the left column to update.
|
|
1924
|
-
* @param {int} iRightColumnIndex The index of the right column to update.
|
|
1925
|
-
* @param {int} iNewLeftColumnWidth The new columnWidth value for the left column.
|
|
1926
|
-
* @param {int} iNewRightColumnWidth The new columnWidth value for the right column.
|
|
1927
|
-
* @private
|
|
1928
|
-
*/
|
|
1929
|
-
_updateModelWithColumnWidths: function (oRow, iLeftColumnIndex, iRightColumnIndex, iNewLeftColumnWidth, iNewRightColumnWidth) {
|
|
1930
|
-
const oModel = this.getView().getModel();
|
|
1931
|
-
const oRowBindingContext = oRow.getBindingContext();
|
|
1932
|
-
const sRowBindingContextPath = oRowBindingContext.getPath();
|
|
1933
|
-
const sLeftColumnPath = `${sRowBindingContextPath}/columns/${iLeftColumnIndex}/descriptor/value/columnWidth`;
|
|
1934
|
-
const sRightColumnPath = `${sRowBindingContextPath}/columns/${iRightColumnIndex}/descriptor/value/columnWidth`;
|
|
1935
|
-
oModel.setProperty(sLeftColumnPath, iNewLeftColumnWidth);
|
|
1936
|
-
oModel.setProperty(sRightColumnPath, iNewRightColumnWidth);
|
|
1937
|
-
},
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* Gets the column width from the column descriptor entry, falls back to max column width if the columnWidth is empty.
|
|
1941
|
-
*
|
|
1942
|
-
* @param {object} oColumn The column data object.
|
|
1943
|
-
* @returns {int} The column width as an integer.
|
|
1944
|
-
* @private
|
|
1945
|
-
*/
|
|
1946
|
-
_getColumnWidth: function (oColumn) {
|
|
1947
|
-
return ObjectPath.get("descriptor.value.columnWidth", oColumn) || MAX_GRID_COLUMN_WIDTH;
|
|
1948
|
-
},
|
|
1949
|
-
|
|
1950
|
-
/**
|
|
1951
|
-
* Sets the column width to the column descriptor.
|
|
1952
|
-
*
|
|
1953
|
-
* @param {object} oColumn The column data object.
|
|
1954
|
-
* @param {int} iColumnWidth The column data object.
|
|
1955
|
-
* @private
|
|
1956
|
-
*/
|
|
1957
|
-
_setColumnWidth: function (oColumn, iColumnWidth) {
|
|
1958
|
-
ObjectPath.set("descriptor.value.columnWidth", iColumnWidth, oColumn);
|
|
1959
|
-
},
|
|
1960
|
-
|
|
1961
|
-
/**
|
|
1962
|
-
*
|
|
1963
|
-
* @param {sap.ushell.components.workPageBuilder.controls.WorkPageColumn[]} aColumns An array of WorkPageColumn controls.
|
|
1964
|
-
* @param {int} iColumnIndex The column index.
|
|
1965
|
-
* @param {int} iTotalColumns The total number of columns.
|
|
1966
|
-
* @returns {sap.ushell.components.workPageBuilder.controls.WorkPageColumn[]} The updated array of WorkPageColumn controls.
|
|
1967
|
-
* @private
|
|
1968
|
-
*/
|
|
1969
|
-
_calculateColWidths: function (aColumns, iColumnIndex, iTotalColumns) {
|
|
1970
|
-
const oColumn = aColumns[iColumnIndex];
|
|
1971
|
-
|
|
1972
|
-
if (this._getColumnWidth(oColumn) - STEP_SIZE >= MIN_GRID_COLUMN_WIDTH) {
|
|
1973
|
-
this._setColumnWidth(oColumn, this._getColumnWidth(oColumn) - STEP_SIZE);
|
|
1974
|
-
iTotalColumns = iTotalColumns - STEP_SIZE;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
if (iTotalColumns > MAX_GRID_COLUMN_WIDTH) {
|
|
1978
|
-
const nextIndex = iColumnIndex - 1 >= 0 ? iColumnIndex - 1 : aColumns.length - 1;
|
|
1979
|
-
this._calculateColWidths(aColumns, nextIndex, iTotalColumns);
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
return aColumns;
|
|
1983
|
-
},
|
|
1984
|
-
|
|
1985
|
-
/**
|
|
1986
|
-
* Returns the data representation of an empty WorkPageColumn.
|
|
1987
|
-
*
|
|
1988
|
-
* @param {int} iColumnWidth The columnWidth for the column.
|
|
1989
|
-
* @returns {object} The WorkPageColumn data object.
|
|
1990
|
-
* @private
|
|
1991
|
-
*/
|
|
1992
|
-
_createEmptyColumn: function (iColumnWidth) {
|
|
1993
|
-
return {
|
|
1994
|
-
id: this._generateUniqueId(),
|
|
1995
|
-
descriptor: {
|
|
1996
|
-
value: {
|
|
1997
|
-
columnWidth: iColumnWidth
|
|
1998
|
-
},
|
|
1999
|
-
schemaVersion: "3.2.0"
|
|
2000
|
-
},
|
|
2001
|
-
configurations: [],
|
|
2002
|
-
cells: []
|
|
2003
|
-
};
|
|
2004
|
-
},
|
|
2005
|
-
|
|
2006
|
-
/**
|
|
2007
|
-
* Returns the data representation of an empty WorkPageRow.
|
|
2008
|
-
*
|
|
2009
|
-
* @returns {object} The WorkPageRow data object.
|
|
2010
|
-
* @private
|
|
2011
|
-
*/
|
|
2012
|
-
_createEmptyRow: function () {
|
|
2013
|
-
return {
|
|
2014
|
-
id: this._generateUniqueId(),
|
|
2015
|
-
descriptor: {
|
|
2016
|
-
value: {
|
|
2017
|
-
title: ""
|
|
2018
|
-
},
|
|
2019
|
-
schemaVersion: "3.2.0"
|
|
2020
|
-
},
|
|
2021
|
-
columns: [this._createEmptyColumn(MAX_GRID_COLUMN_WIDTH)]
|
|
2022
|
-
};
|
|
2023
|
-
},
|
|
2024
|
-
|
|
2025
|
-
/**
|
|
2026
|
-
* Saves the host in a variable to be attached to a card.
|
|
2027
|
-
*
|
|
2028
|
-
* @private
|
|
2029
|
-
*/
|
|
2030
|
-
_saveHost: function () {
|
|
2031
|
-
this.oHost = Element.getElementById("sap.shell.host.environment");
|
|
2032
|
-
if (!this.oHost) {
|
|
2033
|
-
this.oHost = new WorkPageHost("sap.shell.host.environment");
|
|
2034
|
-
// set the ushell container on the host for navigation service access
|
|
2035
|
-
this.oHost._setContainer(this.getOwnerComponent().getUshellContainer());
|
|
2036
|
-
// create a property binding for navigationDisabled to forward to host if a model is present.
|
|
2037
|
-
if (this.oModel) {
|
|
2038
|
-
const oNavDisabledBinding = this.oModel.bindProperty("/navigationDisabled");
|
|
2039
|
-
this.oHost._setNavigationDisabled(oNavDisabledBinding.getValue());
|
|
2040
|
-
// listen to changes on navigationDisabled and propagate to host
|
|
2041
|
-
oNavDisabledBinding.attachChange((oEvent) => {
|
|
2042
|
-
this.oHost._setNavigationDisabled(oEvent.getSource().getValue());
|
|
2043
|
-
});
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
},
|
|
2047
|
-
|
|
2048
|
-
/**
|
|
2049
|
-
* Check if Navigation is disabled
|
|
2050
|
-
*
|
|
2051
|
-
* @private
|
|
2052
|
-
* @since 1.109.0
|
|
2053
|
-
*/
|
|
2054
|
-
|
|
2055
|
-
getNavigationDisabled: function () {
|
|
2056
|
-
return this.oModel.getProperty("/navigationDisabled");
|
|
2057
|
-
},
|
|
2058
|
-
|
|
2059
|
-
/**
|
|
2060
|
-
* Disable the navigation on tiles and widgets
|
|
2061
|
-
* @param {boolean} bNavigation true or false
|
|
2062
|
-
*
|
|
2063
|
-
* @private
|
|
2064
|
-
* @since 1.109.0
|
|
2065
|
-
*/
|
|
2066
|
-
|
|
2067
|
-
setNavigationDisabled: function (bNavigation) {
|
|
2068
|
-
this.oModel.setProperty("/navigationDisabled", bNavigation);
|
|
2069
|
-
},
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* Returns a unique id which does not yet exist on the WorkPage.
|
|
2073
|
-
* Optionally an array of existing IDs can be given as an argument.
|
|
2074
|
-
* This can be helpful if new entities are created in a loop but not yet entered into the model.
|
|
2075
|
-
*
|
|
2076
|
-
* @since 1.112.0
|
|
2077
|
-
* @param {string[]} [aExistingIds] An array of existing IDs as strings.
|
|
2078
|
-
* @returns {string} A unique ID.
|
|
2079
|
-
* @private
|
|
2080
|
-
*/
|
|
2081
|
-
_generateUniqueId: function (aExistingIds) {
|
|
2082
|
-
// make a copy to not change the passed array.
|
|
2083
|
-
let aIds = (aExistingIds || []).concat([]);
|
|
2084
|
-
const oWorkPage = this.oModel.getProperty("/data/workPage");
|
|
2085
|
-
const fnCollectIds = this._collectIds.bind(this);
|
|
2086
|
-
|
|
2087
|
-
aIds = aIds.concat(fnCollectIds(oWorkPage));
|
|
2088
|
-
|
|
2089
|
-
(oWorkPage.rows || []).forEach((oRow) => {
|
|
2090
|
-
aIds = aIds.concat(fnCollectIds(oRow));
|
|
2091
|
-
(oRow.columns || []).forEach((oColumn) => {
|
|
2092
|
-
aIds = aIds.concat(fnCollectIds(oColumn));
|
|
2093
|
-
(oColumn.cells || []).forEach((oCell) => {
|
|
2094
|
-
aIds = aIds.concat(fnCollectIds(oCell));
|
|
2095
|
-
(oCell.widgets || []).forEach((oWidget) => {
|
|
2096
|
-
aIds = aIds.concat(fnCollectIds(oWidget));
|
|
2097
|
-
});
|
|
2098
|
-
});
|
|
2099
|
-
});
|
|
2100
|
-
});
|
|
2101
|
-
|
|
2102
|
-
aIds = aIds.filter((sId) => {
|
|
2103
|
-
return !!sId;
|
|
2104
|
-
});
|
|
2105
|
-
|
|
2106
|
-
return utils.generateUniqueId(aIds);
|
|
2107
|
-
},
|
|
2108
|
-
|
|
2109
|
-
/**
|
|
2110
|
-
* Collects the id and all the configuration ids of an entity on the WorkPage.
|
|
2111
|
-
*
|
|
2112
|
-
* @param {object} oEntity An entity on the WorkPage
|
|
2113
|
-
* @returns {string[]} An array of all ids related to this entity.
|
|
2114
|
-
* @private
|
|
2115
|
-
* @since 1.116.0
|
|
2116
|
-
*/
|
|
2117
|
-
_collectIds: function (oEntity) {
|
|
2118
|
-
const aIds = [oEntity.id];
|
|
2119
|
-
const aSettings = oEntity.configurations || [];
|
|
2120
|
-
|
|
2121
|
-
const aConfigIds = aSettings.map((oConfig) => {
|
|
2122
|
-
return oConfig.id;
|
|
2123
|
-
});
|
|
2124
|
-
|
|
2125
|
-
return aIds.concat(aConfigIds);
|
|
2126
|
-
}
|
|
2127
|
-
});
|
|
2128
|
-
});
|