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,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 { MatOption } from '@angular/material/core';
import { MatDialog } from '@angular/material/dialog';
import { MatFormField, MatLabel, MatHint, MatSuffix } from '@angular/material/form-field';
import { MatInput } from '@angular/material/input';
import { MatSelect } from '@angular/material/select';
import { ActivatedRoute, Router } from '@angular/router';
import { round } from 'mathjs';
import { Regime } from 'src/app/core/regime';
@ -14,6 +20,23 @@ import { TaxService } from '../tax.service';
selector: 'app-tax-detail',
templateUrl: './tax-detail.component.html',
styleUrls: ['./tax-detail.component.css'],
standalone: true,
imports: [
MatCard,
MatCardHeader,
MatCardTitle,
MatCardContent,
ReactiveFormsModule,
MatFormField,
MatLabel,
MatInput,
MatHint,
MatSuffix,
MatSelect,
MatOption,
MatCardActions,
MatButton,
],
})
export class TaxDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
@ -67,27 +90,27 @@ export class TaxDetailComponent implements OnInit, AfterViewInit {
}
save() {
this.ser.saveOrUpdate(this.getItem()).subscribe(
() => {
this.ser.saveOrUpdate(this.getItem()).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/taxes');
},
(error) => {
error: (error) => {
this.toaster.show('Error', error);
},
);
});
}
delete() {
this.ser.delete(this.item.id as string).subscribe(
() => {
this.ser.delete(this.item.id as string).subscribe({
next: () => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/taxes');
},
(error) => {
error: (error) => {
this.toaster.show('Error', error);
},
);
});
}
confirmDelete(): void {