From f26b6ad791f99db5cba63393aefa59897d12ce89 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:03:21 +0200 Subject: [PATCH 1/2] fix: if no workspace views are found at all, show a not found page --- .../workspace-editor/workspace-editor.element.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts index 6c16b3aac4e8..f55bcd8c89ea 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts @@ -75,13 +75,15 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { // Duplicate first workspace and use it for the empty path scenario. [NL] newRoutes.push({ ...newRoutes[0], unique: newRoutes[0].path, path: '' }); - - newRoutes.push({ - path: `**`, - component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, - }); } + // Add a catch-all route for not found + // This will be the last route, so it will only match if no other routes match or if no workspace views are defined. + newRoutes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); + this._routes = newRoutes; } From b29c5ada7ca2398aa8d7a93be414d1b30b7c29e1 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:04:22 +0200 Subject: [PATCH 2/2] fix: rather than redirecting to the first available tab, which may not always be available on secondary routing, let the router display the first tab on an empty url this mirrors how workspace views are displayed in umb-workspace-editor --- .../views/edit/content-editor.element.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts index 693808923e79..8432f1c8cfde 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/views/edit/content-editor.element.ts @@ -85,7 +85,7 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements if (this._hasRootGroups) { routes.push({ - path: `root`, + path: 'root', component: () => import('./content-editor-tab.element.js'), setup: (component) => { (component as UmbContentWorkspaceViewEditTabElement).containerId = null; @@ -108,17 +108,17 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements if (routes.length !== 0) { routes.push({ + ...routes[0], + unique: routes[0].path, path: '', - pathMatch: 'full', - 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; } @@ -132,18 +132,20 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements ? html` ` : ''} ${repeat( this._tabs, (tab) => tab.name, - (tab) => { + (tab, index) => { const path = this._routerPath + '/tab/' + encodeFolderName(tab.name || ''); return html``; }, )}