Correction sur le check de validation de formulaire

This commit is contained in:
2026-01-21 15:53:19 +01:00
parent 3baeb3066e
commit 7698754db2
4 changed files with 58 additions and 54 deletions

View File

@@ -46,7 +46,7 @@
aria-label="Clear" aria-label="Clear"
(click)="selectedJumpType = undefined" (click)="selectedJumpType = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -78,7 +78,7 @@
aria-label="Clear" aria-label="Clear"
(click)="selectedAircraft = undefined" (click)="selectedAircraft = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -104,9 +104,9 @@
aria-hidden="false" aria-hidden="false"
aria-label="Favorite" aria-label="Favorite"
color="primary" color="primary"
svgIcon="favorite"
> >
favorite</mat-icon </mat-icon>
>
} }
</mat-option> </mat-option>
} }
@@ -118,7 +118,7 @@
aria-label="Clear" aria-label="Clear"
(click)="resetDz()" (click)="resetDz()"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -148,7 +148,7 @@
aria-label="Clear" aria-label="Clear"
(click)="selectedGear = undefined" (click)="selectedGear = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -202,7 +202,7 @@
aria-label="Clear" aria-label="Clear"
(click)="exitAltitude = undefined" (click)="exitAltitude = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -221,7 +221,7 @@
aria-label="Clear" aria-label="Clear"
(click)="deployAltitude = undefined" (click)="deployAltitude = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -240,7 +240,7 @@
aria-label="Clear" aria-label="Clear"
(click)="countOfJumps = undefined" (click)="countOfJumps = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
@@ -259,12 +259,12 @@
aria-label="Clear" aria-label="Clear"
(click)="comments = undefined" (click)="comments = undefined"
> >
<mat-icon>close</mat-icon> <mat-icon svgIcon="close"></mat-icon>
</button> </button>
} }
</mat-form-field> </mat-form-field>
<br /> <br />
@if (isValidatedForm()) { @if (this.isValidatedForm()) {
<button mat-raised-button color="accent"> <button mat-raised-button color="accent">
{{ "NewJump_Submit" | translate }} {{ "NewJump_Submit" | translate }}
</button> </button>

View File

@@ -125,6 +125,7 @@ export class NewJumpComponent implements OnInit {
} }
onFormSubmit() { onFormSubmit() {
if (this.isValidatedForm()) {
this.pendingAddRequest = true; this.pendingAddRequest = true;
this.serviceJump this.serviceJump
@@ -154,6 +155,7 @@ export class NewJumpComponent implements OnInit {
this.pendingAddRequest = false; this.pendingAddRequest = false;
}); });
} }
}
public isValidatedForm(): boolean { public isValidatedForm(): boolean {
return ( return (

View File

@@ -141,7 +141,7 @@
} }
</mat-form-field> </mat-form-field>
<br /> <br />
@if (isValidatedForm()) { @if (this.isValidatedForm()) {
<button mat-raised-button color="accent"> <button mat-raised-button color="accent">
{{ "NewTunnelFlight_Submit" | translate }} {{ "NewTunnelFlight_Submit" | translate }}
</button> </button>

View File

@@ -107,6 +107,7 @@ export class NewTunnelFlightComponent implements OnInit {
} }
public onFormSubmit() { public onFormSubmit() {
if (this.isValidatedForm()) {
this.pendingAddRequest = true; this.pendingAddRequest = true;
this.serviceTunnelFlight this.serviceTunnelFlight
@@ -126,6 +127,7 @@ export class NewTunnelFlightComponent implements OnInit {
this.pendingAddRequest = false; this.pendingAddRequest = false;
}); });
} }
}
public isValidatedForm(): boolean { public isValidatedForm(): boolean {
return ( return (