inventory-items #42

Merged
sebastian merged 9 commits from inventory-items into main 2024-04-20 11:39:35 +02:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 9dc5418d64 - Show all commits

View File

@ -23,8 +23,6 @@
</td>
</ng-container>
<ng-container matColumnDef="property">
<th mat-header-cell *matHeaderCellDef>Value</th>
<td mat-cell *matCellDef="let itemProperty">
@ -54,7 +52,7 @@
<ng-container matColumnDef="expand">
<th mat-header-cell *matHeaderCellDef aria-label="row actions">
<button mat-icon-button><mat-icon>add</mat-icon></button>
<button mat-icon-button [disabled]="editedItemProperty !== undefined" (click)="addItemProperty()"><mat-icon>add</mat-icon></button>
</th>
<td mat-cell *matCellDef="let element">
<button mat-icon-button aria-label="expand row" (click)="(expandedElement = expandedElement === element ? null : element); $event.stopPropagation()">

View File

@ -50,6 +50,12 @@ export class ItemPropertyEditorComponent implements OnInit{
} else {
this.editedItemProperty = undefined
}
}
addItemProperty() {
const itemProperty = new ItemProperty("New Property", "", 0);
this.item!.itemProperties.push(itemProperty);
this.datasource.data = this.item!.itemProperties;
this.editedItemProperty = itemProperty;
}
}