fix "ng lint" command (#5012)

* update to latest js-api

* fix the "ng lint" command

* fix linting issues

* fix lint issues

* lint fixes

* code fixes

* fix html

* fix html

* update tests

* test fixes

* update tests

* fix tests and api

* fix code
This commit is contained in:
Denys Vuika
2019-08-29 16:35:30 +01:00
committed by Eugenio Romano
parent 140c64b79f
commit edc0945f39
162 changed files with 537 additions and 530 deletions

View File

@@ -93,7 +93,7 @@ describe('Form service', () => {
const simpleResponseBody = { id: 1, modelType: 'test' };
it('should fetch and parse process definitions', (done) => {
service.getProcessDefinitions().subscribe((result) => {
service.getProcessDefinitions().subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/process-definitions')).toBeTruthy();
expect( [ { id: '1' }, { id: '2' } ]).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
done();
@@ -107,7 +107,7 @@ describe('Form service', () => {
});
it('should fetch and parse tasks', (done) => {
service.getTasks().subscribe((result) => {
service.getTasks().subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/query')).toBeTruthy();
expect( [ { id: '1' }, { id: '2' } ]).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
done();
@@ -240,7 +240,7 @@ describe('Form service', () => {
});
processApiSpy.getProcessDefinitionStartForm.and.returnValue(Promise.resolve({ id: '1' }));
service.getStartFormDefinition('myprocess:1').subscribe((result) => {
service.getStartFormDefinition('myprocess:1').subscribe(() => {
expect(processApiSpy.getProcessDefinitionStartForm).toHaveBeenCalledWith('myprocess:1');
done();
});
@@ -344,7 +344,7 @@ describe('Form service', () => {
});
it('should create a Form with modelType=2', (done) => {
service.createForm('testName').subscribe((result) => {
service.createForm('testName').subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/models')).toBeTruthy();
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).modelType).toEqual(2);
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toEqual('testName');

View File

@@ -161,7 +161,7 @@ describe('NodeService', () => {
testdata: 'testdata'
};
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe((result) => {
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('-root-/children')).toBeTruthy();
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toBeDefined();
done();

View File

@@ -268,7 +268,7 @@ describe('WidgetVisibilityCloudService', () => {
it('should retrieve the value for the right field when it is a process variable', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.rightValue = 'test_value_2';
const rightValue = service.getRightValue(formTest, visibilityObjTest);
@@ -286,7 +286,7 @@ describe('WidgetVisibilityCloudService', () => {
it('should retrieve the value for the left field when it is a process variable', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftValue = 'TEST_VAR_2';
visibilityObjTest.leftType = WidgetTypeEnum.field;
const leftValue = service.getLeftValue(formTest, visibilityObjTest);
@@ -305,7 +305,7 @@ describe('WidgetVisibilityCloudService', () => {
it('should evaluate the visibility for the field between form value and process var', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftType = 'LEFT_FORM_FIELD_ID';
visibilityObjTest.operator = '!=';
visibilityObjTest.rightValue = 'TEST_VAR_2';
@@ -324,7 +324,7 @@ describe('WidgetVisibilityCloudService', () => {
it('should evaluate visibility with multiple conditions', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftType = 'field';
visibilityObjTest.leftValue = 'TEST_VAR_2';
visibilityObjTest.operator = '!=';

View File

@@ -252,7 +252,7 @@ describe('WidgetVisibilityService', () => {
it('should retrieve the value for the right field when it is a process variable', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';
const rightValue = service.getRightValue(formTest, visibilityObjTest);
@@ -270,7 +270,7 @@ describe('WidgetVisibilityService', () => {
it('should retrieve the value for the left field when it is a process variable', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftRestResponseId = 'TEST_VAR_2';
const leftValue = service.getLeftValue(formTest, visibilityObjTest);
@@ -288,7 +288,7 @@ describe('WidgetVisibilityService', () => {
it('should evaluate the visibility for the field between form value and process var', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID';
visibilityObjTest.operator = '!=';
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';
@@ -307,7 +307,7 @@ describe('WidgetVisibilityService', () => {
it('should evaluate visibility with multiple conditions', (done) => {
service.getTaskProcessVariable('9999').subscribe(
(res: TaskProcessVariableModel[]) => {
() => {
visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID';
visibilityObjTest.operator = '!=';
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';

View File

@@ -282,7 +282,7 @@ export class WidgetVisibilityService {
this.processVarList = <TaskProcessVariableModel[]> jsonRes;
return jsonRes;
}),
catchError((err) => this.handleError(err))
catchError(() => this.handleError())
);
}
@@ -298,7 +298,7 @@ export class WidgetVisibilityService {
return !!(condition && condition.operator);
}
private handleError(err) {
private handleError() {
this.logService.error('Error while performing a call');
return throwError('Error while performing a call - Server error');
}