reworked items list on collection page

This commit is contained in:
lotte
2018-08-22 16:30:28 +02:00
parent 1ea0e0ecfc
commit f5fed28722
11 changed files with 53 additions and 30 deletions

View File

@@ -19,6 +19,10 @@ import { fadeIn, fadeInOut } from '../shared/animations/fade';
import { hasValue, isNotEmpty } from '../shared/empty.util';
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
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';
@Component({
selector: 'ds-collection-page',
@@ -41,7 +45,7 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
constructor(
private collectionDataService: CollectionDataService,
private itemDataService: ItemDataService,
private searchService: SearchService,
private metadata: MetadataService,
private route: ActivatedRoute
) {
@@ -82,12 +86,13 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
}
updatePage(searchOptions) {
this.itemRD$ = this.itemDataService.findAll({
scopeID: this.collectionId,
currentPage: searchOptions.pagination.currentPage,
elementsPerPage: searchOptions.pagination.pageSize,
sort: searchOptions.sort
});
this.itemRD$ = this.searchService.search(
new PaginatedSearchOptions({
scope: this.collectionId,
pagination: searchOptions.pagination,
sort: searchOptions.sort,
filters: {type: 2}
})).pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>;
}
ngOnDestroy(): void {