diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts index 6ba9b8846e..a5ed6a86c7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts @@ -37,6 +37,13 @@ export class UmbRouteContext extends UmbContextBase { }); } + getBasePath() { + return this.#basePath.getValue(); + } + getActivePath() { + return this.getBasePath() + '/' + this.#activeLocalPath; + } + public registerModal(registration: UmbModalRouteRegistration) { this.#modalRegistrations.push(registration); this.#createNewUrlBuilder(registration); 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 d9f922996a..5c59f06a66 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 @@ -3,7 +3,7 @@ import { createExtensionElement, UmbExtensionsManifestInitializer } from '@umbra import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; -import type { ManifestWorkspaceView } from '@umbraco-cms/backoffice/workspace'; +import { UMB_WORKSPACE_VIEW_PATH_PATTERN, type ManifestWorkspaceView } from '@umbraco-cms/backoffice/workspace'; import type { UmbRoute, UmbRouterSlotInitEvent, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router'; /** @@ -62,7 +62,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { if (this._workspaceViews.length > 0) { newRoutes = this._workspaceViews.map((manifest) => { return { - path: `view/${manifest.meta.pathname}`, + path: UMB_WORKSPACE_VIEW_PATH_PATTERN.generateLocal({ viewPathname: manifest.meta.pathname }), component: () => createExtensionElement(manifest), setup: (component) => { if (component) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/paths.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/paths.ts index da4f96e16a..8ac71ae068 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/paths.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/paths.ts @@ -5,3 +5,8 @@ export const UMB_WORKSPACE_PATH_PATTERN = new UmbPathPattern< { entityType: string }, typeof UMB_SECTION_PATH_PATTERN.ABSOLUTE_PARAMS >('workspace/:entityType', UMB_SECTION_PATH_PATTERN); + +export const UMB_WORKSPACE_VIEW_PATH_PATTERN = new UmbPathPattern< + { viewPathname: string }, + typeof UMB_WORKSPACE_PATH_PATTERN.ABSOLUTE_PARAMS +>('view/:viewPathname', UMB_WORKSPACE_PATH_PATTERN);