Fix sur le formulaire d'ajout de sauts
This commit is contained in:
@@ -50,6 +50,7 @@ import { MatTableModule } from "@angular/material/table";
|
||||
import { MatTabsModule } from "@angular/material/tabs";
|
||||
import { MatDialogModule } from "@angular/material/dialog";
|
||||
import { MatCardModule } from "@angular/material/card";
|
||||
import { MatRadioModule } from "@angular/material/radio";
|
||||
|
||||
import { CachingInterceptor } from "../interceptor/caching.interceptor";
|
||||
//import { BasicAuthInterceptor } from '../interceptor/basic-auth.interceptor';
|
||||
@@ -151,6 +152,7 @@ const appRoutes: Routes = [
|
||||
MatTabsModule,
|
||||
MatDialogModule,
|
||||
MatCardModule,
|
||||
MatRadioModule,
|
||||
],
|
||||
exports: [HttpClientModule],
|
||||
providers: [
|
||||
|
||||
@@ -46,6 +46,14 @@
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
||||
<div>
|
||||
<label>Float label: </label>
|
||||
<mat-radio-group [(ngModel)]="toto">
|
||||
<mat-radio-button value="auto">Auto</mat-radio-button>
|
||||
<mat-radio-button value="always">Always</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Choose the used gear</mat-label>
|
||||
<input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear">
|
||||
|
||||
@@ -12,10 +12,12 @@ import { JumpTypeService } from "../../services/jump-type.service";
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { isNumber } from "util";
|
||||
|
||||
import { FormControl } from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: "app-new-jump",
|
||||
templateUrl: "./new-jump.component.html",
|
||||
styleUrls: ["./new-jump.component.css"]
|
||||
styleUrls: ["./new-jump.component.css"],
|
||||
})
|
||||
export class NewJumpComponent implements OnInit {
|
||||
beginDate: Date;
|
||||
@@ -35,6 +37,9 @@ export class NewJumpComponent implements OnInit {
|
||||
listOfGear: Array<GearResp>;
|
||||
private countDatasLoaded: number;
|
||||
|
||||
// floatLabelControl = new FormControl("auto");
|
||||
public toto: string;
|
||||
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceJump: JumpService,
|
||||
@@ -93,7 +98,7 @@ export class NewJumpComponent implements OnInit {
|
||||
}
|
||||
|
||||
private getListOfJumpTypes() {
|
||||
this.serviceJumpType.getListOfJumpTypes().subscribe(data => {
|
||||
this.serviceJumpType.getListOfJumpTypes().subscribe((data) => {
|
||||
this.listOfJumpType = data;
|
||||
this.countDatasLoaded = 1;
|
||||
|
||||
@@ -104,14 +109,14 @@ export class NewJumpComponent implements OnInit {
|
||||
}
|
||||
|
||||
private getListOfAircrafts() {
|
||||
this.serviceAircraft.getListOfAircrafts().subscribe(data => {
|
||||
this.serviceAircraft.getListOfAircrafts().subscribe((data) => {
|
||||
this.listOfAircraft = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfDropZones() {
|
||||
this.serviceDropzone.getListOfDropZones().subscribe(data => {
|
||||
this.serviceDropzone.getListOfDropZones().subscribe((data) => {
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
|
||||
this.listOfDropZone = data;
|
||||
this.listOfFilteredDropZone = data;
|
||||
@@ -120,7 +125,7 @@ export class NewJumpComponent implements OnInit {
|
||||
}
|
||||
|
||||
private getListOfGears() {
|
||||
this.serviceGear.getListOfGears().subscribe(data => {
|
||||
this.serviceGear.getListOfGears().subscribe((data) => {
|
||||
this.listOfGear = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
@@ -130,11 +135,16 @@ export class NewJumpComponent implements OnInit {
|
||||
return data ? data.name : undefined;
|
||||
}
|
||||
|
||||
public onChangeDz(event: string) {
|
||||
const filterValue = event.toLowerCase();
|
||||
public onChangeDz(event: any) {
|
||||
let filterValue: string;
|
||||
if (event.id !== undefined) {
|
||||
filterValue = event.name.toLowerCase();
|
||||
} else {
|
||||
filterValue = event.toLowerCase();
|
||||
}
|
||||
|
||||
this.listOfFilteredDropZone = this.listOfDropZone;
|
||||
this.listOfFilteredDropZone = this.listOfFilteredDropZone.filter(option =>
|
||||
this.listOfFilteredDropZone = this.listOfFilteredDropZone.filter((option) =>
|
||||
option.name.toLowerCase().includes(filterValue)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user