diff --git a/web/client/components/resources/enhancers/__tests__/withShareTool-test.js b/web/client/components/resources/enhancers/__tests__/withShareTool-test.js index d8409f93b6..540b1c87ed 100644 --- a/web/client/components/resources/enhancers/__tests__/withShareTool-test.js +++ b/web/client/components/resources/enhancers/__tests__/withShareTool-test.js @@ -49,7 +49,7 @@ describe('withShareTool enhancer', () => { expect(sharePanel).toExist('Share panel doesn\'t exist'); const directLink = sharePanel.querySelector('#sharePanel-tabs-pane-1 .input-link input'); expect(directLink).toExist('directLink doesn\'t exist'); - expect(directLink.value).toBe(window.location.origin + window.location.pathname + "#/" + FAKE_RESOURCE_PATH); + expect(directLink.value).toBe(window.location.origin + window.location.pathname + "#/" + FAKE_RESOURCE_PATH + '/config'); }); it('URL is generated using application path', () => { const Sink = addSharePanel(createSink(() => {})); @@ -67,8 +67,8 @@ describe('withShareTool enhancer', () => { expect(sharePanel).toExist('Share panel doesn\'t exist'); const directLink = sharePanel.querySelector('#sharePanel-tabs-pane-1 .input-link input'); expect(directLink).toExist('directLink doesn\'t exist'); - expect(directLink.value).toBe(FAKE_RESOURCE_URL); - expect(directLink.value).toBe("http://some-location/mapstore/#/FAKE_RESOURCE_PATH"); // double check + expect(directLink.value).toBe(FAKE_RESOURCE_URL + '/config'); + expect(directLink.value).toBe("http://some-location/mapstore/#/FAKE_RESOURCE_PATH/config"); // double check document.getElementById('sharePanel-tabs-tab-3').click(); const codeBlock = document.getElementsByTagName('code')[0]; expect(codeBlock).toExist(); diff --git a/web/client/components/share/SharePanel.jsx b/web/client/components/share/SharePanel.jsx index 962faefefa..ef6cf25b50 100644 --- a/web/client/components/share/SharePanel.jsx +++ b/web/client/components/share/SharePanel.jsx @@ -214,6 +214,7 @@ class SharePanel extends React.Component { const { settings, advancedSettings, mapType, viewerOptions } = this.props; const shouldRemoveSectionId = !settings.showSectionId && advancedSettings && advancedSettings.sectionId; let shareUrl = getSharedGeostoryUrl(removeQueryFromUrl(this.props.shareUrl), shouldRemoveSectionId); + if (!shareUrl.endsWith('config')) shareUrl += `${!shareUrl.endsWith('/') ? '/' : ''}config`; if (settings.bboxEnabled && advancedSettings && advancedSettings.bbox && this.state.bbox) shareUrl = `${shareUrl}?bbox=${this.state.bbox}`; if (settings.showHome && advancedSettings && advancedSettings.homeButton) shareUrl = `${shareUrl}?showHome=true`; if (settings.centerAndZoomEnabled && advancedSettings && advancedSettings.centerAndZoom) {