Delete Conditions
All checks were successful
E2E Testing / test (push) Successful in 1m30s

This commit is contained in:
Sebastian Böckelmann 2024-02-18 17:24:10 +01:00
parent c0bdbd5f40
commit 18ff86840c
2 changed files with 11 additions and 1 deletions

View File

@ -47,7 +47,7 @@
<button mat-icon-button (click)="createCondition()"><mat-icon>add</mat-icon></button> <button mat-icon-button (click)="createCondition()"><mat-icon>add</mat-icon></button>
</th> </th>
<td mat-cell *matCellDef="let condition"> <td mat-cell *matCellDef="let condition">
<button mat-icon-button color="warn"><mat-icon>delete</mat-icon></button> <button mat-icon-button color="warn" (click)="deleteCondition(condition)"><mat-icon>delete</mat-icon></button>
</td> </td>
</ng-container> </ng-container>

View File

@ -48,4 +48,14 @@ export class ScriptaccountConditionEditorComponent implements OnInit{
edit(condition: ScriptAccountCondition) { edit(condition: ScriptAccountCondition) {
this.editedCondition = condition; this.editedCondition = condition;
} }
deleteCondition(condition: ScriptAccountCondition) {
if(this.addedCondition === condition) {
this.addedCondition = undefined;
this.dataSource.data = this.conditions.concat();
} else {
this.onDeleteCondition.emit(condition);
this.dataSource.data = this.conditions.concat();
}
}
} }