Skip to content

Commit 7af67d2

Browse files
rammi987Lucas Bach Bisgaardnielslyngsoe
authored
Have to control of the state store navigation for custom sections or … (#20637)
* Have to control of the state store navigation for custom sections or overrides * revert wording * move logic and update comment --------- Co-authored-by: Lucas Bach Bisgaard <[email protected]> Co-authored-by: Niels Lyngsø <[email protected]>
1 parent ce59537 commit 7af67d2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
8383

8484
const clickedSectionAlias = manifest.alias;
8585

86-
// If the clicked section is the same as the current section, we just load the original section path to load the section root
87-
if (this._currentSectionAlias === clickedSectionAlias) {
86+
// If preventUrlRetention is set to true then go to the section root.
87+
// Or if the clicked section is the current active one, then navigate to the section root
88+
if (manifest?.meta.preventUrlRetention === true || this._currentSectionAlias === clickedSectionAlias) {
8889
const sectionPath = this.#getSectionPath(manifest);
8990
history.pushState(null, '', sectionPath);
9091
return;

src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export interface ManifestSection
1212
export interface MetaSection {
1313
label: string;
1414
pathname: string;
15+
preventUrlRetention?: boolean;
1516
}

0 commit comments

Comments
 (0)