Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@

const clickedSectionAlias = manifest.alias;

// If the clicked section is the same as the current section, we just load the original section path to load the section root
if (this._currentSectionAlias === clickedSectionAlias) {
// If preventUrlRetention is set to true then go to the section root.
// Or if the clicked section is the current active one, then navigate to the section root
if (manifest?.meta.preventUrlRetention === true || this._currentSectionAlias === clickedSectionAlias) {

Check warning on line 88 in src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Code Health Review (main)

❌ New issue: Complex Method

UmbBackofficeHeaderSectionsElement.onSectionClick has a cyclomatic complexity of 10, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
const sectionPath = this.#getSectionPath(manifest);
history.pushState(null, '', sectionPath);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export interface ManifestSection
export interface MetaSection {
label: string;
pathname: string;
preventUrlRetention?: boolean;
}
Loading