Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.

Now all that is needed is to make it ready for strict compiling.
Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier

Bumped to v8.0.0
This commit is contained in:
2020-10-10 08:45:05 +05:30
parent 438a98334d
commit 5ea09df272
320 changed files with 2233 additions and 2268 deletions
@@ -1,13 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatDatepicker } from '@angular/material/datepicker';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
import { Moment } from 'moment';
import { AuthService } from '../auth/auth.service';
import { ToasterService } from '../core/toaster.service';
import { EmployeeService } from '../employee/employee.service';
import { EmployeeFunctionsService } from './employee-functions.service';
@Component({
@@ -15,7 +16,7 @@ import { EmployeeFunctionsService } from './employee-functions.service';
templateUrl: './employee-functions.component.html',
styleUrls: ['./employee-functions.component.css'],
})
export class EmployeeFunctionsComponent implements OnInit {
export class EmployeeFunctionsComponent {
creditSalaryForm: FormGroup;
attendanceRecordForm: FormGroup;
fingerprintForm: FormGroup;
@@ -29,13 +30,10 @@ export class EmployeeFunctionsComponent implements OnInit {
private toaster: ToasterService,
private auth: AuthService,
private ser: EmployeeFunctionsService,
private employeeSer: EmployeeService,
) {
this.createForm();
}
ngOnInit() {}
createForm() {
const startDate = moment().date(1);
const finishDate = moment().date(startDate.daysInMonth());
@@ -43,8 +41,8 @@ export class EmployeeFunctionsComponent implements OnInit {
date: finishDate,
});
this.attendanceRecordForm = this.fb.group({
startDate: startDate,
finishDate: finishDate,
startDate,
finishDate,
});
this.fingerprintForm = this.fb.group({});
}
@@ -73,11 +71,10 @@ export class EmployeeFunctionsComponent implements OnInit {
return;
}
this.ser.creditSalary(date).subscribe(
(result) => {
() => {
this.toaster.show('Success', 'Salaries Credited');
},
(error) => {
console.log('Error:', error);
this.toaster.show('Danger', error);
},
);
@@ -92,13 +89,13 @@ export class EmployeeFunctionsComponent implements OnInit {
);
if (!startDate || !finishDate) {
// this.toaster.show('Danger', 'Please choose a start and finish date.');
return;
return '';
}
return '/attendance-report?s=' + startDate + '&f=' + finishDate;
return `/attendance-report?s=${startDate}&f=${finishDate}`;
}
detectFiles(event) {
this.fingerprintFile = event.target.files[0];
[this.fingerprintFile] = event.target.files;
}
uploadFingerprints() {
@@ -107,7 +104,7 @@ export class EmployeeFunctionsComponent implements OnInit {
return;
}
this.ser.uploadFingerprints(this.fingerprintFile).subscribe(
(result) => {
() => {
this.toaster.show('Success', 'Fingerprints uploaded');
},
(error) => {