mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[DW-45] Process Service - Fix the input type from string to number (#1845)
Process Service - Fix the input type from string to number
This commit is contained in:
committed by
Eugenio Romano
parent
0fa56dff23
commit
8959476941
@@ -28,7 +28,7 @@ export var fakeFilters = {
|
||||
data: [new FilterProcessRepresentationModel({
|
||||
'name': 'Running',
|
||||
'appId': '22',
|
||||
'id': '333',
|
||||
'id': 333,
|
||||
'recent': true,
|
||||
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
|
||||
|
@@ -596,13 +596,13 @@ describe('ActivitiProcessService', () => {
|
||||
});
|
||||
|
||||
it('should return the task filter by id', (done) => {
|
||||
service.getProcessFilterById('333').subscribe(
|
||||
(res: FilterProcessRepresentationModel) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.id).toEqual('333');
|
||||
expect(res.name).toEqual('Running');
|
||||
expect(res.filter.sort).toEqual('created-desc');
|
||||
expect(res.filter.state).toEqual('running');
|
||||
service.getProcessFilterById(333).subscribe(
|
||||
(processFilter: FilterProcessRepresentationModel) => {
|
||||
expect(processFilter).toBeDefined();
|
||||
expect(processFilter.id).toEqual(333);
|
||||
expect(processFilter.name).toEqual('Running');
|
||||
expect(processFilter.filter.sort).toEqual('created-desc');
|
||||
expect(processFilter.filter.state).toEqual('running');
|
||||
done();
|
||||
}
|
||||
);
|
||||
@@ -612,7 +612,7 @@ describe('ActivitiProcessService', () => {
|
||||
service.getProcessFilterByName('Running').subscribe(
|
||||
(res: FilterProcessRepresentationModel) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.id).toEqual('333');
|
||||
expect(res.id).toEqual(333);
|
||||
expect(res.name).toEqual('Running');
|
||||
expect(res.filter.sort).toEqual('created-desc');
|
||||
expect(res.filter.state).toEqual('running');
|
||||
|
@@ -72,13 +72,14 @@ export class ActivitiProcessService {
|
||||
|
||||
/**
|
||||
* Retrieve the process filter by id
|
||||
* @param processId - string - The id of the filter
|
||||
* @param filterId - number - The id of the filter
|
||||
* @param appId - string - optional - The id of app
|
||||
* @returns {Observable<FilterProcessRepresentationModel>}
|
||||
*/
|
||||
getProcessFilterById(processId: string, appId?: string): Observable<FilterProcessRepresentationModel> {
|
||||
return Observable.fromPromise(this.callApiGetUserProcessInstanceFilters(appId))
|
||||
getProcessFilterById(filterId: number, appId?: string): Observable<FilterProcessRepresentationModel> {
|
||||
return Observable.fromPromise(this.callApiProcessFilters(appId))
|
||||
.map((response: any) => {
|
||||
return response.data.find(filter => filter.id === processId);
|
||||
return response.data.find(filter => filter.id === filterId);
|
||||
}).catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user