mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user