Import "TranslateModule"
This commit is contained in:
@@ -11,10 +11,10 @@ import { ConfigurationHelper } from "../services/configuration-helper";
|
||||
import { ServiceCacheApi } from "../services/service-cache-api.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-root",
|
||||
templateUrl: "./app.component.html",
|
||||
styleUrls: ["./app.component.css"],
|
||||
standalone: false
|
||||
selector: "app-root",
|
||||
templateUrl: "./app.component.html",
|
||||
styleUrls: ["./app.component.css"],
|
||||
imports: [],
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
public title = "app";
|
||||
@@ -22,31 +22,31 @@ export class AppComponent implements OnInit {
|
||||
public version: string;
|
||||
public selectedLanguageFlag: string;
|
||||
|
||||
constructor(private router: Router,
|
||||
private authenticationService: AuthenticationService,
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceCacheApi : ServiceCacheApi,
|
||||
private translateService: TranslateService)
|
||||
{
|
||||
this.authenticationService.currentUser.subscribe(user => {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private authenticationService: AuthenticationService,
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceCacheApi: ServiceCacheApi,
|
||||
private translateService: TranslateService
|
||||
) {
|
||||
this.authenticationService.currentUser.subscribe((user) => {
|
||||
if (user) {
|
||||
this.currentUser = user;
|
||||
this.translateService.addLangs(['en', 'fr']);
|
||||
this.translateService.addLangs(["en", "fr"]);
|
||||
this.translateService.use(user.language);
|
||||
this.selectedLanguageFlag = user.language;
|
||||
}
|
||||
});
|
||||
|
||||
ConfigurationHelper.settings.subscribe(settings =>
|
||||
{
|
||||
if (settings != null) {
|
||||
this.version = settings.version;
|
||||
}
|
||||
ConfigurationHelper.settings.subscribe((settings) => {
|
||||
if (settings != null) {
|
||||
this.version = settings.version;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.componentTitle.subscribe(title => (this.title = title));
|
||||
this.serviceComm.componentTitle.subscribe((title) => (this.title = title));
|
||||
}
|
||||
|
||||
public show() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Router, ActivatedRoute } from "@angular/router";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -12,7 +12,7 @@ import { User } from "../../models/user";
|
||||
selector: "app-create-user",
|
||||
templateUrl: "./create-user.component.html",
|
||||
styleUrls: ["./create-user.component.css"],
|
||||
standalone: false,
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class CreateUserComponent implements OnInit {
|
||||
createForm: FormGroup;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
import { Observable, forkJoin } from "rxjs";
|
||||
|
||||
import { AircraftService } from "../../services/aircraft.service";
|
||||
@@ -10,27 +10,31 @@ import { JumpTypeService } from "../../services/jump-type.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-default",
|
||||
templateUrl: "./default.component.html",
|
||||
styleUrls: ["./default.component.css"],
|
||||
standalone: false
|
||||
selector: "app-default",
|
||||
templateUrl: "./default.component.html",
|
||||
styleUrls: ["./default.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class DefaultComponent implements OnInit {
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private translateService: TranslateService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private serviceApiAircraft : AircraftService,
|
||||
private serviceApiJumpType : JumpTypeService,
|
||||
private serviceApiDropzone : DropzoneService,
|
||||
private serviceApiGear : GearService) {}
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private translateService: TranslateService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private serviceApiAircraft: AircraftService,
|
||||
private serviceApiJumpType: JumpTypeService,
|
||||
private serviceApiDropzone: DropzoneService,
|
||||
private serviceApiGear: GearService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authenticationService.alwaysLogin();
|
||||
|
||||
this.putToCacheRefDatas().subscribe(() => { console.log("Push to cache the referentiel datas"); });
|
||||
this.putToCacheRefDatas().subscribe(() => {
|
||||
console.log("Push to cache the referentiel datas");
|
||||
});
|
||||
this.updateTitle();
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
@@ -46,8 +50,8 @@ export class DefaultComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("Default_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("Default_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { Component, Inject, OnInit } from "@angular/core";
|
||||
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { JumpResp } from '../../models/jump';
|
||||
import { JumpService } from '../../services/jump.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { JumpResp } from "../../models/jump";
|
||||
import { JumpService } from "../../services/jump.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-jump-infos',
|
||||
templateUrl: './jump-infos.component.html',
|
||||
styleUrls: ['./jump-infos.component.css'],
|
||||
standalone: false
|
||||
selector: "app-jump-infos",
|
||||
templateUrl: "./jump-infos.component.html",
|
||||
styleUrls: ["./jump-infos.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class JumpInfosComponent implements OnInit {
|
||||
public editMode: boolean;
|
||||
public jump: JumpResp
|
||||
public jump: JumpResp;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private serviceJump: JumpService,
|
||||
private serviceComm: ServiceComm) {
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private serviceJump: JumpService,
|
||||
private serviceComm: ServiceComm
|
||||
) {
|
||||
this.jump = new JumpResp(data.jump);
|
||||
this.editMode = data.editMode;
|
||||
}
|
||||
@@ -26,12 +29,15 @@ export class JumpInfosComponent implements OnInit {
|
||||
ngOnInit(): void {}
|
||||
|
||||
public updateJump() {
|
||||
this.serviceJump.updateJump(this.jump.id,
|
||||
this.jump.isSpecial,
|
||||
this.jump.withCutaway,
|
||||
this.jump.notes)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Jump);
|
||||
});
|
||||
this.serviceJump
|
||||
.updateJump(
|
||||
this.jump.id,
|
||||
this.jump.isSpecial,
|
||||
this.jump.withCutaway,
|
||||
this.jump.notes
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Jump);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +1,59 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { AircraftService } from '../../services/aircraft.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { NewAircraftComponent } from '../new-aircraft/new-aircraft.component';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { AircraftResp } from '../../models/aircraft';
|
||||
import { AircraftService } from "../../services/aircraft.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { NewAircraftComponent } from "../new-aircraft/new-aircraft.component";
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { AircraftResp } from "../../models/aircraft";
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-aircrafts',
|
||||
templateUrl: './list-of-aircrafts.component.html',
|
||||
styleUrls: ['./list-of-aircrafts.component.css'],
|
||||
standalone: false
|
||||
selector: "app-list-of-aircrafts",
|
||||
templateUrl: "./list-of-aircrafts.component.html",
|
||||
styleUrls: ["./list-of-aircrafts.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfAircraftsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = ['name', 'imageData'];
|
||||
public displayedColumns: Array<string> = ["name", "imageData"];
|
||||
public dataSourceTable: MatTableDataSource<AircraftResp>;
|
||||
public resultsLength = 0;
|
||||
public isUserAdmin: boolean;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: AircraftService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService) {
|
||||
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
|
||||
constructor(
|
||||
private serviceApi: AircraftService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {
|
||||
this.isUserAdmin =
|
||||
this.authenticationService.currentUserValue.roles === "admin";
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
this.serviceComm.refreshRequest.subscribe((action) => {
|
||||
if (action === AddAction.Aircraft) {
|
||||
this.dialog.closeAll();
|
||||
this.getListOfAircrafts();
|
||||
}
|
||||
});
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.updateTitle();
|
||||
this.getListOfAircrafts();
|
||||
}
|
||||
|
||||
private getListOfAircrafts() {
|
||||
this.serviceApi.getListOfAircrafts().subscribe(data => {
|
||||
this.serviceApi.getListOfAircrafts().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.dataSourceTable = new MatTableDataSource<AircraftResp>(data);
|
||||
@@ -65,8 +68,8 @@ export class ListOfAircraftsComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("ListAircrafts_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("ListAircrafts_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,43 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { DropZoneResp } from '../../models/dropzone';
|
||||
import { DropzoneService } from '../../services/dropzone.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { NewDropZoneComponent } from '../new-drop-zone/new-drop-zone.component';
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { DropZoneResp } from "../../models/dropzone";
|
||||
import { DropzoneService } from "../../services/dropzone.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { NewDropZoneComponent } from "../new-drop-zone/new-drop-zone.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-dzs',
|
||||
templateUrl: './list-of-dzs.component.html',
|
||||
styleUrls: ['./list-of-dzs.component.css'],
|
||||
standalone: false
|
||||
selector: "app-list-of-dzs",
|
||||
templateUrl: "./list-of-dzs.component.html",
|
||||
styleUrls: ["./list-of-dzs.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfDzsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = [
|
||||
'isfavorite',
|
||||
'name',
|
||||
'address',
|
||||
'type',
|
||||
"isfavorite",
|
||||
"name",
|
||||
"address",
|
||||
"type",
|
||||
];
|
||||
public dataSourceTable: MatTableDataSource<DropZoneResp>;
|
||||
public isUserAdmin: boolean;
|
||||
public resultsLength = 0;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: DropzoneService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService) {
|
||||
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
|
||||
constructor(
|
||||
private serviceApi: DropzoneService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {
|
||||
this.isUserAdmin =
|
||||
this.authenticationService.currentUserValue.roles === "admin";
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -44,32 +47,35 @@ export class ListOfDzsComponent implements OnInit {
|
||||
this.getListOfDropZones();
|
||||
}
|
||||
});
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.updateTitle();
|
||||
this.getListOfDropZones();
|
||||
}
|
||||
|
||||
private getListOfDropZones() {
|
||||
this.serviceApi.getListOfDropZones()
|
||||
.subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0) || a.name.localeCompare(b.name));
|
||||
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
this.serviceApi.getListOfDropZones().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
data.sort(
|
||||
(a, b) =>
|
||||
(b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0) ||
|
||||
a.name.localeCompare(b.name)
|
||||
);
|
||||
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
public setToFavorite(dropzone: DropZoneResp) {
|
||||
dropzone.isFavorite = true;
|
||||
this.serviceApi.setFavoriteDropZone(dropzone);
|
||||
|
||||
|
||||
const data = this.dataSourceTable.data;
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0));
|
||||
this.dataSourceTable = new MatTableDataSource<DropZoneResp>(data);
|
||||
@@ -88,8 +94,8 @@ export class ListOfDzsComponent implements OnInit {
|
||||
|
||||
openDialogToAdd() {
|
||||
this.dialog.open(NewDropZoneComponent, {
|
||||
height: '400px',
|
||||
width: '600px',
|
||||
height: "400px",
|
||||
width: "600px",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,8 +105,8 @@ export class ListOfDzsComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("ListDz_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("ListDz_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
@@ -11,10 +11,10 @@ import { AddAction } from "../../models/add-action.enum";
|
||||
import { NewGearComponent } from "../new-gear/new-gear.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-list-of-gears",
|
||||
templateUrl: "./list-of-gears.component.html",
|
||||
styleUrls: ["./list-of-gears.component.css"],
|
||||
standalone: false
|
||||
selector: "app-list-of-gears",
|
||||
templateUrl: "./list-of-gears.component.html",
|
||||
styleUrls: ["./list-of-gears.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfGearsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = [
|
||||
@@ -23,37 +23,38 @@ export class ListOfGearsComponent implements OnInit {
|
||||
"maxSize",
|
||||
"aad",
|
||||
"mainCanopy",
|
||||
"reserveCanopy"
|
||||
"reserveCanopy",
|
||||
];
|
||||
public dataSourceTable: MatTableDataSource<GearResp>;
|
||||
public resultsLength = 0;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: GearService,
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService) {}
|
||||
constructor(
|
||||
private serviceApi: GearService,
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
this.serviceComm.refreshRequest.subscribe((action) => {
|
||||
if (action === AddAction.Gear) {
|
||||
this.dialog.closeAll();
|
||||
this.getListOfGears();
|
||||
}
|
||||
});
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.updateTitle();
|
||||
this.getListOfGears();
|
||||
}
|
||||
|
||||
getListOfGears() {
|
||||
this.serviceApi.getListOfGears()
|
||||
.subscribe(data => {
|
||||
this.serviceApi.getListOfGears().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
data.sort((a, b) => b.id - a.id);
|
||||
this.dataSourceTable = new MatTableDataSource<GearResp>(data);
|
||||
@@ -66,13 +67,13 @@ export class ListOfGearsComponent implements OnInit {
|
||||
openDialogToAdd() {
|
||||
this.dialog.open(NewGearComponent, {
|
||||
height: "400px",
|
||||
width: "600px"
|
||||
width: "600px",
|
||||
});
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("ListGears_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("ListGears_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { trigger,state, style } from '@angular/animations';
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { FormGroup, FormControl, Validators } from "@angular/forms";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { trigger, state, style } from "@angular/animations";
|
||||
|
||||
import { ImageService } from '../../services/image.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { ImageResp } from '../../models/image';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { ImageService } from "../../services/image.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { ImageResp } from "../../models/image";
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-images',
|
||||
templateUrl: './list-of-images.component.html',
|
||||
styleUrls: ['./list-of-images.component.css'],
|
||||
animations: [
|
||||
trigger('rotatedState', [
|
||||
state('default', style({ transform: 'rotate(0)' })),
|
||||
state('rot90', style({ transform: 'rotate(-90deg)' })),
|
||||
state('rot180', style({ transform: 'rotate(-180deg)' })),
|
||||
state('rot270', style({ transform: 'rotate(-270deg)' })),
|
||||
])
|
||||
],
|
||||
standalone: false
|
||||
selector: "app-list-of-images",
|
||||
templateUrl: "./list-of-images.component.html",
|
||||
styleUrls: ["./list-of-images.component.css"],
|
||||
animations: [
|
||||
trigger("rotatedState", [
|
||||
state("default", style({ transform: "rotate(0)" })),
|
||||
state("rot90", style({ transform: "rotate(-90deg)" })),
|
||||
state("rot180", style({ transform: "rotate(-180deg)" })),
|
||||
state("rot270", style({ transform: "rotate(-270deg)" })),
|
||||
]),
|
||||
],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfImagesComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = ['comment', 'data'];
|
||||
public displayedColumns: Array<string> = ["comment", "data"];
|
||||
public imgForm: FormGroup;
|
||||
public imageError: string;
|
||||
private selectedFile: string;
|
||||
@@ -32,13 +33,13 @@ export class ListOfImagesComponent implements OnInit {
|
||||
public showPopin: boolean;
|
||||
public dataSourceTable: MatTableDataSource<ImageResp>;
|
||||
public resultsLength = 0;
|
||||
public stateRotation: string = 'default';
|
||||
public stateRotation: string = "default";
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(
|
||||
private serviceApi: ImageService,
|
||||
private serviceComm: ServiceComm
|
||||
) { }
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.serviceComm.refreshRequest.subscribe((action) => {
|
||||
@@ -49,33 +50,32 @@ export class ListOfImagesComponent implements OnInit {
|
||||
this.getListOfImages();
|
||||
|
||||
this.imgForm = new FormGroup({
|
||||
comment: new FormControl('', Validators.required),
|
||||
image: new FormControl('', Validators.required),
|
||||
comment: new FormControl("", Validators.required),
|
||||
image: new FormControl("", Validators.required),
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfImages() {
|
||||
this.serviceApi.getListOfImages()
|
||||
.subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
this.dataSourceTable = new MatTableDataSource<ImageResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
this.serviceApi.getListOfImages().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
this.dataSourceTable = new MatTableDataSource<ImageResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
this.resultsLength = data.length;
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
public onFileChanged(fileInput: any) {
|
||||
const file = fileInput.dataTransfer
|
||||
? fileInput.dataTransfer.files[0]
|
||||
: fileInput.target.files[0];
|
||||
const allowed_types = ['image/png', 'image/jpeg'];
|
||||
const allowed_types = ["image/png", "image/jpeg"];
|
||||
const max_size = 20971520;
|
||||
|
||||
if (!allowed_types.includes(file.type)) {
|
||||
this.imageError = 'Only Images are allowed ( JPG | PNG )';
|
||||
this.imageError = "Only Images are allowed ( JPG | PNG )";
|
||||
} else if (file.size > max_size) {
|
||||
this.imageError = 'Maximum size allowed is ' + max_size / 1000 + 'Mb';
|
||||
this.imageError = "Maximum size allowed is " + max_size / 1000 + "Mb";
|
||||
} else {
|
||||
const reader = new FileReader();
|
||||
reader.onload = this.checkAndExtractDataToBase64.bind(this);
|
||||
@@ -90,16 +90,16 @@ export class ListOfImagesComponent implements OnInit {
|
||||
const image = new Image();
|
||||
image.src = e.target.result;
|
||||
image.onload = (rs) => {
|
||||
const img_height = rs.currentTarget['height'];
|
||||
const img_width = rs.currentTarget['width'];
|
||||
const img_height = rs.currentTarget["height"];
|
||||
const img_width = rs.currentTarget["width"];
|
||||
|
||||
if (img_height > max_height && img_width > max_width) {
|
||||
this.imageError =
|
||||
'Maximum dimentions allowed ' + max_height + '*' + max_width + 'px';
|
||||
"Maximum dimentions allowed " + max_height + "*" + max_width + "px";
|
||||
} else {
|
||||
const imgBase64Path = e.target.result;
|
||||
this.selectedFile = imgBase64Path;
|
||||
this.imageError = 'OK';
|
||||
this.imageError = "OK";
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -109,13 +109,14 @@ export class ListOfImagesComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
this.serviceApi.addImage(formData.comment, this.selectedFile)
|
||||
.subscribe(
|
||||
() => { this.getListOfImages(); }
|
||||
);
|
||||
this.serviceApi
|
||||
.addImage(formData.comment, this.selectedFile)
|
||||
.subscribe(() => {
|
||||
this.getListOfImages();
|
||||
});
|
||||
}
|
||||
|
||||
openModal(image: ImageResp){
|
||||
openModal(image: ImageResp) {
|
||||
this.popinImage = image.data;
|
||||
this.showPopin = true;
|
||||
}
|
||||
@@ -125,14 +126,14 @@ export class ListOfImagesComponent implements OnInit {
|
||||
}
|
||||
|
||||
rotate() {
|
||||
if (this.stateRotation === 'default') {
|
||||
this.stateRotation = 'rot90';
|
||||
} else if (this.stateRotation === 'rot90') {
|
||||
this.stateRotation = 'rot180';
|
||||
} else if (this.stateRotation === 'rot180') {
|
||||
this.stateRotation = 'rot270';
|
||||
if (this.stateRotation === "default") {
|
||||
this.stateRotation = "rot90";
|
||||
} else if (this.stateRotation === "rot90") {
|
||||
this.stateRotation = "rot180";
|
||||
} else if (this.stateRotation === "rot180") {
|
||||
this.stateRotation = "rot270";
|
||||
} else {
|
||||
this.stateRotation = 'default';
|
||||
this.stateRotation = "default";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { JumpTypeResp } from "../../models/jumpType";
|
||||
import { JumpTypeService } from "../../services/jump-type.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { NewJumpTypeComponent } from "../new-jump-type/new-jump-type.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-list-of-jump-types",
|
||||
templateUrl: "./list-of-jump-types.component.html",
|
||||
styleUrls: ["./list-of-jump-types.component.css"],
|
||||
standalone: false
|
||||
selector: "app-list-of-jump-types",
|
||||
templateUrl: "./list-of-jump-types.component.html",
|
||||
styleUrls: ["./list-of-jump-types.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfJumpTypesComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = ["name"];
|
||||
@@ -24,33 +24,36 @@ export class ListOfJumpTypesComponent implements OnInit {
|
||||
public resultsLength = 0;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: JumpTypeService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService) {
|
||||
this.isUserAdmin = this.authenticationService.currentUserValue.roles === "admin";
|
||||
constructor(
|
||||
private serviceApi: JumpTypeService,
|
||||
private serviceComm: ServiceComm,
|
||||
private authenticationService: AuthenticationService,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {
|
||||
this.isUserAdmin =
|
||||
this.authenticationService.currentUserValue.roles === "admin";
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.refreshRequest.subscribe(action => {
|
||||
this.serviceComm.refreshRequest.subscribe((action) => {
|
||||
if (action === AddAction.JumpType) {
|
||||
this.dialog.closeAll();
|
||||
this.getListOfJumpTypes();
|
||||
}
|
||||
});
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.updateTitle();
|
||||
this.getListOfJumpTypes();
|
||||
}
|
||||
|
||||
getListOfJumpTypes() {
|
||||
this.serviceApi.getListOfJumpTypes().subscribe(data => {
|
||||
this.serviceApi.getListOfJumpTypes().subscribe((data) => {
|
||||
setTimeout(() => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.dataSourceTable = new MatTableDataSource<JumpTypeResp>(data);
|
||||
@@ -65,8 +68,8 @@ export class ListOfJumpTypesComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("ListJumpTypes_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("ListJumpTypes_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatPaginator, PageEvent } from "@angular/material/paginator";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { Jump } from "../../models/jump";
|
||||
@@ -12,10 +12,10 @@ import { JumpInfosComponent } from "../jump-infos/jump-infos.component";
|
||||
import { StatsService } from "../../services/stats.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-list-of-jumps",
|
||||
templateUrl: "./list-of-jumps.component.html",
|
||||
styleUrls: ["./list-of-jumps.component.css"],
|
||||
standalone: false
|
||||
selector: "app-list-of-jumps",
|
||||
templateUrl: "./list-of-jumps.component.html",
|
||||
styleUrls: ["./list-of-jumps.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfJumpsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = [
|
||||
@@ -31,11 +31,12 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
public isLoading: boolean = false;
|
||||
|
||||
constructor(private serviceApi: JumpService,
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService,
|
||||
private statsService: StatsService
|
||||
constructor(
|
||||
private serviceApi: JumpService,
|
||||
private serviceComm: ServiceComm,
|
||||
public dialog: MatDialog,
|
||||
private translateService: TranslateService,
|
||||
private statsService: StatsService
|
||||
) {}
|
||||
|
||||
ngAferViewInit(): void {
|
||||
@@ -62,15 +63,16 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
getListOfJumps(pageSize: number = 20, pageIndex: number = 0) {
|
||||
this.isLoading = true;
|
||||
|
||||
this.serviceApi.getJumps(pageIndex * pageSize, pageIndex * pageSize + pageSize)
|
||||
.subscribe((data) => {
|
||||
this.dataSourceTable.data = data.rows;
|
||||
setTimeout(() => {
|
||||
this.paginator.length = data.count;
|
||||
this.paginator.pageIndex = pageIndex;
|
||||
this.isLoading = false;
|
||||
}, 500);
|
||||
});
|
||||
this.serviceApi
|
||||
.getJumps(pageIndex * pageSize, pageIndex * pageSize + pageSize)
|
||||
.subscribe((data) => {
|
||||
this.dataSourceTable.data = data.rows;
|
||||
setTimeout(() => {
|
||||
this.paginator.length = data.count;
|
||||
this.paginator.pageIndex = pageIndex;
|
||||
this.isLoading = false;
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
openDialog(item: Jump, editMode: boolean) {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
</mat-nav-list>
|
||||
|
||||
<div class="chart-container">
|
||||
<!-- https://www.freecodecamp.org/news/how-to-make-bar-and-line-charts-using-chartjs-in-angular/ -->
|
||||
<canvas
|
||||
baseChart
|
||||
[data]="barChartData"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { formatDate } from "@angular/common";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { ChartConfiguration, ChartData, ChartType } from "chart.js";
|
||||
import { from, of, groupBy, mergeMap, reduce, map, Observable } from "rxjs";
|
||||
import { from, groupBy, mergeMap, reduce, map } from "rxjs";
|
||||
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { TunnelFlightService } from "../../services/tunnel-flight.service";
|
||||
@@ -14,7 +14,7 @@ import { TunnelFlight, TunnelFlightByMonth } from "../../models/tunnel-flight";
|
||||
selector: "app-list-of-tunnel-flights",
|
||||
templateUrl: "./list-of-tunnel-flights.component.html",
|
||||
styleUrls: ["./list-of-tunnel-flights.component.css"],
|
||||
standalone: false,
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class ListOfTunnelFlightsComponent implements OnInit {
|
||||
public barChartLegend = true;
|
||||
|
||||
@@ -6,12 +6,13 @@ import { MatInput } from "@angular/material/input";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-login-user",
|
||||
templateUrl: "./login-user.component.html",
|
||||
styleUrls: ["./login-user.component.css"],
|
||||
standalone: false,
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class LoginUserComponent implements OnInit, AfterViewInit {
|
||||
loginForm: FormGroup;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-login",
|
||||
templateUrl: "./login.component.html",
|
||||
styleUrls: ["./login.component.css"],
|
||||
standalone: false
|
||||
selector: "app-login",
|
||||
templateUrl: "./login.component.html",
|
||||
styleUrls: ["./login.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
public selectedLanguageFlag: string;
|
||||
|
||||
constructor(private translate: TranslateService) {
|
||||
translate.addLangs(['en', 'fr']);
|
||||
translate.setDefaultLang('en');
|
||||
translate.addLangs(["en", "fr"]);
|
||||
translate.setDefaultLang("en");
|
||||
this.selectedLanguageFlag = "en";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,52 +1,58 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { AircraftService } from '../../services/aircraft.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { AddAction } from '../../models/add-action.enum';
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormControl, FormGroup, Validators } from "@angular/forms";
|
||||
import { AircraftService } from "../../services/aircraft.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-aircraft',
|
||||
templateUrl: './new-aircraft.component.html',
|
||||
styleUrls: ['./new-aircraft.component.css'],
|
||||
standalone: false
|
||||
selector: "app-new-aircraft",
|
||||
templateUrl: "./new-aircraft.component.html",
|
||||
styleUrls: ["./new-aircraft.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class NewAircraftComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
public imageError: string;
|
||||
private selectedFile: string;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceApi: AircraftService) {
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceApi: AircraftService
|
||||
) {
|
||||
this.addForm = new FormGroup(
|
||||
{
|
||||
aircraftName: new FormControl('', Validators.required)
|
||||
aircraftName: new FormControl("", Validators.required),
|
||||
},
|
||||
{ updateOn: 'blur' }
|
||||
{ updateOn: "blur" }
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {}
|
||||
|
||||
onSubmit(formData) {
|
||||
if (formData.invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.serviceApi.addAircraft(formData.aircraftName, this.selectedFile)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Aircraft);
|
||||
});
|
||||
this.serviceApi
|
||||
.addAircraft(formData.aircraftName, this.selectedFile)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Aircraft);
|
||||
});
|
||||
}
|
||||
|
||||
public onFileChanged(fileInput: any) {
|
||||
const file = fileInput.dataTransfer ? fileInput.dataTransfer.files[0] : fileInput.target.files[0];
|
||||
const allowed_types = ['image/png', 'image/jpeg'];
|
||||
const file = fileInput.dataTransfer
|
||||
? fileInput.dataTransfer.files[0]
|
||||
: fileInput.target.files[0];
|
||||
const allowed_types = ["image/png", "image/jpeg"];
|
||||
const max_size = 20971520;
|
||||
|
||||
if (!allowed_types.includes(file.type)) {
|
||||
this.imageError = 'Only Images are allowed ( JPG | PNG )';
|
||||
this.imageError = "Only Images are allowed ( JPG | PNG )";
|
||||
} else if (file.size > max_size) {
|
||||
this.imageError = 'Maximum size allowed is ' + max_size / 1000 + 'Mb';
|
||||
this.imageError = "Maximum size allowed is " + max_size / 1000 + "Mb";
|
||||
} else {
|
||||
const reader = new FileReader();
|
||||
reader.onload = this.checkAndExtractDataToBase64.bind(this);
|
||||
@@ -61,16 +67,16 @@ export class NewAircraftComponent implements OnInit {
|
||||
const image = new Image();
|
||||
image.src = e.target.result;
|
||||
image.onload = (rs) => {
|
||||
const img_height = rs.currentTarget['height'];
|
||||
const img_width = rs.currentTarget['width'];
|
||||
const img_height = rs.currentTarget["height"];
|
||||
const img_width = rs.currentTarget["width"];
|
||||
|
||||
if (img_height > max_height && img_width > max_width) {
|
||||
this.imageError =
|
||||
'Maximum dimentions allowed ' + max_height + '*' + max_width + 'px';
|
||||
"Maximum dimentions allowed " + max_height + "*" + max_width + "px";
|
||||
} else {
|
||||
const imgBase64Path = e.target.result;
|
||||
this.selectedFile = imgBase64Path;
|
||||
this.imageError = 'OK';
|
||||
this.imageError = "OK";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,12 +3,13 @@ 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";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-new-drop-zone",
|
||||
templateUrl: "./new-drop-zone.component.html",
|
||||
styleUrls: ["./new-drop-zone.component.css"],
|
||||
standalone: false
|
||||
selector: "app-new-drop-zone",
|
||||
templateUrl: "./new-drop-zone.component.html",
|
||||
styleUrls: ["./new-drop-zone.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class NewDropZoneComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
@@ -22,16 +23,16 @@ export class NewDropZoneComponent implements OnInit {
|
||||
dzName: new FormControl("", Validators.required),
|
||||
gps: new FormControl("x.x,y.y", [
|
||||
Validators.required,
|
||||
Validators.pattern("d+.d+,d+.d+")
|
||||
Validators.pattern("d+.d+,d+.d+"),
|
||||
]),
|
||||
address: new FormControl("", Validators.required),
|
||||
website: new FormControl("", Validators.required),
|
||||
contactMail: new FormControl("", [
|
||||
Validators.required,
|
||||
Validators.email
|
||||
Validators.email,
|
||||
]),
|
||||
isDz: new FormControl(true),
|
||||
isTunnel: new FormControl(false)
|
||||
isTunnel: new FormControl(false),
|
||||
},
|
||||
{ updateOn: "blur" }
|
||||
);
|
||||
@@ -50,16 +51,19 @@ export class NewDropZoneComponent implements OnInit {
|
||||
dzType.push("tunnel");
|
||||
}
|
||||
|
||||
this.dropzoneService.addDropZone(splitGps[0],
|
||||
splitGps[1],
|
||||
formData.dzName,
|
||||
formData.address,
|
||||
formData.website,
|
||||
formData.contactMail,
|
||||
dzType,
|
||||
false)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Dropzone);
|
||||
});
|
||||
this.dropzoneService
|
||||
.addDropZone(
|
||||
splitGps[0],
|
||||
splitGps[1],
|
||||
formData.dzName,
|
||||
formData.address,
|
||||
formData.website,
|
||||
formData.contactMail,
|
||||
dzType,
|
||||
false
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Dropzone);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,21 @@ import { FormControl, FormGroup, Validators } from "@angular/forms";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { AddAction } from "../../models/add-action.enum";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-new-gear",
|
||||
templateUrl: "./new-gear.component.html",
|
||||
styleUrls: ["./new-gear.component.css"],
|
||||
standalone: false
|
||||
selector: "app-new-gear",
|
||||
templateUrl: "./new-gear.component.html",
|
||||
styleUrls: ["./new-gear.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class NewGearComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceApi: GearService)
|
||||
{
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceApi: GearService
|
||||
) {
|
||||
this.addForm = new FormGroup(
|
||||
{
|
||||
name: new FormControl("", Validators.required),
|
||||
@@ -24,41 +26,44 @@ export class NewGearComponent implements OnInit {
|
||||
minSize: new FormControl("", [
|
||||
Validators.required,
|
||||
Validators.min(60),
|
||||
Validators.max(320)
|
||||
Validators.max(320),
|
||||
]),
|
||||
maxSize: new FormControl("", [
|
||||
Validators.required,
|
||||
Validators.min(60),
|
||||
Validators.max(320)
|
||||
Validators.max(320),
|
||||
]),
|
||||
aad: new FormControl("", Validators.required),
|
||||
mainCanopy: new FormControl("", [
|
||||
Validators.required,
|
||||
Validators.min(60),
|
||||
Validators.max(320)
|
||||
Validators.max(320),
|
||||
]),
|
||||
reserveCanopy: new FormControl("", [
|
||||
Validators.required,
|
||||
Validators.min(60),
|
||||
Validators.max(320)
|
||||
])
|
||||
Validators.max(320),
|
||||
]),
|
||||
},
|
||||
{ updateOn: "blur" }
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {}
|
||||
|
||||
onSubmit(formData) {
|
||||
this.serviceApi.addGear(formData.name,
|
||||
formData.manufacturer,
|
||||
+formData.minSize,
|
||||
+formData.maxSize,
|
||||
formData.aad,
|
||||
formData.mainCanopy,
|
||||
formData.reserveCanopy)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Gear);
|
||||
});
|
||||
this.serviceApi
|
||||
.addGear(
|
||||
formData.name,
|
||||
formData.manufacturer,
|
||||
+formData.minSize,
|
||||
+formData.maxSize,
|
||||
formData.aad,
|
||||
formData.mainCanopy,
|
||||
formData.reserveCanopy
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.Gear);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,32 +3,34 @@ 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";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-new-jump-type",
|
||||
templateUrl: "./new-jump-type.component.html",
|
||||
styleUrls: ["./new-jump-type.component.css"],
|
||||
standalone: false
|
||||
selector: "app-new-jump-type",
|
||||
templateUrl: "./new-jump-type.component.html",
|
||||
styleUrls: ["./new-jump-type.component.css"],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class NewJumpTypeComponent implements OnInit {
|
||||
public addForm: FormGroup;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private jumpTypeService: JumpTypeService) {
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private jumpTypeService: JumpTypeService
|
||||
) {
|
||||
this.addForm = new FormGroup(
|
||||
{
|
||||
jumptypeName: new FormControl("", Validators.required)
|
||||
jumptypeName: new FormControl("", Validators.required),
|
||||
},
|
||||
{ updateOn: "blur" }
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {}
|
||||
|
||||
onSubmit(formData) {
|
||||
this.jumpTypeService.addJumpType(formData.jumptypeName)
|
||||
.subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.JumpType);
|
||||
});
|
||||
this.jumpTypeService.addJumpType(formData.jumptypeName).subscribe(() => {
|
||||
this.serviceComm.refreshData(AddAction.JumpType);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { formatDate } from '@angular/common';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, NativeDateAdapter } from "@angular/material/core";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { formatDate } from "@angular/common";
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
NativeDateAdapter,
|
||||
} from "@angular/material/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { JumpTypeResp } from "../../models/jumpType";
|
||||
import { AircraftResp } from "../../models/aircraft";
|
||||
@@ -17,31 +21,30 @@ import { JumpTypeService } from "../../services/jump-type.service";
|
||||
import { GearService } from "../../services/gear.service";
|
||||
import { StatsService } from "../../services/stats.service";
|
||||
|
||||
|
||||
export const PICK_FORMATS = {
|
||||
parse: { dateInput: 'yy MM dd' },
|
||||
parse: { dateInput: "yy MM dd" },
|
||||
display: {
|
||||
dateInput: 'yyyy-MM-dd',
|
||||
monthYearLabel: 'yyyy MMM',
|
||||
dateA11yLabel: 'yyyy MM dd',
|
||||
monthYearA11yLabel: 'yyyy MMMM',
|
||||
}
|
||||
dateInput: "yyyy-MM-dd",
|
||||
monthYearLabel: "yyyy MMM",
|
||||
dateA11yLabel: "yyyy MM dd",
|
||||
monthYearA11yLabel: "yyyy MMMM",
|
||||
},
|
||||
};
|
||||
class PickDateAdapter extends NativeDateAdapter {
|
||||
format(date: Date, displayFormat: Object): string {
|
||||
return formatDate(date, displayFormat.toString(), "en");
|
||||
override format(date: Date, displayFormat: Object): string {
|
||||
return formatDate(date, displayFormat.toString(), "en");
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "app-new-jump",
|
||||
templateUrl: "./new-jump.component.html",
|
||||
styleUrls: ["./new-jump.component.css"],
|
||||
providers: [
|
||||
{ provide: DateAdapter, useClass: PickDateAdapter },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: PICK_FORMATS }
|
||||
],
|
||||
standalone: false
|
||||
selector: "app-new-jump",
|
||||
templateUrl: "./new-jump.component.html",
|
||||
styleUrls: ["./new-jump.component.css"],
|
||||
providers: [
|
||||
{ provide: DateAdapter, useClass: PickDateAdapter },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: PICK_FORMATS },
|
||||
],
|
||||
imports: [TranslateModule],
|
||||
})
|
||||
export class NewJumpComponent implements OnInit {
|
||||
public beginDate: Date;
|
||||
@@ -66,26 +69,28 @@ export class NewJumpComponent implements OnInit {
|
||||
private listOfDropZone: Array<DropZoneResp>;
|
||||
public maxDate: Date;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceJump: JumpService,
|
||||
private serviceJumpType: JumpTypeService,
|
||||
private serviceAircraft: AircraftService,
|
||||
private serviceDropzone: DropzoneService,
|
||||
private serviceGear: GearService,
|
||||
private dateService: DateService,
|
||||
private translateService: TranslateService,
|
||||
private statsService : StatsService) {}
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceJump: JumpService,
|
||||
private serviceJumpType: JumpTypeService,
|
||||
private serviceAircraft: AircraftService,
|
||||
private serviceDropzone: DropzoneService,
|
||||
private serviceGear: GearService,
|
||||
private dateService: DateService,
|
||||
private translateService: TranslateService,
|
||||
private statsService: StatsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data)=> {
|
||||
if (data === true){
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
if (data === true) {
|
||||
this.updateTitle();
|
||||
}
|
||||
});
|
||||
this.updateTitle();
|
||||
|
||||
this.maxDate = this.dateService.addDays(new Date(), 1);
|
||||
|
||||
|
||||
this.pendingAddRequest = false;
|
||||
this.initForm();
|
||||
this.getListOfJumpTypes();
|
||||
@@ -94,87 +99,92 @@ 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.isSpecial === undefined ? false : this.isSpecial)
|
||||
.subscribe(() => {
|
||||
this.statsService.resetStats();
|
||||
this.comments = undefined;
|
||||
this.withCutaway = false;
|
||||
this.isSpecial = false;
|
||||
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.isSpecial === undefined ? false : this.isSpecial
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.statsService.resetStats();
|
||||
this.comments = undefined;
|
||||
this.withCutaway = false;
|
||||
this.isSpecial = false;
|
||||
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
}
|
||||
|
||||
public isValidatedForm(): boolean {
|
||||
return (this.selectedDz !== undefined &&
|
||||
this.selectedDz.id !== undefined &&
|
||||
this.selectedGear !== undefined &&
|
||||
this.selectedGear.id !== undefined &&
|
||||
this.selectedAircraft !== undefined &&
|
||||
this.selectedAircraft.id !== undefined &&
|
||||
this.selectedJumpType !== undefined &&
|
||||
this.selectedJumpType.id !== undefined &&
|
||||
this.exitAltitude !== undefined &&
|
||||
typeof this.exitAltitude === "number" &&
|
||||
this.deployAltitude !== undefined &&
|
||||
typeof this.deployAltitude === "number" &&
|
||||
this.countOfJumps !== undefined &&
|
||||
typeof this.countOfJumps === "number");
|
||||
return (
|
||||
this.selectedDz !== undefined &&
|
||||
this.selectedDz.id !== undefined &&
|
||||
this.selectedGear !== undefined &&
|
||||
this.selectedGear.id !== undefined &&
|
||||
this.selectedAircraft !== undefined &&
|
||||
this.selectedAircraft.id !== undefined &&
|
||||
this.selectedJumpType !== undefined &&
|
||||
this.selectedJumpType.id !== undefined &&
|
||||
this.exitAltitude !== undefined &&
|
||||
typeof this.exitAltitude === "number" &&
|
||||
this.deployAltitude !== undefined &&
|
||||
typeof this.deployAltitude === "number" &&
|
||||
this.countOfJumps !== undefined &&
|
||||
typeof this.countOfJumps === "number"
|
||||
);
|
||||
}
|
||||
|
||||
private getListOfJumpTypes() {
|
||||
this.serviceJumpType.getListOfJumpTypes()
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfJumpType = data;
|
||||
this.countDatasLoaded = 1;
|
||||
this.serviceJumpType.getListOfJumpTypes().subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfJumpType = data;
|
||||
this.countDatasLoaded = 1;
|
||||
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
this.getListOfGears();
|
||||
});
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
this.getListOfGears();
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfAircrafts() {
|
||||
this.serviceAircraft.getListOfAircrafts(true)
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfAircraft = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
this.serviceAircraft.getListOfAircrafts(true).subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfAircraft = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfDropZones() {
|
||||
this.serviceDropzone.getListOfDropZones(true)
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => (b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0) || a.name.localeCompare(b.name));
|
||||
this.listOfDropZone = data;
|
||||
this.listOfFilteredDropZone = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
this.serviceDropzone.getListOfDropZones(true).subscribe((data) => {
|
||||
data.sort(
|
||||
(a, b) =>
|
||||
(b.isFavorite ? 1 : 0) - (a.isFavorite ? 1 : 0) ||
|
||||
a.name.localeCompare(b.name)
|
||||
);
|
||||
this.listOfDropZone = data;
|
||||
this.listOfFilteredDropZone = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfGears() {
|
||||
this.serviceGear.getListOfGears()
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => b.id - a.id);
|
||||
this.listOfGear = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
this.serviceGear.getListOfGears().subscribe((data) => {
|
||||
data.sort((a, b) => b.id - a.id);
|
||||
this.listOfGear = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
private initForm() {
|
||||
@@ -212,8 +222,8 @@ export class NewJumpComponent implements OnInit {
|
||||
filterValue = event.toLowerCase();
|
||||
|
||||
this.listOfFilteredDropZone = this.listOfDropZone;
|
||||
this.listOfFilteredDropZone = this.listOfFilteredDropZone.filter((option) =>
|
||||
option.name.toLowerCase().includes(filterValue)
|
||||
this.listOfFilteredDropZone = this.listOfFilteredDropZone.filter(
|
||||
(option) => option.name.toLowerCase().includes(filterValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -228,12 +238,12 @@ export class NewJumpComponent implements OnInit {
|
||||
|
||||
public resetDz() {
|
||||
this.selectedDz = undefined;
|
||||
this.onChangeDz('');
|
||||
this.onChangeDz("");
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("NewJump_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("NewJump_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,46 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { formatDate } from '@angular/common';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, NativeDateAdapter } from "@angular/material/core";
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { formatDate } from "@angular/common";
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
NativeDateAdapter,
|
||||
} from "@angular/material/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { TunnelResp } from "../../models/tunnel";
|
||||
|
||||
import { JumpTypeResp } from "../../models/jumpType";
|
||||
import { TunnelService } from '../../services/tunnel.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { TunnelService } from "../../services/tunnel.service";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { TunnelFlightService } from "../../services/tunnel-flight.service";
|
||||
import { JumpTypeService } from "../../services/jump-type.service";
|
||||
import { DateService } from "../../services/date.service";
|
||||
import { MatAutocompleteModule } from "@angular/material/autocomplete";
|
||||
|
||||
export const PICK_FORMATS = {
|
||||
parse: { dateInput: 'yy MM dd' },
|
||||
parse: { dateInput: "yy MM dd" },
|
||||
display: {
|
||||
dateInput: 'yyyy-MM-dd',
|
||||
monthYearLabel: 'yyyy MMM',
|
||||
dateA11yLabel: 'yyyy MM dd',
|
||||
monthYearA11yLabel: 'yyyy MMMM',
|
||||
}
|
||||
dateInput: "yyyy-MM-dd",
|
||||
monthYearLabel: "yyyy MMM",
|
||||
dateA11yLabel: "yyyy MM dd",
|
||||
monthYearA11yLabel: "yyyy MMMM",
|
||||
},
|
||||
};
|
||||
class PickDateAdapter extends NativeDateAdapter {
|
||||
format(date: Date, displayFormat: Object): string {
|
||||
override format(date: Date, displayFormat: Object): string {
|
||||
return formatDate(date, displayFormat.toString(), "en");
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-tunnel-flight',
|
||||
templateUrl: './new-tunnel-flight.component.html',
|
||||
styleUrls: ['./new-tunnel-flight.component.css'],
|
||||
providers: [
|
||||
{ provide: DateAdapter, useClass: PickDateAdapter },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: PICK_FORMATS }
|
||||
],
|
||||
standalone: false
|
||||
selector: "app-new-tunnel-flight",
|
||||
templateUrl: "./new-tunnel-flight.component.html",
|
||||
styleUrls: ["./new-tunnel-flight.component.css"],
|
||||
providers: [
|
||||
{ provide: DateAdapter, useClass: PickDateAdapter },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: PICK_FORMATS },
|
||||
],
|
||||
imports: [MatAutocompleteModule, TranslateModule],
|
||||
})
|
||||
export class NewTunnelFlightComponent implements OnInit {
|
||||
public flightDate: Date;
|
||||
@@ -51,12 +56,14 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
public listOfJumpType: Array<JumpTypeResp>;
|
||||
public maxDate: Date;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceTunnel: TunnelService,
|
||||
private serviceTunnelFlight: TunnelFlightService,
|
||||
private serviceJumpType: JumpTypeService,
|
||||
private translateService: TranslateService,
|
||||
private dateService: DateService) { }
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceTunnel: TunnelService,
|
||||
private serviceTunnelFlight: TunnelFlightService,
|
||||
private serviceJumpType: JumpTypeService,
|
||||
private translateService: TranslateService,
|
||||
private dateService: DateService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.forceTranslateTitle.subscribe((data) => {
|
||||
@@ -77,45 +84,48 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
public onFormSubmit() {
|
||||
this.pendingAddRequest = true;
|
||||
|
||||
this.serviceTunnelFlight.addFlight(this.selectedTunnel.id,
|
||||
this.selectedJumpType.id,
|
||||
this.flightDate,
|
||||
this.minutesOfFlight,
|
||||
this.comments)
|
||||
.subscribe(() => {
|
||||
this.comments = undefined;
|
||||
this.serviceTunnelFlight
|
||||
.addFlight(
|
||||
this.selectedTunnel.id,
|
||||
this.selectedJumpType.id,
|
||||
this.flightDate,
|
||||
this.minutesOfFlight,
|
||||
this.comments
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.comments = undefined;
|
||||
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
}
|
||||
|
||||
public isValidatedForm(): boolean {
|
||||
return (this.selectedTunnel !== undefined &&
|
||||
this.selectedTunnel.id !== undefined &&
|
||||
this.minutesOfFlight !== undefined &&
|
||||
typeof this.minutesOfFlight === "number");
|
||||
return (
|
||||
this.selectedTunnel !== undefined &&
|
||||
this.selectedTunnel.id !== undefined &&
|
||||
this.minutesOfFlight !== undefined &&
|
||||
typeof this.minutesOfFlight === "number"
|
||||
);
|
||||
}
|
||||
|
||||
private getListOfTunnels() {
|
||||
this.serviceTunnel.getListOfTunnels()
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfTunnel = data;
|
||||
this.listOfFilteredTunnel = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
this.serviceTunnel.getListOfTunnels().subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfTunnel = data;
|
||||
this.listOfFilteredTunnel = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfJumpTypes() {
|
||||
this.serviceJumpType.getListOfJumpTypesForTunnel()
|
||||
.subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfJumpType = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
this.serviceJumpType.getListOfJumpTypesForTunnel().subscribe((data) => {
|
||||
data.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.listOfJumpType = data;
|
||||
this.countDatasLoaded++;
|
||||
});
|
||||
}
|
||||
|
||||
public notLoadingToDisplay(): boolean {
|
||||
@@ -123,9 +133,9 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateTitle() {
|
||||
this.translateService.get("NewTunnelFlight_Title").subscribe(
|
||||
data => { this.serviceComm.updatedComponentTitle(data); }
|
||||
);
|
||||
this.translateService.get("NewTunnelFlight_Title").subscribe((data) => {
|
||||
this.serviceComm.updatedComponentTitle(data);
|
||||
});
|
||||
}
|
||||
|
||||
private initForm() {
|
||||
@@ -139,7 +149,7 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
|
||||
public resetTunnel() {
|
||||
this.selectedTunnel = undefined;
|
||||
this.onChangeTunnel('');
|
||||
this.onChangeTunnel("");
|
||||
}
|
||||
|
||||
public onChangeTunnel(event: any) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||
import { MatTableDataSource } from "@angular/material/table";
|
||||
import { MatTabChangeEvent, MatTabGroup } from "@angular/material/tabs";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { TranslateModule, TranslateService } from "@ngx-translate/core";
|
||||
import { DatePipe } from "@angular/common";
|
||||
import { ChartConfiguration, ChartData, ChartType, Colors } from "chart.js";
|
||||
import { ChartConfiguration, ChartData, ChartType } from "chart.js";
|
||||
import { MatTabsModule } from "@angular/material/tabs";
|
||||
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { StatsService } from "../../services/stats.service";
|
||||
@@ -19,7 +20,7 @@ import {
|
||||
selector: "app-summary",
|
||||
templateUrl: "./summary.component.html",
|
||||
styleUrls: ["./summary.component.css"],
|
||||
standalone: false,
|
||||
imports: [MatTabsModule, TranslateModule],
|
||||
})
|
||||
export class SummaryComponent implements OnInit {
|
||||
public dsNbJumpByDz: MatTableDataSource<StatsByDzResp>;
|
||||
@@ -39,7 +40,7 @@ export class SummaryComponent implements OnInit {
|
||||
];
|
||||
|
||||
public barChartLegend = true;
|
||||
public barChartPlugins = [];
|
||||
public barChartPlugins: any = [];
|
||||
public barChartData: ChartData<"line">;
|
||||
public barChartOptions: ChartConfiguration["options"];
|
||||
public barChartType: ChartType;
|
||||
@@ -176,7 +177,15 @@ export class SummaryComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
const results = [];
|
||||
const results: {
|
||||
label: string;
|
||||
data: number[];
|
||||
backgroundColor: string;
|
||||
borderColor: string;
|
||||
pointBackgroundColor: string;
|
||||
fill: boolean;
|
||||
pointRadius: number;
|
||||
}[] = [];
|
||||
tmpResults.forEach((value, key) => {
|
||||
const color = this.jumpTypeToColor.get(key);
|
||||
let tmp = {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<input matInput type="text" formControlName="email" />
|
||||
</mat-form-field>
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
<mat-form-field>
|
||||
<mat-label>Current password</mat-label>
|
||||
@@ -39,8 +39,10 @@
|
||||
<input matInput type="text" formControlName="newPassword" />
|
||||
</mat-form-field>
|
||||
</p>
|
||||
|
||||
<button type="submit" mat-raised-button color="accent">Update my profile</button>
|
||||
|
||||
<button type="submit" mat-raised-button color="accent">
|
||||
Update my profile
|
||||
</button>
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { User } from '../../models/user';
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormGroup, FormControl, Validators } from "@angular/forms";
|
||||
import { AuthenticationService } from "../../services/authentication.service";
|
||||
import { User } from "../../models/user";
|
||||
import { ListOfImagesComponent } from "../list-of-images/list-of-images.component";
|
||||
import { MatLabel, MatFormFieldModule } from "@angular/material/form-field";
|
||||
import { TranslateModule } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-profile',
|
||||
templateUrl: './user-profile.component.html',
|
||||
styleUrls: ['./user-profile.component.css'],
|
||||
standalone: false
|
||||
selector: "app-user-profile",
|
||||
templateUrl: "./user-profile.component.html",
|
||||
styleUrls: ["./user-profile.component.css"],
|
||||
imports: [
|
||||
ListOfImagesComponent,
|
||||
MatLabel,
|
||||
MatFormFieldModule,
|
||||
TranslateModule,
|
||||
],
|
||||
})
|
||||
export class UserProfileComponent implements OnInit {
|
||||
public userForm: FormGroup;
|
||||
|
||||
constructor(private authenticationService: AuthenticationService) { }
|
||||
constructor(private authenticationService: AuthenticationService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
const currentUser = this.authenticationService.currentUserValue;
|
||||
@@ -33,15 +41,15 @@ export class UserProfileComponent implements OnInit {
|
||||
Validators.email,
|
||||
]),
|
||||
currentPassword: new FormControl(
|
||||
'',
|
||||
Validators.pattern('^[A-Za-z0-9_-]{8,15}$')
|
||||
"",
|
||||
Validators.pattern("^[A-Za-z0-9_-]{8,15}$")
|
||||
),
|
||||
newPassword: new FormControl(
|
||||
'',
|
||||
Validators.pattern('^[A-Za-z0-9_-]{8,15}$')
|
||||
"",
|
||||
Validators.pattern("^[A-Za-z0-9_-]{8,15}$")
|
||||
),
|
||||
},
|
||||
{ updateOn: 'blur' }
|
||||
{ updateOn: "blur" }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,56 +68,56 @@ export class UserProfileComponent implements OnInit {
|
||||
|
||||
private calculTailleVoile() {
|
||||
let tailleVoile = new Map<string, Array<number>>();
|
||||
tailleVoile.set("60", [ 175, 161, 147, 133, 124, 115, 107, 97, 89 ]);
|
||||
tailleVoile.set("61", [ 178, 163, 149, 135, 126, 116, 108, 98, 90 ]);
|
||||
tailleVoile.set("62", [ 180, 166, 151, 137, 127, 118, 109, 99, 91 ]);
|
||||
tailleVoile.set("63", [ 183, 168, 153, 138, 129, 119, 111, 100, 91 ]);
|
||||
tailleVoile.set("64", [ 185, 170, 155, 140, 130, 121, 112, 101, 92 ]);
|
||||
tailleVoile.set("65", [ 188, 173, 157, 142, 132, 122, 113, 102, 93 ]);
|
||||
tailleVoile.set("66", [ 190, 175, 159, 144, 134, 123, 114, 103, 94 ]);
|
||||
tailleVoile.set("67", [ 193, 177, 161, 146, 135, 125, 116, 104, 94 ]);
|
||||
tailleVoile.set("68", [ 195, 179, 164, 147, 137, 126, 117, 105, 95 ]);
|
||||
tailleVoile.set("69", [ 198, 182, 166, 149, 138, 128, 118, 106, 96 ]);
|
||||
tailleVoile.set("70", [ 200, 184, 168, 151, 140, 129, 119, 107, 96 ]);
|
||||
tailleVoile.set("71", [ 203, 186, 170, 153, 142, 130, 120, 107, 97 ]);
|
||||
tailleVoile.set("72", [ 205, 189, 172, 155, 143, 132, 121, 108, 98 ]);
|
||||
tailleVoile.set("73", [ 208, 191, 174, 156, 145, 133, 123, 109, 99 ]);
|
||||
tailleVoile.set("74", [ 210, 193, 176, 158, 146, 134, 124, 110, 99 ]);
|
||||
tailleVoile.set("75", [ 213, 196, 178, 160, 148, 136, 125, 111, 100 ]);
|
||||
tailleVoile.set("76", [ 215, 198, 180, 162, 150, 137, 126, 112, 101 ]);
|
||||
tailleVoile.set("77", [ 218, 200, 182, 163, 151, 139, 127, 113, 101 ]);
|
||||
tailleVoile.set("78", [ 220, 202, 184, 165, 153, 140, 128, 114, 102 ]);
|
||||
tailleVoile.set("79", [ 223, 205, 186, 167, 154, 141, 129, 115, 103 ]);
|
||||
tailleVoile.set("80", [ 225, 207, 188, 169, 156, 143, 131, 115, 103 ]);
|
||||
tailleVoile.set("81", [ 228, 209, 190, 170, 157, 144, 132, 116, 104 ]);
|
||||
tailleVoile.set("82", [ 230, 212, 192, 172, 159, 145, 133, 117, 104 ]);
|
||||
tailleVoile.set("83", [ 233, 214, 194, 174, 160, 146, 134, 118, 105 ]);
|
||||
tailleVoile.set("84", [ 235, 216, 196, 176, 162, 148, 135, 119, 106 ]);
|
||||
tailleVoile.set("85", [ 238, 219, 198, 177, 163, 149, 136, 120, 106 ]);
|
||||
tailleVoile.set("86", [ 240, 221, 201, 179, 165, 150, 137, 120, 107 ]);
|
||||
tailleVoile.set("87", [ 243, 223, 203, 181, 166, 152, 138, 121, 108 ]);
|
||||
tailleVoile.set("88", [ 245, 225, 205, 183, 168, 153, 139, 122, 108 ]);
|
||||
tailleVoile.set("89", [ 248, 228, 207, 184, 170, 154, 140, 123, 109 ]);
|
||||
tailleVoile.set("90", [ 250, 230, 209, 186, 171, 156, 141, 124, 109 ]);
|
||||
tailleVoile.set("91", [ 253, 232, 211, 188, 173, 157, 143, 124, 110 ]);
|
||||
tailleVoile.set("92", [ 255, 235, 213, 190, 174, 158, 144, 125, 110 ]);
|
||||
tailleVoile.set("93", [ 258, 237, 215, 191, 176, 159, 145, 126, 111 ]);
|
||||
tailleVoile.set("94", [ 260, 239, 217, 193, 177, 161, 146, 127, 112 ]);
|
||||
tailleVoile.set("95", [ 263, 242, 219, 195, 179, 162, 147, 128, 112 ]);
|
||||
tailleVoile.set("96", [ 265, 244, 221, 197, 180, 163, 148, 128, 113 ]);
|
||||
tailleVoile.set("97", [ 268, 246, 223, 198, 182, 164, 149, 129, 113 ]);
|
||||
tailleVoile.set("98", [ 270, 248, 225, 200, 183, 166, 150, 130, 114 ]);
|
||||
tailleVoile.set("99", [ 273, 251, 227, 202, 185, 167, 151, 131, 114 ]);
|
||||
tailleVoile.set("100", [ 275, 253, 229, 203, 186, 168, 152, 131, 115 ]);
|
||||
tailleVoile.set("101", [ 278, 255, 231, 205, 188, 169, 153, 132, 115 ]);
|
||||
tailleVoile.set("102", [ 280, 258, 233, 207, 189, 171, 154, 133, 116 ]);
|
||||
tailleVoile.set("103", [ 283, 260, 235, 209, 190, 172, 155, 134, 116 ]);
|
||||
tailleVoile.set("104", [ 285, 262, 237, 210, 192, 173, 156, 134, 117 ]);
|
||||
tailleVoile.set("105", [ 288, 265, 239, 212, 193, 174, 157, 135, 118 ]);
|
||||
tailleVoile.set("106", [ 290, 267, 241, 214, 195, 175, 158, 136, 118 ]);
|
||||
tailleVoile.set("107", [ 293, 269, 243, 215, 196, 177, 159, 136, 119 ]);
|
||||
tailleVoile.set("108", [ 295, 271, 245, 217, 198, 178, 160, 137, 119 ]);
|
||||
tailleVoile.set("109", [ 298, 274, 247, 219, 199, 179, 161, 138, 120 ]);
|
||||
tailleVoile.set("110", [ 300, 276, 249, 220, 201, 180, 162, 138, 120 ]);
|
||||
tailleVoile.set("60", [175, 161, 147, 133, 124, 115, 107, 97, 89]);
|
||||
tailleVoile.set("61", [178, 163, 149, 135, 126, 116, 108, 98, 90]);
|
||||
tailleVoile.set("62", [180, 166, 151, 137, 127, 118, 109, 99, 91]);
|
||||
tailleVoile.set("63", [183, 168, 153, 138, 129, 119, 111, 100, 91]);
|
||||
tailleVoile.set("64", [185, 170, 155, 140, 130, 121, 112, 101, 92]);
|
||||
tailleVoile.set("65", [188, 173, 157, 142, 132, 122, 113, 102, 93]);
|
||||
tailleVoile.set("66", [190, 175, 159, 144, 134, 123, 114, 103, 94]);
|
||||
tailleVoile.set("67", [193, 177, 161, 146, 135, 125, 116, 104, 94]);
|
||||
tailleVoile.set("68", [195, 179, 164, 147, 137, 126, 117, 105, 95]);
|
||||
tailleVoile.set("69", [198, 182, 166, 149, 138, 128, 118, 106, 96]);
|
||||
tailleVoile.set("70", [200, 184, 168, 151, 140, 129, 119, 107, 96]);
|
||||
tailleVoile.set("71", [203, 186, 170, 153, 142, 130, 120, 107, 97]);
|
||||
tailleVoile.set("72", [205, 189, 172, 155, 143, 132, 121, 108, 98]);
|
||||
tailleVoile.set("73", [208, 191, 174, 156, 145, 133, 123, 109, 99]);
|
||||
tailleVoile.set("74", [210, 193, 176, 158, 146, 134, 124, 110, 99]);
|
||||
tailleVoile.set("75", [213, 196, 178, 160, 148, 136, 125, 111, 100]);
|
||||
tailleVoile.set("76", [215, 198, 180, 162, 150, 137, 126, 112, 101]);
|
||||
tailleVoile.set("77", [218, 200, 182, 163, 151, 139, 127, 113, 101]);
|
||||
tailleVoile.set("78", [220, 202, 184, 165, 153, 140, 128, 114, 102]);
|
||||
tailleVoile.set("79", [223, 205, 186, 167, 154, 141, 129, 115, 103]);
|
||||
tailleVoile.set("80", [225, 207, 188, 169, 156, 143, 131, 115, 103]);
|
||||
tailleVoile.set("81", [228, 209, 190, 170, 157, 144, 132, 116, 104]);
|
||||
tailleVoile.set("82", [230, 212, 192, 172, 159, 145, 133, 117, 104]);
|
||||
tailleVoile.set("83", [233, 214, 194, 174, 160, 146, 134, 118, 105]);
|
||||
tailleVoile.set("84", [235, 216, 196, 176, 162, 148, 135, 119, 106]);
|
||||
tailleVoile.set("85", [238, 219, 198, 177, 163, 149, 136, 120, 106]);
|
||||
tailleVoile.set("86", [240, 221, 201, 179, 165, 150, 137, 120, 107]);
|
||||
tailleVoile.set("87", [243, 223, 203, 181, 166, 152, 138, 121, 108]);
|
||||
tailleVoile.set("88", [245, 225, 205, 183, 168, 153, 139, 122, 108]);
|
||||
tailleVoile.set("89", [248, 228, 207, 184, 170, 154, 140, 123, 109]);
|
||||
tailleVoile.set("90", [250, 230, 209, 186, 171, 156, 141, 124, 109]);
|
||||
tailleVoile.set("91", [253, 232, 211, 188, 173, 157, 143, 124, 110]);
|
||||
tailleVoile.set("92", [255, 235, 213, 190, 174, 158, 144, 125, 110]);
|
||||
tailleVoile.set("93", [258, 237, 215, 191, 176, 159, 145, 126, 111]);
|
||||
tailleVoile.set("94", [260, 239, 217, 193, 177, 161, 146, 127, 112]);
|
||||
tailleVoile.set("95", [263, 242, 219, 195, 179, 162, 147, 128, 112]);
|
||||
tailleVoile.set("96", [265, 244, 221, 197, 180, 163, 148, 128, 113]);
|
||||
tailleVoile.set("97", [268, 246, 223, 198, 182, 164, 149, 129, 113]);
|
||||
tailleVoile.set("98", [270, 248, 225, 200, 183, 166, 150, 130, 114]);
|
||||
tailleVoile.set("99", [273, 251, 227, 202, 185, 167, 151, 131, 114]);
|
||||
tailleVoile.set("100", [275, 253, 229, 203, 186, 168, 152, 131, 115]);
|
||||
tailleVoile.set("101", [278, 255, 231, 205, 188, 169, 153, 132, 115]);
|
||||
tailleVoile.set("102", [280, 258, 233, 207, 189, 171, 154, 133, 116]);
|
||||
tailleVoile.set("103", [283, 260, 235, 209, 190, 172, 155, 134, 116]);
|
||||
tailleVoile.set("104", [285, 262, 237, 210, 192, 173, 156, 134, 117]);
|
||||
tailleVoile.set("105", [288, 265, 239, 212, 193, 174, 157, 135, 118]);
|
||||
tailleVoile.set("106", [290, 267, 241, 214, 195, 175, 158, 136, 118]);
|
||||
tailleVoile.set("107", [293, 269, 243, 215, 196, 177, 159, 136, 119]);
|
||||
tailleVoile.set("108", [295, 271, 245, 217, 198, 178, 160, 137, 119]);
|
||||
tailleVoile.set("109", [298, 274, 247, 219, 199, 179, 161, 138, 120]);
|
||||
tailleVoile.set("110", [300, 276, 249, 220, 201, 180, 162, 138, 120]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user