mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
committed by
Eugenio Romano
parent
140c64b79f
commit
edc0945f39
@@ -56,7 +56,7 @@ describe('TaskAttachmentList', () => {
|
||||
{ name: 'FakeName-2', lastUpdatedByFullName: 'FakeUser-2', lastUpdated: '2017-01-03' }
|
||||
]));
|
||||
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { FormService } from './../services/form.service';
|
||||
|
||||
@Component({
|
||||
@@ -33,7 +33,7 @@ export class FormListComponent implements OnChanges {
|
||||
constructor(protected formService: FormService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
ngOnChanges() {
|
||||
this.getForms();
|
||||
}
|
||||
|
||||
|
@@ -195,7 +195,7 @@ describe('ContentWidgetComponent', () => {
|
||||
const change = new SimpleChange(null, contentId, true);
|
||||
component.ngOnChanges({ 'id': change });
|
||||
|
||||
component.contentLoaded.subscribe((res) => {
|
||||
component.contentLoaded.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ValidateFormFieldEvent } from './../../../events/validate-form-field.event';
|
||||
import { ValidateFormEvent } from './../../../events/validate-form.event';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { ContainerModel } from './container.model';
|
||||
import { FormFieldTypes } from './form-field-types';
|
||||
@@ -298,7 +297,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateForm.subscribe((event: ValidateFormEvent) => {
|
||||
formService.validateForm.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@@ -316,7 +315,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateFormField.subscribe((event: ValidateFormFieldEvent) => {
|
||||
formService.validateFormField.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@@ -333,7 +332,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateFormField.subscribe((event: ValidateFormFieldEvent) => {
|
||||
formService.validateFormField.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@@ -385,10 +384,10 @@ describe('FormModel', () => {
|
||||
spyOn(form, 'getFormFields').and.returnValue([testField]);
|
||||
|
||||
const validator = <FormFieldValidator> {
|
||||
isSupported(field: FormFieldModel): boolean {
|
||||
isSupported(): boolean {
|
||||
return true;
|
||||
},
|
||||
validate(field: FormFieldModel): boolean {
|
||||
validate(): boolean {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@@ -60,10 +60,10 @@ describe('RowEditorComponent', () => {
|
||||
spyOn(component.table, 'validateRow').and.returnValue(
|
||||
<DynamicRowValidationSummary> {isValid: true, message: null}
|
||||
);
|
||||
component.save.subscribe((e) => {
|
||||
expect(e.table).toBe(component.table);
|
||||
expect(e.row).toBe(component.row);
|
||||
expect(e.column).toBe(component.column);
|
||||
component.save.subscribe((event) => {
|
||||
expect(event.table).toBe(component.table);
|
||||
expect(event.row).toBe(component.row);
|
||||
expect(event.column).toBe(component.column);
|
||||
done();
|
||||
});
|
||||
component.onSaveChanges();
|
||||
@@ -74,7 +74,7 @@ describe('RowEditorComponent', () => {
|
||||
<DynamicRowValidationSummary> {isValid: false, message: 'error'}
|
||||
);
|
||||
let raised = false;
|
||||
component.save.subscribe((e) => raised = true);
|
||||
component.save.subscribe(() => raised = true);
|
||||
component.onSaveChanges();
|
||||
expect(raised).toBeFalsy();
|
||||
});
|
||||
|
@@ -179,7 +179,7 @@ describe('RadioButtonsWidgetComponent', () => {
|
||||
expect(element.querySelector('#radio-id')).not.toBeNull();
|
||||
expect(option).not.toBeNull();
|
||||
option.click();
|
||||
widget.fieldChanged.subscribe((field) => {
|
||||
widget.fieldChanged.subscribe(() => {
|
||||
expect(element.querySelector('#radio-id')).toBeNull();
|
||||
expect(element.querySelector('#radio-id-opt-1-input')).toBeNull();
|
||||
});
|
||||
|
@@ -126,7 +126,7 @@ describe('TabsWidgetComponent', () => {
|
||||
|
||||
tick(500);
|
||||
|
||||
tabWidgetComponent.formTabChanged.subscribe((res) => {
|
||||
tabWidgetComponent.formTabChanged.subscribe(() => {
|
||||
tabWidgetComponent.tabs[1].isVisible = true;
|
||||
|
||||
tick(500);
|
||||
@@ -144,7 +144,7 @@ describe('TabsWidgetComponent', () => {
|
||||
|
||||
tick(500);
|
||||
|
||||
tabWidgetComponent.formTabChanged.subscribe((res) => {
|
||||
tabWidgetComponent.formTabChanged.subscribe(() => {
|
||||
tabWidgetComponent.tabs[0].isVisible = false;
|
||||
|
||||
tick(500);
|
||||
|
@@ -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');
|
||||
|
@@ -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();
|
||||
|
@@ -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 = '!=';
|
||||
|
@@ -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';
|
||||
|
@@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user