diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index b3f44f6e46..6ff1a3ff63 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -68,8 +68,8 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone }, { path: 'community-list', - loadChildren: () => import('./community-list-page/community-list-page.module') - .then((m) => m.CommunityListPageModule), + loadChildren: () => import('./community-list-page/community-list-page-routes') + .then((m) => m.ROUTES), canActivate: [EndUserAgreementCurrentUserGuard] }, { diff --git a/src/app/community-list-page/community-list-page-routes.ts b/src/app/community-list-page/community-list-page-routes.ts new file mode 100644 index 0000000000..f7d4b85563 --- /dev/null +++ b/src/app/community-list-page/community-list-page-routes.ts @@ -0,0 +1,21 @@ +import { Route } from '@angular/router'; + +import { CommunityListService } from './community-list-service'; +import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; + +/** + * RouterModule to help navigate to the page with the community list tree + */ +export const ROUTES: Route[] = [ + { + path: '', + component: ThemedCommunityListPageComponent, + pathMatch: 'full', + providers: [CommunityListService], + resolve: { + breadcrumb: I18nBreadcrumbResolver + }, + data: {title: 'communityList.tabTitle', breadcrumbKey: 'communityList'} + } +]; diff --git a/src/app/community-list-page/community-list-page.module.ts b/src/app/community-list-page/community-list-page.module.ts deleted file mode 100644 index 945a3bf9ea..0000000000 --- a/src/app/community-list-page/community-list-page.module.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { CommunityListPageComponent } from './community-list-page.component'; -import { CommunityListPageRoutingModule } from './community-list-page.routing.module'; -import { CommunityListComponent } from './community-list/community-list.component'; -import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; -import { ThemedCommunityListComponent } from './community-list/themed-community-list.component'; -import { CdkTreeModule } from '@angular/cdk/tree'; - - -const DECLARATIONS = [ - CommunityListPageComponent, - CommunityListComponent, - ThemedCommunityListPageComponent, - ThemedCommunityListComponent -]; -/** - * The page which houses a title and the community list, as described in community-list.component - */ -@NgModule({ - imports: [ - CommonModule, - CommunityListPageRoutingModule, - CdkTreeModule, - ...DECLARATIONS - ], - exports: [ - ...DECLARATIONS, - CdkTreeModule, - ] -}) -export class CommunityListPageModule { - -} diff --git a/src/app/community-list-page/community-list-page.routing.module.ts b/src/app/community-list-page/community-list-page.routing.module.ts deleted file mode 100644 index 1754b1b7cf..0000000000 --- a/src/app/community-list-page/community-list-page.routing.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { CdkTreeModule } from '@angular/cdk/tree'; - -import { CommunityListService } from './community-list-service'; -import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; - -/** - * RouterModule to help navigate to the page with the community list tree - */ -@NgModule({ - imports: [ - RouterModule.forChild([ - { - path: '', - component: ThemedCommunityListPageComponent, - pathMatch: 'full', - resolve: { - breadcrumb: I18nBreadcrumbResolver - }, - data: { title: 'communityList.tabTitle', breadcrumbKey: 'communityList' } - } - ]), - CdkTreeModule, - ], - providers: [CommunityListService] -}) -export class CommunityListPageRoutingModule { -} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index 861468a7a3..f54abcfb77 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -23,7 +23,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { AppModule } from '../../app/app.module'; import { ItemPageModule } from '../../app/item-page/item-page.module'; import { RouterModule } from '@angular/router'; -import { CommunityListPageModule } from '../../app/community-list-page/community-list-page.module'; import { InfoModule } from '../../app/info/info.module'; import { StatisticsPageModule } from '../../app/statistics-page/statistics-page.module'; import { CommunityPageModule } from '../../app/community-page/community-page.module'; @@ -274,7 +273,6 @@ const DECLARATIONS = [ CollectionPageModule, CommonModule, CommunityFormModule, - CommunityListPageModule, CommunityPageModule, DragDropModule, ItemSharedModule, diff --git a/src/themes/dspace/lazy-theme.module.ts b/src/themes/dspace/lazy-theme.module.ts index 85c14d3e8a..39df9e0d6c 100644 --- a/src/themes/dspace/lazy-theme.module.ts +++ b/src/themes/dspace/lazy-theme.module.ts @@ -23,7 +23,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { AppModule } from '../../app/app.module'; import { ItemPageModule } from '../../app/item-page/item-page.module'; import { RouterModule } from '@angular/router'; -import { CommunityListPageModule } from '../../app/community-list-page/community-list-page.module'; import { InfoModule } from '../../app/info/info.module'; import { StatisticsPageModule } from '../../app/statistics-page/statistics-page.module'; import { CommunityPageModule } from '../../app/community-page/community-page.module'; @@ -55,7 +54,6 @@ const DECLARATIONS = [ CollectionPageModule, CommonModule, CommunityFormModule, - CommunityListPageModule, CommunityPageModule, DragDropModule, ItemSharedModule,