180 lines
8.4 KiB
TypeScript
180 lines
8.4 KiB
TypeScript
/**
|
||
* Created by stefania on 9/16/16.
|
||
*/
|
||
import { ModuleWithProviders } from '@angular/core';
|
||
import { Routes, RouterModule } from '@angular/router';
|
||
|
||
import { DashboardComponent } from "./dashboard.component";
|
||
import { CommunitiesComponent } from './pages/community/communities.component';
|
||
import { ManageZenodoCommunitiesComponent } from "./pages/zenodo-communities/manage-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 { LoginGuard} from './openaireLibrary/login/loginGuard.guard';
|
||
import { ConnectAdminLoginGuard} from './openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard';
|
||
|
||
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
||
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
||
import{ClaimsAdminComponent} from './openaireLibrary/claims/claimsAdmin/claimsAdmin.component';
|
||
|
||
import {StatsComponent} from "./pages/stats/stats.component";
|
||
import {MiningComponent} from './pages/mining/mining.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';
|
||
import {WellcomeComponent} from './pages/wellcome/wellcome.component';
|
||
|
||
import {ManageUserNotificationsComponent} from './pages/usernotifications/manage-user-notifications.component';
|
||
|
||
//TODO replace IsCommunity with ConnectAdminLoginGuard
|
||
//, IsCommunity
|
||
const appRoutes: Routes = [
|
||
{
|
||
path: '',
|
||
component: WellcomeComponent,
|
||
canActivate: [FreeGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
// redirectTo: 'dashboard',
|
||
// pathMatch: 'full'
|
||
},
|
||
{
|
||
path: 'dashboard',
|
||
component: DashboardComponent,
|
||
canActivate: [IsCommunity, ConnectAdminLoginGuard],resolve: { envSpecific: EnvironmentSpecificResolver }
|
||
},
|
||
{
|
||
path: 'manage-user-notifications',
|
||
component: ManageUserNotificationsComponent,
|
||
canActivate: [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: ManageZenodoCommunitiesComponent,
|
||
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',
|
||
component: MiningComponent,canActivate: [IsCommunity,ConnectAdminLoginGuard]
|
||
},
|
||
{
|
||
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’}*/);
|