UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

154 lines (153 loc) 6.98 kB
// SPDX-License-Identifier: Apache-2.0 import ApplicationLifeCycleManager from '../app/lifecyclemanager'; import AuthManager from '../auth/authmanager'; import DragManager from '../../components/treeview/tools/dragmanager'; import PluginManager from '../auth/pluginmanager'; import ConfigManager from '../configuration/configmanager'; import GirafeConfig from '../configuration/girafeconfig'; import ErrorManager from '../error/errormanager'; import I18nManager from '../i18n/i18nmanager'; import LayerManager from '../layers/layermanager'; import SnapManager from '../layers/snapmanager'; import LocalFileManager from '../localfile/localfilemanager'; import LogManager from '../logging/logmanager'; import OfflineManager from '../offline/offlinemanager'; import OgcApiFeaturesManager from '../ogcapi/ogcapifeaturesmanager'; import OrderingManager from '../ordering/orderingmanager'; import SessionManager from '../share/sessionmanager'; import ShareManager from '../share/sharemanager'; import StateSerializer from '../share/stateserializer'; import ComponentManager from '../state/componentManager'; import MapManager from '../state/mapManager'; import StateManager from '../state/statemanager'; import UserInteractionManager from '../state/userInteractionManager'; import CustomThemesManager from '../themes/customthemesmanager'; import ThemesHelper from '../themes/themeshelper'; import ThemesManager from '../themes/themesmanager'; import UserLayerManager from '../themes/userlayermanager'; import PermalinkManager from '../url/permalinkmanager'; import UrlManager from '../url/urlmanager'; import UserDataManager from '../userdata/userdatamanager'; import WfsManager from '../wfs/wfsmanager'; import WmsManager from '../wms/wmsmanager'; import { MockConfig } from './mockconfig'; import OnBoardingManager from '../onboarding/onboardingmanager'; import ThemeFavoritesManager from '../themes/themefavoritesmanager'; import SearchManager from '../search/searchmanager'; import FeedbackManager from '../feedback/feedbackmanager'; export default class MockGirafeContext { userDataManager; configManager; stateManager; componentManager; userInteractionManager; i18nManager; pluginManager; themesManager; themesHelper; permalinkManager; urlManager; dragManager; layerManager; sessionManager; stateSerializer; shareManager; customThemesManager; errorManager; wfsManager; authManager; snapManager; mapManager; logManager; offlineManager; applicationLifeCycleManager; orderingManager; userLayerManager; wmsManager; ogcApiFeaturesManager; localFileManager; onBoardingManager; themeFavoritesManager; searchManager; feedbackManager; constructor() { this.componentManager = new ComponentManager(this); this.userDataManager = new UserDataManager(this); this.configManager = new ConfigManager(this); this.logManager = new LogManager(this); this.stateManager = new StateManager(this); this.orderingManager = new OrderingManager(this); this.applicationLifeCycleManager = new ApplicationLifeCycleManager(this); this.mapManager = new MapManager(this); this.offlineManager = new OfflineManager(this); this.snapManager = new SnapManager(this); this.authManager = new AuthManager(this); this.pluginManager = new PluginManager(this); this.i18nManager = new I18nManager(this); this.userInteractionManager = new UserInteractionManager(this); this.dragManager = new DragManager(this); this.urlManager = new UrlManager(this); this.permalinkManager = new PermalinkManager(this); this.layerManager = new LayerManager(this); this.userLayerManager = new UserLayerManager(this); this.themesHelper = new ThemesHelper(this); this.stateSerializer = new StateSerializer(this); this.sessionManager = new SessionManager(this); this.shareManager = new ShareManager(this); this.wfsManager = new WfsManager(this); this.errorManager = new ErrorManager(this); this.customThemesManager = new CustomThemesManager(this); this.themesManager = new ThemesManager(this); this.wmsManager = new WmsManager(this); this.localFileManager = new LocalFileManager(this); this.ogcApiFeaturesManager = new OgcApiFeaturesManager(this); this.onBoardingManager = new OnBoardingManager(this); this.themeFavoritesManager = new ThemeFavoritesManager(this); this.searchManager = new SearchManager(this); this.feedbackManager = new FeedbackManager(this); } async initialize() { // NOTE: This initialization order is important, because some singleton will need other ones! this.componentManager.initializeSingleton(); this.userDataManager.initializeSingleton(); this.userDataManager.setSource(MockConfig.userdata.source); this.userDataManager.deleteAllUserData(); // @ts-ignore this.configManager['config'] = new GirafeConfig(MockConfig); // @ts-ignore this.configManager['defaultConfig'] = new GirafeConfig(MockConfig); this.logManager.initializeSingleton(); this.stateManager.initializeSingleton(); this.orderingManager.initializeSingleton(); this.applicationLifeCycleManager.initializeSingleton(); this.mapManager.initializeSingleton(); this.offlineManager.initializeSingleton(); this.snapManager.initializeSingleton(); this.authManager.initializeSingleton(); this.pluginManager.initializeSingleton(); this.i18nManager.initializeSingleton(); // @ts-expect-error: private property this.i18nManager.translations = { fr: { a: 'translated_a', b: 'translated_b' } }; this.userInteractionManager.initializeSingleton(); this.dragManager.initializeSingleton(); this.urlManager.initializeSingleton(); this.permalinkManager.initializeSingleton(); this.layerManager.initializeSingleton(); this.userLayerManager.initializeSingleton(); this.themesHelper.initializeSingleton(); this.stateSerializer.initializeSingleton(); this.sessionManager.initializeSingleton(); this.shareManager.initializeSingleton(); this.wfsManager.initializeSingleton(); this.errorManager.initializeSingleton(); this.customThemesManager.initializeSingleton(); this.themesManager.initializeSingleton(); this.wmsManager.initializeSingleton(); this.localFileManager.initializeSingleton(); this.ogcApiFeaturesManager.initializeSingleton(); this.onBoardingManager.initializeSingleton(); this.themeFavoritesManager.initializeSingleton(); this.searchManager.initializeSingleton(); this.feedbackManager.initializeSingleton(); } }