Skip to content
Snippets Groups Projects
Commit ff43ec6e authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch...

Merge branch '812-dynamic-routes-are-not-removed-in-frontend-immediately-when-they-are-removed-in-the-backend' into 'release-3.0'

Resolve "Dynamic routes are not removed in frontend (immediately) when they are removed in the backend"

See merge request !1227
parents 6f2d6890 2e9446c0
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1227Resolve "Dynamic routes are not removed in frontend (immediately) when they are removed in the backend",!1183Release 3.0
Pipeline #125863 canceled
......@@ -41,6 +41,7 @@ Fixed
* Phone numbers couldn't be in regional format.
* System status view wasn't accessible through new frontend if a check failed.
* Progress page didn't show error message on failure.
* Dynamic routes were not removed/hid when the respective object registering it was deleted.
`3.0b3`_ - 2023-03-19
---------------------
......
......@@ -283,7 +283,7 @@ export default {
},
$route: {
handler(newRoute) {
if (newRoute.matched.length === 0) {
if (newRoute.matched.length === 0 || newRoute.meta.hide) {
this.error404 = true;
} else {
this.error404 = false;
......
......@@ -55,7 +55,8 @@ const menusMixin = {
: true) &&
(route.meta.validators
? this.checkValidators(route.meta.validators)
: true)
: true) &&
!route.meta.hide
) {
let menuItem = {
...route.meta,
......@@ -83,7 +84,8 @@ const menusMixin = {
: true) &&
(route.meta.validators
? this.checkValidators(route.meta.validators)
: true)
: true) &&
!route.meta.hide
) {
let menuItem = {
...route.meta,
......
......@@ -14,7 +14,7 @@ const routesMixin = {
apollo: {
dynamicRoutes: {
query: gqlDynamicRoutes,
pollInterval: 60000,
pollInterval: 10000,
},
},
watch: {
......@@ -38,6 +38,8 @@ const routesMixin = {
menuPermission: route.menuPermission,
permission: route.routePermission,
newTab: route.menuNewTab,
dynamic: true,
hide: false,
},
};
......@@ -49,6 +51,17 @@ const routesMixin = {
}
}
for (const route of this.$router
.getRoutes()
.filter((r) => r.meta.dynamic && !r.meta.hide)) {
if (
!(newDynamicRoutes.map((r) => r.routeName).indexOf(route.name) > -1)
) {
let hiddenRoute = { ...route, meta: { ...route.meta, hide: true } };
this.$router.addRoute(hiddenRoute);
}
}
this.getPermissionNames();
this.buildMenus();
},
......
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