Improved test readibility and code

This commit is contained in:
Vito Albano
2016-10-12 17:12:00 +01:00
parent 1037385295
commit 90332daa64
12 changed files with 289 additions and 400 deletions

View File

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