@geogirafe/lib-geoportal 1.2.0-dev.2872463389 → 1.2.0-dev.2889263072
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/api/apicontext.d.ts +12 -1
- package/api/apicontext.js +19 -111
- package/api/apisessionmanager.d.ts +1 -1
- package/api/apisessionmanager.js +1 -1
- package/base/GirafeDraggableElement.js +2 -2
- package/base/GirafeResizableElement.js +4 -4
- package/base/GirafeSingleton.d.ts +1 -1
- package/base/GirafeSingleton.js +1 -1
- package/components/basemap/component.js +1 -1
- package/components/cross-section/cross-section-settings/component.js +1 -1
- package/components/cross-section/scatterplot.js +1 -1
- package/components/drawing/component-mobile.js +1 -1
- package/components/drawing/component.js +4 -4
- package/components/drawing/fixed-dimension/component.js +1 -1
- package/components/edit/component.js +1 -1
- package/components/edit/editform/component.js +1 -1
- package/components/extlayers/component.js +1 -1
- package/components/map-2d/component.js +1 -1
- package/components/map-2d/tools/swipemanager.js +2 -2
- package/components/modals/component.js +1 -1
- package/components/navigation/component.d.ts +2 -2
- package/components/navigation/component.js +6 -6
- package/components/news/news-button/component.d.ts +0 -1
- package/components/news/news-button/component.js +0 -6
- package/components/news/news-panel/component.d.ts +2 -2
- package/components/news/news-panel/component.js +5 -5
- package/components/print/component.js +7 -7
- package/components/print/tools/MFPLegendEncoder.js +1 -1
- package/components/querybuilder/component.js +2 -2
- package/components/scale/component.js +1 -1
- package/components/selectionwindow/component.js +1 -1
- package/components/share/component.js +1 -1
- package/components/themes/component.d.ts +1 -1
- package/components/themes/component.js +4 -4
- package/components/themes-mobile/layer-selected/component.js +1 -1
- package/components/timerestriction/timepicker/component.js +1 -1
- package/components/timerestriction/timeslider/component.js +4 -4
- package/components/treeview/treeviewroot/component.js +1 -1
- package/components/userpreferences/component.d.ts +1 -1
- package/components/userpreferences/component.js +7 -7
- package/models/xmlTypes.js +1 -1
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/app/lifecyclemanager.d.ts +1 -1
- package/tools/app/lifecyclemanager.js +1 -1
- package/tools/auth/abstractconnectmanager.js +2 -2
- package/tools/auth/authmanager.d.ts +1 -1
- package/tools/auth/authmanager.js +1 -1
- package/tools/auth/pluginmanager.d.ts +1 -1
- package/tools/auth/pluginmanager.js +1 -1
- package/tools/configuration/configmanager.d.ts +3 -2
- package/tools/configuration/configmanager.js +9 -5
- package/tools/configuration/girafeconfig.d.ts +6 -5
- package/tools/configuration/girafeconfig.js +3 -0
- package/tools/context/context.d.ts +1 -0
- package/tools/context/context.js +4 -112
- package/tools/context/contexthelper.d.ts +6 -0
- package/tools/context/contexthelper.js +102 -0
- package/tools/error/errormanager.d.ts +1 -1
- package/tools/error/errormanager.js +1 -1
- package/tools/feedback/feedbackmanager.d.ts +1 -2
- package/tools/feedback/feedbackmanager.js +6 -8
- package/tools/i18n/i18nmanager.d.ts +1 -1
- package/tools/i18n/i18nmanager.js +22 -20
- package/tools/layers/layermanager.d.ts +1 -1
- package/tools/layers/layermanager.js +1 -1
- package/tools/layers/snapmanager.d.ts +1 -1
- package/tools/layers/snapmanager.js +1 -1
- package/tools/localfile/localfilemanager.d.ts +1 -1
- package/tools/localfile/localfilemanager.js +1 -1
- package/tools/logging/defaultconsole.d.ts +8 -0
- package/tools/logging/defaultconsole.js +9 -0
- package/tools/logging/logmanager.d.ts +1 -7
- package/tools/logging/logmanager.js +8 -13
- package/tools/main.d.ts +3 -1
- package/tools/main.js +2 -0
- package/tools/offline/offlinemanager.d.ts +3 -3
- package/tools/offline/offlinemanager.js +6 -6
- package/tools/ogcapi/ogcapifeaturesmanager.d.ts +1 -1
- package/tools/ogcapi/ogcapifeaturesmanager.js +1 -1
- package/tools/onboarding/onboardingmanager.js +4 -4
- package/tools/ordering/orderingmanager.d.ts +1 -1
- package/tools/ordering/orderingmanager.js +1 -1
- package/tools/resizewindow.js +6 -6
- package/tools/search/abstractsearchclient.d.ts +1 -1
- package/tools/search/abstractsearchclient.js +2 -2
- package/tools/search/searchmanager.d.ts +1 -1
- package/tools/search/searchmanager.js +2 -2
- package/tools/selection/selectionmanager.d.ts +1 -1
- package/tools/selection/selectionmanager.js +1 -1
- package/tools/share/sessionmanager.d.ts +1 -1
- package/tools/share/sessionmanager.js +1 -1
- package/tools/share/sharemanager.d.ts +1 -1
- package/tools/share/sharemanager.js +1 -1
- package/tools/share/stateserializer.d.ts +1 -1
- package/tools/share/stateserializer.js +1 -1
- package/tools/state/statemanager.d.ts +1 -1
- package/tools/state/statemanager.js +1 -1
- package/tools/tests/mockconfig.d.ts +2 -3
- package/tools/tests/mockconfig.js +0 -1
- package/tools/tests/mockcontext.d.ts +13 -1
- package/tools/tests/mockcontext.js +27 -112
- package/tools/tests/mockhelper.d.ts +2 -2
- package/tools/tests/mockhelper.js +4 -5
- package/tools/themes/customthemesmanager.d.ts +3 -3
- package/tools/themes/customthemesmanager.js +9 -9
- package/tools/themes/themefavoritesmanager.d.ts +5 -5
- package/tools/themes/themefavoritesmanager.js +16 -16
- package/tools/themes/themeshelper.d.ts +1 -1
- package/tools/themes/themeshelper.js +1 -1
- package/tools/themes/themesmanager.d.ts +1 -1
- package/tools/themes/themesmanager.js +2 -2
- package/tools/time/layertimeformatter.js +1 -1
- package/tools/url/permalinkmanager.d.ts +1 -1
- package/tools/url/permalinkmanager.js +1 -1
- package/tools/userdata/userdatamanager.d.ts +18 -39
- package/tools/userdata/userdatamanager.js +111 -75
- package/tools/wfs/wfsmanager.d.ts +1 -1
- package/tools/wfs/wfsmanager.js +1 -1
- package/tools/wms/wmsmanager.d.ts +1 -1
- package/tools/wms/wmsmanager.js +1 -1
|
@@ -4,7 +4,7 @@ declare class SnapManager extends GirafeSingleton {
|
|
|
4
4
|
private inactiveSnapLayers;
|
|
5
5
|
private get olMap();
|
|
6
6
|
private get state();
|
|
7
|
-
initializeSingleton(): void
|
|
7
|
+
initializeSingleton(): Promise<void>;
|
|
8
8
|
private mapInteractionsChanged;
|
|
9
9
|
private activateSnappingForAllLayers;
|
|
10
10
|
private deactivateSnappingForAllLayers;
|
|
@@ -13,7 +13,7 @@ class SnapManager extends GirafeSingleton {
|
|
|
13
13
|
get state() {
|
|
14
14
|
return this.context.stateManager.state;
|
|
15
15
|
}
|
|
16
|
-
initializeSingleton() {
|
|
16
|
+
async initializeSingleton() {
|
|
17
17
|
this.context.stateManager.subscribe(/layers\.layersList\..*\.activeState/, (_oldActive, _newActive, layer) => {
|
|
18
18
|
this.layerUpdated(layer);
|
|
19
19
|
});
|
|
@@ -13,7 +13,7 @@ declare class LocalFileManager extends GirafeSingleton {
|
|
|
13
13
|
private activeLayers;
|
|
14
14
|
private readonly featureLayerMap;
|
|
15
15
|
constructor(context: IGirafeContext);
|
|
16
|
-
initializeSingleton(): void
|
|
16
|
+
initializeSingleton(): Promise<void>;
|
|
17
17
|
private registerEvents;
|
|
18
18
|
private createInteraction;
|
|
19
19
|
loadLocalFile(localFile: File): Promise<void>;
|
|
@@ -25,7 +25,7 @@ class LocalFileManager extends GirafeSingleton {
|
|
|
25
25
|
this.map = this.context.mapManager.getMap();
|
|
26
26
|
this.name = `localFileManager`;
|
|
27
27
|
}
|
|
28
|
-
initializeSingleton() {
|
|
28
|
+
async initializeSingleton() {
|
|
29
29
|
this.registerEvents();
|
|
30
30
|
// Add drag n drop interaction to add local files
|
|
31
31
|
const dragAndDropInteraction = this.createInteraction();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default class DefaultConsole {
|
|
2
|
+
static readonly debug: typeof console.debug;
|
|
3
|
+
static readonly log: typeof console.log;
|
|
4
|
+
static readonly info: typeof console.info;
|
|
5
|
+
static readonly warn: typeof console.warn;
|
|
6
|
+
static readonly error: typeof console.error;
|
|
7
|
+
static readonly assert: typeof console.assert;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
export default class DefaultConsole {
|
|
3
|
+
static debug = console.debug;
|
|
4
|
+
static log = console.log;
|
|
5
|
+
static info = console.info;
|
|
6
|
+
static warn = console.warn;
|
|
7
|
+
static error = console.error;
|
|
8
|
+
static assert = console.assert;
|
|
9
|
+
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
2
2
|
export default class LogManager extends GirafeSingleton {
|
|
3
|
-
|
|
4
|
-
private readonly defaultLog;
|
|
5
|
-
private readonly defaultInfo;
|
|
6
|
-
private readonly defaultWarn;
|
|
7
|
-
private readonly defaultError;
|
|
8
|
-
private readonly defaultAssert;
|
|
9
|
-
initLogging(): void;
|
|
3
|
+
initializeSingleton(): Promise<void>;
|
|
10
4
|
/**
|
|
11
5
|
* Write log to output if the current loglevel is debug, info, warn or error
|
|
12
6
|
* @returns true if the log was written, false instead
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
3
|
+
import DefaultConsole from './defaultconsole.js';
|
|
3
4
|
export default class LogManager extends GirafeSingleton {
|
|
4
|
-
|
|
5
|
-
defaultLog = console.log;
|
|
6
|
-
defaultInfo = console.info;
|
|
7
|
-
defaultWarn = console.warn;
|
|
8
|
-
defaultError = console.error;
|
|
9
|
-
defaultAssert = console.assert;
|
|
10
|
-
initLogging() {
|
|
5
|
+
async initializeSingleton() {
|
|
11
6
|
console.debug = this.debug.bind(this);
|
|
12
7
|
console.log = this.log.bind(this);
|
|
13
8
|
console.info = this.info.bind(this);
|
|
@@ -21,7 +16,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
21
16
|
*/
|
|
22
17
|
debug(message, ...optionalParams) {
|
|
23
18
|
if (this.context.configManager.Config.general.logLevel === 'debug') {
|
|
24
|
-
|
|
19
|
+
DefaultConsole.debug(message, ...optionalParams);
|
|
25
20
|
return true;
|
|
26
21
|
}
|
|
27
22
|
return false;
|
|
@@ -33,7 +28,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
33
28
|
log(message, ...optionalParams) {
|
|
34
29
|
if (this.context.configManager.Config.general.logLevel === 'debug' ||
|
|
35
30
|
this.context.configManager.Config.general.logLevel === 'info') {
|
|
36
|
-
|
|
31
|
+
DefaultConsole.log(message, ...optionalParams);
|
|
37
32
|
return true;
|
|
38
33
|
}
|
|
39
34
|
return false;
|
|
@@ -45,7 +40,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
45
40
|
info(message, ...optionalParams) {
|
|
46
41
|
if (this.context.configManager.Config.general.logLevel === 'debug' ||
|
|
47
42
|
this.context.configManager.Config.general.logLevel === 'info') {
|
|
48
|
-
|
|
43
|
+
DefaultConsole.info(message, ...optionalParams);
|
|
49
44
|
return true;
|
|
50
45
|
}
|
|
51
46
|
return false;
|
|
@@ -58,7 +53,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
58
53
|
if (this.context.configManager.Config.general.logLevel === 'debug' ||
|
|
59
54
|
this.context.configManager.Config.general.logLevel === 'info' ||
|
|
60
55
|
this.context.configManager.Config.general.logLevel === 'warn') {
|
|
61
|
-
|
|
56
|
+
DefaultConsole.warn(message, ...optionalParams);
|
|
62
57
|
return true;
|
|
63
58
|
}
|
|
64
59
|
return false;
|
|
@@ -68,7 +63,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
68
63
|
* @returns true if the log was written, false instead
|
|
69
64
|
*/
|
|
70
65
|
error(message, ...optionalParams) {
|
|
71
|
-
|
|
66
|
+
DefaultConsole.error(message, ...optionalParams);
|
|
72
67
|
return true;
|
|
73
68
|
}
|
|
74
69
|
/**
|
|
@@ -77,7 +72,7 @@ export default class LogManager extends GirafeSingleton {
|
|
|
77
72
|
*/
|
|
78
73
|
assert(condition, ...optionalParams) {
|
|
79
74
|
// assert has the same log level as error
|
|
80
|
-
|
|
75
|
+
DefaultConsole.assert(condition, ...optionalParams);
|
|
81
76
|
return !condition;
|
|
82
77
|
}
|
|
83
78
|
}
|
package/tools/main.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export { default as GMFManager } from './auth/gmfmanager.js';
|
|
|
9
9
|
export { default as OpenIdConnectManager } from './auth/openidconnectmanager.js';
|
|
10
10
|
export { default as PluginManager } from './auth/pluginmanager.js';
|
|
11
11
|
export { default as ConfigManager } from './configuration/configmanager.js';
|
|
12
|
-
export type { HighlightMode } from './configuration/girafeconfig.js';
|
|
12
|
+
export type { HighlightMode, UserDataConfig } from './configuration/girafeconfig.js';
|
|
13
13
|
export { default as GirafeConfig } from './configuration/girafeconfig.js';
|
|
14
14
|
export { defaultNewsSanitizeConfig, defaultPermalinkSanitizeConfig, defaultQuerySanitizeConfig } from './configuration/sanitizeconfig-defaults.js';
|
|
15
15
|
export { default as GirafeContext } from './context/context.js';
|
|
16
|
+
export { default as ContextInitializationHelper } from './context/contexthelper.js';
|
|
16
17
|
export type { default as IGirafeContext } from './context/icontext.js';
|
|
17
18
|
export type { DrawingShape, ArrowStyle, ArrowPosition, LineStroke, MeasureInformation, SerializedFeature } from './drawing/drawingFeature.js';
|
|
18
19
|
export { default as DrawingFeature } from './drawing/drawingFeature.js';
|
|
@@ -40,6 +41,7 @@ export { default as SnapManager } from './layers/snapmanager.js';
|
|
|
40
41
|
export type { WMSLegendURLOptions } from './legendhelper.js';
|
|
41
42
|
export { default as LegendHelper } from './legendhelper.js';
|
|
42
43
|
export { default as LocalFileManager } from './localfile/localfilemanager.js';
|
|
44
|
+
export { default as DefaultConsole } from './logging/defaultconsole.js';
|
|
43
45
|
export { default as LogManager } from './logging/logmanager.js';
|
|
44
46
|
export { default as OfflineManager } from './offline/offlinemanager.js';
|
|
45
47
|
export { DEMO_LAYERS } from './ogcapi/demolayers.js';
|
package/tools/main.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as ConfigManager } from './configuration/configmanager.js';
|
|
|
12
12
|
export { default as GirafeConfig } from './configuration/girafeconfig.js';
|
|
13
13
|
export { defaultNewsSanitizeConfig, defaultPermalinkSanitizeConfig, defaultQuerySanitizeConfig } from './configuration/sanitizeconfig-defaults.js';
|
|
14
14
|
export { default as GirafeContext } from './context/context.js';
|
|
15
|
+
export { default as ContextInitializationHelper } from './context/contexthelper.js';
|
|
15
16
|
export { default as DrawingFeature } from './drawing/drawingFeature.js';
|
|
16
17
|
export { default as DrawingSerializer } from './drawing/drawingSerializer.js';
|
|
17
18
|
export { default as DrawingState } from './drawing/drawingState.js';
|
|
@@ -33,6 +34,7 @@ export { default as SimpleMaskManager } from './layers/simplemaskmanager.js';
|
|
|
33
34
|
export { default as SnapManager } from './layers/snapmanager.js';
|
|
34
35
|
export { default as LegendHelper } from './legendhelper.js';
|
|
35
36
|
export { default as LocalFileManager } from './localfile/localfilemanager.js';
|
|
37
|
+
export { default as DefaultConsole } from './logging/defaultconsole.js';
|
|
36
38
|
export { default as LogManager } from './logging/logmanager.js';
|
|
37
39
|
export { default as OfflineManager } from './offline/offlinemanager.js';
|
|
38
40
|
export { DEMO_LAYERS } from './ogcapi/demolayers.js';
|
|
@@ -15,19 +15,19 @@ declare class OfflineManager extends GirafeSingleton {
|
|
|
15
15
|
private readonly tilesStoreName;
|
|
16
16
|
private readonly bboxStoreName;
|
|
17
17
|
private readonly vectorLayer;
|
|
18
|
-
initializeSingleton(): void
|
|
18
|
+
initializeSingleton(): Promise<void>;
|
|
19
19
|
initializeOfflineState(isOffline: boolean): void;
|
|
20
20
|
private registerEvents;
|
|
21
21
|
/** Exports all the WMTS tiles for the layers in parameter and store them to local cache */
|
|
22
22
|
exportWMTSTiles(bbox: Extent, wmtsLayers: LayerWmts[], progressCallback?: CallableFunction): Promise<void>;
|
|
23
|
-
upgradeIndexedDb
|
|
23
|
+
private upgradeIndexedDb;
|
|
24
24
|
/** The offline manager works with a ServiceWorker in charge of intercepting
|
|
25
25
|
* the fetch requests and read the data from the local cache if the application
|
|
26
26
|
* is offline. This method defines the servicework object to use.
|
|
27
27
|
* Without this, the offline mode won't work.
|
|
28
28
|
*/
|
|
29
29
|
setServiceWorker(sw: ServiceWorker | null, storeVersion: number, dbCacheName: string): Promise<void>;
|
|
30
|
-
switchOffline(): void
|
|
30
|
+
switchOffline(): Promise<void>;
|
|
31
31
|
private getAllTileUrls;
|
|
32
32
|
private getTileUrlsForWmtsLayer;
|
|
33
33
|
private fetchAndSaveTiles;
|
|
@@ -35,7 +35,7 @@ class OfflineManager extends GirafeSingleton {
|
|
|
35
35
|
})
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
|
-
initializeSingleton() {
|
|
38
|
+
async initializeSingleton() {
|
|
39
39
|
this.map.addLayer(this.vectorLayer);
|
|
40
40
|
}
|
|
41
41
|
initializeOfflineState(isOffline) {
|
|
@@ -50,7 +50,7 @@ class OfflineManager extends GirafeSingleton {
|
|
|
50
50
|
this.state.isOffline = false;
|
|
51
51
|
});
|
|
52
52
|
this.context.stateManager.subscribe('isOffline', () => {
|
|
53
|
-
this.switchOffline();
|
|
53
|
+
void this.switchOffline();
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
/** Exports all the WMTS tiles for the layers in parameter and store them to local cache */
|
|
@@ -90,9 +90,9 @@ class OfflineManager extends GirafeSingleton {
|
|
|
90
90
|
tilesStoreName: this.tilesStoreName
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
switchOffline() {
|
|
93
|
+
async switchOffline() {
|
|
94
94
|
if (this.context.stateManager.state.isOffline) {
|
|
95
|
-
this.displayBoundBoxes();
|
|
95
|
+
await this.displayBoundBoxes();
|
|
96
96
|
}
|
|
97
97
|
else if (this.vectorLayer) {
|
|
98
98
|
this.vectorLayer.setSource(null);
|
|
@@ -231,11 +231,11 @@ class OfflineManager extends GirafeSingleton {
|
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
async clearTileStore() {
|
|
234
|
-
this.clearStore(this.tilesStoreName);
|
|
234
|
+
await this.clearStore(this.tilesStoreName);
|
|
235
235
|
}
|
|
236
236
|
async clearBBoxStore() {
|
|
237
237
|
this.vectorLayer.setSource(null);
|
|
238
|
-
this.clearStore(this.bboxStoreName);
|
|
238
|
+
await this.clearStore(this.bboxStoreName);
|
|
239
239
|
}
|
|
240
240
|
async saveBoundingBox(bbox) {
|
|
241
241
|
const database = await this.database();
|
|
@@ -13,7 +13,7 @@ import { OgcApiClientOptions } from './ogcapiclient.js';
|
|
|
13
13
|
export default class OgcApiFeaturesManager extends VendorSpecificOgcServerManager<OgcApiFeaturesClient, OgcApiClientOptions> {
|
|
14
14
|
protected get state(): import("../main.js").State;
|
|
15
15
|
getClientId(ogcServer: ServerOgc): string;
|
|
16
|
-
initializeSingleton(): void
|
|
16
|
+
initializeSingleton(): Promise<void>;
|
|
17
17
|
getSchema(layer: OapifLayer): Promise<OgcApiFeaturesSchema>;
|
|
18
18
|
getItems(layer: OapifLayer, crs?: string, bbox?: number[], limit?: number): Promise<Feature<Geometry>[]>;
|
|
19
19
|
getItem(layer: OapifLayer, featureId: string): Promise<Feature<Geometry> | undefined>;
|
|
@@ -14,7 +14,7 @@ export default class OgcApiFeaturesManager extends VendorSpecificOgcServerManage
|
|
|
14
14
|
getClientId(ogcServer) {
|
|
15
15
|
return ogcServer.urlOapif ?? '';
|
|
16
16
|
}
|
|
17
|
-
initializeSingleton() {
|
|
17
|
+
async initializeSingleton() {
|
|
18
18
|
// Register the clients
|
|
19
19
|
this.registerClientClass('default', OgcApiFeaturesClient);
|
|
20
20
|
this.registerClientClass('georama', OgcApiFeaturesClientGeorama);
|
|
@@ -8,7 +8,7 @@ export default class OnBoardingManager extends GirafeSingleton {
|
|
|
8
8
|
}
|
|
9
9
|
STORAGE_PATH = 'onboardingTourAlreadyDone';
|
|
10
10
|
async restart() {
|
|
11
|
-
this.context.userDataManager.saveUserData(this.STORAGE_PATH, 'false');
|
|
11
|
+
await this.context.userDataManager.saveUserData(this.STORAGE_PATH, 'false');
|
|
12
12
|
return this.start();
|
|
13
13
|
}
|
|
14
14
|
async start() {
|
|
@@ -17,13 +17,13 @@ export default class OnBoardingManager extends GirafeSingleton {
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
await this.context.i18nManager.ensureTranslationLoaded();
|
|
20
|
-
const tourAlreadyDone = this.context.userDataManager.getUserData(this.STORAGE_PATH) || 'false';
|
|
20
|
+
const tourAlreadyDone = (await this.context.userDataManager.getUserData(this.STORAGE_PATH)) || 'false';
|
|
21
21
|
if (tourAlreadyDone !== 'true') {
|
|
22
22
|
const onboardingDriver = driver({
|
|
23
23
|
popoverClass: 'girafe-onboarding-theme',
|
|
24
24
|
showProgress: true,
|
|
25
|
-
onDestroyed: (_element, _step, _options) => {
|
|
26
|
-
this.context.userDataManager.saveUserData(this.STORAGE_PATH, 'true');
|
|
25
|
+
onDestroyed: async (_element, _step, _options) => {
|
|
26
|
+
await this.context.userDataManager.saveUserData(this.STORAGE_PATH, 'true');
|
|
27
27
|
},
|
|
28
28
|
nextBtnText: this.context.i18nManager.getTranslation('onboarding-next-button-text'),
|
|
29
29
|
prevBtnText: this.context.i18nManager.getTranslation('onboarding-previous-button-text'),
|
package/tools/resizewindow.js
CHANGED
|
@@ -108,12 +108,12 @@ export default class ResizeWindow {
|
|
|
108
108
|
this.width = dimension.width;
|
|
109
109
|
this.height = dimension.height;
|
|
110
110
|
const css = getComputedStyle(this.host);
|
|
111
|
-
this.minHeight = parseInt(css.minHeight) || 0;
|
|
112
|
-
this.maxHeight = parseInt(css.maxHeight) || Infinity;
|
|
113
|
-
this.minWidth = parseInt(css.minWidth) || 0;
|
|
114
|
-
this.maxWidth = parseInt(css.maxWidth) || Infinity;
|
|
115
|
-
this.top = parseInt(css.top) || 0;
|
|
116
|
-
this.left = parseInt(css.left) || 0;
|
|
111
|
+
this.minHeight = Number.parseInt(css.minHeight) || 0;
|
|
112
|
+
this.maxHeight = Number.parseInt(css.maxHeight) || Infinity;
|
|
113
|
+
this.minWidth = Number.parseInt(css.minWidth) || 0;
|
|
114
|
+
this.maxWidth = Number.parseInt(css.maxWidth) || Infinity;
|
|
115
|
+
this.top = Number.parseInt(css.top) || 0;
|
|
116
|
+
this.left = Number.parseInt(css.left) || 0;
|
|
117
117
|
// Call a function whenever the cursor moves.
|
|
118
118
|
document.onmousemove = (dragEvent) => this.resize(dragEvent, direction);
|
|
119
119
|
// Detach events.
|
|
@@ -26,7 +26,7 @@ declare abstract class AbstractSearchClient extends GirafeSingleton {
|
|
|
26
26
|
[x: string]: any;
|
|
27
27
|
}>>;
|
|
28
28
|
protected constructor(context: IGirafeContext, config: BaseSearchClientConfig);
|
|
29
|
-
initializeSingleton(): void
|
|
29
|
+
initializeSingleton(): Promise<void>;
|
|
30
30
|
protected get mapProjection(): import("ol/proj.js").Projection;
|
|
31
31
|
/**
|
|
32
32
|
* Sanitize the url by removing placeholders that are wrongfully interpreted as URL fragments by the URL parser.
|
|
@@ -25,8 +25,8 @@ class AbstractSearchClient extends GirafeSingleton {
|
|
|
25
25
|
this.url = this.sanitizeUrl(config.url);
|
|
26
26
|
this.resultSrid = config.resultSrid;
|
|
27
27
|
}
|
|
28
|
-
initializeSingleton() {
|
|
29
|
-
super.initializeSingleton();
|
|
28
|
+
async initializeSingleton() {
|
|
29
|
+
await super.initializeSingleton();
|
|
30
30
|
}
|
|
31
31
|
get mapProjection() {
|
|
32
32
|
return this.context.mapManager.getMap().getView().getProjection();
|
|
@@ -18,7 +18,7 @@ declare class SearchManager extends GirafeSingleton {
|
|
|
18
18
|
private defaultMaxExtent?;
|
|
19
19
|
readonly minSearchTermLength = 3;
|
|
20
20
|
constructor(context: IGirafeContext);
|
|
21
|
-
initializeSingleton(): void
|
|
21
|
+
initializeSingleton(): Promise<void>;
|
|
22
22
|
protected createClient(providerConfig: SearchProviderConfig): void;
|
|
23
23
|
/**
|
|
24
24
|
* Returns available search categories per provider.
|
|
@@ -16,8 +16,8 @@ class SearchManager extends GirafeSingleton {
|
|
|
16
16
|
constructor(context) {
|
|
17
17
|
super(context);
|
|
18
18
|
}
|
|
19
|
-
initializeSingleton() {
|
|
20
|
-
super.initializeSingleton();
|
|
19
|
+
async initializeSingleton() {
|
|
20
|
+
await super.initializeSingleton();
|
|
21
21
|
for (const providerConfig of this.context.configManager.Config.search?.providers ?? []) {
|
|
22
22
|
this.createClient(providerConfig);
|
|
23
23
|
}
|
|
@@ -8,7 +8,7 @@ import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectionManager extends GirafeSingleton {
|
|
10
10
|
private get state();
|
|
11
|
-
initializeSingleton(): void
|
|
11
|
+
initializeSingleton(): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Selects all the features of the queryable layers that are inside the given extent.
|
|
14
14
|
* Layers selectable today are WMS, WMTS (with wms layer) and Local files.
|
|
@@ -13,7 +13,7 @@ export default class SelectionManager extends GirafeSingleton {
|
|
|
13
13
|
get state() {
|
|
14
14
|
return this.context.stateManager.state;
|
|
15
15
|
}
|
|
16
|
-
initializeSingleton() {
|
|
16
|
+
async initializeSingleton() {
|
|
17
17
|
this.context.stateManager.subscribe('selection.selectionParameters', (_, newParams) => {
|
|
18
18
|
// The querying is asynchronous and nobody awaits it here,
|
|
19
19
|
// so a failing request must not end up in an unhandled rejection.
|
|
@@ -2,7 +2,7 @@ import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
|
2
2
|
import ISessionManager from './isessionmanager.js';
|
|
3
3
|
declare class SessionManager extends GirafeSingleton implements ISessionManager {
|
|
4
4
|
private readonly sessionHash;
|
|
5
|
-
initializeSingleton(): void
|
|
5
|
+
initializeSingleton(): Promise<void>;
|
|
6
6
|
beginSession(): void;
|
|
7
7
|
saveStateToSession(): void;
|
|
8
8
|
hasState(): boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
3
3
|
class SessionManager extends GirafeSingleton {
|
|
4
4
|
sessionHash = 'session';
|
|
5
|
-
initializeSingleton() {
|
|
5
|
+
async initializeSingleton() {
|
|
6
6
|
window.addEventListener('pagehide', () => this.saveStateToSession());
|
|
7
7
|
}
|
|
8
8
|
beginSession() {
|
|
@@ -3,7 +3,7 @@ import { IUrlShortener } from './iurlshortener.js';
|
|
|
3
3
|
declare class ShareManager extends GirafeSingleton {
|
|
4
4
|
private urlShortener?;
|
|
5
5
|
get UrlShortener(): IUrlShortener | undefined;
|
|
6
|
-
initializeSingleton(): void
|
|
6
|
+
initializeSingleton(): Promise<void>;
|
|
7
7
|
getStateToShare(): string;
|
|
8
8
|
hasSharedState(): boolean;
|
|
9
9
|
private getStateFromUrl;
|
|
@@ -2,7 +2,7 @@ import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
|
2
2
|
import { Constructor, IBrainSerializer } from '../state/brain/serialize.js';
|
|
3
3
|
declare class StateSerializer extends GirafeSingleton {
|
|
4
4
|
private readonly brainSerializer;
|
|
5
|
-
initializeSingleton(): void
|
|
5
|
+
initializeSingleton(): Promise<void>;
|
|
6
6
|
addSerializer(type: Constructor<object>, serializerData: IBrainSerializer<object>): void;
|
|
7
7
|
getSerializedState(): string;
|
|
8
8
|
deserializeAndSetState(compressedState: string): boolean;
|
|
@@ -17,7 +17,7 @@ import LayoutState from '../state/layout.js';
|
|
|
17
17
|
import LayoutSerializer from './serializers/layoutserializer.js';
|
|
18
18
|
class StateSerializer extends GirafeSingleton {
|
|
19
19
|
brainSerializer = new BrainSerializer();
|
|
20
|
-
initializeSingleton() {
|
|
20
|
+
async initializeSingleton() {
|
|
21
21
|
this.addSerializer((Array), new ActiveBasemapsSerializer(this.context));
|
|
22
22
|
this.addSerializer(MapPosition, new MapPositionSerializer(this.context));
|
|
23
23
|
this.addSerializer(LayersConfig, new LayersConfigSerializer(this.context));
|
|
@@ -8,7 +8,7 @@ declare class StateManager extends GirafeSingleton {
|
|
|
8
8
|
get state(): State;
|
|
9
9
|
private readonly callbacks;
|
|
10
10
|
constructor(context: IGirafeContext);
|
|
11
|
-
initializeSingleton(): void
|
|
11
|
+
initializeSingleton(): Promise<void>;
|
|
12
12
|
private setDefaultValues;
|
|
13
13
|
private setDefaultLayout;
|
|
14
14
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserDataConfig } from '../configuration/girafeconfig';
|
|
1
2
|
export declare const MockConfig: {
|
|
2
3
|
general: {
|
|
3
4
|
locale: string;
|
|
@@ -58,9 +59,7 @@ export declare const MockConfig: {
|
|
|
58
59
|
lidar: {
|
|
59
60
|
url: string;
|
|
60
61
|
};
|
|
61
|
-
userdata:
|
|
62
|
-
source: string;
|
|
63
|
-
};
|
|
62
|
+
userdata: UserDataConfig;
|
|
64
63
|
crs: {
|
|
65
64
|
code: string;
|
|
66
65
|
definition: string;
|
|
@@ -46,8 +46,8 @@ export default class MockGirafeContext implements IGirafeContext {
|
|
|
46
46
|
readonly themesManager: ThemesManager;
|
|
47
47
|
readonly themesHelper: ThemesHelper;
|
|
48
48
|
readonly permalinkManager: PermalinkManager;
|
|
49
|
-
readonly urlManager: UrlManager;
|
|
50
49
|
readonly dragManager: DragManager;
|
|
50
|
+
readonly urlManager: UrlManager;
|
|
51
51
|
readonly layerManager: LayerManager;
|
|
52
52
|
readonly sessionManager: SessionManager;
|
|
53
53
|
readonly stateSerializer: StateSerializer;
|
|
@@ -72,6 +72,18 @@ export default class MockGirafeContext implements IGirafeContext {
|
|
|
72
72
|
readonly themeFavoritesManager: ThemeFavoritesManager;
|
|
73
73
|
readonly searchManager: SearchManager;
|
|
74
74
|
readonly feedbackManager: FeedbackManager;
|
|
75
|
+
private readonly contextHelper;
|
|
75
76
|
constructor();
|
|
76
77
|
initialize(): Promise<void>;
|
|
78
|
+
/** The context can contains hook methods that will be called after each manager initialization.
|
|
79
|
+
* The hook method must be named with the property name + the "Hook" suffix.
|
|
80
|
+
* The hook method must be async and will be awaited
|
|
81
|
+
* For example, the methods themesManagerHook() will be called immediately after
|
|
82
|
+
* the call of themesManager.initializeSingleton().
|
|
83
|
+
* This allows specific initialization methods when defining custom contexts
|
|
84
|
+
* (for example for the apiContext, the mockContext, or any customContext)
|
|
85
|
+
*/
|
|
86
|
+
protected userDataManagerHook(): Promise<void>;
|
|
87
|
+
protected configManagerHook(): Promise<void>;
|
|
88
|
+
protected i18nManagerHook(): Promise<void>;
|
|
77
89
|
}
|