@geogirafe/lib-geoportal 1.2.0-dev.2857870396 → 1.2.0-dev.2858535198
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/CONTRIBUTING.md +1 -0
- package/components/contact/component.d.ts +2 -0
- package/components/contact/component.js +17 -4
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/auth/authmanager.js +6 -1
- package/tools/auth/gmfmanager.d.ts +1 -0
- package/tools/auth/gmfmanager.js +9 -0
- package/tools/configuration/girafeconfig.d.ts +1 -0
- package/tools/configuration/girafeconfig.js +1 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -104,6 +104,7 @@ A big thank to all the contributors of GeoGirafe, in alphabetical order:
|
|
|
104
104
|
- Jonathan Lurie @jonathanlurie (Camptocamp SA)
|
|
105
105
|
- Karsten Deininger @kdeininger (Geoinformation Basel-Landschaft)
|
|
106
106
|
- Laurent Lienher @llienher (JaquierPointet SA)
|
|
107
|
+
- Livio Bätscher @LivioBae (Geoinformation Basel-Stadt)
|
|
107
108
|
- Loris Hubler @lhubler (Geoinformation Basel-Stadt)
|
|
108
109
|
- Lucie Nicolier @lucienicolier (JaquierPointet SA)
|
|
109
110
|
- Matthew Parkan @matthew.parkan (SITN Neuchâtel)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
|
|
2
2
|
import IGirafePanel from '../../tools/state/igirafepanel.js';
|
|
3
|
+
import { IUrlShortener } from '../../tools/share/iurlshortener.js';
|
|
3
4
|
declare class ContactComponent extends GirafeHTMLElement implements IGirafePanel {
|
|
4
5
|
protected templateUrl: string | null;
|
|
5
6
|
protected styleUrls: string[] | null;
|
|
@@ -10,6 +11,7 @@ declare class ContactComponent extends GirafeHTMLElement implements IGirafePanel
|
|
|
10
11
|
shortUrl: string;
|
|
11
12
|
constructor();
|
|
12
13
|
togglePanel(visible: boolean): void;
|
|
14
|
+
get urlShortener(): IUrlShortener | undefined;
|
|
13
15
|
private getCurrentStateUrl;
|
|
14
16
|
sendMessage(): Promise<void>;
|
|
15
17
|
render(): void;
|
|
@@ -23,15 +23,28 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
23
23
|
}
|
|
24
24
|
togglePanel(visible) {
|
|
25
25
|
this.isPanelVisible = visible;
|
|
26
|
+
this.render();
|
|
26
27
|
if (visible) {
|
|
27
|
-
this.
|
|
28
|
+
this.getCurrentStateUrl().then((url) => {
|
|
29
|
+
this.shortUrl = url;
|
|
30
|
+
this.refreshRender();
|
|
31
|
+
});
|
|
28
32
|
}
|
|
29
|
-
this.render();
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
get urlShortener() {
|
|
35
|
+
return this.context.shareManager.UrlShortener;
|
|
36
|
+
}
|
|
37
|
+
async getCurrentStateUrl() {
|
|
32
38
|
const baseUrl = this.context.urlManager.getBaseUrlPath();
|
|
33
39
|
const hash = this.context.shareManager.getStateToShare();
|
|
34
|
-
|
|
40
|
+
const longurl = `${baseUrl}#${hash}`;
|
|
41
|
+
// Fallback if shortner is unavailable
|
|
42
|
+
if (!this.urlShortener) {
|
|
43
|
+
return longurl;
|
|
44
|
+
}
|
|
45
|
+
// Get short URL
|
|
46
|
+
const response = await this.urlShortener.shortenUrl(longurl);
|
|
47
|
+
return response.shorturl;
|
|
35
48
|
}
|
|
36
49
|
async sendMessage() {
|
|
37
50
|
const email = this.shadow.getElementById('email').value;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.2.0-dev.
|
|
1
|
+
{"version":"1.2.0-dev.2858535198", "build":"2858535198", "date":"17/09/2026"}
|
|
@@ -95,7 +95,12 @@ export default class AuthManager extends GirafeSingleton {
|
|
|
95
95
|
this.state.oauth.status = 'loginFailed';
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
else if (this.state.oauth.status === 'loggedIn'
|
|
98
|
+
else if (this.state.oauth.status === 'loggedIn') {
|
|
99
|
+
this.issuerManager.finalizeLoginWorkflow();
|
|
100
|
+
}
|
|
101
|
+
else if (this.state.oauth.status === 'loggedOut') {
|
|
102
|
+
// Get the anonymous rights
|
|
103
|
+
await this.gmfManager.getAnonymousUserInfo();
|
|
99
104
|
this.issuerManager.finalizeLoginWorkflow();
|
|
100
105
|
}
|
|
101
106
|
else if (this.state.oauth.status === 'loginFailed') {
|
package/tools/auth/gmfmanager.js
CHANGED
|
@@ -61,4 +61,13 @@ export default class GMFManager {
|
|
|
61
61
|
const userInfoUrl = this.isOAuth ? this.gmfConfigForOAuth.userInfoUrl : `${this.gmfConfigForGmfAuth.url}loginuser`;
|
|
62
62
|
this.state.oauth.userInfo = await fetch(userInfoUrl).then((r) => r.json());
|
|
63
63
|
}
|
|
64
|
+
async getAnonymousUserInfo() {
|
|
65
|
+
console.debug('Auth: 3. Get Anonymous UserInfo');
|
|
66
|
+
const anonymousUserInfoUrl = this.isOAuth
|
|
67
|
+
? this.gmfConfigForOAuth.anonymousUserInfoUrl
|
|
68
|
+
: `${this.gmfConfigForGmfAuth.url}loginuser`;
|
|
69
|
+
if (anonymousUserInfoUrl) {
|
|
70
|
+
this.state.oauth.userInfo = await fetch(anonymousUserInfoUrl).then((r) => r.json());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
64
73
|
}
|
|
@@ -450,6 +450,7 @@ class GirafeConfig {
|
|
|
450
450
|
};
|
|
451
451
|
const geomapfishConfig = {
|
|
452
452
|
userInfoUrl: config.oauth.geomapfish.userInfoUrl,
|
|
453
|
+
anonymousUserInfoUrl: config.oauth.geomapfish.anonymousUserInfoUrl,
|
|
453
454
|
loginUrl: config.oauth.geomapfish.loginUrl,
|
|
454
455
|
logoutUrl: config.oauth.geomapfish.logoutUrl,
|
|
455
456
|
anonymousUsername: config.oauth.geomapfish.anonymousUsername,
|