167 lines
7.7 KiB
TypeScript
167 lines
7.7 KiB
TypeScript
/**
|
||
* Created by stefania on 9/16/16.
|
||
*/
|
||
import { ModuleWithProviders } from '@angular/core';
|
||
import { Routes, RouterModule} from '@angular/router';
|
||
import { CommunitiesComponent } from './pages/community/communities.component';
|
||
import { ZenodoCommunitiesComponent } from "./pages/zenodo-communities/zenodo-communities.component";
|
||
import { ManageSubscribersComponent } from "./pages/subscribers/manage-subscribers.component";
|
||
import { CommunityEditFormComponent } from "./pages/community/community-edit-form/community-edit-form.component";
|
||
import { SubjectsEditFormComponent } from "./pages/subjects/subjects-edit-form/subjects-edit-form.component";
|
||
import { EntitiesComponent } from "./pages/entity/entities.component";
|
||
import { PagesComponent } from "./pages/page/pages.component";
|
||
import { PageHelpContentsComponent } from "./pages/helpcontent/page-help-contents.component";
|
||
import { NewPageHelpContentComponent } from "./pages/helpcontent/new-page-help-content.component";
|
||
import { EditPageHelpContentComponent } from "./pages/helpcontent/edit-page-help-content.component";
|
||
import { DivIdsComponent } from "./pages/divId/divIds.component";
|
||
import { DivHelpContentsComponent } from "./pages/divhelpcontent/div-help-contents.component";
|
||
import { NewDivHelpContentComponent } from "./pages/divhelpcontent/new-div-help-content.component";
|
||
import { EditDivHelpContentComponent } from "./pages/divhelpcontent/edit-div-help-content.component";
|
||
import { EditHtmlPageContentComponent } from "./pages/htmlpagecontent/edit-htmlpage-content.component";
|
||
import {ClaimsComponent} from './pages/claims/claims.component';
|
||
import {FreeGuard} from './openaireLibrary/login/freeGuard.guard';
|
||
import {IsCommunity} from './openaireLibrary/connect/communityGuard/isCommunity.guard';
|
||
import { AdminLoginGuard} from './openaireLibrary/login/adminLoginGuard.guard';
|
||
import { ConnectAdminLoginGuard} from './openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
|
||
|
||
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
||
|
||
import {StatsComponent} from './pages/stats/stats.component';
|
||
import{CommunityErrorPageComponent} from './openaireLibrary/connect/communityGuard/communityErrorPage.component';
|
||
import {AdminErrorPageComponent} from './pages/error/errorPage.component';
|
||
|
||
import { ManageProjectsComponent } from './pages/community/projects/manage-projects.component';
|
||
import { ManageContentProvidersComponent } from './pages/community/content-providers/manage-content-providers.component';
|
||
|
||
const appRoutes: Routes = [
|
||
{
|
||
path: '', loadChildren: './pages/wellcome/wellcome.module#WellcomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'dashboard',
|
||
loadChildren: './pages/dashboard/dashboard.module#DashboardModule',
|
||
canLoad: [IsCommunity, ConnectAdminLoginGuard],
|
||
resolve: {envSpecific: EnvironmentSpecificResolver}
|
||
},
|
||
{
|
||
path: 'manage-user-notifications',
|
||
loadChildren: './pages/usernotifications/manage-user-notifications.module#ManageUserNotificationsModule',
|
||
canLoad: [IsCommunity, ConnectAdminLoginGuard],
|
||
resolve: {envSpecific: EnvironmentSpecificResolver}
|
||
},
|
||
{
|
||
path: 'communities',
|
||
component: CommunitiesComponent,
|
||
canActivate: [AdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'community-edit-form',
|
||
component: CommunityEditFormComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-zenodo-communities',
|
||
component: ZenodoCommunitiesComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-subscribers',
|
||
component: ManageSubscribersComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-subjects',
|
||
component: SubjectsEditFormComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'entities',
|
||
component: EntitiesComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'classes',
|
||
component: DivIdsComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'pages',
|
||
component: PagesComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'pageContents',
|
||
component: PageHelpContentsComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'pageContents/new',
|
||
component: NewPageHelpContentComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
//path: 'pageContents/edit/:id',
|
||
path: 'pageContents/edit',
|
||
component: EditPageHelpContentComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
|
||
{
|
||
path: 'classContents',
|
||
component: DivHelpContentsComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'classContents/new',
|
||
component: NewDivHelpContentComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'classContents/edit',
|
||
component: EditDivHelpContentComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'htmlPageContent/edit',
|
||
component: EditHtmlPageContentComponent, canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'claims',
|
||
component: ClaimsComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{ path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||
{ path: 'user-info', loadChildren: './login/libUser.module#LibUserModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||
|
||
{
|
||
path: 'stats',
|
||
component: StatsComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard],
|
||
resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-projects',
|
||
component: ManageProjectsComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard], resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-content-providers',
|
||
component: ManageContentProvidersComponent,
|
||
canActivate: [IsCommunity,ConnectAdminLoginGuard], resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'mining',
|
||
loadChildren: './pages/mining/mining.module#MiningModule'
|
||
},
|
||
{
|
||
path: 'errorcommunity',
|
||
component: CommunityErrorPageComponent,canActivate: [FreeGuard]
|
||
},
|
||
{ path: '**', pathMatch: 'full', component: AdminErrorPageComponent }
|
||
|
||
];
|
||
// @NgModule({
|
||
// imports: [RouterModule.forRoot(appRoutes)],
|
||
// exports: [RouterModule],
|
||
// providers: [EnvironmentSpecificResolver, EnvironmentSpecificService]
|
||
// })
|
||
export const appRoutingProviders: any[] = [
|
||
];
|
||
|
||
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes/*, {onSameUrlNavigation: ‘reload’}*/);
|