Fix autour des dates des jumps lors
de la création
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user