+
+
\ No newline at end of file
diff --git a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.css b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.html b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.html
new file mode 100644
index 0000000..6f902d9
--- /dev/null
+++ b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.spec.ts b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.spec.ts
new file mode 100644
index 0000000..c9a2786
--- /dev/null
+++ b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.spec.ts
@@ -0,0 +1,21 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ListOfTunnelFlightsComponent } from './list-of-tunnel-flights.component';
+
+describe('ListOfTunnelFlightsComponent', () => {
+ let component: ListOfTunnelFlightsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ declarations: [ListOfTunnelFlightsComponent]
+ });
+ fixture = TestBed.createComponent(ListOfTunnelFlightsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts
new file mode 100644
index 0000000..4fdcd20
--- /dev/null
+++ b/Front/skydivelogs-app/src/app/list-of-tunnel-flights/list-of-tunnel-flights.component.ts
@@ -0,0 +1,93 @@
+import { Component, OnInit } from '@angular/core';
+import { TranslateService } from '@ngx-translate/core';
+import { ChartConfiguration, ChartData } from 'chart.js';
+
+import { TunnelService } from '../../services/tunnel.service';
+import { ServiceComm } from '../../services/service-comm.service';
+import { TunnelFlightService } from "../../services/tunnel-flight.service";
+
+@Component({
+ selector: 'app-list-of-tunnel-flights',
+ templateUrl: './list-of-tunnel-flights.component.html',
+ styleUrls: ['./list-of-tunnel-flights.component.css']
+})
+export class ListOfTunnelFlightsComponent implements OnInit {
+ public barChartLegend = true;
+ public barChartPlugins = [];
+ public barChartData: ChartData<'bar'>;
+ public barChartOptions: ChartConfiguration['options'];
+ public barChartType: string;
+ public isLoading: boolean = false;
+
+ constructor(private serviceComm: ServiceComm,
+ private serviceTunnel: TunnelService,
+ private serviceTunnelFlight: TunnelFlightService,
+ private translateService: TranslateService) { }
+
+ ngOnInit() {
+ this.serviceComm.forceTranslateTitle.subscribe((data) => {
+ if (data === true) {
+ this.updateTitle();
+ }
+ });
+ this.updateTitle();
+
+ this.isLoading = true;
+ this.getData();
+ }
+
+ private updateTitle() {
+ this.translateService.get("ListTunnelFlight_Title").subscribe(
+ data => { this.serviceComm.UpdatedComponentTitle(data); }
+ );
+ }
+
+ private getData(): void {
+ this.barChartType = "bar";
+ this.barChartData = {
+ labels: ['2006', '2007', '2008', '2009', '2010', '2011', '2012'],
+ datasets: [
+ { data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A' },
+ { data: [28, 48, 40, 19, 86, 27, 90], label: 'Series B' }
+ ]
+ };
+
+ this.barChartOptions = {
+ responsive: false,
+ plugins: {
+ legend: {
+ display: true
+ },
+ tooltip: {
+ callbacks: {
+ footer: this.footer,
+ }
+ }
+ },
+ interaction: {
+ intersect: false,
+ mode: 'nearest',
+ axis: 'x'
+ },
+ scales: {
+ x: {
+ stacked: true
+ },
+ y: {
+ stacked: true
+ }
+ }
+ };
+
+ this.isLoading = false;
+ }
+
+ private footer = (tooltipItems) => {
+ let sum = 0;
+
+ tooltipItems.forEach(function (tooltipItem) {
+ sum += tooltipItem.parsed.y;
+ });
+ return 'Sum: ' + sum;
+ };
+}
diff --git a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts
index ec55e1c..45eb4dc 100644
--- a/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts
+++ b/Front/skydivelogs-app/src/app/new-tunnel-flight/new-tunnel-flight.component.ts
@@ -47,10 +47,10 @@ export class NewTunnelFlightComponent implements OnInit {
private pendingAddRequest: boolean;
constructor(private serviceComm: ServiceComm,
- private serviceTunnel: TunnelService,
- private serviceTunnelFlight: TunnelFlightService,
- private translateService: TranslateService,
- private statsService: StatsService) { }
+ private serviceTunnel: TunnelService,
+ private serviceTunnelFlight: TunnelFlightService,
+ private translateService: TranslateService,
+ private statsService: StatsService) { }
ngOnInit() {
this.serviceComm.forceTranslateTitle.subscribe((data) => {
diff --git a/Front/skydivelogs-app/src/assets/i18n/en.json b/Front/skydivelogs-app/src/assets/i18n/en.json
index 7e888ce..1845734 100644
--- a/Front/skydivelogs-app/src/assets/i18n/en.json
+++ b/Front/skydivelogs-app/src/assets/i18n/en.json
@@ -37,6 +37,7 @@
"ListGears_Title" : "List of gears",
"ListAircrafts_Title" : "List of aircrafts",
"NewTunnelFlight_Title" : "New tunnel flights",
+ "ListTunnelFlight_Title" : "List of hours of tunnel",
"App_Footer" : "Web software to log your skydive jumps - v",
"App_Nav_Summary" : "Summary",
@@ -48,6 +49,7 @@
"App_Nav_Gears" : "List of gears",
"App_Nav_Logout" : "Logout",
"App_Nav_NewTunnelFlight" : "Add tunnel time",
+ "App_Nav_TunnelFlights": "The tunnel flights",
"List_Aircrafts_Add" : "Add a aircraft",
"List_Aircrafts_Header_Id" : "ID",
@@ -116,5 +118,8 @@
"NewTunnelFlight_ChooseTunnel": "Choose the tunnel",
"NewTunnelFlight_Minutes": "Minutes of the flight",
"NewTunnelFlight_Comments": "Comments",
- "NewTunnelFlight_Submit": "Submit"
+ "NewTunnelFlight_Submit": "Submit",
+ "NewTunnelFlight_Comments_Lbl": "Comments",
+ "NewTunnelFlight_Minutes_Lbl": "Time of flight (minutes)",
+ "NewTunnelFlight_Date_Lbl": "Date of flight"
}
\ No newline at end of file
diff --git a/Front/skydivelogs-app/src/assets/i18n/fr.json b/Front/skydivelogs-app/src/assets/i18n/fr.json
index 6f5381b..ab5d53d 100644
--- a/Front/skydivelogs-app/src/assets/i18n/fr.json
+++ b/Front/skydivelogs-app/src/assets/i18n/fr.json
@@ -37,6 +37,7 @@
"ListGears_Title" : "Liste des pièges",
"ListAircrafts_Title" : "Liste des avions",
"NewTunnelFlight_Title" : "Nouveaux créneaux de soufflerie",
+ "ListTunnelFlight_Title" : "Heures de tunnel",
"App_Footer" : "Application pour enregistrer ses sauts de parachutisme - v",
"App_Nav_Summary" : "Récapitulatif",
@@ -48,6 +49,7 @@
"App_Nav_Gears" : "Pièges",
"App_Nav_Logout" : "Se déconnecter",
"App_Nav_NewTunnelFlight" : "Ajouter du temps en tunnel",
+ "App_Nav_TunnelFlights": "Les vols en soufflerie",
"List_Aircrafts_Add" : "Ajouter un avion",
"List_Aircrafts_Header_Id" : "ID",
@@ -116,5 +118,8 @@
"NewTunnelFlight_ChooseTunnel": "Choisir le tunnel",
"NewTunnelFlight_Minutes": "Temps de vol(minutes)",
"NewTunnelFlight_Comments": "Commentaires",
- "NewTunnelFlight_Submit": "Ajouter"
+ "NewTunnelFlight_Submit": "Ajouter",
+ "NewTunnelFlight_Comments_Lbl": "Commentaires",
+ "NewTunnelFlight_Minutes_Lbl": "Temps de vol(minutes)",
+ "NewTunnelFlight_Date_Lbl": "Date des vols"
}
\ No newline at end of file