@geogirafe/lib-geoportal 1.1.0-dev.2636580374 → 1.1.0-dev.2640619249
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/components/share/component.js +3 -5
- package/components/share/tools/geogirafesharemanager.d.ts +1 -1
- package/components/share/tools/geogirafesharemanager.js +3 -3
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/configuration/girafeconfig.d.ts +1 -0
- package/tools/configuration/girafeconfig.js +2 -1
|
@@ -153,12 +153,10 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
153
153
|
}
|
|
154
154
|
this.awaitingIframeUrl = true;
|
|
155
155
|
this.refreshRender();
|
|
156
|
-
const
|
|
156
|
+
const iframeBaseUrl = this.context.configManager.Config.share?.iframeBaseUrl ?? `${this.context.urlManager.getRootUrl()}iframe.html`;
|
|
157
157
|
const hash = this.context.shareManager.getStateToShare();
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
const longIframeUrl = `${baseUrl}${indexDocument}#${hash}`;
|
|
161
|
-
const response = await this.urlShortener.shortenUrl(longIframeUrl, indexDocument);
|
|
158
|
+
const longIframeUrl = `${iframeBaseUrl}#${hash}`;
|
|
159
|
+
const response = await this.urlShortener.shortenUrl(longIframeUrl, iframeBaseUrl);
|
|
162
160
|
this.iframeUrl = response.shorturl;
|
|
163
161
|
this.iframeCode = `<iframe title="iframe GeoGirafe" width="${this.iframeWidth}" height="${this.iframeHeight}" src="${this.iframeUrl}"></iframe>`;
|
|
164
162
|
this.awaitingIframeUrl = false;
|
|
@@ -4,6 +4,6 @@ declare class GeoGirafeShareManager implements IUrlShortener {
|
|
|
4
4
|
private readonly serviceUrl;
|
|
5
5
|
private readonly urlManager;
|
|
6
6
|
constructor(serviceUrl: string, urlManager: UrlManager);
|
|
7
|
-
shortenUrl(longUrl: string,
|
|
7
|
+
shortenUrl(longUrl: string, forcedBaseUrl?: string): Promise<UrlShortenerResponse>;
|
|
8
8
|
}
|
|
9
9
|
export default GeoGirafeShareManager;
|
|
@@ -6,7 +6,7 @@ class GeoGirafeShareManager {
|
|
|
6
6
|
this.serviceUrl = serviceUrl;
|
|
7
7
|
this.urlManager = urlManager;
|
|
8
8
|
}
|
|
9
|
-
async shortenUrl(longUrl,
|
|
9
|
+
async shortenUrl(longUrl, forcedBaseUrl) {
|
|
10
10
|
const errorResponse = {
|
|
11
11
|
success: false,
|
|
12
12
|
shorturl: longUrl
|
|
@@ -23,9 +23,9 @@ class GeoGirafeShareManager {
|
|
|
23
23
|
});
|
|
24
24
|
const response_data = (await response.json());
|
|
25
25
|
if (response_data) {
|
|
26
|
-
const baseUrl = this.urlManager.getBaseUrlPath();
|
|
26
|
+
const baseUrl = forcedBaseUrl ?? this.urlManager.getBaseUrlPath();
|
|
27
27
|
const hash = response_data.short_url.split('/').pop();
|
|
28
|
-
const shortUrl = `${baseUrl}
|
|
28
|
+
const shortUrl = `${baseUrl}#gg-${hash}`;
|
|
29
29
|
const qrcode = await generateQrCode(shortUrl);
|
|
30
30
|
return {
|
|
31
31
|
success: true,
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1.0-dev.
|
|
1
|
+
{"version":"1.1.0-dev.2640619249", "build":"2640619249", "date":"30/06/2026"}
|
|
@@ -185,7 +185,8 @@ class GirafeConfig {
|
|
|
185
185
|
service: config.share?.service ?? 'gmf',
|
|
186
186
|
preferNames: config.share?.preferNames ?? false,
|
|
187
187
|
createUrl: config.share?.createUrl,
|
|
188
|
-
getUrl: config.share?.getUrl
|
|
188
|
+
getUrl: config.share?.getUrl,
|
|
189
|
+
iframeBaseUrl: config.share?.iframeBaseUrl
|
|
189
190
|
};
|
|
190
191
|
}
|
|
191
192
|
initConfigSelection(config) {
|