[ADF - 1681] Added username and created initials pipe for user info (#2479)

* [ADF-1681] appling design spec to userinfo component

* [ADF-1681] added default pipe to userinfo

* [ADF-1681] fixed pipe name and added pipe test

* [ADF-168] fixed test for new userinfo feature

* [ADF-1681] fixed test

* [ADF-1681] fixed style for initials image

* [ADF-1681] fixed button for new material design spec

* [ADF - 1681] Added documentation for the new values

* [ADF - 1681] added some test to check new input attributes
This commit is contained in:
Vito
2017-10-16 22:55:40 +01:00
committed by Eugenio Romano
parent bf05b5df05
commit 3023d30d38
15 changed files with 325 additions and 90 deletions

View File

@@ -45,7 +45,10 @@ export class UserInfoComponent implements OnInit {
menuPositionY: string = 'below';
@Input()
fallBackThumbnailImage: string;
showName: boolean = true;
@Input()
namePosition: string = 'right';
ecmUser: EcmUserModel;
bpmUser: BpmUserModel;
@@ -78,9 +81,9 @@ export class UserInfoComponent implements OnInit {
if (this.authService.isEcmLoggedIn()) {
this.ecmUserService.getCurrentUserInfo()
.subscribe((res) => {
this.ecmUser = new EcmUserModel(res);
this.getEcmAvatar();
}
this.ecmUser = new EcmUserModel(res);
this.getEcmAvatar();
}
);
} else {
this.ecmUser = null;
@@ -101,13 +104,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();
}
@@ -116,15 +112,7 @@ export class UserInfoComponent implements OnInit {
this.ecmUserImage = this.ecmUserService.getUserProfileImage(this.ecmUser.avatarId);
}
getUserAvatar() {
return this.ecmUserImage || this.bpmUserImage;
}
getBpmUserAvatar() {
return this.bpmUserImage;
}
getEcmUserAvatar() {
return this.ecmUserImage;
showOnRight() {
return this.namePosition === 'right';
}
}