Skip to content

Commit ff12bda

Browse files
committed
additional no route routes
1 parent ce33dc6 commit ff12bda

File tree

6 files changed

+38
-21
lines changed

6 files changed

+38
-21
lines changed

src/apps/backoffice/components/backoffice-main.element.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export class UmbBackofficeMainElement extends UmbLitElement {
4848
const newRoutes = this._sections
4949
.filter((x) => x.manifest)
5050
.map((section) => {
51-
const existingRoute = this._routes.find((r) => r.path === UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }));
51+
const existingRoute = this._routes.find(
52+
(r) => r.path === UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }),
53+
);
5254
if (existingRoute) {
5355
return existingRoute;
5456
} else {
@@ -63,17 +65,17 @@ export class UmbBackofficeMainElement extends UmbLitElement {
6365
}
6466
});
6567

66-
if(newRoutes.length > 0 ) {
68+
if (newRoutes.length > 0) {
6769
newRoutes.push({
6870
path: ``,
69-
redirectTo: newRoutes[0].path
71+
redirectTo: newRoutes[0].path,
7072
});
71-
}
7273

73-
newRoutes.push({
74-
path: `**`,
75-
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
76-
});
74+
newRoutes.push({
75+
path: `**`,
76+
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
77+
});
78+
}
7779

7880
this._routes = newRoutes;
7981
}

src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,14 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
207207
redirectTo: routes[0]?.path,
208208
guards: [() => this._activeTabId === undefined],
209209
});
210-
// TODO: Look at this case.
210+
}
211+
212+
if (routes.length !== 0) {
213+
routes.push({
214+
path: `**`,
215+
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
216+
guards: [() => this._activeTabId === undefined],
217+
});
211218
}
212219

213220
// 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]

src/packages/core/content/workspace/views/edit/content-editor.element.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
106106
path: '',
107107
redirectTo: routes[0]?.path,
108108
});
109-
}
110109

111-
routes.push({
112-
path: `**`,
113-
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
114-
});
110+
routes.push({
111+
path: `**`,
112+
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
113+
});
114+
}
115115

116116
this._routes = routes;
117117
}

src/packages/core/section/section-main-views/section-main-views.element.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ export class UmbSectionMainViewElement extends UmbLitElement {
7979
});
8080

8181
const routes = [...dashboardRoutes, ...viewRoutes];
82-
this._routes = routes?.length > 0 ? [...routes, { path: '', redirectTo: routes?.[0]?.path }] : [];
82+
if (routes.length > 0) {
83+
routes.push({ path: '', redirectTo: routes?.[0]?.path });
84+
85+
routes.push({
86+
path: `**`,
87+
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
88+
});
89+
}
90+
this._routes = routes;
8391
}
8492

8593
override render() {

src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
7373

7474
// Duplicate first workspace and use it for the empty path scenario. [NL]
7575
newRoutes.push({ ...newRoutes[0], path: '' });
76-
}
7776

78-
newRoutes.push({
79-
path: `**`,
80-
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
81-
});
77+
newRoutes.push({
78+
path: `**`,
79+
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
80+
});
81+
}
8282

8383
this._routes = newRoutes;
8484
}

src/packages/user/user-group/section-view/user-group-section-view.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class UmbUserGroupSectionViewElement extends UmbLitElement {
3333
{
3434
path: `**`,
3535
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
36-
}
36+
},
3737
];
3838

3939
override render() {

0 commit comments

Comments
 (0)