Update to Angular v19 and fixing #3
177
Front/skydivelogs-app/src/app/app.config.ts
Normal file
177
Front/skydivelogs-app/src/app/app.config.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
import { BrowserModule } from "@angular/platform-browser";
|
||||
import {
|
||||
NgModule,
|
||||
importProvidersFrom,
|
||||
inject,
|
||||
provideAppInitializer,
|
||||
} from "@angular/core";
|
||||
import { ApplicationConfig, provideZoneChangeDetection } from "@angular/core";
|
||||
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
|
||||
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
|
||||
import { provideRouter, RouterModule } from "@angular/router";
|
||||
import { DatePipe } from "@angular/common";
|
||||
import { HttpClient, HTTP_INTERCEPTORS } from "@angular/common/http";
|
||||
|
||||
import { SummaryComponent } from "./summary/summary.component";
|
||||
import { ListOfJumpsComponent } from "./list-of-jumps/list-of-jumps.component";
|
||||
import { ListOfDzsComponent } from "./list-of-dzs/list-of-dzs.component";
|
||||
import { NewJumpComponent } from "./new-jump/new-jump.component";
|
||||
import { ListOfAircraftsComponent } from "./list-of-aircrafts/list-of-aircrafts.component";
|
||||
import { ListOfJumpTypesComponent } from "./list-of-jump-types/list-of-jump-types.component";
|
||||
import { ListOfGearsComponent } from "./list-of-gears/list-of-gears.component";
|
||||
import { NewAircraftComponent } from "./new-aircraft/new-aircraft.component";
|
||||
import { NewGearComponent } from "./new-gear/new-gear.component";
|
||||
import { NewDropZoneComponent } from "./new-drop-zone/new-drop-zone.component";
|
||||
import { NewJumpTypeComponent } from "./new-jump-type/new-jump-type.component";
|
||||
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 { ListOfTunnelFlightsComponent } from "./list-of-tunnel-flights/list-of-tunnel-flights.component";
|
||||
|
||||
import { DateService } from "../services/date.service";
|
||||
import { AircraftService } from "../services/aircraft.service";
|
||||
import { DropzoneService } from "../services/dropzone.service";
|
||||
import { GearService } from "../services/gear.service";
|
||||
import { JumpService } from "../services/jump.service";
|
||||
import { JumpTypeService } from "../services/jump-type.service";
|
||||
import { StatsService } from "../services/stats.service";
|
||||
import { ServiceComm } from "../services/service-comm.service";
|
||||
import { RequestCache } from "../services/request-cache.service";
|
||||
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";
|
||||
import { MatAutocompleteModule } from "@angular/material/autocomplete";
|
||||
import { MatButtonModule } from "@angular/material/button";
|
||||
import { MatCheckboxModule } from "@angular/material/checkbox";
|
||||
import { MatOptionModule, MatNativeDateModule } from "@angular/material/core";
|
||||
import { MatDatepickerModule } from "@angular/material/datepicker";
|
||||
import { MatFormFieldModule } from "@angular/material/form-field";
|
||||
import { MatIconModule } from "@angular/material/icon";
|
||||
import { MatInputModule } from "@angular/material/input";
|
||||
import { MatPaginatorModule } from "@angular/material/paginator";
|
||||
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
|
||||
import { MatProgressBarModule } from "@angular/material/progress-bar";
|
||||
import { MatSelectModule } from "@angular/material/select";
|
||||
import { MatTableModule } from "@angular/material/table";
|
||||
import { MatTabsModule } from "@angular/material/tabs";
|
||||
import { MatDialogModule } from "@angular/material/dialog";
|
||||
import { MatCardModule } from "@angular/material/card";
|
||||
import { MatRadioModule } from "@angular/material/radio";
|
||||
import { MatSidenavModule } from "@angular/material/sidenav";
|
||||
import { MatListModule } from "@angular/material/list";
|
||||
import { MatToolbarModule } from "@angular/material/toolbar";
|
||||
import { provideCharts, withDefaultRegisterables } from "ng2-charts";
|
||||
|
||||
import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor";
|
||||
import { ErrorInterceptor } from "../interceptor/error.interceptor";
|
||||
import { environment } from "../environments/environment";
|
||||
|
||||
import { AppComponent } from "./app.component";
|
||||
import { routes } from "./app.routes";
|
||||
|
||||
// AOT compilation support
|
||||
export function httpTranslateLoader(http: HttpClient) {
|
||||
return new TranslateHttpLoader(http);
|
||||
}
|
||||
|
||||
// Déclaration de la fonction d'initialisation de la configuration
|
||||
export function initConfig(configService: ConfigurationHelper) {
|
||||
return () => configService.load(environment.env);
|
||||
}
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
TunnelService,
|
||||
TunnelFlightService,
|
||||
ImageService,
|
||||
AircraftService,
|
||||
DropzoneService,
|
||||
GearService,
|
||||
JumpService,
|
||||
JumpTypeService,
|
||||
StatsService,
|
||||
ServiceComm,
|
||||
DateService,
|
||||
RequestCache,
|
||||
ConfigurationHelper,
|
||||
DatePipe,
|
||||
ServiceCacheApi,
|
||||
provideAppInitializer(() => {
|
||||
const initializerFn = initConfig(inject(ConfigurationHelper));
|
||||
return initializerFn();
|
||||
}),
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: JwtAuthInterceptor, multi: true },
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
||||
provideCharts(withDefaultRegisterables()),
|
||||
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||
provideRouter(routes),
|
||||
],
|
||||
// declarations: [
|
||||
// AppComponent,
|
||||
// SummaryComponent,
|
||||
// ListOfJumpsComponent,
|
||||
// ListOfDzsComponent,
|
||||
// NewJumpComponent,
|
||||
// ListOfAircraftsComponent,
|
||||
// ListOfJumpTypesComponent,
|
||||
// ListOfGearsComponent,
|
||||
// NewAircraftComponent,
|
||||
// NewGearComponent,
|
||||
// NewDropZoneComponent,
|
||||
// NewJumpTypeComponent,
|
||||
// DefaultComponent,
|
||||
// LoginComponent,
|
||||
// CreateUserComponent,
|
||||
// LoginUserComponent,
|
||||
// UserProfileComponent,
|
||||
// ListOfImagesComponent,
|
||||
// JumpInfosComponent,
|
||||
// NewTunnelFlightComponent,
|
||||
// ListOfTunnelFlightsComponent,
|
||||
// ],
|
||||
// imports: [
|
||||
// RouterModule.forRoot(routes, { enableTracing: !environment.production }),
|
||||
// TranslateModule.forRoot({
|
||||
// loader: {
|
||||
// provide: TranslateLoader,
|
||||
// useFactory: httpTranslateLoader,
|
||||
// deps: [HttpClient],
|
||||
// },
|
||||
// }),
|
||||
// ReactiveFormsModule,
|
||||
// FormsModule,
|
||||
// BrowserModule,
|
||||
// BrowserAnimationsModule,
|
||||
// MatPaginatorModule,
|
||||
// MatTableModule,
|
||||
// MatSelectModule,
|
||||
// MatOptionModule,
|
||||
// MatFormFieldModule,
|
||||
// MatCheckboxModule,
|
||||
// MatDatepickerModule,
|
||||
// MatNativeDateModule,
|
||||
// MatInputModule,
|
||||
// MatButtonModule,
|
||||
// MatIconModule,
|
||||
// MatAutocompleteModule,
|
||||
// MatProgressSpinnerModule,
|
||||
// MatProgressBarModule,
|
||||
// MatTabsModule,
|
||||
// MatDialogModule,
|
||||
// MatCardModule,
|
||||
// MatRadioModule,
|
||||
// MatSidenavModule,
|
||||
// MatListModule,
|
||||
// MatToolbarModule,
|
||||
// ],
|
||||
};
|
||||
@@ -172,11 +172,7 @@ export function initConfig(configService: ConfigurationHelper) {
|
||||
ListOfTunnelFlightsComponent,
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
appRoutes,
|
||||
{ enableTracing: !environment.production } // <-- debugging purposes only
|
||||
// { enableTracing: !environment.production, relativeLinkResolution: 'legacy' } // <-- debugging purposes only
|
||||
),
|
||||
RouterModule.forRoot(appRoutes, { enableTracing: !environment.production }),
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
|
||||
76
Front/skydivelogs-app/src/app/app.routes.ts
Normal file
76
Front/skydivelogs-app/src/app/app.routes.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { Routes } from "@angular/router";
|
||||
|
||||
import { AuthGuardService } from "../services/auth-guard.service";
|
||||
|
||||
import { SummaryComponent } from "./summary/summary.component";
|
||||
import { ListOfJumpsComponent } from "./list-of-jumps/list-of-jumps.component";
|
||||
import { ListOfDzsComponent } from "./list-of-dzs/list-of-dzs.component";
|
||||
import { NewJumpComponent } from "./new-jump/new-jump.component";
|
||||
import { ListOfAircraftsComponent } from "./list-of-aircrafts/list-of-aircrafts.component";
|
||||
import { ListOfJumpTypesComponent } from "./list-of-jump-types/list-of-jump-types.component";
|
||||
import { ListOfGearsComponent } from "./list-of-gears/list-of-gears.component";
|
||||
import { DefaultComponent } from "./default/default.component";
|
||||
import { LoginComponent } from "./login/login.component";
|
||||
import { UserProfileComponent } from "./user-profile/user-profile.component";
|
||||
import { NewTunnelFlightComponent } from "./new-tunnel-flight/new-tunnel-flight.component";
|
||||
import { ListOfTunnelFlightsComponent } from "./list-of-tunnel-flights/list-of-tunnel-flights.component";
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: "",
|
||||
component: DefaultComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "summary",
|
||||
component: SummaryComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "jumps",
|
||||
component: ListOfJumpsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "dzs",
|
||||
component: ListOfDzsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "newjump",
|
||||
component: NewJumpComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "aircrafts",
|
||||
component: ListOfAircraftsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "jumpTypes",
|
||||
component: ListOfJumpTypesComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "gears",
|
||||
component: ListOfGearsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "user",
|
||||
component: UserProfileComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "newTunnelFlight",
|
||||
component: NewTunnelFlightComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
{
|
||||
path: "tunnelFlights",
|
||||
component: ListOfTunnelFlightsComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
},
|
||||
|
||||
{ path: "login", component: LoginComponent },
|
||||
];
|
||||
@@ -1,23 +1,32 @@
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>SkydivelogsApp</title>
|
||||
<base href="/" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>SkydivelogsApp</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
</head>
|
||||
|
||||
<body class="mat-app-background">
|
||||
<app-root>
|
||||
<div class="app-loading">
|
||||
<div class="logo"></div>
|
||||
<svg class="spinner" viewBox="25 25 50 50">
|
||||
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
|
||||
</svg>
|
||||
</div>
|
||||
</app-root>
|
||||
</body>
|
||||
|
||||
<body class="mat-app-background">
|
||||
<app-root>
|
||||
<div class="app-loading">
|
||||
<div class="logo"></div>
|
||||
<svg class="spinner" viewBox="25 25 50 50">
|
||||
<circle
|
||||
class="path"
|
||||
cx="50"
|
||||
cy="50"
|
||||
r="20"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
stroke-miterlimit="10"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</app-root>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
// import { enableProdMode } from "@angular/core";
|
||||
// import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
// import { AppModule } from "./app/app.module";
|
||||
// import { environment } from "./environments/environment";
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
// if (environment.production) {
|
||||
// enableProdMode();
|
||||
// }
|
||||
|
||||
// platformBrowserDynamic()
|
||||
// .bootstrapModule(AppModule)
|
||||
// .catch((err) => console.log(err));
|
||||
|
||||
import { enableProdMode } from "@angular/core";
|
||||
import { bootstrapApplication } from "@angular/platform-browser";
|
||||
|
||||
import { appConfig } from "./app/app.config";
|
||||
import { AppComponent } from "./app/app.component";
|
||||
|
||||
import { environment } from "./environments/environment";
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.log(err));
|
||||
bootstrapApplication(AppComponent, appConfig).catch((err) =>
|
||||
console.error(err)
|
||||
);
|
||||
|
||||
5
Front/skydivelogs-app/src/typings.d.ts
vendored
5
Front/skydivelogs-app/src/typings.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
/* SystemJS module definition */
|
||||
declare var module: NodeModule;
|
||||
interface NodeModule {
|
||||
id: string;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/out-tsc",
|
||||
"strict": true,
|
||||
"strict": false,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
|
||||
Reference in New Issue
Block a user