Specify Templatesystem
All checks were successful
E2E Testing / test (push) Successful in 1m30s

This commit is contained in:
Sebastian Böckelmann 2024-04-14 07:57:50 +02:00
parent 8a993bd93d
commit 5a2282ddd3
3 changed files with 34 additions and 2 deletions

View File

@ -1 +1,14 @@
<p>template-specificator works!</p> <h1 mat-dialog-title>Specify Templatesystem</h1>
<div mat-dialog-content>
<p>This will not affect the properties of the Templatesystem itself!</p>
<mat-form-field appearance="outline" class="long-form">
<mat-label>Select Templatesystem</mat-label>
<mat-select [formControl]="templateCtrl">
<mat-option *ngFor="let templateSystem of templateSystems" [value]="templateSystem">{{templateSystem.componentName}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div mat-dialog-actions align="end">
<button mat-stroked-button (click)="cancelSpecification()">Cancel</button>
<button mat-raised-button color="accent" [disabled]="templateCtrl.invalid" (click)="confirmSpecification()">Confirm</button>
</div>

View File

@ -1,4 +1,7 @@
import { Component } from '@angular/core'; import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {Gamesystem} from "../../../project/game-model/gamesystems/Gamesystem";
import {FormControl, Validators} from "@angular/forms";
@Component({ @Component({
selector: 'app-template-specificator', selector: 'app-template-specificator',
@ -7,4 +10,17 @@ import { Component } from '@angular/core';
}) })
export class TemplateSpecificatorComponent { export class TemplateSpecificatorComponent {
templateCtrl: FormControl = new FormControl('', [Validators.required])
constructor(private dialogRef: MatDialogRef<TemplateSpecificatorComponent>,
@Inject(MAT_DIALOG_DATA) public templateSystems: Gamesystem<any, any>[] = []) {
}
cancelSpecification() {
this.dialogRef.close()
}
confirmSpecification() {
this.dialogRef.close(this.templateCtrl.value)
}
} }