From aad23c8001facd3305d7b79bfdc21d42d647cf58 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Fri, 8 Jan 2021 11:12:45 +0100 Subject: [PATCH] Remove circular dependencies --- .../collection-form/collection-form.module.ts | 19 +++++++++++++++++++ .../collection-page.module.ts | 9 +++------ .../edit-collection-page.module.ts | 4 ++-- .../community-form/community-form.module.ts | 19 +++++++++++++++++++ .../+community-page/community-page.module.ts | 11 ++++------- .../edit-community-page.module.ts | 4 ++-- .../comcol-role/comcol-role.component.ts | 13 ++++--------- 7 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 src/app/+collection-page/collection-form/collection-form.module.ts create mode 100644 src/app/+community-page/community-form/community-form.module.ts diff --git a/src/app/+collection-page/collection-form/collection-form.module.ts b/src/app/+collection-page/collection-form/collection-form.module.ts new file mode 100644 index 0000000000..a9ff5f3ea9 --- /dev/null +++ b/src/app/+collection-page/collection-form/collection-form.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; + +import { CollectionFormComponent } from './collection-form.component'; +import { SharedModule } from '../../shared/shared.module'; + +@NgModule({ + imports: [ + SharedModule + ], + declarations: [ + CollectionFormComponent, + ], + exports: [ + CollectionFormComponent + ] +}) +export class CollectionFormModule { + +} diff --git a/src/app/+collection-page/collection-page.module.ts b/src/app/+collection-page/collection-page.module.ts index 554d56815a..83ba12f037 100644 --- a/src/app/+collection-page/collection-page.module.ts +++ b/src/app/+collection-page/collection-page.module.ts @@ -6,13 +6,13 @@ import { SharedModule } from '../shared/shared.module'; import { CollectionPageComponent } from './collection-page.component'; import { CollectionPageRoutingModule } from './collection-page-routing.module'; import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component'; -import { CollectionFormComponent } from './collection-form/collection-form.component'; import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; import { EditItemTemplatePageComponent } from './edit-item-template-page/edit-item-template-page.component'; import { EditItemPageModule } from '../+item-page/edit-item-page/edit-item-page.module'; import { CollectionItemMapperComponent } from './collection-item-mapper/collection-item-mapper.component'; import { SearchService } from '../core/shared/search/search.service'; import { StatisticsModule } from '../statistics/statistics.module'; +import { CollectionFormModule } from './collection-form/collection-form.module'; @NgModule({ imports: [ @@ -20,19 +20,16 @@ import { StatisticsModule } from '../statistics/statistics.module'; SharedModule, CollectionPageRoutingModule, StatisticsModule.forRoot(), - EditItemPageModule + EditItemPageModule, + CollectionFormModule ], declarations: [ CollectionPageComponent, CreateCollectionPageComponent, DeleteCollectionPageComponent, - CollectionFormComponent, EditItemTemplatePageComponent, CollectionItemMapperComponent ], - exports: [ - CollectionFormComponent - ], providers: [ SearchService, ] diff --git a/src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts b/src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts index 6ca0948512..b743032c8c 100644 --- a/src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts +++ b/src/app/+collection-page/edit-collection-page/edit-collection-page.module.ts @@ -4,11 +4,11 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '../../shared/shared.module'; import { EditCollectionPageRoutingModule } from './edit-collection-page.routing.module'; import { CollectionMetadataComponent } from './collection-metadata/collection-metadata.component'; -import { CollectionPageModule } from '../collection-page.module'; import { CollectionRolesComponent } from './collection-roles/collection-roles.component'; import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; import { CollectionSourceComponent } from './collection-source/collection-source.component'; import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; +import { CollectionFormModule } from '../collection-form/collection-form.module'; /** * Module that contains all components related to the Edit Collection page administrator functionality @@ -18,7 +18,7 @@ import { CollectionAuthorizationsComponent } from './collection-authorizations/c CommonModule, SharedModule, EditCollectionPageRoutingModule, - CollectionPageModule + CollectionFormModule ], declarations: [ EditCollectionPageComponent, diff --git a/src/app/+community-page/community-form/community-form.module.ts b/src/app/+community-page/community-form/community-form.module.ts new file mode 100644 index 0000000000..36dbea5c0d --- /dev/null +++ b/src/app/+community-page/community-form/community-form.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; + +import { CommunityFormComponent } from './community-form.component'; +import { SharedModule } from '../../shared/shared.module'; + +@NgModule({ + imports: [ + SharedModule + ], + declarations: [ + CommunityFormComponent, + ], + exports: [ + CommunityFormComponent + ] +}) +export class CommunityFormModule { + +} diff --git a/src/app/+community-page/community-page.module.ts b/src/app/+community-page/community-page.module.ts index 1228783c3b..a9eaef033d 100644 --- a/src/app/+community-page/community-page.module.ts +++ b/src/app/+community-page/community-page.module.ts @@ -8,27 +8,24 @@ import { CommunityPageSubCollectionListComponent } from './sub-collection-list/c import { CommunityPageRoutingModule } from './community-page-routing.module'; import { CommunityPageSubCommunityListComponent } from './sub-community-list/community-page-sub-community-list.component'; import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component'; -import { CommunityFormComponent } from './community-form/community-form.component'; import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component'; import { StatisticsModule } from '../statistics/statistics.module'; +import { CommunityFormModule } from './community-form/community-form.module'; @NgModule({ imports: [ CommonModule, SharedModule, CommunityPageRoutingModule, - StatisticsModule.forRoot() + StatisticsModule.forRoot(), + CommunityFormModule ], declarations: [ CommunityPageComponent, CommunityPageSubCollectionListComponent, CommunityPageSubCommunityListComponent, CreateCommunityPageComponent, - DeleteCommunityPageComponent, - CommunityFormComponent - ], - exports: [ - CommunityFormComponent + DeleteCommunityPageComponent ] }) diff --git a/src/app/+community-page/edit-community-page/edit-community-page.module.ts b/src/app/+community-page/edit-community-page/edit-community-page.module.ts index 9c4a97eb5e..3f7511f700 100644 --- a/src/app/+community-page/edit-community-page/edit-community-page.module.ts +++ b/src/app/+community-page/edit-community-page/edit-community-page.module.ts @@ -2,12 +2,12 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { SharedModule } from '../../shared/shared.module'; import { EditCommunityPageRoutingModule } from './edit-community-page.routing.module'; -import { CommunityPageModule } from '../community-page.module'; import { EditCommunityPageComponent } from './edit-community-page.component'; import { CommunityCurateComponent } from './community-curate/community-curate.component'; import { CommunityMetadataComponent } from './community-metadata/community-metadata.component'; import { CommunityRolesComponent } from './community-roles/community-roles.component'; import { CommunityAuthorizationsComponent } from './community-authorizations/community-authorizations.component'; +import { CommunityFormModule } from '../community-form/community-form.module'; /** * Module that contains all components related to the Edit Community page administrator functionality @@ -17,7 +17,7 @@ import { CommunityAuthorizationsComponent } from './community-authorizations/com CommonModule, SharedModule, EditCommunityPageRoutingModule, - CommunityPageModule + CommunityFormModule ], declarations: [ EditCommunityPageComponent, diff --git a/src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts b/src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts index 111ba70104..7ec422e69d 100644 --- a/src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts +++ b/src/app/shared/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts @@ -1,22 +1,17 @@ import { Component, Input, OnInit } from '@angular/core'; import { Group } from '../../../../core/eperson/models/group.model'; import { Community } from '../../../../core/shared/community.model'; -import { Observable } from 'rxjs'; +import { BehaviorSubject, Observable } from 'rxjs'; import { GroupDataService } from '../../../../core/eperson/group-data.service'; import { Collection } from '../../../../core/shared/collection.model'; -import { map, switchMap } from 'rxjs/operators'; -import { - getFirstCompletedRemoteData, - getAllCompletedRemoteData -} from '../../../../core/shared/operators'; +import { filter, map, switchMap } from 'rxjs/operators'; +import { getAllCompletedRemoteData, getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { RequestService } from '../../../../core/data/request.service'; import { RemoteData } from '../../../../core/data/remote-data'; import { HALLink } from '../../../../core/shared/hal-link.model'; import { getGroupEditRoute } from '../../../../+admin/admin-access-control/admin-access-control-routing-paths'; -import { hasValue, hasNoValue } from '../../../empty.util'; -import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; +import { hasNoValue, hasValue } from '../../../empty.util'; import { NoContent } from '../../../../core/shared/NoContent.model'; -import { filter } from 'rxjs/internal/operators/filter'; /** * Component for managing a community or collection role.