mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 04:23:04 +00:00
[CST-7119] User menu fixes and improvements
This commit is contained in:

committed by
Davide Negretti

parent
273c754370
commit
c75f5f7c81
@@ -8,6 +8,10 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
|
||||
import { MenuID } from '../shared/menu/menu-id.model';
|
||||
import { ThemeService } from '../shared/theme-support/theme.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { AppState } from '../app.reducer';
|
||||
import { isAuthenticated } from '../core/auth/selectors';
|
||||
|
||||
/**
|
||||
* Component representing the public navbar
|
||||
@@ -25,18 +29,29 @@ export class NavbarComponent extends MenuComponent {
|
||||
*/
|
||||
menuID = MenuID.PUBLIC;
|
||||
|
||||
/**
|
||||
* Whether user is authenticated.
|
||||
* @type {Observable<string>}
|
||||
*/
|
||||
public isAuthenticated$: Observable<boolean>;
|
||||
|
||||
public isXsOrSm$: Observable<boolean>;
|
||||
|
||||
constructor(protected menuService: MenuService,
|
||||
protected injector: Injector,
|
||||
public windowService: HostWindowService,
|
||||
public browseService: BrowseService,
|
||||
public authorizationService: AuthorizationDataService,
|
||||
public route: ActivatedRoute,
|
||||
protected themeService: ThemeService
|
||||
protected themeService: ThemeService,
|
||||
private store: Store<AppState>,
|
||||
) {
|
||||
super(menuService, injector, authorizationService, route, themeService);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
this.isXsOrSm$ = this.windowService.isXsOrSm();
|
||||
this.isAuthenticated$ = this.store.pipe(select(isAuthenticated));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user