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: [
|
data: [
|
||||||
new AppDefinitionRepresentationModel(
|
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' }
|
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' }
|
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) => {
|
it('should return the task filter by id', (done) => {
|
||||||
service.getTaskFilterById('2').subscribe(
|
service.getTaskFilterById(2).subscribe(
|
||||||
(res: FilterRepresentationModel) => {
|
(taskFilter: FilterRepresentationModel) => {
|
||||||
expect(res).toBeDefined();
|
expect(taskFilter).toBeDefined();
|
||||||
expect(res.id).toEqual('2');
|
expect(taskFilter.id).toEqual(2);
|
||||||
expect(res.name).toEqual('FakeMyTasks');
|
expect(taskFilter.name).toEqual('FakeMyTasks');
|
||||||
expect(res.filter.sort).toEqual('created-desc');
|
expect(taskFilter.filter.sort).toEqual('created-desc');
|
||||||
expect(res.filter.state).toEqual('open');
|
expect(taskFilter.filter.state).toEqual('open');
|
||||||
expect(res.filter.assignment).toEqual('fake-assignee');
|
expect(taskFilter.filter.assignment).toEqual('fake-assignee');
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -125,7 +125,7 @@ describe('Activiti TaskList Service', () => {
|
|||||||
service.getTaskFilterByName('FakeMyTasks').subscribe(
|
service.getTaskFilterByName('FakeMyTasks').subscribe(
|
||||||
(res: FilterRepresentationModel) => {
|
(res: FilterRepresentationModel) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
expect(res.id).toEqual('2');
|
expect(res.id).toEqual(2);
|
||||||
expect(res.name).toEqual('FakeMyTasks');
|
expect(res.name).toEqual('FakeMyTasks');
|
||||||
expect(res.filter.sort).toEqual('created-desc');
|
expect(res.filter.sort).toEqual('created-desc');
|
||||||
expect(res.filter.state).toEqual('open');
|
expect(res.filter.state).toEqual('open');
|
||||||
|
@@ -79,13 +79,14 @@ export class ActivitiTaskListService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the Tasks filter by id
|
* 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>}
|
* @returns {Observable<FilterRepresentationModel>}
|
||||||
*/
|
*/
|
||||||
getTaskFilterById(taskId: string, appId?: string): Observable<FilterRepresentationModel> {
|
getTaskFilterById(filterId: number, appId?: string): Observable<FilterRepresentationModel> {
|
||||||
return Observable.fromPromise(this.callApiTaskFilters(appId))
|
return Observable.fromPromise(this.callApiTaskFilters(appId))
|
||||||
.map((response: any) => {
|
.map((response: any) => {
|
||||||
return response.data.find(filter => filter.id === taskId);
|
return response.data.find(filter => filter.id === filterId);
|
||||||
}).catch(err => this.handleError(err));
|
}).catch(err => this.handleError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user