From 130fefd635a54a5e474105f115a253aa7fcddb0f Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Mon, 8 Jan 2024 23:27:28 +0100 Subject: [PATCH] 110889: Moved & renamed ComcolRecentlyAddedComponent --- .../collection-page-routing.module.ts | 4 +-- .../collection-page/collection-page.module.ts | 2 -- src/app/shared/comcol/comcol.module.ts | 2 ++ .../comcol-recently-added.component.html} | 0 .../comcol-recently-added.component.scss} | 0 .../comcol-recently-added.component.spec.ts} | 28 +++++++-------- .../comcol-recently-added.component.ts} | 36 +++++++++---------- 7 files changed, 36 insertions(+), 36 deletions(-) rename src/app/{collection-page/sections/recently-added/collection-recently-added.component.html => shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.html} (100%) rename src/app/{collection-page/sections/recently-added/collection-recently-added.component.scss => shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.scss} (100%) rename src/app/{collection-page/sections/recently-added/collection-recently-added.component.spec.ts => shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.spec.ts} (54%) rename src/app/{collection-page/sections/recently-added/collection-recently-added.component.ts => shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.ts} (63%) diff --git a/src/app/collection-page/collection-page-routing.module.ts b/src/app/collection-page/collection-page-routing.module.ts index 5ddef6ca68b..d40ed0d8f78 100644 --- a/src/app/collection-page/collection-page-routing.module.ts +++ b/src/app/collection-page/collection-page-routing.module.ts @@ -25,7 +25,7 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; import { BrowseByGuard } from '../browse-by/browse-by-guard'; import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; -import { CollectionRecentlyAddedComponent } from './sections/recently-added/collection-recently-added.component'; +import { ComcolRecentlyAddedComponent } from '../shared/comcol/sections/comcol-recently-added/comcol-recently-added.component'; @NgModule({ imports: [ @@ -73,7 +73,7 @@ import { CollectionRecentlyAddedComponent } from './sections/recently-added/coll { path: '', pathMatch: 'full', - component: CollectionRecentlyAddedComponent, + component: ComcolRecentlyAddedComponent, }, { path: 'browse/:id', diff --git a/src/app/collection-page/collection-page.module.ts b/src/app/collection-page/collection-page.module.ts index 8782be0a45f..5db85d48e98 100644 --- a/src/app/collection-page/collection-page.module.ts +++ b/src/app/collection-page/collection-page.module.ts @@ -19,7 +19,6 @@ import { ComcolModule } from '../shared/comcol/comcol.module'; import { DsoSharedModule } from '../dso-shared/dso-shared.module'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; import { BrowseByPageModule } from '../browse-by/browse-by-page.module'; -import { CollectionRecentlyAddedComponent } from './sections/recently-added/collection-recently-added.component'; const DECLARATIONS = [ CollectionPageComponent, @@ -29,7 +28,6 @@ const DECLARATIONS = [ EditItemTemplatePageComponent, ThemedEditItemTemplatePageComponent, CollectionItemMapperComponent, - CollectionRecentlyAddedComponent, ]; @NgModule({ diff --git a/src/app/shared/comcol/comcol.module.ts b/src/app/shared/comcol/comcol.module.ts index 7ce48a3a55d..773640e9379 100644 --- a/src/app/shared/comcol/comcol.module.ts +++ b/src/app/shared/comcol/comcol.module.ts @@ -18,6 +18,7 @@ import { FormModule } from '../form/form.module'; import { UploadModule } from '../upload/upload.module'; import { ComcolBrowseByComponent } from './sections/comcol-browse-by/comcol-browse-by.component'; import { BrowseByModule } from '../../browse-by/browse-by.module'; +import { ComcolRecentlyAddedComponent } from './sections/comcol-recently-added/comcol-recently-added.component'; const COMPONENTS = [ ComcolPageContentComponent, @@ -33,6 +34,7 @@ const COMPONENTS = [ ComcolRoleComponent, ThemedComcolPageHandleComponent, ComcolBrowseByComponent, + ComcolRecentlyAddedComponent, ]; @NgModule({ diff --git a/src/app/collection-page/sections/recently-added/collection-recently-added.component.html b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.html similarity index 100% rename from src/app/collection-page/sections/recently-added/collection-recently-added.component.html rename to src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.html diff --git a/src/app/collection-page/sections/recently-added/collection-recently-added.component.scss b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.scss similarity index 100% rename from src/app/collection-page/sections/recently-added/collection-recently-added.component.scss rename to src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.scss diff --git a/src/app/collection-page/sections/recently-added/collection-recently-added.component.spec.ts b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.spec.ts similarity index 54% rename from src/app/collection-page/sections/recently-added/collection-recently-added.component.spec.ts rename to src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.spec.ts index 4acc24e3f59..d01c1ed16a8 100644 --- a/src/app/collection-page/sections/recently-added/collection-recently-added.component.spec.ts +++ b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CollectionRecentlyAddedComponent } from './collection-recently-added.component'; -import { APP_CONFIG } from '../../../../config/app-config.interface'; -import { environment } from '../../../../environments/environment.test'; +import { ComcolRecentlyAddedComponent } from './comcol-recently-added.component'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment.test'; import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { SearchServiceStub } from '../../../shared/testing/search-service.stub'; -import { SearchService } from '../../../core/shared/search/search.service'; -import { VarDirective } from '../../../shared/utils/var.directive'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { PaginationServiceStub } from '../../../testing/pagination-service.stub'; +import { SearchServiceStub } from '../../../testing/search-service.stub'; +import { SearchService } from '../../../../core/shared/search/search.service'; +import { VarDirective } from '../../../utils/var.directive'; import { TranslateModule } from '@ngx-translate/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -describe('CollectionRecentlyAddedComponent', () => { - let component: CollectionRecentlyAddedComponent; - let fixture: ComponentFixture; +describe('ComcolRecentlyAddedComponent', () => { + let component: ComcolRecentlyAddedComponent; + let fixture: ComponentFixture; let activatedRoute: ActivatedRouteStub; let paginationService: PaginationServiceStub; @@ -27,7 +27,7 @@ describe('CollectionRecentlyAddedComponent', () => { await TestBed.configureTestingModule({ declarations: [ - CollectionRecentlyAddedComponent, + ComcolRecentlyAddedComponent, VarDirective, ], imports: [ @@ -42,7 +42,7 @@ describe('CollectionRecentlyAddedComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); - fixture = TestBed.createComponent(CollectionRecentlyAddedComponent); + fixture = TestBed.createComponent(ComcolRecentlyAddedComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/collection-page/sections/recently-added/collection-recently-added.component.ts b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.ts similarity index 63% rename from src/app/collection-page/sections/recently-added/collection-recently-added.component.ts rename to src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.ts index 65af77a63b5..a2c11dab941 100644 --- a/src/app/collection-page/sections/recently-added/collection-recently-added.component.ts +++ b/src/app/shared/comcol/sections/comcol-recently-added/comcol-recently-added.component.ts @@ -1,29 +1,29 @@ import { Component, OnInit, Inject, OnDestroy } from '@angular/core'; import { Observable, combineLatest as observableCombineLatest } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { Item } from '../../../core/shared/item.model'; +import { RemoteData } from '../../../../core/data/remote-data'; +import { PaginatedList } from '../../../../core/data/paginated-list.model'; +import { Item } from '../../../../core/shared/item.model'; import { switchMap, map, startWith, take } from 'rxjs/operators'; -import { getFirstSucceededRemoteData, toDSpaceObjectListRD } from '../../../core/shared/operators'; -import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; -import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; -import { BROWSE_LINKS_TO_FOLLOW } from '../../../core/browse/browse.service'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { SortOptions, SortDirection } from '../../../core/cache/models/sort-options.model'; -import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; -import { SearchService } from '../../../core/shared/search/search.service'; -import { Collection } from '../../../core/shared/collection.model'; +import { getFirstSucceededRemoteData, toDSpaceObjectListRD } from '../../../../core/shared/operators'; +import { PaginatedSearchOptions } from '../../../search/models/paginated-search-options.model'; +import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { BROWSE_LINKS_TO_FOLLOW } from '../../../../core/browse/browse.service'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { PaginationComponentOptions } from '../../../pagination/pagination-component-options.model'; +import { SortOptions, SortDirection } from '../../../../core/cache/models/sort-options.model'; +import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; +import { SearchService } from '../../../../core/shared/search/search.service'; +import { Collection } from '../../../../core/shared/collection.model'; import { ActivatedRoute, Data } from '@angular/router'; -import { fadeIn } from '../../../shared/animations/fade'; +import { fadeIn } from '../../../animations/fade'; @Component({ - selector: 'ds-collection-recently-added', - templateUrl: './collection-recently-added.component.html', - styleUrls: ['./collection-recently-added.component.scss'], + selector: 'ds-comcol-recently-added', + templateUrl: './comcol-recently-added.component.html', + styleUrls: ['./comcol-recently-added.component.scss'], animations: [fadeIn], }) -export class CollectionRecentlyAddedComponent implements OnInit, OnDestroy { +export class ComcolRecentlyAddedComponent implements OnInit, OnDestroy { paginationConfig: PaginationComponentOptions;