Moved from tslint to eslint as tslint was depreciated.
Added prettier and also prettied all the typescript files using prettier ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
1 parent
40e79ff949
commit
1350870f9e
545 files changed
+8455
-7036
No files matched your search
@@ -1,19 +1,19 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {FormBuilder, FormGroup} from '@angular/forms';
|
||||
import { Component, OnInit } 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 { 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';
|
||||
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({
|
||||
selector: 'app-employee-functions',
|
||||
templateUrl: './employee-functions.component.html',
|
||||
styleUrls: ['./employee-functions.component.css']
|
||||
styleUrls: ['./employee-functions.component.css'],
|
||||
})
|
||||
export class EmployeeFunctionsComponent implements OnInit {
|
||||
creditSalaryForm: FormGroup;
|
||||
@@ -29,23 +29,22 @@ export class EmployeeFunctionsComponent implements OnInit {
|
||||
private toaster: ToasterService,
|
||||
private auth: AuthService,
|
||||
private ser: EmployeeFunctionsService,
|
||||
private employeeSer: EmployeeService
|
||||
private employeeSer: EmployeeService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
createForm() {
|
||||
const startDate = moment().date(1);
|
||||
const finishDate = moment().date(startDate.daysInMonth());
|
||||
this.creditSalaryForm = this.fb.group({
|
||||
date: finishDate
|
||||
date: finishDate,
|
||||
});
|
||||
this.attendanceRecordForm = this.fb.group({
|
||||
startDate: startDate,
|
||||
finishDate: finishDate
|
||||
finishDate: finishDate,
|
||||
});
|
||||
this.fingerprintForm = this.fb.group({});
|
||||
}
|
||||
@@ -73,21 +72,24 @@ export class EmployeeFunctionsComponent implements OnInit {
|
||||
this.toaster.show('Danger', 'Please choose a valid date.');
|
||||
return;
|
||||
}
|
||||
this.ser.creditSalary(date)
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', 'Salaries Credited');
|
||||
},
|
||||
(error) => {
|
||||
console.log('Error:', error);
|
||||
this.toaster.show('Danger', error);
|
||||
}
|
||||
);
|
||||
this.ser.creditSalary(date).subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', 'Salaries Credited');
|
||||
},
|
||||
(error) => {
|
||||
console.log('Error:', error);
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
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').value).format(
|
||||
'DD-MMM-YYYY',
|
||||
);
|
||||
const finishDate = moment(this.attendanceRecordForm.get('finishDate').value).format(
|
||||
'DD-MMM-YYYY',
|
||||
);
|
||||
if (!startDate || !finishDate) {
|
||||
// this.toaster.show('Danger', 'Please choose a start and finish date.');
|
||||
return;
|
||||
@@ -104,14 +106,13 @@ export class EmployeeFunctionsComponent implements OnInit {
|
||||
this.toaster.show('Danger', 'Please choose a file first!');
|
||||
return;
|
||||
}
|
||||
this.ser.uploadFingerprints(this.fingerprintFile)
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', 'Fingerprints uploaded');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
}
|
||||
);
|
||||
this.ser.uploadFingerprints(this.fingerprintFile).subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', 'Fingerprints uploaded');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user