mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[DW-44] - Task Service - Add a new method to get the application details by Id (#1843)
ADF-555 New service that returns application details for a given appId
This commit is contained in:
committed by
Eugenio Romano
parent
25cffb1f19
commit
f89a0eafd9
@@ -506,6 +506,24 @@ describe('Activiti TaskList Service', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should get the deployed app details by id ', (done) => {
|
||||
service.getApplicationDetailsById(1).subscribe(
|
||||
(app: any) => {
|
||||
expect(app).toBeDefined();
|
||||
expect(app.name).toEqual('Sales-Fakes-App');
|
||||
expect(app.description).toEqual('desc-fake1');
|
||||
expect(app.deploymentId).toEqual('111');
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify(fakeApps)
|
||||
});
|
||||
});
|
||||
|
||||
it('should create a new standalone task ', (done) => {
|
||||
let taskFake = new TaskDetailsModel({
|
||||
name: 'FakeNameTask',
|
||||
|
@@ -42,13 +42,25 @@ export class ActivitiTaskListService {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
|
||||
.map((response: any) => {
|
||||
if (name) {
|
||||
return response.data.find(p => p.name === name);
|
||||
return response.data.find(app => app.name === name);
|
||||
}
|
||||
return response.data;
|
||||
})
|
||||
.catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Deployed App details by appId
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getApplicationDetailsById(appId: number): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
|
||||
.map((response: any) => {
|
||||
return response.data.find(app => app.id === appId);
|
||||
})
|
||||
.catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all the Tasks filters
|
||||
* @returns {Observable<any>}
|
||||
|
Reference in New Issue
Block a user