Chore: Upgrade to Angular v18

Chore: Upgrade to Python 3.12
Chore: Upgrade to psycopg3
This commit is contained in:
2024-06-03 13:22:56 +05:30
parent 56c1be5e05
commit 010e9a84db
573 changed files with 5727 additions and 6528 deletions

View File

@ -1,6 +1,10 @@
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 { MatDialog } from '@angular/material/dialog';
import { MatFormField, MatLabel } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { ActivatedRoute, Router } from '@angular/router';
import { Regime } from '../../core/regime';
@ -12,6 +16,19 @@ import { RegimeService } from '../regime.service';
selector: 'app-regime-detail',
templateUrl: './regime-detail.component.html',
styleUrls: ['./regime-detail.component.css'],
standalone: true,
imports: [
MatCard,
MatCardHeader,
MatCardTitle,
MatCardContent,
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
MatCardActions,
MatButton,
],
})
export class RegimeDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
@ -63,27 +80,27 @@ export class RegimeDetailComponent implements OnInit, AfterViewInit {
}
save() {
this.ser.saveOrUpdate(this.getItem()).subscribe(
() => {
this.ser.saveOrUpdate(this.getItem()).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/regimes');
},
(error) => {
error: (error) => {
this.toaster.show('Error', error);
},
);
});
}
delete() {
this.ser.delete(this.item.id as number).subscribe(
() => {
this.ser.delete(this.item.id as number).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/regimes');
},
(error) => {
error: (error) => {
this.toaster.show('Error', error);
},
);
});
}
confirmDelete(): void {