mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
code fixes
- interpolate ng2 components html content - fix: load images for Login - fix: load images for User Info - fix: load images for Document List - fix: decorator inheritance issue for Form - fix: load images for Search
This commit is contained in:
@@ -31,29 +31,14 @@ declare let componentHandler: any;
|
||||
})
|
||||
export class UserInfoComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
ecmBackgroundImage: string;
|
||||
|
||||
@Input()
|
||||
bpmBackgroundImage: string;
|
||||
|
||||
@Input()
|
||||
menuOpenType: string = 'right';
|
||||
|
||||
@Input()
|
||||
fallBackThumbnailImage: string;
|
||||
|
||||
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;
|
||||
bpmUserImage: string;
|
||||
ecmUserImage: string;
|
||||
|
||||
constructor(private ecmUserService: EcmUserService,
|
||||
private bpmUserService: BpmUserService,
|
||||
@@ -86,7 +71,7 @@ export class UserInfoComponent implements OnInit {
|
||||
this.ecmUserService.getCurrentUserInfo()
|
||||
.subscribe((res) => {
|
||||
this.ecmUser = <EcmUserModel> res;
|
||||
this.getEcmAvatar();
|
||||
this.ecmUserImage = this.ecmUserService.getUserProfileImage(this.ecmUser.avatarId);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -102,13 +87,6 @@ export class UserInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
onImageLoadingError(event) {
|
||||
if (event) {
|
||||
let element = <any> event.target;
|
||||
element.src = this.fallBackThumbnailImage || this.anonymousImageUrl;
|
||||
}
|
||||
}
|
||||
|
||||
stopClosing(event) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
@@ -125,22 +103,10 @@ export class UserInfoComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private getEcmAvatar() {
|
||||
this.ecmUserImage = this.ecmUserService.getUserProfileImage(this.ecmUser.avatarId);
|
||||
}
|
||||
|
||||
getUserAvatar() {
|
||||
return this.ecmUserImage || this.bpmUserImage;
|
||||
}
|
||||
|
||||
getBpmUserAvatar() {
|
||||
return this.bpmUserImage;
|
||||
}
|
||||
|
||||
getEcmUserAvatar() {
|
||||
return this.ecmUserImage;
|
||||
}
|
||||
|
||||
formatValue(value: string) {
|
||||
return value === 'null' ? null : value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user