diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/structure/content-type-container-structure-helper.class.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/structure/content-type-container-structure-helper.class.ts index 90955831c2..08046776e5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/structure/content-type-container-structure-helper.class.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/structure/content-type-container-structure-helper.class.ts @@ -102,7 +102,6 @@ export class UmbContentTypeContainerStructureHelper { if (container) { - console.log('Container update', container.name); this._containerName = container.name ?? ''; this._containerType = container.type; if (container.parent) { @@ -227,7 +226,6 @@ export class UmbContentTypeContainerStructureHelper i === cons.findIndex((y) => y.name === x.name && y.type === x.type)); this.#mergedContainers.setValue(merged); - console.log('merge', containers, ' > ', merged); }; /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts index c315ce3948..4a88c10c4f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts @@ -20,7 +20,6 @@ import type { UmbConfirmModalData } from '@umbraco-cms/backoffice/modal'; import { UMB_MODAL_MANAGER_CONTEXT, umbConfirmModal } from '@umbraco-cms/backoffice/modal'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbSorterController } from '@umbraco-cms/backoffice/sorter'; -import './content-type-design-editor-tab.element.js'; @customElement('umb-content-type-design-editor') export class UmbContentTypeDesignEditorElement extends UmbLitElement implements UmbWorkspaceViewElement { @@ -124,9 +123,6 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements this._tabsStructureHelper.setIsRoot(true); this.observe(this._tabsStructureHelper.mergedContainers, (tabs) => { this._tabs = tabs; - this._tabs.forEach((tab) => { - this.#updateCachedTabElementId(tab.name ?? '', tab.id); - }); this.#sorter.setModel(tabs); this._createRoutes(); }); @@ -158,37 +154,6 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements ); } - #routeElementCache = new Map(); - - #getCacheOrImportTabElement(tabName: string) { - const found = this.#routeElementCache.get(tabName); - if (found) { - return found; - } - - const element = document.createElement( - 'umb-content-type-design-editor-tab', - ) as UmbContentTypeDesignEditorTabElement; - this.#routeElementCache.set(tabName, element); - return element; - } - - #updateCachedTabElementId(tabName: string, containerId: string | null) { - const found = this.#routeElementCache.get(tabName); - if (found) { - found.containerId = containerId; - } - } - - #updateCachedTabElementName(tabName: string, newTabName: string) { - // change key for map entry: - const found = this.#routeElementCache.get(tabName); - if (found) { - this.#routeElementCache.set(newTabName, found); - this.#routeElementCache.delete(tabName); - } - } - private _createRoutes() { // TODO: How about storing a set of elements based on tab ids? to prevent re-initializing the element when renaming..[NL] if (!this.#workspaceContext || !this._tabs || this._hasRootGroups === undefined) return; @@ -205,7 +170,7 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements } routes.push({ path: `tab/${encodeFolderName(tabName).toString()}`, - component: () => this.#getCacheOrImportTabElement(tabName), + component: () => import('./content-type-design-editor-tab.element.js'), setup: (component) => { // Or just cache the current view here, and use it if the same is begin requested?. [NL] //(component as UmbContentTypeDesignEditorTabElement).tabName = tabName; @@ -217,8 +182,7 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements routes.push({ path: 'root', - component: () => - document.createElement('umb-content-type-design-editor-tab') as UmbContentTypeDesignEditorTabElement, + component: () => import('./content-type-design-editor-tab.element.js'), setup: (component) => { //(component as UmbContentTypeDesignEditorTabElement).noTabName = true; (component as UmbContentTypeDesignEditorTabElement).containerId = null; @@ -332,8 +296,6 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements (event.target as HTMLInputElement).value = newName; } - this.#updateCachedTabElementName(tab.name ?? '', newName); - this._tabsStructureHelper.partialUpdateContainer(tab.id!, { name: newName, });