Adding comments to solo functions, prevent continuing process without selected solo
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2022-09-16 12:33:18 +02:00
parent 1027011447
commit 139fb20814
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE
3 changed files with 28 additions and 2 deletions

View File

@ -49,7 +49,8 @@
<div id="which-solo" class="visible-{{this.currentPage === 4}}"> <div id="which-solo" class="visible-{{this.currentPage === 4}}">
<p>Select the Solo that has been played:</p> <p>Select the Solo that has been played:</p>
<div class="togglebtn active-{{isSoloActive(solo)}}" *ngFor="let solo of getAllPossibleSolos()" (click)="toggleSolo(solo)">{{solo.toString()}}</div> <div class="togglebtn active-{{isSoloActive(solo)}}" *ngFor="let solo of getAllPossibleSolos()" (click)="toggleSolo(solo)">{{solo.toString()}}</div>
<button (click)="switchToNextPage()">Next</button> <p id="solo-warn" *ngIf="noSoloSelectedYet()">Please select a solo to continue</p>
<button (click)="switchToNextPage()" [disabled]="noSoloSelectedYet()">Next</button>
</div> </div>
<div id="extra-points" class="visible-{{this.currentPage === 5}}"> <div id="extra-points" class="visible-{{this.currentPage === 5}}">
<p>Extra Points</p> <p>Extra Points</p>

View File

@ -30,7 +30,7 @@
color: $inactive; color: $inactive;
} }
#player-amount-warn, #announcement-warn, #team-warn, #score-warn { #player-amount-warn, #announcement-warn, #team-warn, #score-warn, #solo-warn {
color: $warn; color: $warn;
} }

View File

@ -640,15 +640,40 @@ export class AddGameComponent implements OnInit {
return numberOfElders === 1; return numberOfElders === 1;
} }
/**
* Checks if the given solo is currently active
* @param solo The solo to check active status for
*/
isSoloActive(solo: solos.Solo): boolean { isSoloActive(solo: solos.Solo): boolean {
return this.soloPlayed === solo; return this.soloPlayed === solo;
} }
/**
* Returns all possible solo values
*/
getAllPossibleSolos(): solos.Solo[] { getAllPossibleSolos(): solos.Solo[] {
return solos.getAllSoloValues(); return solos.getAllSoloValues();
} }
/**
* Toggles the given solo as the active one
* @param solo The solo to set as the active one
*/
toggleSolo(solo: solos.Solo): void { toggleSolo(solo: solos.Solo): void {
this.soloPlayed = solo; this.soloPlayed = solo;
} }
noSoloSelectedYet(): boolean {
return this.soloPlayed === undefined;
}
/**
* ______ __ ____ _ __
* / ____/ __/ /__________ _ / __ \____ (_)___ / /______
* / __/ | |/_/ __/ ___/ __ `/ / /_/ / __ \/ / __ \/ __/ ___/
* / /____> </ /_/ / / /_/ / / ____/ /_/ / / / / / /_(__ )
* /_____/_/|_|\__/_/ \__,_/ /_/ \____/_/_/ /_/\__/____/
*/
} }