Skip to content

Commit

Permalink
#9269 fix issue of correct map embed url in sharing map (#9395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudadel54 authored Sep 11, 2023
1 parent 47d97af commit 587287b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/client/components/share/SharePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class SharePanel extends React.Component {
modal: false,
draggable: true,
onClose: () => {},
shareUrlRegex: "(h[^#]*)#\\/viewer\\/([^\\/]*)\\/([A-Za-z0-9]*)",
shareUrlReplaceString: "$1embedded.html#/$3",
shareUrlRegex: "(h[^#]*)#\\/viewer\\/([A-Za-z0-9]*)",
shareUrlReplaceString: "$1embedded.html#/$2",
embedPanel: true,
embedOptions: {},
showAPI: true,
Expand Down
2 changes: 2 additions & 0 deletions web/client/components/share/__tests__/SharePanel-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ describe("The SharePanel component", () => {
const cmpSharePanel = ReactDOM.render(<SharePanel selectedTab="embed" getCount={()=>0} shareUrlRegex=".*" shareUrlReplaceString="ABC" shareUrl="www.geo-solutions.it" isVisible={false} />, document.getElementById("container"));
expect(cmpSharePanel).toExist();
const parsed = cmpSharePanel.generateUrl("TEST", "(TE)ST", "$1");
const embedMap = cmpSharePanel.generateUrl("http://localhost:8081/#/viewer/44asd", "(h[^#]*)#\/viewer\/([^\/]*\/[A-Za-z0-9]*|[A-Za-z0-9]*)", "$2");
expect(parsed).toBe("TE");
expect(embedMap).toBe("44asd");
});
it('test showAPI flag', () => {
let cmpSharePanel = ReactDOM.render(<SharePanel selectedTab="embed" showAPI={false} getCount={()=>0} shareUrl="www.geo-solutions.it" isVisible />, document.getElementById("container"));
Expand Down

0 comments on commit 587287b

Please sign in to comment.