Add missing system collection redirects (#19522)

* Add missing system collection redirects in content route

* Add changeset
This commit is contained in:
Pascal Jufer
2023-08-25 03:22:17 +02:00
committed by GitHub
parent b6d3438794
commit f15725bbf1
2 changed files with 46 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Added missing system collection redirects in content route

View File

@@ -33,6 +33,14 @@ const checkForSystem: NavigationGuard = (to, from) => {
}
}
if (to.params.collection === 'directus_dashboards') {
if (to.params.primaryKey) {
return `/insights/${to.params.primaryKey}`;
} else {
return '/insights';
}
}
if (to.params.collection === 'directus_activity') {
if (to.params.primaryKey) {
return `/activity/${to.params.primaryKey}`;
@@ -41,11 +49,23 @@ const checkForSystem: NavigationGuard = (to, from) => {
}
}
if (to.params.collection === 'directus_webhooks') {
if (to.params.collection === 'directus_settings') {
return '/settings/project';
}
if (to.params.collection === 'directus_collections') {
if (to.params.primaryKey) {
return `/settings/webhooks/${to.params.primaryKey}`;
return `/settings/data-model/${to.params.primaryKey}`;
} else {
return '/settings/webhooks';
return '/settings/data-model';
}
}
if (to.params.collection === 'directus_roles') {
if (to.params.primaryKey) {
return `/settings/roles/${to.params.primaryKey}`;
} else {
return '/settings/roles';
}
}
@@ -65,6 +85,22 @@ const checkForSystem: NavigationGuard = (to, from) => {
}
}
if (to.params.collection === 'directus_webhooks') {
if (to.params.primaryKey) {
return `/settings/webhooks/${to.params.primaryKey}`;
} else {
return '/settings/webhooks';
}
}
if (to.params.collection === 'directus_flows') {
if (to.params.primaryKey) {
return `/settings/flows/${to.params.primaryKey}`;
} else {
return '/settings/flows';
}
}
if (
'bookmark' in from.query &&
typeof from.query.bookmark === 'string' &&
@@ -73,6 +109,8 @@ const checkForSystem: NavigationGuard = (to, from) => {
) {
return addQueryToPath(to.fullPath, { bookmark: from.query.bookmark });
}
return;
};
const getArchiveValue = (query: LocationQuery) => {