additional no route routes
This commit is contained in:
@@ -48,7 +48,9 @@ export class UmbBackofficeMainElement extends UmbLitElement {
|
||||
const newRoutes = this._sections
|
||||
.filter((x) => x.manifest)
|
||||
.map((section) => {
|
||||
const existingRoute = this._routes.find((r) => r.path === UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }));
|
||||
const existingRoute = this._routes.find(
|
||||
(r) => r.path === UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }),
|
||||
);
|
||||
if (existingRoute) {
|
||||
return existingRoute;
|
||||
} else {
|
||||
@@ -63,18 +65,18 @@ export class UmbBackofficeMainElement extends UmbLitElement {
|
||||
}
|
||||
});
|
||||
|
||||
if(newRoutes.length > 0 ) {
|
||||
if (newRoutes.length > 0) {
|
||||
newRoutes.push({
|
||||
path: ``,
|
||||
redirectTo: newRoutes[0].path
|
||||
redirectTo: newRoutes[0].path,
|
||||
});
|
||||
|
||||
newRoutes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
}
|
||||
|
||||
newRoutes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
|
||||
this._routes = newRoutes;
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,14 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
|
||||
redirectTo: routes[0]?.path,
|
||||
guards: [() => this._activeTabId === undefined],
|
||||
});
|
||||
// TODO: Look at this case.
|
||||
}
|
||||
|
||||
if (routes.length !== 0) {
|
||||
routes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
guards: [() => this._activeTabId === undefined],
|
||||
});
|
||||
}
|
||||
|
||||
// If we have an active tab name, then we might have a active tab name re-name, then we will redirect to the new name if it has been changed: [NL]
|
||||
|
||||
@@ -106,12 +106,12 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
|
||||
path: '',
|
||||
redirectTo: routes[0]?.path,
|
||||
});
|
||||
}
|
||||
|
||||
routes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
routes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
}
|
||||
|
||||
this._routes = routes;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,15 @@ export class UmbSectionMainViewElement extends UmbLitElement {
|
||||
});
|
||||
|
||||
const routes = [...dashboardRoutes, ...viewRoutes];
|
||||
this._routes = routes?.length > 0 ? [...routes, { path: '', redirectTo: routes?.[0]?.path }] : [];
|
||||
if (routes.length > 0) {
|
||||
routes.push({ path: '', redirectTo: routes?.[0]?.path });
|
||||
|
||||
routes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
}
|
||||
this._routes = routes;
|
||||
}
|
||||
|
||||
override render() {
|
||||
|
||||
@@ -73,12 +73,12 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
|
||||
|
||||
// Duplicate first workspace and use it for the empty path scenario. [NL]
|
||||
newRoutes.push({ ...newRoutes[0], path: '' });
|
||||
}
|
||||
|
||||
newRoutes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
newRoutes.push({
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
});
|
||||
}
|
||||
|
||||
this._routes = newRoutes;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class UmbUserGroupSectionViewElement extends UmbLitElement {
|
||||
{
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
override render() {
|
||||
|
||||
Reference in New Issue
Block a user