From cbc695be324f2565b0ba0136cba3b4caf356ad71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 9 Jun 2023 10:28:59 +0200 Subject: [PATCH] fix navigation to root of document type --- ...ocument-type-workspace-view-edit.element.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts index 815f3390cf..ae10ee5be8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts @@ -86,7 +86,7 @@ export class UmbDocumentTypeWorkspaceViewEditElement } routes.push({ - path: '', + path: 'root', component: () => import('./document-type-workspace-view-edit-tab.element.js'), setup: (component) => { (component as UmbDocumentTypeWorkspaceViewEditTabElement).noTabName = true; @@ -94,7 +94,12 @@ export class UmbDocumentTypeWorkspaceViewEditElement }, }); - if (routes.length !== 0) { + if (this._hasRootGroups) { + routes.push({ + path: '', + redirectTo: 'root', + }); + } else if (routes.length !== 0) { routes.push({ path: '', redirectTo: routes[0]?.path, @@ -148,13 +153,14 @@ export class UmbDocumentTypeWorkspaceViewEditElement renderTabsNavigation() { if (!this._tabs) return; - const contentTabActive = this._routerPath + '/' === this._activePath; + const rootTabPath = this._routerPath + '/root'; + const rootTabActive = rootTabPath === this._activePath; return html` Content ${repeat(