fix delete
This commit is contained in:
@@ -391,7 +391,7 @@ export class UmbContentTypeStructureManager<
|
||||
throw new Error('Could not find the Content Type to remove container from');
|
||||
}
|
||||
const frozenContainers = contentType.containers ?? [];
|
||||
const containers = frozenContainers.filter((x) => x.id !== containerId || x.parent?.id !== containerId);
|
||||
const containers = frozenContainers.filter((x) => x.id !== containerId && x.parent?.id !== containerId);
|
||||
|
||||
const frozenProperties = contentType.properties ?? [];
|
||||
const properties = frozenProperties.filter((x) => x.container?.id !== containerId);
|
||||
|
||||
@@ -228,7 +228,7 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
|
||||
this._routes = routes;
|
||||
}
|
||||
|
||||
async #requestRemoveTab(tab: UmbPropertyTypeContainerModel | undefined) {
|
||||
async #requestDeleteTab(tab: UmbPropertyTypeContainerModel | undefined) {
|
||||
// TODO: Localize this:
|
||||
const modalData: UmbConfirmModalData = {
|
||||
headline: 'Delete tab',
|
||||
@@ -248,9 +248,9 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
|
||||
|
||||
await umbConfirmModal(this, modalData);
|
||||
|
||||
this.#remove(tab?.id);
|
||||
this.#deleteTab(tab?.id);
|
||||
}
|
||||
#remove(tabId?: string) {
|
||||
#deleteTab(tabId?: string) {
|
||||
if (!tabId) return;
|
||||
this.#workspaceContext?.structure.removeContainer(null, tabId);
|
||||
// TODO: We should only navigate away if it was the last tab and if it was the active one... [NL]
|
||||
@@ -495,7 +495,7 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
|
||||
@click=${(e: MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.#requestRemoveTab(tab);
|
||||
this.#requestDeleteTab(tab);
|
||||
}}
|
||||
compact>
|
||||
<uui-icon name="icon-trash"></uui-icon>
|
||||
|
||||
Reference in New Issue
Block a user