Fix
This commit is contained in:
@@ -24,6 +24,10 @@ import { DefaultComponent } from "./default/default.component";
|
||||
import { LoginComponent } from "./login/login.component";
|
||||
import { CreateUserComponent } from "./create-user/create-user.component";
|
||||
import { LoginUserComponent } from "./login-user/login-user.component";
|
||||
import { UserProfileComponent } from "./user-profile/user-profile.component";
|
||||
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
|
||||
import { JumpInfosComponent } from './jump-infos/jump-infos.component';
|
||||
import { NewTunnelFlightComponent } from './new-tunnel-flight/new-tunnel-flight.component';
|
||||
|
||||
import { DateService } from "../services/date.service";
|
||||
import { AircraftService } from "../services/aircraft.service";
|
||||
@@ -39,6 +43,7 @@ import { ImageService } from "../services/image.service";
|
||||
import { ConfigurationHelper } from "../services/configuration-helper";
|
||||
import { ServiceCacheApi } from "../services/service-cache-api.service";
|
||||
import { TunnelService } from "../services/tunnel.service";
|
||||
import { TunnelFlightService } from "../services/tunnel-flight.service";
|
||||
|
||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||
@@ -65,10 +70,6 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
|
||||
import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor";
|
||||
import { ErrorInterceptor } from "../interceptor/error.interceptor";
|
||||
import { UserProfileComponent } from "./user-profile/user-profile.component";
|
||||
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
|
||||
import { JumpInfosComponent } from './jump-infos/jump-infos.component';
|
||||
import { NewTunnelFlightComponent } from './new-tunnel-flight/new-tunnel-flight.component';
|
||||
|
||||
const appRoutes: Routes = [
|
||||
{ path: "", component: DefaultComponent, canActivate: [AuthGuardService] },
|
||||
@@ -151,7 +152,7 @@ export function initConfig(configService: ConfigurationHelper) {
|
||||
UserProfileComponent,
|
||||
ListOfImagesComponent,
|
||||
JumpInfosComponent,
|
||||
NewTunnelFlightComponent,
|
||||
NewTunnelFlightComponent
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
@@ -195,6 +196,7 @@ export function initConfig(configService: ConfigurationHelper) {
|
||||
exports: [HttpClientModule],
|
||||
providers: [
|
||||
TunnelService,
|
||||
TunnelFlightService,
|
||||
ImageService,
|
||||
AircraftService,
|
||||
DropzoneService,
|
||||
|
||||
@@ -5,10 +5,11 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { TunnelResp } from "../../models/tunnel";
|
||||
|
||||
import { DateService } from 'src/services/date.service';
|
||||
import { TunnelService } from 'src/services/tunnel.service';
|
||||
import { ServiceComm } from 'src/services/service-comm.service';
|
||||
import { StatsService } from 'src/services/stats.service';
|
||||
import { DateService } from '../../services/date.service';
|
||||
import { TunnelService } from '../../services/tunnel.service';
|
||||
import { ServiceComm } from '../../services/service-comm.service';
|
||||
import { StatsService } from '../../services/stats.service';
|
||||
import { TunnelFlightService } from "../../services/tunnel-flight.service";
|
||||
|
||||
export const PICK_FORMATS = {
|
||||
parse: { dateInput: 'yy MM dd' },
|
||||
@@ -47,6 +48,7 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
private serviceTunnel: TunnelService,
|
||||
private serviceTunnelFlight: TunnelFlightService,
|
||||
private dateService: DateService,
|
||||
private translateService: TranslateService,
|
||||
private statsService: StatsService) { }
|
||||
@@ -67,20 +69,19 @@ export class NewTunnelFlightComponent implements OnInit {
|
||||
onFormSubmit() {
|
||||
this.pendingAddRequest = true;
|
||||
|
||||
this.serviceTunnel.AddFlight(this.selectedTunnel.id,
|
||||
this.beginDate,
|
||||
this.minutesOfFlight,
|
||||
this.comments)
|
||||
.subscribe(() => {
|
||||
this.statsService.resetStats();
|
||||
this.comments = undefined;
|
||||
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
this.serviceTunnelFlight.addFlight(this.selectedTunnel.id,
|
||||
this.beginDate,
|
||||
this.minutesOfFlight,
|
||||
this.comments)
|
||||
.subscribe(() => {
|
||||
this.statsService.resetStats();
|
||||
this.comments = undefined;
|
||||
|
||||
if (this.resetForm === true) {
|
||||
this.initForm();
|
||||
}
|
||||
this.pendingAddRequest = false;
|
||||
});
|
||||
}
|
||||
|
||||
public isValidatedForm(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user