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,14 +1,14 @@
|
||||
import { CdkScrollable } from '@angular/cdk/scrolling';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
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';
|
||||
@@ -19,7 +19,6 @@ import { StockKeepingUnit } from '../../core/product';
|
||||
selector: 'app-journal-dialog',
|
||||
templateUrl: './product-detail-dialog.component.html',
|
||||
styleUrls: ['./product-detail-dialog.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatDialogTitle,
|
||||
CdkScrollable,
|
||||
@@ -34,6 +33,13 @@ import { StockKeepingUnit } from '../../core/product';
|
||||
],
|
||||
})
|
||||
export class ProductDetailDialogComponent implements OnInit {
|
||||
dialogRef = inject<MatDialogRef<ProductDetailDialogComponent>>(MatDialogRef);
|
||||
data = inject<{
|
||||
item: StockKeepingUnit;
|
||||
isSold: boolean;
|
||||
isPurchased: boolean;
|
||||
}>(MAT_DIALOG_DATA);
|
||||
|
||||
form: FormGroup<{
|
||||
units: FormControl<string>;
|
||||
fraction: FormControl<number>;
|
||||
@@ -42,11 +48,7 @@ export class ProductDetailDialogComponent implements OnInit {
|
||||
salePrice: FormControl<number>;
|
||||
}>;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ProductDetailDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: { item: StockKeepingUnit; isSold: boolean; isPurchased: boolean },
|
||||
) {
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
units: new FormControl('', { nonNullable: true }),
|
||||
fraction: new FormControl(1, { nonNullable: true }),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { CurrencyPipe } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
|
||||
import { MatCard, MatCardActions, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { MatOption } from '@angular/material/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
@@ -10,27 +10,26 @@ import { MatFormField, MatLabel } 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 {
|
||||
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 { BehaviorSubject } from 'rxjs';
|
||||
|
||||
import { Product, StockKeepingUnit } from '../../core/product';
|
||||
import { ProductGroup } from '../../core/product-group';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { ProductService } from '../product.service';
|
||||
|
||||
import { ProductDetailDatasource } from './product-detail-datasource';
|
||||
import { ProductDetailDialogComponent } from './product-detail-dialog.component';
|
||||
|
||||
@@ -38,7 +37,6 @@ import { ProductDetailDialogComponent } from './product-detail-dialog.component'
|
||||
selector: 'app-product-detail',
|
||||
templateUrl: './product-detail.component.html',
|
||||
styleUrls: ['./product-detail.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
@@ -69,6 +67,12 @@ import { ProductDetailDialogComponent } from './product-detail-dialog.component'
|
||||
],
|
||||
})
|
||||
export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private dialog = inject(MatDialog);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private ser = inject(ProductService);
|
||||
|
||||
@ViewChild('nameElement', { static: true }) nameElement!: ElementRef<HTMLInputElement>;
|
||||
form: FormGroup<{
|
||||
code: FormControl<string | number>;
|
||||
@@ -111,13 +115,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
displayedColumns = ['units', 'fraction', 'yield', 'costPrice', 'salePrice', 'action'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private snackBar: MatSnackBar,
|
||||
private ser: ProductService,
|
||||
) {
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
code: new FormControl<string | number>({ value: 0, disabled: true }, { nonNullable: true }),
|
||||
name: new FormControl<string | null>(null),
|
||||
|
||||
Reference in New Issue
Block a user