main #48

Closed
sebastian wants to merge 44 commits from main into inventory
2 changed files with 18 additions and 2 deletions
Showing only changes of commit 2b83650348 - Show all commits

View File

@ -6,13 +6,20 @@
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef>Value</th>
<td mat-cell *matCellDef="let characteristicValue">{{characteristicValue.value}}</td>
<td mat-cell *matCellDef="let characteristicValue">
<span *ngIf="characteristicValue !== editedItemgroupCharacteristicValue">{{characteristicValue.value}}</span>
<mat-form-field appearance="outline" style="width: 100%;" *ngIf="characteristicValue === editedItemgroupCharacteristicValue">
<mat-label>Value</mat-label>
<input matInput [(ngModel)]="characteristicValue.value">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let characteristicValue">
<button mat-icon-button><mat-icon>edit</mat-icon></button>
<button mat-icon-button *ngIf="editedItemgroupCharacteristicValue == undefined" (click)="editCharacteristicValue(characteristicValue)"><mat-icon>edit</mat-icon></button>
<button mat-icon-button *ngIf="editedItemgroupCharacteristicValue != undefined" (click)="finishEditing()" [disabled]="characteristicValue !== editedItemgroupCharacteristicValue"><mat-icon>done</mat-icon></button>
</td>
</ng-container>

View File

@ -16,6 +16,7 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
datasource: MatTableDataSource<ItemgroupCharacteristicValue> = new MatTableDataSource<ItemgroupCharacteristicValue>();
displayedColumns: string[] = ['characteristic', 'value', 'edit']
editedItemgroupCharacteristicValue: ItemgroupCharacteristicValue | undefined
ngOnInit() {
this.item!.initializeItemCharacteristics();
@ -30,4 +31,12 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
}
return []
}
editCharacteristicValue(itemCharacteristicValue: ItemgroupCharacteristicValue): void {
this.editedItemgroupCharacteristicValue = itemCharacteristicValue;
}
finishEditing() {
this.editedItemgroupCharacteristicValue = undefined;
}
}