mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +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({
|
data: [new FilterProcessRepresentationModel({
|
||||||
'name': 'Running',
|
'name': 'Running',
|
||||||
'appId': '22',
|
'appId': '22',
|
||||||
'id': '333',
|
'id': 333,
|
||||||
'recent': true,
|
'recent': true,
|
||||||
'icon': 'glyphicon-random',
|
'icon': 'glyphicon-random',
|
||||||
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
|
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
|
||||||
|
@@ -596,13 +596,13 @@ describe('ActivitiProcessService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return the task filter by id', (done) => {
|
it('should return the task filter by id', (done) => {
|
||||||
service.getProcessFilterById('333').subscribe(
|
service.getProcessFilterById(333).subscribe(
|
||||||
(res: FilterProcessRepresentationModel) => {
|
(processFilter: FilterProcessRepresentationModel) => {
|
||||||
expect(res).toBeDefined();
|
expect(processFilter).toBeDefined();
|
||||||
expect(res.id).toEqual('333');
|
expect(processFilter.id).toEqual(333);
|
||||||
expect(res.name).toEqual('Running');
|
expect(processFilter.name).toEqual('Running');
|
||||||
expect(res.filter.sort).toEqual('created-desc');
|
expect(processFilter.filter.sort).toEqual('created-desc');
|
||||||
expect(res.filter.state).toEqual('running');
|
expect(processFilter.filter.state).toEqual('running');
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -612,7 +612,7 @@ describe('ActivitiProcessService', () => {
|
|||||||
service.getProcessFilterByName('Running').subscribe(
|
service.getProcessFilterByName('Running').subscribe(
|
||||||
(res: FilterProcessRepresentationModel) => {
|
(res: FilterProcessRepresentationModel) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
expect(res.id).toEqual('333');
|
expect(res.id).toEqual(333);
|
||||||
expect(res.name).toEqual('Running');
|
expect(res.name).toEqual('Running');
|
||||||
expect(res.filter.sort).toEqual('created-desc');
|
expect(res.filter.sort).toEqual('created-desc');
|
||||||
expect(res.filter.state).toEqual('running');
|
expect(res.filter.state).toEqual('running');
|
||||||
|
@@ -72,13 +72,14 @@ export class ActivitiProcessService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the process filter by id
|
* 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>}
|
* @returns {Observable<FilterProcessRepresentationModel>}
|
||||||
*/
|
*/
|
||||||
getProcessFilterById(processId: string, appId?: string): Observable<FilterProcessRepresentationModel> {
|
getProcessFilterById(filterId: number, appId?: string): Observable<FilterProcessRepresentationModel> {
|
||||||
return Observable.fromPromise(this.callApiGetUserProcessInstanceFilters(appId))
|
return Observable.fromPromise(this.callApiProcessFilters(appId))
|
||||||
.map((response: any) => {
|
.map((response: any) => {
|
||||||
return response.data.find(filter => filter.id === processId);
|
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