From 1bd02328cc5dae471934ea0a5fefa8290bf5bc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 13 Apr 2023 11:23:44 +0200 Subject: [PATCH] update URL as tab name changes --- .../document-type-workspace-view-edit.element.ts | 7 ++++--- .../workspace-container-structure-helper.class.ts | 10 ++++++++++ .../workspace-structure-manager.class.ts | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts index c244382b54..8411f6470f 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.ts @@ -147,7 +147,7 @@ export class UmbDocumentTypeWorkspaceViewEditElement extends UmbLitElement { // TODO: make better url folder name: const path = this._routerPath + '/tab/' + encodeURI(tab.name || ''); return html` - ${path === this._activePath + ${path === this._activePath && this._tabsStructureHelper.isOwnerContainer(tab.id!) ? html` { const newName = (e.target as HTMLInputElement).value; - // Update the current URL, so we are still on this specific tab: - window.history.replaceState(null, '', this._routerPath + '/tab/' + encodeURI(newName)); this._tabsStructureHelper.partialUpdateContainer(tab.id, { name: newName, }); + + // Update the current URL, so we are still on this specific tab: + window.history.replaceState(null, '', this._routerPath + '/tab/' + encodeURI(newName)); }}> x.id === groupId) !== undefined; + } + /** Manipulate methods: */ async addContainer(ownerId?: string, sortOrder?: number) { diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-context/workspace-structure-manager.class.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-context/workspace-structure-manager.class.ts index 94bca9717d..fd6d6ad19b 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-context/workspace-structure-manager.class.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-context/workspace-structure-manager.class.ts @@ -221,7 +221,7 @@ export class UmbWorkspacePropertyStructureManager + partialUpdate: Partial ) { await this.#init; documentTypeId = documentTypeId ?? this.#rootDocumentTypeId!;