diff --git a/.gitignore b/.gitignore
index 2c5234a..376cf27 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@
/Back/skydiveLogs-api.Ioc/obj
/Back/skydiveLogs-api.Data/bin
/Back/skydiveLogs-api.Business/bin
+/Back/dist
diff --git a/Front/skydivelogs-app/src/app/list-of-aircrafts/list-of-aircrafts.component.ts b/Front/skydivelogs-app/src/app/list-of-aircrafts/list-of-aircrafts.component.ts
index a244367..168d982 100644
--- a/Front/skydivelogs-app/src/app/list-of-aircrafts/list-of-aircrafts.component.ts
+++ b/Front/skydivelogs-app/src/app/list-of-aircrafts/list-of-aircrafts.component.ts
@@ -28,7 +28,8 @@ export class ListOfAircraftsComponent implements OnInit {
ngOnInit() {
this.serviceComm.refreshRequest.subscribe(action => {
- if (action === AddAction.Gear) {
+ if (action === AddAction.Aircraft) {
+ this.dialog.closeAll();
this.getListOfAircrafts();
}
});
diff --git a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts
index a688d97..e0ca298 100644
--- a/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts
+++ b/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts
@@ -37,7 +37,8 @@ export class ListOfDzsComponent implements OnInit {
ngOnInit() {
this.serviceComm.refreshRequest.subscribe(action => {
- if (action === AddAction.Gear) {
+ if (action === AddAction.Dropzone) {
+ this.dialog.closeAll();
this.getListOfDropZones();
}
});
diff --git a/Front/skydivelogs-app/src/app/list-of-gears/list-of-gears.component.ts b/Front/skydivelogs-app/src/app/list-of-gears/list-of-gears.component.ts
index 73c77a9..f035dd1 100644
--- a/Front/skydivelogs-app/src/app/list-of-gears/list-of-gears.component.ts
+++ b/Front/skydivelogs-app/src/app/list-of-gears/list-of-gears.component.ts
@@ -37,6 +37,7 @@ export class ListOfGearsComponent implements OnInit {
ngOnInit() {
this.serviceComm.refreshRequest.subscribe(action => {
if (action === AddAction.Gear) {
+ this.dialog.closeAll();
this.getListOfGears();
}
});
diff --git a/Front/skydivelogs-app/src/app/list-of-jump-types/list-of-jump-types.component.ts b/Front/skydivelogs-app/src/app/list-of-jump-types/list-of-jump-types.component.ts
index 8039b01..06fb945 100644
--- a/Front/skydivelogs-app/src/app/list-of-jump-types/list-of-jump-types.component.ts
+++ b/Front/skydivelogs-app/src/app/list-of-jump-types/list-of-jump-types.component.ts
@@ -28,7 +28,8 @@ export class ListOfJumpTypesComponent implements OnInit {
ngOnInit() {
this.serviceComm.refreshRequest.subscribe(action => {
- if (action === AddAction.Gear) {
+ if (action === AddAction.JumpType) {
+ this.dialog.closeAll();
this.getListOfJumpTypes();
}
});
diff --git a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.css b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.css
index 8d63ef9..789ae32 100644
--- a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.css
+++ b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.css
@@ -11,3 +11,9 @@ table {
min-width: 200px;
word-wrap: break-word;
}
+
+.smallSpanWithBreakWord {
+ display: inline-block;
+ min-width: 50px;
+ word-wrap: break-word;
+}
diff --git a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.html b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.html
index 700cbb2..f366f66 100644
--- a/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.html
+++ b/Front/skydivelogs-app/src/app/list-of-jumps/list-of-jumps.component.html
@@ -7,21 +7,32 @@
| Date |
- {{element.jumpDate | date: 'yyyy-MM-dd'}} |
+
+
+ |
Jump Type |
- {{element.jumpType.name}} |
+
+
+ |
+
Aircraft |
- {{element.aircraft.name}} |
+
+
+ |
+
Drop Zone |
- {{element.dropZone.name}} |
+
+
+ |
+
Gear |
{{element.gear.name}} |
diff --git a/Front/skydivelogs-app/src/app/new-aircraft/new-aircraft.component.ts b/Front/skydivelogs-app/src/app/new-aircraft/new-aircraft.component.ts
index 39ff807..e6b58be 100644
--- a/Front/skydivelogs-app/src/app/new-aircraft/new-aircraft.component.ts
+++ b/Front/skydivelogs-app/src/app/new-aircraft/new-aircraft.component.ts
@@ -16,18 +16,18 @@ export class NewAircraftComponent implements OnInit {
private serviceComm: ServiceComm,
private serviceApi: AircraftService
) {
- this.addForm = new FormGroup({
- aircraftName: new FormControl("", Validators.required)
- });
+ this.addForm = new FormGroup(
+ {
+ aircraftName: new FormControl("", Validators.required)
+ },
+ { updateOn: "blur" }
+ );
}
ngOnInit() {}
onSubmit(formData) {
- this.serviceApi.AddAircraft(formData.value.aircraftName);
+ this.serviceApi.AddAircraft(formData.aircraftName);
this.serviceComm.RefreshData(AddAction.Aircraft);
-
- this.serviceComm.RefreshData(AddAction.Aircraft);
- this.addForm.reset();
}
}
diff --git a/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.html b/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.html
index e85b2e4..f512c54 100644
--- a/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.html
+++ b/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.html
@@ -17,6 +17,12 @@
+
+
+ Web site
+
+
+
Mail of contact
diff --git a/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.ts b/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.ts
index eb12f15..af69808 100644
--- a/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.ts
+++ b/Front/skydivelogs-app/src/app/new-drop-zone/new-drop-zone.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { AddAction } from "../../models/add-action.enum";
import { ServiceComm } from "../../services/service-comm.service";
+import { DropzoneService } from "../../services/dropzone.service";
@Component({
selector: "app-new-drop-zone",
@@ -11,27 +12,53 @@ import { ServiceComm } from "../../services/service-comm.service";
export class NewDropZoneComponent implements OnInit {
public addForm: FormGroup;
- constructor(private serviceComm: ServiceComm) {
- this.addForm = new FormGroup({
- dzName: new FormControl("", Validators.required),
- gps: new FormControl("x.x,y.y", [
- Validators.required,
- Validators.pattern("d+.d+,d+.d+")
- ]),
- address: new FormControl("", Validators.required),
- contactMail: new FormControl("", [Validators.required, Validators.email]),
- isDz: new FormControl(true),
- isTunnel: new FormControl(false)
- });
+ constructor(
+ private serviceComm: ServiceComm,
+ private dropzoneService: DropzoneService
+ ) {
+ this.addForm = new FormGroup(
+ {
+ dzName: new FormControl("", Validators.required),
+ gps: new FormControl("x.x,y.y", [
+ Validators.required,
+ Validators.pattern("d+.d+,d+.d+")
+ ]),
+ address: new FormControl("", Validators.required),
+ website: new FormControl("", Validators.required),
+ contactMail: new FormControl("", [
+ Validators.required,
+ Validators.email
+ ]),
+ isDz: new FormControl(true),
+ isTunnel: new FormControl(false)
+ },
+ { updateOn: "blur" }
+ );
}
ngOnInit() {}
onSubmit(formData) {
- console.log(formData.status);
- console.warn("New data : ", formData);
+ const splitGps: Array = formData.gps.split(",");
+ let dzType: Array = new Array();
- this.serviceComm.RefreshData(AddAction.Gear);
- this.addForm.reset();
+ if (formData.isDz === true) {
+ dzType.push("dz");
+ }
+ if (formData.isTunnel === true) {
+ dzType.push("tunnel");
+ }
+
+ this.dropzoneService.AddDropZone(
+ splitGps[0],
+ splitGps[1],
+ formData.dzName,
+ formData.address,
+ formData.website,
+ formData.contactMail,
+ dzType,
+ false
+ );
+ this.serviceComm.RefreshData(AddAction.Dropzone);
}
}
diff --git a/Front/skydivelogs-app/src/app/new-gear/new-gear.component.ts b/Front/skydivelogs-app/src/app/new-gear/new-gear.component.ts
index f9f9664..58b116d 100644
--- a/Front/skydivelogs-app/src/app/new-gear/new-gear.component.ts
+++ b/Front/skydivelogs-app/src/app/new-gear/new-gear.component.ts
@@ -17,47 +17,48 @@ export class NewGearComponent implements OnInit {
private serviceComm: ServiceComm,
private serviceApi: GearService
) {
- this.addForm = new FormGroup({
- name: new FormControl("", Validators.required),
- manufacturer: new FormControl("", Validators.required),
- minSize: new FormControl("", [
- Validators.required,
- Validators.min(60),
- Validators.max(320)
- ]),
- maxSize: new FormControl("", [
- Validators.required,
- Validators.min(60),
- Validators.max(320)
- ]),
- aad: new FormControl("", Validators.required),
- mainCanopy: new FormControl("", [
- Validators.required,
- Validators.min(60),
- Validators.max(320)
- ]),
- reserveCanopy: new FormControl("", [
- Validators.required,
- Validators.min(60),
- Validators.max(320)
- ])
- });
+ this.addForm = new FormGroup(
+ {
+ name: new FormControl("", Validators.required),
+ manufacturer: new FormControl("", Validators.required),
+ minSize: new FormControl("", [
+ Validators.required,
+ Validators.min(60),
+ Validators.max(320)
+ ]),
+ maxSize: new FormControl("", [
+ Validators.required,
+ Validators.min(60),
+ Validators.max(320)
+ ]),
+ aad: new FormControl("", Validators.required),
+ mainCanopy: new FormControl("", [
+ Validators.required,
+ Validators.min(60),
+ Validators.max(320)
+ ]),
+ reserveCanopy: new FormControl("", [
+ Validators.required,
+ Validators.min(60),
+ Validators.max(320)
+ ])
+ },
+ { updateOn: "blur" }
+ );
}
ngOnInit() {}
onSubmit(formData) {
this.serviceApi.AddGear(
- formData.value.name,
- formData.value.manufacturer,
- formData.value.minSize,
- formData.value.maxSize,
- formData.value.aad,
- formData.value.mainCanopy,
- formData.value.reserveCanopy
+ formData.name,
+ formData.manufacturer,
+ +formData.minSize,
+ +formData.maxSize,
+ formData.aad,
+ formData.mainCanopy,
+ formData.reserveCanopy
);
-
this.serviceComm.RefreshData(AddAction.Gear);
- this.addForm.reset();
}
}
diff --git a/Front/skydivelogs-app/src/app/new-jump-type/new-jump-type.component.ts b/Front/skydivelogs-app/src/app/new-jump-type/new-jump-type.component.ts
index 2d53ebb..c11dc5c 100644
--- a/Front/skydivelogs-app/src/app/new-jump-type/new-jump-type.component.ts
+++ b/Front/skydivelogs-app/src/app/new-jump-type/new-jump-type.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { AddAction } from "../../models/add-action.enum";
import { ServiceComm } from "../../services/service-comm.service";
+import { JumpTypeService } from "../../services/jump-type.service";
@Component({
selector: "app-new-jump-type",
@@ -11,19 +12,22 @@ import { ServiceComm } from "../../services/service-comm.service";
export class NewJumpTypeComponent implements OnInit {
public addForm: FormGroup;
- constructor(private serviceComm: ServiceComm) {
- this.addForm = new FormGroup({
- jumptypeName: new FormControl("", Validators.required)
- });
+ constructor(
+ private serviceComm: ServiceComm,
+ private jumpTypeService: JumpTypeService
+ ) {
+ this.addForm = new FormGroup(
+ {
+ jumptypeName: new FormControl("", Validators.required)
+ },
+ { updateOn: "blur" }
+ );
}
ngOnInit() {}
onSubmit(formData) {
- console.log(formData.status);
- console.warn("New data : ", formData);
-
- this.serviceComm.RefreshData(AddAction.Gear);
- this.addForm.reset();
+ this.jumpTypeService.AddJumpType(formData.jumptypeName);
+ this.serviceComm.RefreshData(AddAction.JumpType);
}
}
diff --git a/Front/skydivelogs-app/src/services/aircraft.service.ts b/Front/skydivelogs-app/src/services/aircraft.service.ts
index 7b461fb..41a85c9 100644
--- a/Front/skydivelogs-app/src/services/aircraft.service.ts
+++ b/Front/skydivelogs-app/src/services/aircraft.service.ts
@@ -1,11 +1,10 @@
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs';
+import { Injectable } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import { Observable } from "rxjs";
-import { AircraftResp, AircraftReq } from '../models/aircraft';
-
-import { BaseService } from './base.service';
+import { AircraftResp, AircraftReq } from "../models/aircraft";
+import { BaseService } from "./base.service";
@Injectable()
export class AircraftService extends BaseService {
@@ -14,10 +13,9 @@ export class AircraftService extends BaseService {
}
public getListOfAircrafts(): Observable> {
- return this.http.get>(
- `${this.apiUrl}/Aircraft`,
- { headers: this.headers }
- );
+ return this.http.get>(`${this.apiUrl}/Aircraft`, {
+ headers: this.headers
+ });
}
public AddAircraft(aircraftName: string) {
@@ -32,5 +30,4 @@ export class AircraftService extends BaseService {
})
.subscribe(data => console.log(data));
}
-
}
diff --git a/Front/skydivelogs-app/src/services/dropzone.service.ts b/Front/skydivelogs-app/src/services/dropzone.service.ts
index 958d6fa..32d5f5a 100644
--- a/Front/skydivelogs-app/src/services/dropzone.service.ts
+++ b/Front/skydivelogs-app/src/services/dropzone.service.ts
@@ -1,12 +1,11 @@
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs';
-import { map } from 'rxjs/operators';
+import { Injectable } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import { Observable } from "rxjs";
+import { map } from "rxjs/operators";
-import { DropZoneResp } from '../models/dropzone';
-
-import { BaseService } from './base.service';
+import { DropZoneResp, DropZoneReq } from "../models/dropzone";
+import { BaseService } from "./base.service";
@Injectable()
export class DropzoneService extends BaseService {
@@ -48,4 +47,33 @@ export class DropzoneService extends BaseService {
return true;
}
+
+ public AddDropZone(
+ latitude: string,
+ longitude: string,
+ name: string,
+ address: string,
+ website: string,
+ email: string,
+ type: Array,
+ isFavorite: boolean
+ ) {
+ const bodyNewDropZone: DropZoneReq = {
+ id: 0,
+ latitude: latitude,
+ longitude: longitude,
+ name: name,
+ address: address,
+ website: website,
+ email: email,
+ type: type,
+ isFavorite: isFavorite
+ };
+
+ this.http
+ .post(`${this.apiUrl}/DropZone`, bodyNewDropZone, {
+ headers: this.headers
+ })
+ .subscribe(data => console.log(data));
+ }
}
diff --git a/Front/skydivelogs-app/src/services/gear.service.ts b/Front/skydivelogs-app/src/services/gear.service.ts
index 00c4c60..2921b50 100644
--- a/Front/skydivelogs-app/src/services/gear.service.ts
+++ b/Front/skydivelogs-app/src/services/gear.service.ts
@@ -1,11 +1,10 @@
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs';
+import { Injectable } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import { Observable } from "rxjs";
-import { GearResp, GearReq } from '../models/gear';
-
-import { BaseService } from './base.service';
+import { GearResp, GearReq } from "../models/gear";
+import { BaseService } from "./base.service";
@Injectable()
export class GearService extends BaseService {
@@ -19,13 +18,15 @@ export class GearService extends BaseService {
});
}
- public AddGear(name: string,
+ public AddGear(
+ name: string,
manufacturer: string,
minSize: number,
maxSize: number,
aad: string,
mainCanopy: string,
- reserveCanopy: string) {
+ reserveCanopy: string
+ ) {
const bodyNewGear: GearReq = {
id: 0,
name: name,
@@ -43,5 +44,4 @@ export class GearService extends BaseService {
})
.subscribe(data => console.log(data));
}
-
}
diff --git a/Front/skydivelogs-app/src/services/jump-type.service.ts b/Front/skydivelogs-app/src/services/jump-type.service.ts
index 63bda73..4d773cf 100644
--- a/Front/skydivelogs-app/src/services/jump-type.service.ts
+++ b/Front/skydivelogs-app/src/services/jump-type.service.ts
@@ -1,11 +1,10 @@
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs';
+import { Injectable } from "@angular/core";
+import { HttpClient } from "@angular/common/http";
+import { Observable } from "rxjs";
-import { JumpTypeResp } from '../models/jumpType';
-
-import { BaseService } from './base.service';
+import { JumpTypeResp, JumpTypeReq } from "../models/jumpType";
+import { BaseService } from "./base.service";
@Injectable()
export class JumpTypeService extends BaseService {
@@ -14,9 +13,21 @@ export class JumpTypeService extends BaseService {
}
public getListOfJumpTypes(): Observable> {
- return this.http.get>(
- `${this.apiUrl}/JumpType`,
- { headers: this.headers }
- );
+ return this.http.get>(`${this.apiUrl}/JumpType`, {
+ headers: this.headers
+ });
+ }
+
+ public AddJumpType(jumptypetName: string) {
+ const bodyJumpType: JumpTypeReq = {
+ id: 0,
+ name: jumptypetName
+ };
+
+ this.http
+ .post(`${this.apiUrl}/JumpType`, bodyJumpType, {
+ headers: this.headers
+ })
+ .subscribe(data => console.log(data));
}
}