[AAE-1174] select first user info when open the first time (#5345)

* select first info user when open

* add early check to build the tabs

* fix lint

* try different solution
This commit is contained in:
Eugenio Romano
2020-01-13 11:24:03 +01:00
committed by GitHub
parent 26677c6789
commit a8c2a0b1e2
4 changed files with 86 additions and 65 deletions

View File

@@ -62,6 +62,8 @@ export class UserInfoComponent implements OnInit {
@Input()
namePosition: string = 'right';
mode: string;
ecmUser$: Observable<EcmUserModel>;
bpmUser$: Observable<BpmUserModel>;
identityUser$: Observable<IdentityUserModel>;
@@ -80,13 +82,17 @@ export class UserInfoComponent implements OnInit {
getUserInfo() {
if (this.authService.isOauth()) {
this.loadIdentityUserInfo();
this.mode = 'SSO';
} else if (this.authService.isEcmLoggedIn() && this.authService.isBpmLoggedIn()) {
this.loadEcmUserInfo();
this.loadBpmUserInfo();
this.mode = 'ALL';
} else if (this.authService.isEcmLoggedIn()) {
this.loadEcmUserInfo();
this.mode = 'CONTENT';
} else if (this.authService.isBpmLoggedIn()) {
this.loadBpmUserInfo();
this.mode = 'PROCESS';
}
}
@@ -95,7 +101,7 @@ export class UserInfoComponent implements OnInit {
}
private closeUserModal($event: KeyboardEvent) {
if ($event.keyCode === 27 ) {
if ($event.keyCode === 27) {
this.trigger.closeMenu();
}
}
@@ -120,7 +126,7 @@ export class UserInfoComponent implements OnInit {
event.stopPropagation();
}
getEcmAvatar(avatarId: any ): string {
getEcmAvatar(avatarId: any): string {
return this.ecmUserService.getUserProfileImage(avatarId);
}