Chore: Check for deprecations using eslint plugin

Chore: environment file replacement stopped.
Chore: All components are now standalone and removed all modules
Chore: App routing is now in app.routes and similarly for all submodules
Chore: Http interceptors are now functional and split refresh interceptor into a separate one.
This commit is contained in:
2024-05-31 22:54:41 +05:30
parent b6bb3dbcfd
commit 4571b31fc0
309 changed files with 3897 additions and 5222 deletions
@@ -1,6 +1,12 @@
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { MatButton } from '@angular/material/button';
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
import { MatCheckbox } from '@angular/material/checkbox';
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
import { MatDialog } from '@angular/material/dialog';
import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { ActivatedRoute, Router } from '@angular/router';
import moment from 'moment';
@@ -13,6 +19,24 @@ import { RecipeTemplateService } from '../recipe-template.service';
selector: 'app-recipe-template-detail',
templateUrl: './recipe-template-detail.component.html',
styleUrls: ['./recipe-template-detail.component.css'],
standalone: true,
imports: [
MatCard,
MatCardHeader,
MatCardTitle,
MatCardContent,
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
MatDatepickerInput,
MatDatepickerToggle,
MatSuffix,
MatDatepicker,
MatCheckbox,
MatCardActions,
MatButton,
],
})
export class RecipeTemplateDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
@@ -67,27 +91,27 @@ export class RecipeTemplateDetailComponent implements OnInit, AfterViewInit {
}
save() {
this.ser.saveOrUpdate(this.getItem()).subscribe(
() => {
this.ser.saveOrUpdate(this.getItem()).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/recipe-templates');
},
(error) => {
error: (error) => {
this.toaster.show('Danger', error);
},
);
});
}
delete() {
this.ser.delete(this.item.id).subscribe(
() => {
this.ser.delete(this.item.id).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/recipe-templates');
},
(error) => {
error: (error) => {
this.toaster.show('Danger', error);
},
);
});
}
confirmDelete(): void {