mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Improved test readibility and code
This commit is contained in:
@@ -37,24 +37,22 @@ export class EcmUserService {
|
||||
* @param userName - the user name
|
||||
*/
|
||||
getUserInfo(userName: string): Observable<EcmUserModel> {
|
||||
if ( this.authService.isEcmLoggedIn() ) {
|
||||
return Observable.fromPromise(this.callApiGetPersonInfo(userName))
|
||||
.map(
|
||||
(data) => <EcmUserModel> data['entry']
|
||||
)
|
||||
.catch(this.handleError);
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentUserInfo() {
|
||||
return this.getUserInfo('-me-');
|
||||
}
|
||||
|
||||
callApiGetPersonInfo(userName: string, opts?: any) {
|
||||
private callApiGetPersonInfo(userName: string, opts?: any) {
|
||||
return this.authService.getAlfrescoApi().core.peopleApi.getPerson(userName, opts);
|
||||
}
|
||||
|
||||
getCurrentUserProfileImageUrl(avatarId: string) {
|
||||
getUserProfileImage(avatarId: string) {
|
||||
if ( avatarId ) {
|
||||
let nodeObj = {entry: {id: avatarId}};
|
||||
return this.contentService.getContentUrl(nodeObj);
|
||||
|
Reference in New Issue
Block a user