Add New ItemProperties
All checks were successful
E2E Testing / test (push) Successful in 1m33s

This commit is contained in:
Sebastian Böckelmann 2024-04-20 08:15:18 +02:00
parent 704150d999
commit 9dc5418d64
2 changed files with 7 additions and 3 deletions

View File

@ -23,8 +23,6 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="property"> <ng-container matColumnDef="property">
<th mat-header-cell *matHeaderCellDef>Value</th> <th mat-header-cell *matHeaderCellDef>Value</th>
<td mat-cell *matCellDef="let itemProperty"> <td mat-cell *matCellDef="let itemProperty">
@ -54,7 +52,7 @@
<ng-container matColumnDef="expand"> <ng-container matColumnDef="expand">
<th mat-header-cell *matHeaderCellDef aria-label="row actions"> <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> </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<button mat-icon-button aria-label="expand row" (click)="(expandedElement = expandedElement === element ? null : element); $event.stopPropagation()"> <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 { } else {
this.editedItemProperty = undefined 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;
} }
} }