Skip to content
Snippets Groups Projects
Commit 15e4167c authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Pass query string when navigating legacy pages

parent 743f4360
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1222Resolve "Query strings do not get passed when navigating legacy pages in SPA",!1183Release 3.0
Checking pipeline status
......@@ -33,6 +33,7 @@ Fixed
* The `Stop Impersonation` button is not shown due to an oversee when changing the type of the whoAmI query to an object of UserType
* Offline fallback page for legacy pages was misleading sometimes.
* Route changes in the Legacy-Component iframe didn't trigger a scroll to the top
* Query strings did not get passed when navigating legacy pages inside of the SPA.
`3.0b3`_ - 2023-03-19
---------------------
......
......@@ -59,13 +59,14 @@ export default {
const location = this.$refs.contentIFrame.contentWindow.location;
const url = new URL(location);
const path = url.pathname.replace(/^\/django/, "");
const pathWithQueryString = path + encodeURI(url.search);
const routePath =
path.charAt(path.length - 1) === "/" &&
this.$route.path.charAt(path.length - 1) !== "/"
? this.$route.path + "/"
: this.$route.path;
if (path !== routePath) {
this.$router.push(path);
this.$router.push(pathWithQueryString);
}
// Show loader if iframe starts to change its content, even if the $route stays the same
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment