1 |
61384
|
k.triantaf
|
import {NgModule} from '@angular/core';
|
2 |
|
|
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';
|
3 |
|
|
import {IsCommunity} from './openaireLibrary/connect/communityGuard/isCommunity.guard';
|
4 |
|
|
import {ConnectAdminLoginGuard} from './openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
|
5 |
|
|
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
|
6 |
|
|
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
|
7 |
|
|
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
|
8 |
|
|
|
9 |
|
|
const routes: Routes = [
|
10 |
|
|
{
|
11 |
|
|
path: '',
|
12 |
|
|
loadChildren: () => import('./pages/manage-communities/manage-communities.module').then(m => m.ManageCommunitiesModule),
|
13 |
|
|
canActivateChild: [LoginGuard]
|
14 |
|
|
},
|
15 |
|
|
{
|
16 |
|
|
path: 'reload',
|
17 |
|
|
loadChildren: () => import('./reload/libReload.module').then(m => m.LibReloadModule),
|
18 |
|
|
data: {hasSidebar: false, hasHeader: false}
|
19 |
|
|
},
|
20 |
|
|
{
|
21 |
|
|
path: 'user-info',
|
22 |
|
|
loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule),
|
23 |
|
|
data: {hasSidebar: false}
|
24 |
|
|
},
|
25 |
|
|
{ path: 'error',
|
26 |
|
|
pathMatch: 'full',
|
27 |
|
|
component: AdminErrorPageComponent,
|
28 |
|
|
data: {hasSidebar: false}
|
29 |
|
|
},
|
30 |
|
|
{
|
31 |
|
|
path: 'connect/admin-tools',
|
32 |
|
|
loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
|
33 |
|
|
canActivateChild: [AdminLoginGuard],
|
34 |
|
|
data: {portal: 'connect'}
|
35 |
|
|
},
|
36 |
|
|
{
|
37 |
|
|
path: 'openaire/admin-tools',
|
38 |
|
|
loadChildren: () => import('./pages/admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
|
39 |
|
|
canActivateChild: [AdminLoginGuard],
|
40 |
|
|
data: {portal: 'openaire'}
|
41 |
|
|
},
|
42 |
|
|
{
|
43 |
|
|
path: 'admin-tools',
|
44 |
|
|
loadChildren: () => import('./pages/admin-tools/portal-admin-tools-routing.module').then(m => m.PortalAdminToolsRoutingModule),
|
45 |
|
|
canActivateChild: [AdminLoginGuard]
|
46 |
|
|
},
|
47 |
|
|
{
|
48 |
|
|
path: ':community', redirectTo: '/:community/info/profile', pathMatch: 'full'
|
49 |
|
|
},
|
50 |
|
|
{
|
51 |
|
|
path: ':community',
|
52 |
|
|
loadChildren: () => import('./pages/community-routing.module').then(m => m.CommunityRoutingModule),
|
53 |
|
|
canActivateChild: [IsCommunity, ConnectAdminLoginGuard]
|
54 |
|
|
},
|
55 |
|
|
{ path: '**',
|
56 |
|
|
pathMatch: 'full',
|
57 |
|
|
component: AdminErrorPageComponent
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
];
|
61 |
|
|
|
62 |
|
|
@NgModule({
|
63 |
|
|
imports: [RouterModule.forRoot(routes, {
|
64 |
|
|
preloadingStrategy: PreloadAllModules,
|
65 |
|
|
onSameUrlNavigation: "reload"
|
66 |
|
|
})],
|
67 |
|
|
exports: [ RouterModule ]
|
68 |
|
|
})
|
69 |
|
|
export class AppRoutingModule {}
|