enable prefer-const rule for tslint, fix issues (#4409)

* enable prefer-const rule for tslint, fix issues

* Update content-node-selector.component.spec.ts

* Update content-node-selector.component.spec.ts

* fix const

* fix lint issues

* update tests

* update tests

* update tests

* fix code

* fix page class
This commit is contained in:
Denys Vuika
2019-03-25 12:19:33 +00:00
committed by Eugenio Romano
parent 26c5982a1a
commit a7a48e8b2b
581 changed files with 5435 additions and 5402 deletions

View File

@@ -62,7 +62,7 @@ export class DateRangeWidgetComponent implements OnInit {
this.dateAdapter.setLocale(locale);
});
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
const momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
momentDateAdapter.overrideDisplayFormat = this.SHOW_FORMAT;
if (this.field) {
@@ -75,11 +75,11 @@ export class DateRangeWidgetComponent implements OnInit {
}
}
let startDateControl = new FormControl(this.startDatePicker);
const startDateControl = new FormControl(this.startDatePicker);
startDateControl.setValidators(Validators.required);
this.dateRange.addControl('startDate', startDateControl);
let endDateControl = new FormControl(this.endDatePicker);
const endDateControl = new FormControl(this.endDatePicker);
endDateControl.setValidators(Validators.required);
this.dateRange.addControl('endDate', endDateControl);
@@ -89,8 +89,8 @@ export class DateRangeWidgetComponent implements OnInit {
onGroupValueChanged() {
if (this.dateRange.valid) {
let dateStart = this.convertToMomentDateWithTime(this.dateRange.controls.startDate.value);
let endStart = this.convertToMomentDateWithTime(this.dateRange.controls.endDate.value);
const dateStart = this.convertToMomentDateWithTime(this.dateRange.controls.startDate.value);
const endStart = this.convertToMomentDateWithTime(this.dateRange.controls.endDate.value);
this.dateRangeChanged.emit({startDate: dateStart, endDate: endStart});
}
}
@@ -100,9 +100,9 @@ export class DateRangeWidgetComponent implements OnInit {
}
dateCheck(formControl: AbstractControl) {
let startDate = moment(formControl.get('startDate').value);
let endDate = moment(formControl.get('endDate').value);
let isAfterCheck = startDate.isAfter(endDate);
const startDate = moment(formControl.get('startDate').value);
const endDate = moment(formControl.get('endDate').value);
const isAfterCheck = startDate.isAfter(endDate);
return isAfterCheck ? {'greaterThan': true} : null;
}

View File

@@ -65,7 +65,7 @@ export class DropdownWidgetAnalyticsComponent extends WidgetComponent implements
}
buildValidatorList() {
let validatorList = [];
const validatorList = [];
validatorList.push(Validators.required);
if (this.showDefaultOption) {
validatorList.push(this.validateDropDown);

View File

@@ -53,7 +53,7 @@ export class DurationWidgetComponent extends NumberWidgetAnalyticsComponent impl
}
ngOnInit() {
let timeType = new FormControl();
const timeType = new FormControl();
this.formGroup.addControl('timeType', timeType);
if (this.required) {
@@ -63,7 +63,7 @@ export class DurationWidgetComponent extends NumberWidgetAnalyticsComponent impl
this.field.value = 0;
}
let paramOptions: ParameterValueModel[] = [];
const paramOptions: ParameterValueModel[] = [];
paramOptions.push(new ParameterValueModel({id: '1', name: 'Seconds'}));
paramOptions.push(new ParameterValueModel({id: '60', name: 'Minutes'}));
paramOptions.push(new ParameterValueModel({id: '3600', name: 'Hours'}));

View File

@@ -26,7 +26,7 @@ export class WidgetComponent implements OnChanges {
fieldChanged: EventEmitter<any> = new EventEmitter<any>();
ngOnChanges(changes: SimpleChanges) {
let field = changes['field'];
const field = changes['field'];
if (field && field.currentValue) {
this.fieldChanged.emit(field.currentValue.value);
return;