Strict done!!

This commit is contained in:
2020-11-23 16:42:54 +05:30
parent af343cb7f9
commit afe746ecdc
142 changed files with 1258 additions and 907 deletions
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatDatepicker } from '@angular/material/datepicker';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
@@ -20,7 +20,7 @@ export class EmployeeFunctionsComponent {
creditSalaryForm: FormGroup;
attendanceRecordForm: FormGroup;
fingerprintForm: FormGroup;
fingerprintFile: File;
fingerprintFile: File | null = null;
constructor(
private route: ActivatedRoute,
@@ -44,7 +44,7 @@ export class EmployeeFunctionsComponent {
}
chosenYearHandler(normalizedYear: Moment) {
const dateControl = this.creditSalaryForm.get('date');
const dateControl = this.creditSalaryForm.get('date') as FormControl;
const ctrlValue = dateControl.value;
ctrlValue.year(normalizedYear.year());
ctrlValue.date(ctrlValue.daysInMonth());
@@ -52,7 +52,7 @@ export class EmployeeFunctionsComponent {
}
chosenMonthHandler(normlizedMonth: Moment, datepicker: MatDatepicker<Moment>) {
const dateControl = this.creditSalaryForm.get('date');
const dateControl = this.creditSalaryForm.get('date') as FormControl;
const ctrlValue = dateControl.value;
ctrlValue.month(normlizedMonth.month());
ctrlValue.date(ctrlValue.daysInMonth());
@@ -61,7 +61,9 @@ export class EmployeeFunctionsComponent {
}
creditSalary() {
const date = moment(this.creditSalaryForm.get('date').value).format('DD-MMM-YYYY');
const date = moment((this.creditSalaryForm.get('date') as FormControl).value).format(
'DD-MMM-YYYY',
);
if (!date) {
this.toaster.show('Danger', 'Please choose a valid date.');
return;
@@ -77,12 +79,12 @@ export class EmployeeFunctionsComponent {
}
attendanceRecordUrl() {
const startDate = moment(this.attendanceRecordForm.get('startDate').value).format(
'DD-MMM-YYYY',
);
const finishDate = moment(this.attendanceRecordForm.get('finishDate').value).format(
'DD-MMM-YYYY',
);
const startDate = moment(
(this.attendanceRecordForm.get('startDate') as FormControl).value,
).format('DD-MMM-YYYY');
const finishDate = moment(
(this.attendanceRecordForm.get('finishDate') as FormControl).value,
).format('DD-MMM-YYYY');
if (!startDate || !finishDate) {
// this.toaster.show('Danger', 'Please choose a start and finish date.');
return '';
@@ -90,8 +92,9 @@ export class EmployeeFunctionsComponent {
return `/attendance-report?s=${startDate}&f=${finishDate}`;
}
detectFiles(event) {
[this.fingerprintFile] = event.target.files;
detectFiles(event: Event) {
// eslint-disable-next-line prefer-destructuring
this.fingerprintFile = ((event.target as HTMLInputElement).files as FileList)[0];
}
uploadFingerprints() {