Skip to content

Commit 67ab067

Browse files
committed
Merge branch 'release/16.0'
2 parents b3ac82b + 82a063b commit 67ab067

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/menu/menu-variant-tree-structure-workspace-context-base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export abstract class UmbMenuVariantTreeStructureWorkspaceContextBase extends Um
5454
async #requestStructure() {
5555
const isNew = this.#workspaceContext?.getIsNew();
5656
const uniqueObservable = isNew
57-
? this.#workspaceContext?._internal_createUnderParentEntityType
57+
? this.#workspaceContext?._internal_createUnderParentEntityUnique
5858
: this.#workspaceContext?.unique;
5959
const entityTypeObservable = isNew
60-
? this.#workspaceContext?._internal_createUnderParentEntityUnique
60+
? this.#workspaceContext?._internal_createUnderParentEntityType
6161
: this.#workspaceContext?.entityType;
6262

6363
let structureItems: Array<UmbVariantStructureItemModel> = [];
@@ -112,7 +112,7 @@ export abstract class UmbMenuVariantTreeStructureWorkspaceContextBase extends Um
112112
}
113113

114114
#setParentData(structureItems: Array<UmbVariantStructureItemModel>) {
115-
/* If the item is not new, the current item is the last item in the array.
115+
/* If the item is not new, the current item is the last item in the array.
116116
We filter out the current item unique to handle any case where it could show up */
117117
const parent = structureItems.filter((item) => item.unique !== this.#workspaceContext?.getUnique()).pop();
118118

@@ -142,7 +142,7 @@ export abstract class UmbMenuVariantTreeStructureWorkspaceContextBase extends Um
142142

143143
return entity;
144144
})
145-
/* If the item is not new, the current item is the last item in the array.
145+
/* If the item is not new, the current item is the last item in the array.
146146
We filter out the current item unique to handle any case where it could show up */
147147
.filter((item) => item.unique !== this.#workspaceContext?.getUnique());
148148

src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-variant-menu-breadcrumb/workspace-variant-menu-breadcrumb.element.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ export class UmbWorkspaceVariantMenuBreadcrumbElement extends UmbLitElement {
5858

5959
#observeStructure() {
6060
if (!this.#structureContext || !this.#workspaceContext) return;
61-
const isNew = this.#workspaceContext.getIsNew();
6261

6362
this.observe(this.#structureContext.structure, (value) => {
64-
this._structure = isNew ? value : value.slice(0, -1);
63+
if (!this.#workspaceContext) return;
64+
const unique = this.#workspaceContext.getUnique();
65+
// exclude the current unique from the structure. We append this with an observer of the name
66+
this._structure = value.filter((structureItem) => structureItem.unique !== unique);
6567
});
6668
}
6769

0 commit comments

Comments
 (0)