mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[DW-43] Task Service - Fix the input type from string to number (#1842)
ADF-554 Process Service - Fix the input type from string to number
This commit is contained in:
committed by
Eugenio Romano
parent
f89a0eafd9
commit
0fa56dff23
@@ -25,12 +25,12 @@ export var fakeFilters = {
|
||||
data: [
|
||||
new AppDefinitionRepresentationModel(
|
||||
{
|
||||
id: '1', name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
id: 1, name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-involved' }
|
||||
}
|
||||
),
|
||||
{
|
||||
id: '2', name: 'FakeMyTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
id: 2, name: 'FakeMyTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-assignee' }
|
||||
}
|
||||
]
|
||||
|
@@ -102,14 +102,14 @@ describe('Activiti TaskList Service', () => {
|
||||
});
|
||||
|
||||
it('should return the task filter by id', (done) => {
|
||||
service.getTaskFilterById('2').subscribe(
|
||||
(res: FilterRepresentationModel) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.id).toEqual('2');
|
||||
expect(res.name).toEqual('FakeMyTasks');
|
||||
expect(res.filter.sort).toEqual('created-desc');
|
||||
expect(res.filter.state).toEqual('open');
|
||||
expect(res.filter.assignment).toEqual('fake-assignee');
|
||||
service.getTaskFilterById(2).subscribe(
|
||||
(taskFilter: FilterRepresentationModel) => {
|
||||
expect(taskFilter).toBeDefined();
|
||||
expect(taskFilter.id).toEqual(2);
|
||||
expect(taskFilter.name).toEqual('FakeMyTasks');
|
||||
expect(taskFilter.filter.sort).toEqual('created-desc');
|
||||
expect(taskFilter.filter.state).toEqual('open');
|
||||
expect(taskFilter.filter.assignment).toEqual('fake-assignee');
|
||||
done();
|
||||
}
|
||||
);
|
||||
@@ -125,7 +125,7 @@ describe('Activiti TaskList Service', () => {
|
||||
service.getTaskFilterByName('FakeMyTasks').subscribe(
|
||||
(res: FilterRepresentationModel) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.id).toEqual('2');
|
||||
expect(res.id).toEqual(2);
|
||||
expect(res.name).toEqual('FakeMyTasks');
|
||||
expect(res.filter.sort).toEqual('created-desc');
|
||||
expect(res.filter.state).toEqual('open');
|
||||
|
@@ -79,13 +79,14 @@ export class ActivitiTaskListService {
|
||||
|
||||
/**
|
||||
* Retrieve the Tasks filter by id
|
||||
* @param taskId - string - The id of the filter
|
||||
* @param filterId - number - The id of the filter
|
||||
* @param appId - string - optional - The id of app
|
||||
* @returns {Observable<FilterRepresentationModel>}
|
||||
*/
|
||||
getTaskFilterById(taskId: string, appId?: string): Observable<FilterRepresentationModel> {
|
||||
getTaskFilterById(filterId: number, appId?: string): Observable<FilterRepresentationModel> {
|
||||
return Observable.fromPromise(this.callApiTaskFilters(appId))
|
||||
.map((response: any) => {
|
||||
return response.data.find(filter => filter.id === taskId);
|
||||
return response.data.find(filter => filter.id === filterId);
|
||||
}).catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user