Project

General

Profile

1
import { RouterModule, Routes } from '@angular/router';
2
import { NgModule } from '@angular/core';
3
import { LandingComponent } from './pages/landing/landing.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

    
9
const appRoutes: Routes = [
10
  {
11
    path: '',
12
    redirectTo: '/landing',
13
    pathMatch: 'full'
14
  },
15
  {
16
    path: 'landing',
17
    component: LandingComponent
18
  },
19
  {
20
    path: 'join',
21
    component: JoinComponent,
22
    canActivate: [AuthGuardService]
23
  },
24
  {
25
    path: 'emptyPage',
26
    component: EmptyPageComponent,
27
    canActivate: [AuthGuardService]
28
  },
29
  {
30
    path: 'repository',
31
    loadChildren: './pages/repository/repository.module#RepositoryModule',
32
    // loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
33
    canActivate: [AuthGuardService]
34
  },
35
  {
36
    path: 'repositoryAdmin',
37
    loadChildren: './pages/repository/repository.module#RepositoryModule',
38
    // loadChildren: () => import('./pages/repository/repository.module').then(m => m.RepositoryModule),
39
    canActivate: [AuthGuardService]
40
  },
41

    
42

    
43
  // {
44
  //   path: 'dashboard',
45
  //   component: DashboardComponent,
46
  //   canActivate: [AuthGuardService]
47
  // },
48
  {
49
    path: 'sources',
50
    loadChildren: './pages/sources/sources.module#SourcesModule',
51
    canActivate: [AuthGuardService]
52
  },
53
  {
54
    path: 'compatibility',
55
    loadChildren: './pages/compatibility/compatibility.module#CompatibilityModule'
56
  },
57
  {
58
    path: 'content',
59
    loadChildren: './pages/content/content.module#ContentModule',
60
    canActivate: [AuthGuardService]
61
  },
62
  // {
63
  //   path: 'getImpact',
64
  //   loadChildren: './pages/metrics/metrics.module#MetricsModule',
65
  //   canActivate: [AuthGuardService]
66
  // },
67
  {
68
    path: 'admin',
69
    loadChildren: './pages/adminPg/adminPg.module#AdminPgModule',
70
  },
71
  {
72
    path: '403-forbidden',
73
    component: ForbiddenPageComponent
74
  },
75
  // {
76
  //   path: '',
77
  //   redirectTo: '/landing',
78
  //   pathMatch: 'full'
79
  // },
80
  {
81
    //fixme redirect to 404
82
    path: '**',
83
    redirectTo: '/403-forbidden',
84
    // component: ForbiddenPageComponent
85
  }
86
];
87

    
88

    
89
@NgModule ({
90
  imports: [RouterModule.forRoot(appRoutes)],
91
  exports: [RouterModule]
92
})
93

    
94
export class AppRoutingModule {}
95

    
(1-1/6)