ui fix on navbar

This commit is contained in:
Sofia Papacharalampous 2024-06-04 11:20:33 +03:00
parent 386aa5de05
commit 82b53314b9
2 changed files with 9 additions and 1 deletions

View File

@ -57,7 +57,7 @@
<ul class="navbar-nav"> <ul class="navbar-nav">
<!-- Login --> <!-- Login -->
<li class="nav-item" *ngIf="this.isAuthenticated();else loginoption"> <li class="nav-item" *ngIf="this.isAuthenticated();else loginoption">
<img mat-card-avatar class="my-mat-card-avatar" [src]="getPrincipalAvatar() ?? getDefaultAvatar()" (error)="this.applyFallbackAvatar($event)" (click)="openProfile()" [matTooltip]="this.getPrincipalName()"> <img mat-card-avatar class="my-mat-card-avatar" [src]="getPrincipalAvatar() ?? getDefaultAvatar()" (error)="this.applyFallbackAvatar($event)" (click)="openProfile()" [matTooltip]="userName">
<!--<img mat-card-avatar class="my-mat-card-avatar" *ngIf="!this.principalHasAvatar()" [src]="this.getDefaultAvatar()" (click)="openProfile()"> --> <!--<img mat-card-avatar class="my-mat-card-avatar" *ngIf="!this.principalHasAvatar()" [src]="this.getDefaultAvatar()" (click)="openProfile()"> -->
</li> </li>
<ng-template #loginoption> <ng-template #loginoption>

View File

@ -26,6 +26,7 @@ import { nameof } from 'ts-simple-nameof';
import { StartNewDmpDialogComponent } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.component'; import { StartNewDmpDialogComponent } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.component';
import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component'; import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component';
import { UserDialogComponent } from './user-dialog/user-dialog.component'; import { UserDialogComponent } from './user-dialog/user-dialog.component';
import { UserService } from '@app/core/services/user/user.service';
@Component({ @Component({
selector: 'app-navbar', selector: 'app-navbar',
@ -33,6 +34,7 @@ import { UserDialogComponent } from './user-dialog/user-dialog.component';
styleUrls: ['./navbar.component.css', './navbar.component.scss'] styleUrls: ['./navbar.component.css', './navbar.component.scss']
}) })
export class NavbarComponent extends BaseComponent implements OnInit { export class NavbarComponent extends BaseComponent implements OnInit {
userName: string = '';
progressIndication = false; progressIndication = false;
//private listTitles: any[]; //private listTitles: any[];
location: Location; location: Location;
@ -53,6 +55,7 @@ export class NavbarComponent extends BaseComponent implements OnInit {
private element: ElementRef, private element: ElementRef,
private router: Router, private router: Router,
public authentication: AuthService, public authentication: AuthService,
private userService: UserService,
private dialog: MatDialog, private dialog: MatDialog,
private progressIndicationService: ProgressIndicationService, private progressIndicationService: ProgressIndicationService,
private languageService: LanguageService, private languageService: LanguageService,
@ -105,6 +108,11 @@ export class NavbarComponent extends BaseComponent implements OnInit {
} }
}); });
this.loadLogo(); this.loadLogo();
this.userService.getSingle(this.authentication.userId(), [
nameof<User>(x => x.id),
nameof<User>(x => x.name)
]).subscribe(u => this.userName = u.name);
} }
private loadLogo() { private loadLogo() {