Amélioration de l'interface de l'inventaire.

La valeur entrée dans l'ajout de produit ne sera plus supprimée lorsque la souris ne survole plus le produit.
This commit is contained in:
FyloZ 2021-03-20 17:03:36 -04:00
parent 2a55e3d2f9
commit 84457d3788
2 changed files with 7 additions and 2 deletions

View File

@ -68,13 +68,16 @@
<ng-container matColumnDef="addQuantity">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell [class.disabled]="!canEditMaterial" *matCellDef="let material; let i = index">
<div *ngIf="(!hoveredMaterial && i === 0) || hoveredMaterial === material" class="input-group">
<div
[hidden]="!((!hoveredMaterial && i === 0) || (hoveredMaterial === material) || (selectedMaterial && selectedMaterial === material))"
class="input-group">
<input
#addQuantityInput
class="form-control"
type="number"
step="0.01"
placeholder="0"/>
placeholder="0"
(click)="selectedMaterial = material"/>
<div class="input-group-append">
<button
mat-flat-button

View File

@ -28,6 +28,7 @@ export class InventoryComponent extends ErrorHandlingComponent {
columns = ['name', 'materialType', 'quantity', 'addQuantity', 'lowQuantityIcon', 'simdutIcon', 'editButton', 'openSimdutButton']
hoveredMaterial: Material | null
selectedMaterial: Material | null
units = UNIT_MILLILITER
lowQuantityThreshold = 100 // TEMPORARY will be in the application settings
@ -115,6 +116,7 @@ export class InventoryComponent extends ErrorHandlingComponent {
materialQuantities => {
// Reset the input value
input.value = null
this.selectedMaterial = null
material.inventoryQuantity = parseInt(materialQuantities.filter(mq => mq.material === material.id)[0].quantity)
},