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:
@@ -38,7 +38,7 @@ export class BpmUserService {
|
||||
*/
|
||||
getCurrentUserInfo(): Observable<BpmUserModel> {
|
||||
if ( this.authService.isBpmLoggedIn() ) {
|
||||
return Observable.fromPromise(this.callApiGetProfile())
|
||||
return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.profileApi.getProfilePicture())
|
||||
.map(
|
||||
(data) => <BpmUserModel> data
|
||||
)
|
||||
@@ -46,9 +46,9 @@ export class BpmUserService {
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentUserProfileImage(): any {
|
||||
getCurrentUserProfileImage(): Observable<any> {
|
||||
if ( this.authService.isBpmLoggedIn() ) {
|
||||
return Observable.fromPromise(this.callApiGetProfilePicture())
|
||||
return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.profileApi.getProfile())
|
||||
.map(
|
||||
(data) => data
|
||||
)
|
||||
@@ -56,25 +56,6 @@ export class BpmUserService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call js api to get current user profile picture
|
||||
*/
|
||||
callApiGetProfilePicture() {
|
||||
try {
|
||||
return this.authService.getAlfrescoApi().activiti.profileApi.getProfilePicture();
|
||||
} catch (exc) {
|
||||
console.error(exc);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call js api to get current user information
|
||||
*/
|
||||
callApiGetProfile() {
|
||||
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw the error
|
||||
* @param error
|
||||
|
Reference in New Issue
Block a user