make grade optional
continuous-integration/drone/push Build is passing Details

master
Hannah 2026-07-17 22:52:13 -06:00
parent dc33b9a81c
commit 9c9968320a
2 changed files with 2 additions and 4 deletions

View File

@ -53,7 +53,7 @@
<div class="form-row-2-col">
<mat-form-field class="w-100" [class.background-error]="hasErrors('grade')">
<mat-label>Grade</mat-label>
<input matInput type="number" formControlName="grade" required>
<input matInput type="text" formControlName="grade">
<mat-error>Please enter student grade</mat-error>
</mat-form-field>
<mat-form-field class="w-100" [class.background-error]="hasErrors('dob')">

View File

@ -74,7 +74,6 @@ this.form = this.formBuilder.group({
studentComplete(): boolean {
var firstName = this.form.get('firstName');
var lastName = this.form.get('lastName');
var grade = this.form.get('grade');
var dob = this.form.get('dob');
var hasAllergies = this.form.get('hasAllergies');
var hasDietaryRestrictions = this.form.get('hasDietaryRestrictions');
@ -85,7 +84,6 @@ this.form = this.formBuilder.group({
var hasFirst = firstName && firstName.value && firstName.value.length > 1;
var hasLast = lastName && lastName.value && lastName.value.length > 1;
var hasGrade = grade && grade.value && grade.value > 0;
var hasDob = dob && dob.value != null;
var hasAllergiesComplete = hasAllergies && hasAllergies.value != null;
var hasDietaryRestrictionsComplete = hasDietaryRestrictions && hasDietaryRestrictions.value != null;
@ -97,7 +95,7 @@ this.form = this.formBuilder.group({
var validAllergies = hasAllergiesComplete && ((hasAllergies.value === 'true' && allergiesComplete) || (hasAllergies.value === 'false'));
var validDietaryRestrictions = hasDietaryRestrictionsComplete && ((hasDietaryRestrictions.value === 'true' && dietaryRestrictionsComplete) || (hasDietaryRestrictions.value === 'false'));
return hasFirst && hasLast && hasGrade && hasDob && validAllergies && validDietaryRestrictions && hasRidesBus && hasAttendedInPast;
return hasFirst && hasLast && hasDob && validAllergies && validDietaryRestrictions && hasRidesBus && hasAttendedInPast;
}
parentComplete(): boolean {