Display Initial Value of ProductStates in their Visualizer
All checks were successful
E2E Testing / test (push) Successful in 1m29s

This commit is contained in:
Sebastian Böckelmann 2024-02-12 18:07:30 +01:00
parent f69d105164
commit 8f5d366dd9
3 changed files with 16 additions and 3 deletions

View File

@ -1,7 +1,12 @@
<table mat-table [dataSource]="datasource" class="mat-elevation-z8">
<ng-container *ngFor="let col of displayedColumns; let i = index" [matColumnDef]="col">
<th mat-header-cell *matHeaderCellDef>{{col}}</th>
<td mat-cell *matCellDef="let state">{{getStateLabel(state, i)}}</td>
<td mat-cell *matCellDef="let state">
<span *ngIf="i < displayedColumns.length-1">{{getStateLabel(state, i)}}</span>
<mat-icon *ngIf="i == displayedColumns.length-1">
{{state.initial? 'done':'close'}}
</mat-icon>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

View File

@ -1,3 +1,7 @@
table {
width: 100%;
}
.mat-column-Initial {
width: 32px;
}

View File

@ -13,8 +13,9 @@ import {
} from "@angular/material/table";
import {SimpleState} from "../../../../game-model/gamesystems/SimpleState";
import {State} from "../../../../game-model/gamesystems/State";
import {NgForOf} from "@angular/common";
import {NgForOf, NgIf} from "@angular/common";
import {ProductState} from "../../../../game-model/gamesystems/ProductState";
import {MatIcon} from "@angular/material/icon";
@Component({
selector: 'app-product-state-editor',
@ -30,7 +31,9 @@ import {ProductState} from "../../../../game-model/gamesystems/ProductState";
MatHeaderCellDef,
MatCell,
MatCellDef,
NgForOf
NgForOf,
NgIf,
MatIcon
],
templateUrl: './product-state-editor.component.html',
styleUrl: './product-state-editor.component.scss'
@ -45,6 +48,7 @@ export class ProductStateEditorComponent implements OnInit{
ngOnInit() {
this.gamesystem!.generateFromChildsystems();
this.generateColumnNamesRecursively(this.gamesystem!, "");
this.displayedColumns.push('Initial');
this.datasource.data = this.gamesystem!.states;
}