Temporal products route added.
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<form [formGroup]="form" class="flex-col wrapped">
|
||||
<div class="row-container">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Code</mat-label>
|
||||
<input matInput formControlName="code" />
|
||||
<mat-label>Handle</mat-label>
|
||||
<input matInput formControlName="handle" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="row-container">
|
||||
|
||||
@@ -47,7 +47,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
@ViewChild('nameElement', { static: true }) nameElement!: ElementRef<HTMLInputElement>;
|
||||
form: FormGroup<{
|
||||
code: FormControl<string | number>;
|
||||
handle: FormControl<string>;
|
||||
name: FormControl<string | null>;
|
||||
description: FormControl<string | null>;
|
||||
fractionUnits: FormControl<string | null>;
|
||||
@@ -89,7 +89,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
constructor() {
|
||||
this.form = new FormGroup({
|
||||
code: new FormControl<string | number>({ value: 0, disabled: true }, { nonNullable: true }),
|
||||
handle: new FormControl<string>({ value: '', disabled: true }, { nonNullable: true }),
|
||||
name: new FormControl<string | null>(null),
|
||||
description: new FormControl<string | null>(null),
|
||||
fractionUnits: new FormControl<string | null>(null),
|
||||
@@ -138,7 +138,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
item.productGroup = this.productGroups.find((x) => x.id === item.productGroup?.id);
|
||||
this.item = item;
|
||||
this.form.setValue({
|
||||
code: this.item.code || '(Auto)',
|
||||
handle: this.item.handle || '',
|
||||
name: this.item.name,
|
||||
description: this.item.description || '',
|
||||
fractionUnits: this.item.fractionUnits ?? '',
|
||||
|
||||
Reference in New Issue
Block a user