Moved to Angular v20 and Tailwind v4 plus all related dependencies
Renamed Docker directory. Also serving static files from FastAPI.
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { CdkScrollable } from '@angular/cdk/scrolling';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
|
||||
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatOption } from '@angular/material/core';
|
||||
import {
|
||||
MAT_DIALOG_DATA,
|
||||
MatDialogRef,
|
||||
MatDialogTitle,
|
||||
MatDialogContent,
|
||||
MatDialogActions,
|
||||
MatDialogClose,
|
||||
MatDialogContent,
|
||||
MatDialogRef,
|
||||
MatDialogTitle,
|
||||
} from '@angular/material/dialog';
|
||||
import { MatFormField, MatLabel } from '@angular/material/form-field';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
@@ -27,7 +27,6 @@ import { MathService } from '../shared/math.service';
|
||||
selector: 'app-issue-dialog',
|
||||
templateUrl: './issue-dialog.component.html',
|
||||
styleUrls: ['./issue-dialog.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatDialogTitle,
|
||||
CdkScrollable,
|
||||
@@ -46,6 +45,15 @@ import { MathService } from '../shared/math.service';
|
||||
],
|
||||
})
|
||||
export class IssueDialogComponent implements OnInit {
|
||||
dialogRef = inject<MatDialogRef<IssueDialogComponent>>(MatDialogRef);
|
||||
data = inject<{
|
||||
inventory: Inventory;
|
||||
date: string;
|
||||
}>(MAT_DIALOG_DATA);
|
||||
|
||||
private math = inject(MathService);
|
||||
private batchSer = inject(BatchService);
|
||||
|
||||
batches: Observable<Batch[]>;
|
||||
form: FormGroup<{
|
||||
batch: FormControl<string | null>;
|
||||
@@ -54,12 +62,7 @@ export class IssueDialogComponent implements OnInit {
|
||||
|
||||
batch: Batch = new Batch();
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<IssueDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { inventory: Inventory; date: string },
|
||||
private math: MathService,
|
||||
private batchSer: BatchService,
|
||||
) {
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
batch: new FormControl<string | null>(null),
|
||||
quantity: new FormControl<string>('', { nonNullable: true }),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { IssueGridService } from './issue-grid.service';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@@ -13,10 +13,8 @@ const serviceName = 'IssueGridService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class IssueGridService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
private http = inject(HttpClient);
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
issueGrid(date: string): Observable<IssueGridItem[]> {
|
||||
return this.http
|
||||
|
||||
@@ -1,35 +1,36 @@
|
||||
import { AsyncPipe, DecimalPipe, CurrencyPipe } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, HostListener } from '@angular/core';
|
||||
import { AsyncPipe, CurrencyPipe, DecimalPipe } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, HostListener, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
|
||||
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
||||
import {
|
||||
MatCard,
|
||||
MatCardActions,
|
||||
MatCardContent,
|
||||
MatCardFooter,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatCardContent,
|
||||
MatCardActions,
|
||||
MatCardFooter,
|
||||
} from '@angular/material/card';
|
||||
import { MatOption } from '@angular/material/core';
|
||||
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
|
||||
import { MatDatepicker, MatDatepickerInput, MatDatepickerToggle } from '@angular/material/datepicker';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatFormField, MatLabel, MatSuffix, MatPrefix } from '@angular/material/form-field';
|
||||
import { MatFormField, MatLabel, MatPrefix, MatSuffix } from '@angular/material/form-field';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {
|
||||
MatTable,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatHeaderRowDef,
|
||||
MatCellDef,
|
||||
MatColumnDef,
|
||||
MatHeaderCell,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatHeaderRowDef,
|
||||
MatRow,
|
||||
MatRowDef,
|
||||
MatTable,
|
||||
} from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { round } from 'mathjs';
|
||||
@@ -43,14 +44,12 @@ import { BatchService } from '../core/batch.service';
|
||||
import { CostCentre } from '../core/cost-centre';
|
||||
import { Inventory } from '../core/inventory';
|
||||
import { IssueGridItem } from '../core/issue-grid-item';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
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';
|
||||
import { IssueDialogComponent } from './issue-dialog.component';
|
||||
import { IssueGridDataSource } from './issue-grid-datasource';
|
||||
@@ -60,7 +59,6 @@ import { IssueGridService } from './issue-grid.service';
|
||||
selector: 'app-issue',
|
||||
templateUrl: './issue.component.html',
|
||||
styleUrls: ['./issue.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
@@ -102,6 +100,16 @@ import { IssueGridService } from './issue-grid.service';
|
||||
],
|
||||
})
|
||||
export class IssueComponent implements OnInit, AfterViewInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private dialog = inject(MatDialog);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private auth = inject(AuthService);
|
||||
private math = inject(MathService);
|
||||
private ser = inject(VoucherService);
|
||||
private batchSer = inject(BatchService);
|
||||
private issueGridSer = inject(IssueGridService);
|
||||
|
||||
@ViewChild('batchElement', { static: true }) batchElement!: ElementRef<HTMLInputElement>;
|
||||
@ViewChild('dateElement', { static: true }) dateElement!: ElementRef<HTMLInputElement>;
|
||||
|
||||
@@ -145,17 +153,7 @@ export class IssueComponent implements OnInit, AfterViewInit {
|
||||
|
||||
batches: Observable<Batch[]>;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private snackBar: MatSnackBar,
|
||||
private auth: AuthService,
|
||||
private math: MathService,
|
||||
private ser: VoucherService,
|
||||
private batchSer: BatchService,
|
||||
private issueGridSer: IssueGridService,
|
||||
) {
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
date: new FormControl(new Date(), { nonNullable: true }),
|
||||
source: new FormControl<string | null>(null),
|
||||
|
||||
@@ -2,7 +2,6 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { ResolveFn } from '@angular/router';
|
||||
|
||||
import { Voucher } from '../core/voucher';
|
||||
|
||||
import { issueResolver } from './issue.resolver';
|
||||
|
||||
describe('issueResolver', () => {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Routes } from '@angular/router';
|
||||
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
import { costCentreListResolver } from '../cost-centre/cost-centre-list.resolver';
|
||||
|
||||
import { IssueComponent } from './issue.component';
|
||||
import { issueResolver } from './issue.resolver';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user