@geogirafe/lib-geoportal 1.1.0-dev.2387914979 → 1.1.0-dev.2398428535

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geomapfish.dev"
7
7
  },
8
- "version": "1.1.0-dev.2387914979",
8
+ "version": "1.1.0-dev.2398428535",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2387914979", "build":"2387914979", "date":"16/03/2026"}
1
+ {"version":"1.1.0-dev.2398428535", "build":"2398428535", "date":"20/03/2026"}
@@ -68,6 +68,7 @@ export default class GeoGirafeApp {
68
68
  await this.initializeServiceWorker();
69
69
  this.initializeInterface();
70
70
  this.addCustomSerializers();
71
+ this.context.stateManager.state.application.isCustomSerializerInitialized = true;
71
72
  this.defineCoreComponents();
72
73
  this.resolveReady();
73
74
  }
@@ -85,7 +86,6 @@ export default class GeoGirafeApp {
85
86
  }
86
87
  addCustomSerializers() {
87
88
  // Add custom state and serializers (need to be done early, because the shared state will need them)
88
- // TODO REG : Is this not done too late ? We need to check this, perhaps it shouol dbe done before the intialization of the share
89
89
  this.context.stateManager.state.extendedState.drawing = new DrawingState();
90
90
  this.context.stateSerializer.addSerializer(DrawingState, new DrawingSerializer(this.context));
91
91
  this.context.stateManager.state.extendedState.share = new ShareState();
@@ -3,6 +3,13 @@ export default class ApplicationLifeCycleManager extends GirafeSingleton {
3
3
  private get state();
4
4
  initializeSingleton(): void;
5
5
  private log;
6
+ /**
7
+ * For the application to be ready to load the themes and to deserialize the shared state or the session,
8
+ * The following elements must have been prepared:
9
+ * - Custom Serializer
10
+ * - OAuth process done
11
+ */
12
+ private checkReadyToLoadThemes;
6
13
  /**
7
14
  * For the application to be ready for usage, following elements must have been loaded:
8
15
  * - Configuration (config.json)
@@ -26,6 +26,12 @@ export default class ApplicationLifeCycleManager extends GirafeSingleton {
26
26
  });
27
27
  this.context.stateManager.subscribe('application.isAuthInitialized', (_, isAuthInitialized) => {
28
28
  this.log(isAuthInitialized, 'Authentication has been initialized');
29
+ this.checkReadyToLoadThemes();
30
+ this.checkApplicationReady();
31
+ });
32
+ this.context.stateManager.subscribe('application.isCustomSerializerInitialized', (_, isCustomSerializerInitialized) => {
33
+ this.log(isCustomSerializerInitialized, 'Custom Serializers have been initialized');
34
+ this.checkReadyToLoadThemes();
29
35
  this.checkApplicationReady();
30
36
  });
31
37
  }
@@ -34,6 +40,18 @@ export default class ApplicationLifeCycleManager extends GirafeSingleton {
34
40
  console.info(`ApplicationLifeCycle: ${text}`);
35
41
  }
36
42
  }
43
+ /**
44
+ * For the application to be ready to load the themes and to deserialize the shared state or the session,
45
+ * The following elements must have been prepared:
46
+ * - Custom Serializer
47
+ * - OAuth process done
48
+ */
49
+ checkReadyToLoadThemes() {
50
+ const isReady = this.state.application.isAuthInitialized && this.state.application.isCustomSerializerInitialized;
51
+ if (isReady) {
52
+ this.state.application.isReadyToLoadThemes = true;
53
+ }
54
+ }
37
55
  /**
38
56
  * For the application to be ready for usage, following elements must have been loaded:
39
57
  * - Configuration (config.json)
@@ -48,7 +66,8 @@ export default class ApplicationLifeCycleManager extends GirafeSingleton {
48
66
  !this.state.projection ||
49
67
  !this.state.position.resolution ||
50
68
  !this.state.application.isStateInitialized ||
51
- !this.state.application.isAuthInitialized) {
69
+ !this.state.application.isAuthInitialized ||
70
+ !this.state.application.isCustomSerializerInitialized) {
52
71
  isReady = false;
53
72
  }
54
73
  if (isReady) {
@@ -102,6 +102,8 @@ export default class State {
102
102
  isConfigurationLoaded: boolean;
103
103
  isAuthInitialized: boolean;
104
104
  isStateInitialized: boolean;
105
+ isCustomSerializerInitialized: boolean;
106
+ isReadyToLoadThemes: boolean;
105
107
  isReady: boolean;
106
108
  };
107
109
  position: MapPosition;
@@ -59,6 +59,10 @@ export default class State {
59
59
  isAuthInitialized: false,
60
60
  // This doesn't mean that a shared state was loaded, just that the processed is finished
61
61
  isStateInitialized: false,
62
+ // Cutom serializer are ready. There are important for desirializing the shared state or the current session
63
+ isCustomSerializerInitialized: false,
64
+ // When isAuthInitialized and isCustomSerializerInitialized, then we are ready to load themes
65
+ isReadyToLoadThemes: false,
62
66
  // Everything needed by GeoGirafe to work properly has been loaded
63
67
  isReady: false
64
68
  };
@@ -22,8 +22,8 @@ class ThemesManager extends GirafeSingleton {
22
22
  }
23
23
  initializeSingleton() {
24
24
  // We have to wait the authentication to be able to load the themes with the right user-rights
25
- this.context.stateManager.subscribe('application.isAuthInitialized', async () => {
26
- if (this.state.application.isAuthInitialized) {
25
+ this.context.stateManager.subscribe('application.isReadyToLoadThemes', async () => {
26
+ if (this.state.application.isReadyToLoadThemes) {
27
27
  await this.initialize();
28
28
  }
29
29
  });