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:
Denys Vuika
2016-12-07 14:55:09 +00:00
parent 45993793f9
commit 29f426f643
30 changed files with 134 additions and 306 deletions

View File

@@ -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;
}