Chore: Eslint v9

Chore: Angular Zoneless
Chore: Removed Angular-Hotkeys dependency
Fix: Localization works properly now
Chore: Using Material 3 theme now
Chore: Removed toaster service to use snackbar directly
Fix: F2 Date working on all components now
This commit is contained in:
tanshu committed 2024-07-25 10:16:48 +05:30
1 parent c07c79ffda
commit 336a8f59c5
94 files changed
+846 -1030

No files matched your search

@@ -9,7 +9,7 @@ import { MatTabGroup, MatTab } from '@angular/material/tabs';
import moment from 'moment';
import { Moment } from 'moment';
import { ToasterService } from '../core/toaster.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { EmployeeFunctionsService } from './employee-functions.service';
@@ -48,7 +48,7 @@ export class EmployeeFunctionsComponent {
fingerprintFile: File | null = null;
constructor(
private toaster: ToasterService,
private snackBar: MatSnackBar,
private ser: EmployeeFunctionsService,
) {
const startDate = moment().date(1);
@@ -80,15 +80,15 @@ export class EmployeeFunctionsComponent {
creditSalary() {
const date = (this.creditSalaryForm.value.date ?? moment()).format('DD-MMM-YYYY');
if (!date) {
this.toaster.show('Danger', 'Please choose a valid date.');
this.snackBar.open('Please choose a valid date.', 'Danger');
return;
}
this.ser.creditSalary(date).subscribe({
next: () => {
this.toaster.show('Success', 'Salaries Credited');
this.snackBar.open('Salaries Credited', 'Success');
},
error: (error) => {
this.toaster.show('Danger', error);
this.snackBar.open(error, 'Danger');
},
});
}
@@ -97,7 +97,7 @@ export class EmployeeFunctionsComponent {
const startDate = (this.attendanceRecordForm.value.startDate ?? moment()).format('DD-MMM-YYYY');
const finishDate = (this.attendanceRecordForm.value.finishDate ?? moment()).format('DD-MMM-YYYY');
if (!startDate || !finishDate) {
// this.toaster.show('Danger', 'Please choose a start and finish date.');
// this.snackBar.open('Please choose a start and finish date.', 'Danger');
return '';
}
return `/attendance-report?s=${startDate}&f=${finishDate}`;
@@ -107,7 +107,7 @@ export class EmployeeFunctionsComponent {
const startDate = (this.attendanceRecordForm.value.startDate ?? moment()).format('DD-MMM-YYYY');
const finishDate = (this.attendanceRecordForm.value.finishDate ?? moment()).format('DD-MMM-YYYY');
if (!startDate || !finishDate) {
// this.toaster.show('Danger', 'Please choose a start and finish date.');
// this.snackBar.open('Please choose a start and finish date.', 'Danger');
return '';
}
return `/fingerprint-report?s=${startDate}&f=${finishDate}`;
@@ -119,15 +119,15 @@ export class EmployeeFunctionsComponent {
uploadFingerprints() {
if (!this.fingerprintFile) {
this.toaster.show('Danger', 'Please choose a file first!');
this.snackBar.open('Please choose a file first!', 'Danger');
return;
}
this.ser.uploadFingerprints(this.fingerprintFile).subscribe({
next: () => {
this.toaster.show('Success', 'Fingerprints uploaded');
this.snackBar.open('Fingerprints uploaded', 'Success');
},
error: (error) => {
this.toaster.show('Danger', error);
this.snackBar.open(error, 'Danger');
},
});
}