remove getTicket and fix tasklist filter

This commit is contained in:
Eugenio Romano 2016-08-23 12:24:09 +01:00
parent a02a17d78b
commit 2f64605c93
3 changed files with 9 additions and 17 deletions

View File

@ -164,7 +164,7 @@ export class ActivitiTaskListService {
if (appId) { if (appId) {
return this.authService.getAlfrescoApi().activiti.taskApi.filterTasks({appDefinitionId: appId}); return this.authService.getAlfrescoApi().activiti.taskApi.filterTasks({appDefinitionId: appId});
} else { } else {
return this.authService.getAlfrescoApi().activiti.taskApi.filterTasks({}); return this.authService.getAlfrescoApi().activiti.taskApi.filterTasks();
} }
} }

View File

@ -246,7 +246,8 @@ describe('AlfrescoAuthentication', () => {
it('should return both ECM and BPM tickets after the login done', (done) => { it('should return both ECM and BPM tickets after the login done', (done) => {
authService.login('fake-username', 'fake-password').subscribe(() => { authService.login('fake-username', 'fake-password').subscribe(() => {
expect(authService.isLoggedIn()).toBe(true); expect(authService.isLoggedIn()).toBe(true);
expect(authService.getTicket()).toEqual(['fake-post-ticket', 'Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk']); expect(authService.getTicketEcm()).toEqual('fake-post-ticket');
expect(authService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
done(); done();
}); });
@ -267,7 +268,8 @@ describe('AlfrescoAuthentication', () => {
}, },
(err: any) => { (err: any) => {
expect(authService.isLoggedIn()).toBe(false); expect(authService.isLoggedIn()).toBe(false);
expect(authService.getTicket()).toBe(null); expect(authService.getTicketEcm()).toBe(null);
expect(authService.getTicketBpm()).toBe(null);
done(); done();
}); });
@ -286,7 +288,8 @@ describe('AlfrescoAuthentication', () => {
}, },
(err: any) => { (err: any) => {
expect(authService.isLoggedIn()).toBe(false); expect(authService.isLoggedIn()).toBe(false);
expect(authService.getTicket()).toBe(null); expect(authService.getTicketEcm()).toBe(null);
expect(authService.getTicketBpm()).toBe(null);
done(); done();
}); });
@ -307,7 +310,8 @@ describe('AlfrescoAuthentication', () => {
}, },
(err: any) => { (err: any) => {
expect(authService.isLoggedIn()).toBe(false); expect(authService.isLoggedIn()).toBe(false);
expect(authService.getTicket()).toBe(null); expect(authService.getTicketEcm()).toBe(null);
expect(authService.getTicketBpm()).toBe(null);
done(); done();
}); });

View File

@ -133,18 +133,6 @@ export class AlfrescoAuthenticationService {
} }
} }
/**
* The method return the ECM and Bpm in an Array ticket stored in the localStorage
* @returns ticket
*/
public getTicket(): any {
if (localStorage.getItem('ticket-ECM') || localStorage.getItem('ticket-BPM')) {
return [localStorage.getItem('ticket-ECM'), localStorage.getItem('ticket-BPM')];
} else {
return null;
}
}
/** /**
* The method return the BPM ticket stored in the localStorage * The method return the BPM ticket stored in the localStorage
* @returns ticket * @returns ticket