Merge remote-tracking branch 'origin/ui-redesign' into ui-redesign

This commit is contained in:
George Kalampokis 2020-07-17 16:11:58 +03:00
commit d4e4d5ca13
3 changed files with 7 additions and 12 deletions

View File

@ -4,7 +4,7 @@
<mat-divider class="col-12 top-divider"></mat-divider> <mat-divider class="col-12 top-divider"></mat-divider>
<div class="col-12 pl-2"> <div class="col-12 pl-2">
<a class="profile email-btn mt-2 mb-2 pl-0"> <a class="profile email-btn mt-2 mb-2 pl-0">
<mat-icon class="check-icon">check</mat-icon>{{ data.user.email }} <mat-icon class="check-icon">check</mat-icon>{{ getPrincipalEmail() }}
</a> </a>
</div> </div>
<mat-divider class="col-12"></mat-divider> <mat-divider class="col-12"></mat-divider>

View File

@ -35,6 +35,12 @@ export class UserDialogComponent implements OnInit {
return ''; return '';
} }
public getPrincipalEmail(): string {
const principal: Principal = this.authentication.current();
if (principal) { return principal.email; }
return '';
}
public principalHasAvatar(): boolean { public principalHasAvatar(): boolean {
return this.authentication.current() && this.authentication.current().avatarUrl != null && this.authentication.current().avatarUrl.length > 0; return this.authentication.current() && this.authentication.current().avatarUrl != null && this.authentication.current().avatarUrl.length > 0;
} }

View File

@ -73,7 +73,6 @@ export class NavbarComponent extends BaseComponent implements OnInit {
this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {
setTimeout(() => { this.progressIndication = x; }); setTimeout(() => { this.progressIndication = x; });
}); });
this.getPrincipalAsUser();
} }
public isAuthenticated(): boolean { public isAuthenticated(): boolean {
@ -84,13 +83,6 @@ export class NavbarComponent extends BaseComponent implements OnInit {
return this.currentRoute === '/language-editor' || this.currentRoute === '/profile'; return this.currentRoute === '/language-editor' || this.currentRoute === '/profile';
} }
public getPrincipalAsUser() {
const principal: Principal = this.authentication.current();
if (principal) {
this.userService.getUser(principal.id).pipe(takeUntil(this._destroyed)).subscribe(result => this.user = result);
}
}
sidebarOpen() { sidebarOpen() {
const toggleButton = this.toggleButton; const toggleButton = this.toggleButton;
const body = document.getElementsByTagName('body')[0]; const body = document.getElementsByTagName('body')[0];
@ -223,9 +215,6 @@ export class NavbarComponent extends BaseComponent implements OnInit {
autoFocus: false, autoFocus: false,
closeOnNavigation: true, closeOnNavigation: true,
disableClose: false, disableClose: false,
data: {
user: this.user
},
position: { top: '64px', right: '1em' } position: { top: '64px', right: '1em' }
}); });
} }