Fix duplicate condition and displaying min twice instead of min and max value
All checks were successful
E2E Testing / test (push) Successful in 1m35s

This commit is contained in:
Sebastian Böckelmann 2024-02-18 17:17:39 +01:00
parent 80dcfb33bf
commit 79eee273a0
2 changed files with 3 additions and 4 deletions

View File

@ -26,7 +26,7 @@
<ng-container matColumnDef="maxValue">
<th mat-header-cell *matHeaderCellDef>Maximal Value</th>
<td mat-cell *matCellDef="let condition">
<span *ngIf="condition !== editedCondition && condition !== addedCondition">{{condition.minValue}}</span>
<span *ngIf="condition !== editedCondition && condition !== addedCondition">{{condition.maxValue}}</span>
<mat-form-field appearance="fill" class="long-form" *ngIf=" condition === editedCondition">
<mat-label>Maximal Value</mat-label>
<input matInput [(ngModel)]="editedCondition!.maxValue">

View File

@ -29,16 +29,15 @@ export class ScriptaccountConditionEditorComponent implements OnInit{
this.addedCondition = ScriptAccountCondition.constructScriptAccountCondition(new ScriptAccount("", ""), 0,0);
this.editedCondition = this.addedCondition;
this.dataSource.data = this.dataSource.data.concat(this.addedCondition!);
console.log(this.dataSource.data.length)
console.log(this.conditions.length)
}
finishEditing() {
if(this.addedCondition != undefined) {
const createdCondition = ScriptAccountCondition.constructScriptAccountCondition(this.addedCondition.scriptAccount, this.addedCondition.minValue, this.addedCondition.maxValue);
if(createdCondition != undefined) {
console.log(createdCondition)
this.onCreateCondition.emit(createdCondition);
this.conditions.push(createdCondition);
console.log(this.conditions)
this.dataSource.data = this.conditions;
}
this.addedCondition = undefined;