Mark Gamesystem as unsaved after state change
Some checks failed
E2E Testing / test (push) Failing after 1m21s

This commit is contained in:
Sebastian Böckelmann 2024-02-10 12:03:44 +01:00
parent 4dbed5a855
commit 0f82b6edac
2 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<td mat-cell *matCellDef="let state">
<span *ngIf="editedElement !== state"> {{state.stateLabel}}</span>
<mat-form-field appearance="fill" class="long-form" *ngIf="editedElement === state">
<input matInput [(ngModel)]="state.stateLabel" (ngModelChange)="isEditedStateValid()">
<input matInput [(ngModel)]="state.stateLabel" (ngModelChange)="onStateChange()">
<mat-hint class="mat-error" *ngIf="editedStateLabelError"><mat-icon class="warning-icon">warning</mat-icon>Missing State-Label Information</mat-hint>
</mat-form-field>
</td>
@ -17,7 +17,7 @@
<p *ngIf="editedElement !== element">{{element.stateDescription}}</p>
<mat-form-field appearance="fill" class="long-form" *ngIf="element === editedElement">
<mat-label>Description</mat-label>
<textarea matInput [(ngModel)]="element.stateDescription" rows="3"></textarea>
<textarea matInput [(ngModel)]="element.stateDescription" rows="3" (ngModelChange)="onStateChange()"></textarea>
</mat-form-field>
</div>
</td>
@ -32,7 +32,7 @@
<mat-icon *ngIf="state.initial">done</mat-icon>
<mat-icon *ngIf="!state.initial">close</mat-icon>
</div>
<mat-checkbox *ngIf="editedElement === state" [(ngModel)]="state.initial"></mat-checkbox>
<mat-checkbox *ngIf="editedElement === state" [(ngModel)]="state.initial" (ngModelChange)="onStateChange()"></mat-checkbox>
</td>
</ng-container>

View File

@ -76,7 +76,11 @@ export class SimpleStateEditorComponent implements OnInit{
this.dataSource.data = this.gamesystem.states;
this.editedElement = simpleState;
this.expandedElement = simpleState;
this.onStateChange();
}
}
}
onStateChange() {
this.gamesystem!.onModifyContent();
}
}