fix
This commit is contained in:
@@ -34,6 +34,7 @@ export class NewJumpComponent implements OnInit {
|
|||||||
listOfFilteredDropZone: Array<DropZoneResp>;
|
listOfFilteredDropZone: Array<DropZoneResp>;
|
||||||
listOfGear: Array<GearResp>;
|
listOfGear: Array<GearResp>;
|
||||||
private countDatasLoaded: number;
|
private countDatasLoaded: number;
|
||||||
|
private pendingAddRequest: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private serviceComm: ServiceComm,
|
private serviceComm: ServiceComm,
|
||||||
@@ -47,6 +48,7 @@ export class NewJumpComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.serviceComm.UpdatedComponentTitle("Add a new jump");
|
this.serviceComm.UpdatedComponentTitle("Add a new jump");
|
||||||
|
this.pendingAddRequest = false;
|
||||||
|
|
||||||
this.endDate = new Date();
|
this.endDate = new Date();
|
||||||
this.beginDate = this.dateService.AddDays(new Date(), -1);
|
this.beginDate = this.dateService.AddDays(new Date(), -1);
|
||||||
@@ -59,6 +61,8 @@ export class NewJumpComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onFormSubmit() {
|
onFormSubmit() {
|
||||||
|
this.pendingAddRequest = true;
|
||||||
|
|
||||||
this.serviceJump.AddListOfJump(
|
this.serviceJump.AddListOfJump(
|
||||||
this.selectedJumpType.id,
|
this.selectedJumpType.id,
|
||||||
this.selectedAircraft.id,
|
this.selectedAircraft.id,
|
||||||
@@ -72,7 +76,10 @@ export class NewJumpComponent implements OnInit {
|
|||||||
this.countOfJumps
|
this.countOfJumps
|
||||||
);
|
);
|
||||||
|
|
||||||
this.initForm();
|
setTimeout(() => {
|
||||||
|
this.initForm();
|
||||||
|
this.pendingAddRequest = false;
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValidatedForm(): boolean {
|
public isValidatedForm(): boolean {
|
||||||
@@ -140,6 +147,8 @@ export class NewJumpComponent implements OnInit {
|
|||||||
this.selectedGear = undefined;
|
this.selectedGear = undefined;
|
||||||
this.selectedAircraft = undefined;
|
this.selectedAircraft = undefined;
|
||||||
this.selectedJumpType = undefined;
|
this.selectedJumpType = undefined;
|
||||||
|
|
||||||
|
this.listOfFilteredDropZone = this.listOfDropZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public displayFn(data?: JumpTypeResp): string | undefined {
|
public displayFn(data?: JumpTypeResp): string | undefined {
|
||||||
@@ -160,7 +169,7 @@ export class NewJumpComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public allDatasLoaded(): boolean {
|
public loadingToDisplay(): boolean {
|
||||||
return this.countDatasLoaded === 4;
|
return this.pendingAddRequest || this.countDatasLoaded === 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user