From 976302389fa2eb79a60fe9c27cc8da39e96d13d2 Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 23 Aug 2018 14:01:37 +0200 Subject: [PATCH] fixed collection page, added SearchFilter Model --- .../collection-page.component.ts | 12 ++---- .../full/full-item-page.component.html | 4 +- .../full/full-item-page.component.scss | 5 ++- .../paginated-search-options.model.spec.ts | 7 +++- .../paginated-search-options.model.ts | 6 ++- src/app/+search-page/search-filter.model.ts | 20 ++++++++++ .../+search-page/search-options.model.spec.ts | 7 +++- src/app/+search-page/search-options.model.ts | 16 +++++--- .../search-page.component.spec.ts | 2 +- .../search-configuration.service.spec.ts | 21 ++++++++-- .../search-configuration.service.ts | 38 +++++++++++++++---- .../core/shared/dspace-object-type.model.ts | 7 ++++ src/app/thumbnail/thumbnail.component.html | 4 +- 13 files changed, 111 insertions(+), 38 deletions(-) create mode 100644 src/app/+search-page/search-filter.model.ts create mode 100644 src/app/core/shared/dspace-object-type.model.ts diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts index 646a8944ee..89567c4a54 100644 --- a/src/app/+collection-page/collection-page.component.ts +++ b/src/app/+collection-page/collection-page.component.ts @@ -5,7 +5,6 @@ import { Observable } from 'rxjs/Observable'; import { Subscription } from 'rxjs/Subscription'; import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model'; import { CollectionDataService } from '../core/data/collection-data.service'; -import { ItemDataService } from '../core/data/item-data.service'; import { PaginatedList } from '../core/data/paginated-list'; import { RemoteData } from '../core/data/remote-data'; @@ -21,8 +20,8 @@ import { PaginationComponentOptions } from '../shared/pagination/pagination-comp import { filter, flatMap, map } from 'rxjs/operators'; import { SearchService } from '../+search-page/search-service/search.service'; import { PaginatedSearchOptions } from '../+search-page/paginated-search-options.model'; -import { SearchResult } from '../+search-page/search-result.model'; import { toDSpaceObjectListRD } from '../core/shared/operators'; +import { DSpaceObjectType } from '../core/shared/dspace-object-type.model'; @Component({ selector: 'ds-collection-page', @@ -68,18 +67,13 @@ export class CollectionPageComponent implements OnInit, OnDestroy { this.metadata.processRemoteData(this.collectionRD$); const page = +params.page || this.paginationConfig.currentPage; const pageSize = +params.pageSize || this.paginationConfig.pageSize; - const sortDirection = +params.page || this.sortConfig.direction; const pagination = Object.assign({}, this.paginationConfig, { currentPage: page, pageSize: pageSize } ); - const sort = Object.assign({}, - this.sortConfig, - { direction: sortDirection, field: params.sortField } - ); this.updatePage({ pagination: pagination, - sort: sort + sort: this.sortConfig }); })); @@ -91,7 +85,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy { scope: this.collectionId, pagination: searchOptions.pagination, sort: searchOptions.sort, - filters: {type: 2} + dsoType: DSpaceObjectType.ITEM })).pipe(toDSpaceObjectListRD()) as Observable>>; } diff --git a/src/app/+item-page/full/full-item-page.component.html b/src/app/+item-page/full/full-item-page.component.html index ba517f0f59..1d0c4ab812 100644 --- a/src/app/+item-page/full/full-item-page.component.html +++ b/src/app/+item-page/full/full-item-page.component.html @@ -2,8 +2,8 @@
-