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