From aba3a9439ddfa9ea4319a4e510cf1bb9ed3152ee Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 14 May 2025 16:43:14 +0200 Subject: [PATCH] 129964: Fixed the header role structure being invalid in the custom theme - Replaced the menubar role from the parent of all the header buttons like lang switch, auth menu & help toggle with toolbar - Replaced the remaining `` buttons in the header with ` } - @if ((isAuthenticated | async) && (showAuth | async)) { + @if (isAuthenticated && showAuth) { - } @else { -
- @if ((isAuthenticated | async) !== true) { - - {{ 'nav.login' | translate }}(current) - - } - @if ((isAuthenticated | async)) { - - - (current) - - } -
- } + + } + +} @else { +
+ @if (isAuthenticated === true) { + + + (current) + + } @else { + + {{ 'nav.login' | translate }}(current) + + } +
+} - - - + diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.scss b/src/app/shared/auth-nav-menu/auth-nav-menu.component.scss index 84e4916eff..7d4ec043ac 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.scss +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.scss @@ -28,3 +28,7 @@ box-shadow: unset; } } + +.dropdown-toggle::after { + margin-left: 0; +} diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts index 49c701f77d..c5ede5aff7 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -64,7 +64,7 @@ export class AuthNavMenuComponent implements OnInit { * Whether user is authenticated. * @type {Observable} */ - public isAuthenticated: Observable; + public isAuthenticated$: Observable; /** * True if the authentication is loading. @@ -74,7 +74,7 @@ export class AuthNavMenuComponent implements OnInit { public isMobile$: Observable; - public showAuth = observableOf(false); + public showAuth$ = observableOf(false); public user: Observable; @@ -89,14 +89,14 @@ export class AuthNavMenuComponent implements OnInit { ngOnInit(): void { // set isAuthenticated - this.isAuthenticated = this.store.pipe(select(isAuthenticated)); + this.isAuthenticated$ = this.store.pipe(select(isAuthenticated)); // set loading this.loading = this.store.pipe(select(isAuthenticationLoading)); this.user = this.authService.getAuthenticatedUserFromStore(); - this.showAuth = this.store.pipe( + this.showAuth$ = this.store.pipe( select(routerStateSelector), filter((router: RouterReducerState) => isNotUndefined(router) && isNotUndefined(router.state)), map((router: RouterReducerState) => (!router.state.url.startsWith(LOGIN_ROUTE) diff --git a/src/app/shared/lang-switch/lang-switch.component.html b/src/app/shared/lang-switch/lang-switch.component.html index f96d1208b5..1565974f98 100644 --- a/src/app/shared/lang-switch/lang-switch.component.html +++ b/src/app/shared/lang-switch/lang-switch.component.html @@ -4,7 +4,7 @@ [attr.aria-label]="'nav.language' |translate" aria-controls="language-menu-list" aria-haspopup="menu" - class="dropdown-toggle" + class="dropdown-toggle btn btn-link px-0" [title]="'nav.language' | translate" (click)="$event.preventDefault()" data-toggle="dropdown" ngbDropdownToggle data-test="lang-switch" @@ -16,6 +16,7 @@ @for (lang of translate.getLangs(); track lang) { } diff --git a/src/themes/dspace/app/header/header.component.html b/src/themes/dspace/app/header/header.component.html index a975f54263..caf5e8fc5a 100644 --- a/src/themes/dspace/app/header/header.component.html +++ b/src/themes/dspace/app/header/header.component.html @@ -17,7 +17,7 @@
-