mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
81 lines
2.8 KiB
TypeScript
81 lines
2.8 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { RouterModule } from '@angular/router';
|
|
|
|
import { CommunityPageResolver } from './community-page.resolver';
|
|
import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component';
|
|
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
|
import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard';
|
|
import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component';
|
|
import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver';
|
|
import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service';
|
|
import { LinkService } from '../core/cache/builders/link.service';
|
|
import { COMMUNITY_EDIT_PATH, COMMUNITY_CREATE_PATH } from './community-page-routing-paths';
|
|
import { CommunityPageAdministratorGuard } from './community-page-administrator.guard';
|
|
import { MenuItemType } from '../shared/menu/initial-menus-state';
|
|
import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model';
|
|
import { ThemedCommunityPageComponent } from './themed-community-page.component';
|
|
|
|
@NgModule({
|
|
imports: [
|
|
RouterModule.forChild([
|
|
{
|
|
path: COMMUNITY_CREATE_PATH,
|
|
component: CreateCommunityPageComponent,
|
|
canActivate: [AuthenticatedGuard, CreateCommunityPageGuard]
|
|
},
|
|
{
|
|
path: ':id',
|
|
resolve: {
|
|
dso: CommunityPageResolver,
|
|
breadcrumb: CommunityBreadcrumbResolver
|
|
},
|
|
runGuardsAndResolvers: 'always',
|
|
children: [
|
|
{
|
|
path: COMMUNITY_EDIT_PATH,
|
|
loadChildren: () => import('./edit-community-page/edit-community-page.module')
|
|
.then((m) => m.EditCommunityPageModule),
|
|
canActivate: [CommunityPageAdministratorGuard]
|
|
},
|
|
{
|
|
path: 'delete',
|
|
pathMatch: 'full',
|
|
component: DeleteCommunityPageComponent,
|
|
canActivate: [AuthenticatedGuard],
|
|
},
|
|
{
|
|
path: '',
|
|
component: ThemedCommunityPageComponent,
|
|
pathMatch: 'full',
|
|
}
|
|
],
|
|
data: {
|
|
menu: {
|
|
public: [{
|
|
id: 'statistics_community_:id',
|
|
active: true,
|
|
visible: true,
|
|
model: {
|
|
type: MenuItemType.LINK,
|
|
text: 'menu.section.statistics',
|
|
link: 'statistics/communities/:id/',
|
|
} as LinkMenuItemModel,
|
|
}],
|
|
},
|
|
},
|
|
},
|
|
])
|
|
],
|
|
providers: [
|
|
CommunityPageResolver,
|
|
CommunityBreadcrumbResolver,
|
|
DSOBreadcrumbsService,
|
|
LinkService,
|
|
CreateCommunityPageGuard,
|
|
CommunityPageAdministratorGuard
|
|
]
|
|
})
|
|
export class CommunityPageRoutingModule {
|
|
|
|
}
|