diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts index 41655e46d0..4dc38218e1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts @@ -9,7 +9,7 @@ export class UmbCreateEntityAction }> extends // TODO: can we make this a generic create action async execute() { // TODO: get entity type from repository? - const url = `section/settings/workspace/template/create/${this.unique || 'root'}`; + const url = `section/settings/workspace/template/create/${this.unique || 'null'}`; // TODO: how do we handle this with a href? history.pushState(null, '', url); } diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts index 44c84b9cf0..6f0f55799a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts @@ -149,7 +149,6 @@ ${currentContent}`; alias: template.alias, }); this.repository.requestTreeItemsOf(this.#masterTemplate.value?.id ?? null); - } } @@ -158,7 +157,7 @@ ${currentContent}`; if (!data) return; this.setIsNew(true); this.#data.next({ ...data, id: '', name: '', alias: '', $type: 'TemplateResponseModel' }); - if (!parentId || parentId === 'root') return; + if (!parentId) return; await this.setMasterTemplate(parentId); } diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.element.ts index 099c171f9e..23b7f0233a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.element.ts @@ -21,12 +21,11 @@ export class UmbTemplateWorkspaceElement extends UmbLitElement { @state() _routes: UmbRoute[] = [ { - path: 'create/:parentKey', + path: 'create/:parentId', component: () => this.#element, setup: (component: PageComponent, info: IRoutingInfo) => { - const parentKey = info.match.params.parentKey; - - this.#templateWorkspaceContext.create(parentKey === 'root' ? null : parentKey); + const parentId = info.match.params.parentId === 'null' ? null : info.match.params.parentId; + this.#templateWorkspaceContext.create(parentId); }, }, {