Fix autour des dates des jumps lors

de la création
This commit is contained in:
Sébastien André
2021-04-19 18:58:08 +02:00
parent 9a7b2c5ca3
commit 27928f1696
7 changed files with 147 additions and 227 deletions

View File

@@ -10,13 +10,11 @@ import { AircraftService } from "../../services/aircraft.service";
import { JumpService } from "../../services/jump.service";
import { JumpTypeService } from "../../services/jump-type.service";
import { GearService } from "../../services/gear.service";
import { isNumber } from "util";
import { ThrowStmt } from "@angular/compiler";
@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;
@@ -38,15 +36,13 @@ export class NewJumpComponent implements OnInit {
private pendingAddRequest: boolean;
comments: string;
constructor(
private serviceComm: ServiceComm,
private serviceJump: JumpService,
private serviceJumpType: JumpTypeService,
private serviceAircraft: AircraftService,
private serviceDropzone: DropzoneService,
private serviceGear: GearService,
private dateService: DateService
) {}
constructor(private serviceComm: ServiceComm,
private serviceJump: JumpService,
private serviceJumpType: JumpTypeService,
private serviceAircraft: AircraftService,
private serviceDropzone: DropzoneService,
private serviceGear: GearService,
private dateService: DateService) {}
ngOnInit() {
this.serviceComm.UpdatedComponentTitle("Add a new jump");
@@ -60,19 +56,17 @@ export class NewJumpComponent implements OnInit {
onFormSubmit() {
this.pendingAddRequest = true;
this.serviceJump.AddListOfJump(
this.selectedJumpType.id,
this.selectedAircraft.id,
this.selectedDz.id,
this.selectedGear.id,
this.withCutaway === undefined ? false : this.withCutaway,
this.beginDate,
this.endDate,
this.exitAltitude,
this.deployAltitude,
this.countOfJumps,
this.comments
);
this.serviceJump.AddListOfJump(this.selectedJumpType.id,
this.selectedAircraft.id,
this.selectedDz.id,
this.selectedGear.id,
this.withCutaway === undefined ? false : this.withCutaway,
this.beginDate,
this.endDate,
this.exitAltitude,
this.deployAltitude,
this.countOfJumps,
this.comments);
setTimeout(() => {
this.initForm();
@@ -111,14 +105,14 @@ export class NewJumpComponent implements OnInit {
}
private getListOfAircrafts() {
this.serviceAircraft.getListOfAircrafts().subscribe((data) => {
this.serviceAircraft.getListOfAircrafts(true).subscribe((data) => {
this.listOfAircraft = data;
this.countDatasLoaded++;
});
}
private getListOfDropZones() {
this.serviceDropzone.getListOfDropZones().subscribe((data) => {
this.serviceDropzone.getListOfDropZones(true).subscribe((data) => {
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
this.listOfDropZone = data;
this.listOfFilteredDropZone = data;
@@ -147,6 +141,7 @@ export class NewJumpComponent implements OnInit {
this.selectedJumpType = undefined;
this.listOfFilteredDropZone = this.listOfDropZone;
this.comments = undefined;
}
public displayFn(data?: JumpTypeResp): string | undefined {