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

+2 -2
View File
@@ -2,7 +2,7 @@ import { inject } from '@angular/core';
import { CanActivateFn } from '@angular/router';
import { Router } from '@angular/router';
import { ToasterService } from '../core/toaster.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { AuthService } from './auth.service';
@@ -18,7 +18,7 @@ export const authGuard: CanActivateFn = (route, state) => {
return false;
}
if (permission !== undefined && user.perms.indexOf(permission) === -1) {
inject(ToasterService).show('Danger', 'You do not have the permission to access this area.');
inject(MatSnackBar).open('You do not have the permission to access this area.', 'Danger');
return false;
}
// logged in so return true
@@ -8,7 +8,7 @@ import { MatIcon } from '@angular/material/icon';
import { MatInput } from '@angular/material/input';
import { ActivatedRoute, Router } from '@angular/router';
import { ToasterService } from '../../core/toaster.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { CookieService } from '../../shared/cookie.service';
import { AuthService } from '../auth.service';
@@ -34,7 +34,7 @@ import { AuthService } from '../auth.service';
],
})
export class LoginComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
@ViewChild('nameElement', { static: true }) nameElement!: ElementRef<HTMLInputElement>;
form: FormGroup<{
username: FormControl<string>;
password: FormControl<string>;
@@ -50,7 +50,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
private route: ActivatedRoute,
private auth: AuthService,
private router: Router,
private toaster: ToasterService,
private snackBar: MatSnackBar,
private cs: CookieService,
) {
this.hide = true;
@@ -68,9 +68,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
setTimeout(() => {
if (this.nameElement) {
this.nameElement.nativeElement.focus();
}
this.nameElement.nativeElement.focus();
}, 0);
}
@@ -91,7 +89,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
this.showOtp = true;
this.clientId = this.cs.getCookie('client_id');
}
this.toaster.show('Danger', error.error.details);
this.snackBar.open(error.error.details, 'Danger');
},
});
}
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from '../../core/toaster.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { AuthService } from '../auth.service';
@Component({
@@ -13,7 +13,7 @@ export class LogoutComponent implements OnInit {
constructor(
private auth: AuthService,
private router: Router,
private toaster: ToasterService,
private snackBar: MatSnackBar,
) {}
ngOnInit() {