mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#878 fix user info demo
This commit is contained in:
@@ -47,9 +47,13 @@ export class UserInfoComponent implements AfterViewChecked, OnInit {
|
||||
private baseComponentPath = module.id.replace('components/user-info.component.js', '');
|
||||
|
||||
ecmUser: EcmUserModel;
|
||||
|
||||
bpmUser: BpmUserModel;
|
||||
|
||||
anonymousImageUrl: string = this.baseComponentPath + 'img/anonymous.gif';
|
||||
|
||||
bpmUserImage: any;
|
||||
|
||||
ecmUserImage: any;
|
||||
|
||||
constructor(private ecmUserService: EcmUserService,
|
||||
@@ -59,6 +63,10 @@ export class UserInfoComponent implements AfterViewChecked, OnInit {
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('node_modules/ng2-alfresco-userinfo/src');
|
||||
}
|
||||
|
||||
authService.loginSubject.subscribe((response) => {
|
||||
this.getUserInfo();
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
@@ -69,10 +77,18 @@ export class UserInfoComponent implements AfterViewChecked, OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getUserInfo();
|
||||
}
|
||||
|
||||
getUserInfo() {
|
||||
this.getEcmUserInfo();
|
||||
this.getBpmUserInfo();
|
||||
}
|
||||
|
||||
isLoggedIn() {
|
||||
return this.authService.isLoggedIn();
|
||||
}
|
||||
|
||||
getEcmUserInfo(): void {
|
||||
if (this.authService.isEcmLoggedIn()) {
|
||||
this.ecmUserService.getCurrentUserInfo()
|
||||
|
Reference in New Issue
Block a user