Fix the links in the homepage

This commit is contained in:
Sébastien ANDRE
2023-09-25 16:36:56 +02:00
parent 9a237fc73a
commit 708745013f
3 changed files with 68 additions and 37 deletions

View File

@@ -1,10 +1,14 @@
import { BrowserModule } from "@angular/platform-browser"; import { BrowserModule } from "@angular/platform-browser";
import { APP_INITIALIZER, NgModule } from "@angular/core"; import { APP_INITIALIZER, NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router"; import { RouterModule, Routes } from "@angular/router";
import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; import {
import { DatePipe } from '@angular/common'; HttpClient,
import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; HttpClientModule,
import { TranslateHttpLoader } from '@ngx-translate/http-loader'; HTTP_INTERCEPTORS,
} from "@angular/common/http";
import { DatePipe } from "@angular/common";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
import { AppComponent } from "./app.component"; import { AppComponent } from "./app.component";
import { environment } from "../environments/environment"; import { environment } from "../environments/environment";
@@ -26,9 +30,9 @@ import { CreateUserComponent } from "./create-user/create-user.component";
import { LoginUserComponent } from "./login-user/login-user.component"; import { LoginUserComponent } from "./login-user/login-user.component";
import { UserProfileComponent } from "./user-profile/user-profile.component"; import { UserProfileComponent } from "./user-profile/user-profile.component";
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component"; import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
import { JumpInfosComponent } from './jump-infos/jump-infos.component'; import { JumpInfosComponent } from "./jump-infos/jump-infos.component";
import { NewTunnelFlightComponent } from './new-tunnel-flight/new-tunnel-flight.component'; import { NewTunnelFlightComponent } from "./new-tunnel-flight/new-tunnel-flight.component";
import { ListOfTunnelFlightsComponent } from './list-of-tunnel-flights/list-of-tunnel-flights.component'; import { ListOfTunnelFlightsComponent } from "./list-of-tunnel-flights/list-of-tunnel-flights.component";
import { DateService } from "../services/date.service"; import { DateService } from "../services/date.service";
import { AircraftService } from "../services/aircraft.service"; import { AircraftService } from "../services/aircraft.service";
@@ -65,65 +69,69 @@ import { MatTabsModule } from "@angular/material/tabs";
import { MatDialogModule } from "@angular/material/dialog"; import { MatDialogModule } from "@angular/material/dialog";
import { MatCardModule } from "@angular/material/card"; import { MatCardModule } from "@angular/material/card";
import { MatRadioModule } from "@angular/material/radio"; import { MatRadioModule } from "@angular/material/radio";
import { MatSidenavModule } from '@angular/material/sidenav'; import { MatSidenavModule } from "@angular/material/sidenav";
import { MatListModule } from '@angular/material/list'; import { MatListModule } from "@angular/material/list";
import { MatToolbarModule } from '@angular/material/toolbar'; import { MatToolbarModule } from "@angular/material/toolbar";
import { NgChartsModule } from 'ng2-charts'; import { NgChartsModule } from "ng2-charts";
import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor"; import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor";
import { ErrorInterceptor } from "../interceptor/error.interceptor"; import { ErrorInterceptor } from "../interceptor/error.interceptor";
const appRoutes: Routes = [ const appRoutes: Routes = [
{ path: "", component: DefaultComponent, canActivate: [AuthGuardService] }, {
path: "",
component: DefaultComponent,
canActivate: [AuthGuardService],
},
{ {
path: "summary", path: "summary",
component: SummaryComponent, component: SummaryComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "jumps", path: "jumps",
component: ListOfJumpsComponent, component: ListOfJumpsComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "dzs", path: "dzs",
component: ListOfDzsComponent, component: ListOfDzsComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "newjump", path: "newjump",
component: NewJumpComponent, component: NewJumpComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "aircrafts", path: "aircrafts",
component: ListOfAircraftsComponent, component: ListOfAircraftsComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "jumpTypes", path: "jumpTypes",
component: ListOfJumpTypesComponent, component: ListOfJumpTypesComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "gears", path: "gears",
component: ListOfGearsComponent, component: ListOfGearsComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "user", path: "user",
component: UserProfileComponent, component: UserProfileComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "newTunnelFlight", path: "newTunnelFlight",
component: NewTunnelFlightComponent, component: NewTunnelFlightComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ {
path: "tunnelFlights", path: "tunnelFlights",
component: ListOfTunnelFlightsComponent, component: ListOfTunnelFlightsComponent,
canActivate: [AuthGuardService] canActivate: [AuthGuardService],
}, },
{ path: "login", component: LoginComponent }, { path: "login", component: LoginComponent },
@@ -161,7 +169,7 @@ export function initConfig(configService: ConfigurationHelper) {
ListOfImagesComponent, ListOfImagesComponent,
JumpInfosComponent, JumpInfosComponent,
NewTunnelFlightComponent, NewTunnelFlightComponent,
ListOfTunnelFlightsComponent ListOfTunnelFlightsComponent,
], ],
imports: [ imports: [
RouterModule.forRoot( RouterModule.forRoot(
@@ -173,8 +181,8 @@ export function initConfig(configService: ConfigurationHelper) {
loader: { loader: {
provide: TranslateLoader, provide: TranslateLoader,
useFactory: httpTranslateLoader, useFactory: httpTranslateLoader,
deps: [HttpClient] deps: [HttpClient],
} },
}), }),
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
@@ -201,7 +209,7 @@ export function initConfig(configService: ConfigurationHelper) {
MatSidenavModule, MatSidenavModule,
MatListModule, MatListModule,
MatToolbarModule, MatToolbarModule,
NgChartsModule NgChartsModule,
], ],
exports: [HttpClientModule], exports: [HttpClientModule],
providers: [ providers: [
@@ -220,11 +228,15 @@ export function initConfig(configService: ConfigurationHelper) {
ConfigurationHelper, ConfigurationHelper,
DatePipe, DatePipe,
ServiceCacheApi, ServiceCacheApi,
{ provide: APP_INITIALIZER, useFactory: initConfig, deps: [ConfigurationHelper], multi: true }, {
provide: APP_INITIALIZER,
useFactory: initConfig,
deps: [ConfigurationHelper],
multi: true,
},
{ provide: HTTP_INTERCEPTORS, useClass: JwtAuthInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: JwtAuthInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true } { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })
export class AppModule { export class AppModule {}
}

View File

@@ -1 +1,18 @@
<div class="content"></div> <div class="content">
<p>
<a class="nostyle" routerLink="/summary" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="Summary" style="width: 256px; height:256px; font-size: 256px;">timeline</mat-icon>
</a>
</p>
<p>
<a class="nostyle" routerLink="/newjump" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="Add jumps" style="width: 256px; height:256px; font-size: 256px;">add_circle</mat-icon>
</a>
</p>
<p>
<a class="nostyle" routerLink="/jumps" routerLinkActive="active" skipLocationChange>
<mat-icon aria-hidden="false" aria-label="List of jumps" style="width: 256px; height:256px; font-size: 256px;">list_alt</mat-icon>
</a>
</p>
</div>

View File

@@ -16,17 +16,12 @@ mat-form-field{
} }
a { a {
/* background-color: red; */
/* box-shadow: 0 2px 0 darkred; */
color: white; color: white;
/* padding: 0.5em 0.5em; */
/* position: relative; */
text-decoration: none; text-decoration: none;
text-transform: uppercase; text-transform: uppercase;
} }
a:hover { a:hover {
/* background-color: #ce0606; */
box-shadow: 0 2px 0 darkred; box-shadow: 0 2px 0 darkred;
} }
@@ -34,3 +29,10 @@ a:active {
box-shadow: none; box-shadow: none;
top: 5px; top: 5px;
} }
a.nostyle {
text-decoration: none !important;
}
a.nostyle:hover {
box-shadow: none !important;
}