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:
@@ -1,7 +1,36 @@
|
||||
import { AsyncPipe, DecimalPipe, CurrencyPipe } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
|
||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
||||
import {
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatCardContent,
|
||||
MatCardActions,
|
||||
MatCardFooter,
|
||||
} from '@angular/material/card';
|
||||
import { MatOption } from '@angular/material/core';
|
||||
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatFormField, MatLabel, MatSuffix, MatPrefix } from '@angular/material/form-field';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {
|
||||
MatTable,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatHeaderRowDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatRow,
|
||||
} from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Hotkey, HotkeysService } from 'angular2-hotkeys';
|
||||
import { round } from 'mathjs';
|
||||
@@ -20,6 +49,7 @@ import { User } from '../core/user';
|
||||
import { Voucher } from '../core/voucher';
|
||||
import { VoucherService } from '../core/voucher.service';
|
||||
import { ConfirmDialogComponent } from '../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { LocalTimePipe } from '../shared/local-time.pipe';
|
||||
import { MathService } from '../shared/math.service';
|
||||
|
||||
import { IssueDataSource } from './issue-datasource';
|
||||
@@ -31,6 +61,46 @@ import { IssueGridService } from './issue-grid.service';
|
||||
selector: 'app-issue',
|
||||
templateUrl: './issue.component.html',
|
||||
styleUrls: ['./issue.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatCardContent,
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
MatLabel,
|
||||
MatInput,
|
||||
MatDatepickerInput,
|
||||
MatDatepickerToggle,
|
||||
MatSuffix,
|
||||
MatDatepicker,
|
||||
MatSelect,
|
||||
MatOption,
|
||||
MatPrefix,
|
||||
MatAutocompleteTrigger,
|
||||
MatAutocomplete,
|
||||
MatButton,
|
||||
MatTable,
|
||||
MatSort,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatIconButton,
|
||||
MatIcon,
|
||||
MatHeaderRowDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatRow,
|
||||
MatCardActions,
|
||||
MatCardFooter,
|
||||
AsyncPipe,
|
||||
DecimalPipe,
|
||||
CurrencyPipe,
|
||||
LocalTimePipe,
|
||||
],
|
||||
})
|
||||
export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild('batchElement', { static: true }) batchElement?: ElementRef;
|
||||
@@ -263,8 +333,8 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
save() {
|
||||
const voucher: Voucher = this.getVoucher();
|
||||
this.ser.saveOrUpdate(voucher).subscribe(
|
||||
(result) => {
|
||||
this.ser.saveOrUpdate(voucher).subscribe({
|
||||
next: (result) => {
|
||||
this.toaster.show('Success', '');
|
||||
if (voucher.id === result.id) {
|
||||
this.loadVoucher(result);
|
||||
@@ -272,10 +342,10 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.router.navigate(['/issue', result.id]);
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
error: (error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
newVoucher() {
|
||||
@@ -292,15 +362,15 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.ser.delete(this.voucher.id as string).subscribe(
|
||||
() => {
|
||||
this.ser.delete(this.voucher.id as string).subscribe({
|
||||
next: () => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigate(['/issue'], { replaceUrl: true });
|
||||
},
|
||||
(error) => {
|
||||
error: (error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
confirmDelete(): void {
|
||||
|
||||
Reference in New Issue
Block a user