Project

General

Profile

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: './pages/repository/repository.module#RepositoryModule',
37
    // loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
38
    canActivate: [AuthGuardService]
39
  },
40
  {
41
    path: 'repositoryAdmin',
42
    loadChildren: './pages/repository/repository.module#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: './pages/sources/sources.module#SourcesModule',
56
    canActivate: [AuthGuardService]
57
  },
58
  {
59
    path: 'compatibility',
60
    loadChildren: './pages/compatibility/compatibility.module#CompatibilityModule'
61
  },
62
  {
63
    path: 'content',
64
    loadChildren: './pages/content/content.module#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: './pages/adminPg/adminPg.module#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)],
96
  exports: [RouterModule]
97
})
98

    
99
export class AppRoutingModule {}
100

    
(1-1/6)