1
|
import { RouterModule, Routes } from '@angular/router';
|
2
|
import { NgModule } from '@angular/core';
|
3
|
import { HomeComponent } from './pages/landing/home/home.component';
|
4
|
import { AuthGuardService } from './services/auth-guard.service';
|
5
|
import { ForbiddenPageComponent } from './shared/reusablecomponents/403-forbidden-page.component';
|
6
|
import { EmptyPageComponent } from "./pages/emptypage/empty-page.component";
|
7
|
import { JoinComponent } from "./pages/join/join.component";
|
8
|
import { AboutComponent } from "./pages/landing/about/about.component";
|
9
|
|
10
|
const appRoutes: Routes = [
|
11
|
{
|
12
|
path: '',
|
13
|
redirectTo: '/home',
|
14
|
pathMatch: 'full'
|
15
|
},
|
16
|
{
|
17
|
path: 'home',
|
18
|
component: HomeComponent
|
19
|
},
|
20
|
{
|
21
|
path: 'about',
|
22
|
component: AboutComponent
|
23
|
},
|
24
|
{
|
25
|
path: 'join',
|
26
|
component: JoinComponent,
|
27
|
canActivate: [AuthGuardService]
|
28
|
},
|
29
|
{
|
30
|
path: 'emptyPage',
|
31
|
component: EmptyPageComponent,
|
32
|
canActivate: [AuthGuardService]
|
33
|
},
|
34
|
{
|
35
|
path: 'repository',
|
36
|
loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
|
37
|
// loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
|
38
|
canActivate: [AuthGuardService]
|
39
|
},
|
40
|
{
|
41
|
path: 'repositoryAdmin',
|
42
|
loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
|
43
|
// loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
|
44
|
canActivate: [AuthGuardService]
|
45
|
},
|
46
|
|
47
|
|
48
|
// {
|
49
|
// path: 'dashboard',
|
50
|
// component: DashboardComponent,
|
51
|
// canActivate: [AuthGuardService]
|
52
|
// },
|
53
|
{
|
54
|
path: 'sources',
|
55
|
loadChildren: () => import('./pages/sources/sources.module').then(m => m.SourcesModule),
|
56
|
canActivate: [AuthGuardService]
|
57
|
},
|
58
|
{
|
59
|
path: 'compatibility',
|
60
|
loadChildren: () => import('./pages/compatibility/compatibility.module').then(m => m.CompatibilityModule)
|
61
|
},
|
62
|
{
|
63
|
path: 'content',
|
64
|
loadChildren: () => import('./pages/content/content.module').then(m => m.ContentModule),
|
65
|
canActivate: [AuthGuardService]
|
66
|
},
|
67
|
// {
|
68
|
// path: 'getImpact',
|
69
|
// loadChildren: './pages/metrics/metrics.module#MetricsModule',
|
70
|
// canActivate: [AuthGuardService]
|
71
|
// },
|
72
|
{
|
73
|
path: 'admin',
|
74
|
loadChildren: () => import('./pages/adminPg/adminPg.module').then(m => m.AdminPgModule),
|
75
|
},
|
76
|
{
|
77
|
path: '403-forbidden',
|
78
|
component: ForbiddenPageComponent
|
79
|
},
|
80
|
// {
|
81
|
// path: '',
|
82
|
// redirectTo: '/home',
|
83
|
// pathMatch: 'full'
|
84
|
// },
|
85
|
{
|
86
|
//fixme redirect to 404
|
87
|
path: '**',
|
88
|
redirectTo: '/403-forbidden',
|
89
|
// component: ForbiddenPageComponent
|
90
|
}
|
91
|
];
|
92
|
|
93
|
|
94
|
@NgModule ({
|
95
|
imports: [RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' })],
|
96
|
exports: [RouterModule]
|
97
|
})
|
98
|
|
99
|
export class AppRoutingModule {}
|
100
|
|