@geogirafe/lib-geoportal 1.1.0-dev.2623495582 → 1.1.0-dev.2628335916

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.
@@ -57,9 +57,13 @@ declare class PrintComponent extends GirafeHTMLElement implements IGirafePanel {
57
57
  */
58
58
  onLayoutChanged(event: KeyboardEvent): void;
59
59
  /**
60
- * Set selected scale in the state and update the mask.
60
+ * Set the selected scale in the state and update the mask.
61
61
  */
62
62
  onScaleChanged(event: KeyboardEvent): void;
63
+ /**
64
+ * On pressing enter take the value from the event target (input)
65
+ * and set the selected scale in the state and update the mask.
66
+ */
63
67
  onCustomScaleTyped(evt: KeyboardEvent): void;
64
68
  /**
65
69
  * @Returns the current print scale.
@@ -113,10 +113,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
113
113
  this.render();
114
114
  }
115
115
  /**
116
- * Set selected scale in the state and update the mask.
116
+ * Set the selected scale in the state and update the mask.
117
117
  */
118
118
  onScaleChanged(event) {
119
- this.printMaskManager?.setManuallySelectedScale(false);
120
119
  if (this.context.configManager.Config.print?.customScale) {
121
120
  if (event.target?.value === 'custom') {
122
121
  this.showCustomScale = true;
@@ -128,19 +127,19 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
128
127
  }
129
128
  this.state.print.scale = parseInt(event.target?.value);
130
129
  this.printMaskManager?.zoomToScale(this.state.print.scale);
131
- this.printMaskManager?.setManuallySelectedScale(false);
132
130
  }
131
+ /**
132
+ * On pressing enter take the value from the event target (input)
133
+ * and set the selected scale in the state and update the mask.
134
+ */
133
135
  onCustomScaleTyped(evt) {
134
- // Only when the user presses the Enter key.
135
- if (evt.key === 'Enter') {
136
- const value = parseInt(evt.target?.value);
137
- if (value) {
138
- this.state.print.scale = value;
139
- this.printMaskManager?.zoomToScale(this.state.print.scale);
140
- this.render();
141
- this.printMaskManager?.setManuallySelectedScale(true);
142
- }
136
+ const value = parseInt(evt.target?.value);
137
+ if (evt.key !== 'Enter' || !value) {
138
+ return;
143
139
  }
140
+ this.state.print.scale = value;
141
+ this.printMaskManager?.zoomToScale(this.state.print.scale);
142
+ this.render();
144
143
  }
145
144
  /**
146
145
  * @Returns the current print scale.
@@ -10,12 +10,12 @@ declare class PrintMaskManager {
10
10
  private readonly printMaskLayer;
11
11
  private readonly map;
12
12
  private readonly eventsCallbacks;
13
+ private readonly olEventsKeys;
13
14
  private possibleScales;
14
- scaleManuallySelected: boolean;
15
+ private scaleManuallySelected;
15
16
  constructor(map: Map, stateManager: StateManager);
16
17
  private get state();
17
18
  destroy(): void;
18
- setManuallySelectedScale(value: boolean): void;
19
19
  /**
20
20
  * Sets the possible scales to fit the mask/view to.
21
21
  */
@@ -25,7 +25,9 @@ declare class PrintMaskManager {
25
25
  */
26
26
  zoomToScale(scale: number): void;
27
27
  /**
28
- * Register the events for printing pageSize and mask visibility changes.
28
+ * Register the events for:
29
+ * - printing pageSize and mask visibility changes.
30
+ * - set scaleManuallySelected to false when the resolution changes.
29
31
  */
30
32
  private registerEvents;
31
33
  /**
@@ -1,6 +1,7 @@
1
1
  import PrintMaskLayer from './printMaskLayer.js';
2
2
  import GeoConsts from '../../../tools/geoconsts.js';
3
3
  import { getOlayerByName } from '../../../tools/utils/olutils.js';
4
+ import { unByKey } from 'ol/Observable.js';
4
5
  const PRINT_MASK_LAYER_NAME = 'PrintMask';
5
6
  /**
6
7
  * Independent manager to display a mask layer adapted to the print.
@@ -11,6 +12,7 @@ class PrintMaskManager {
11
12
  printMaskLayer = new PrintMaskLayer({ name: PRINT_MASK_LAYER_NAME });
12
13
  map;
13
14
  eventsCallbacks = [];
15
+ olEventsKeys = [];
14
16
  possibleScales = [];
15
17
  scaleManuallySelected = false;
16
18
  constructor(map, stateManager) {
@@ -25,12 +27,11 @@ class PrintMaskManager {
25
27
  destroy() {
26
28
  this.stateManager.unsubscribe(this.eventsCallbacks);
27
29
  this.eventsCallbacks.length = 0;
30
+ unByKey(this.olEventsKeys);
31
+ this.olEventsKeys.length = 0;
28
32
  this.state.print.maskVisible = false;
29
33
  this.onPrintMaskVisibleChanged();
30
34
  }
31
- setManuallySelectedScale(value) {
32
- this.scaleManuallySelected = value;
33
- }
34
35
  /**
35
36
  * Sets the possible scales to fit the mask/view to.
36
37
  */
@@ -44,16 +45,27 @@ class PrintMaskManager {
44
45
  const mapSize = this.map.getSize() ?? [0, 0];
45
46
  const printMapSize = this.state.print.pageSize ?? [0, 0];
46
47
  const resolution = PrintMaskManager.getOptimalResolution(mapSize, printMapSize, scale);
47
- this.map.getView().setResolution(resolution);
48
+ const constraintRes = this.map.getView().getConstraints().resolution(resolution, 1, mapSize, undefined);
49
+ // Set the resolution (this emits the change:resolution event).
50
+ this.map.getView().setResolution(constraintRes);
51
+ // After the change:resolution event, force the map to render at the next key frame with
52
+ // scaleManuallySelected to true.
53
+ this.map.render();
54
+ this.scaleManuallySelected = true;
48
55
  }
49
56
  /**
50
- * Register the events for printing pageSize and mask visibility changes.
57
+ * Register the events for:
58
+ * - printing pageSize and mask visibility changes.
59
+ * - set scaleManuallySelected to false when the resolution changes.
51
60
  */
52
61
  registerEvents() {
53
62
  this.eventsCallbacks.push(...[
54
63
  this.stateManager.subscribe('print.pageSize', () => this.onPrintFormatChanged()),
55
64
  this.stateManager.subscribe('print.maskVisible', () => this.onPrintMaskVisibleChanged())
56
65
  ]);
66
+ this.olEventsKeys.push(this.map.getView().on('change:resolution', () => {
67
+ this.scaleManuallySelected = false;
68
+ }));
57
69
  }
58
70
  /**
59
71
  * Sets the print.scale value.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.1.0-dev.2623495582",
8
+ "version": "1.1.0-dev.2628335916",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2623495582", "build":"2623495582", "date":"23/06/2026"}
1
+ {"version":"1.1.0-dev.2628335916", "build":"2628335916", "date":"25/06/2026"}
@@ -88,7 +88,16 @@ export default class OpenIdConnectManager extends AbstractConnectManager {
88
88
  authorizationUrl.searchParams.set('code_challenge', code_challenge);
89
89
  authorizationUrl.searchParams.set('code_challenge_method', this.issuerConfig.codeChallengeMethod);
90
90
  if (silent) {
91
- authorizationUrl.searchParams.set('prompt', 'none');
91
+ // Add custom parameters for silent login
92
+ for (const [key, value] of Object.entries(this.issuerConfig.customSilentLoginParams)) {
93
+ authorizationUrl.searchParams.set(key, value);
94
+ }
95
+ }
96
+ else {
97
+ // Add custom parameters for login
98
+ for (const [key, value] of Object.entries(this.issuerConfig.customLoginParams)) {
99
+ authorizationUrl.searchParams.set(key, value);
100
+ }
92
101
  }
93
102
  return authorizationUrl;
94
103
  }
@@ -216,6 +216,12 @@ declare class GirafeConfig {
216
216
  audience: string[];
217
217
  audienceExcludedPaths: string[];
218
218
  alwaysSendCookies: boolean;
219
+ customSilentLoginParams: {
220
+ [key: string]: string;
221
+ };
222
+ customLoginParams: {
223
+ [key: string]: string;
224
+ };
219
225
  };
220
226
  geomapfish: {
221
227
  userInfoUrl: string;
@@ -408,7 +408,9 @@ class GirafeConfig {
408
408
  checkSessionOnLoad: config.oauth.issuer.checkSessionOnLoad ?? false,
409
409
  audience: config.oauth.issuer.audience,
410
410
  audienceExcludedPaths: config.oauth.issuer.audienceExcludedPaths ?? [],
411
- alwaysSendCookies: config.oauth.issuer.alwaysSendCookies ?? false
411
+ alwaysSendCookies: config.oauth.issuer.alwaysSendCookies ?? false,
412
+ customSilentLoginParams: config.oauth.issuer.customSilentLoginParams ?? {},
413
+ customLoginParams: config.oauth.issuer.customLoginParams ?? {}
412
414
  };
413
415
  const geomapfishConfig = {
414
416
  userInfoUrl: config.oauth.geomapfish.userInfoUrl,