diff --git a/resources/i18n/en.json b/resources/i18n/en.json
index 2239d605cc..e65321cf39 100644
--- a/resources/i18n/en.json
+++ b/resources/i18n/en.json
@@ -91,7 +91,8 @@
"sub-collections": "Loading sub-collections...",
"items": "Loading items...",
"item": "Loading item...",
- "objects": "Loading..."
+ "objects": "Loading...",
+ "search-results": "Loading search results..."
},
"error": {
"default": "Error",
@@ -101,6 +102,7 @@
"sub-collections": "Error fetching sub-collections",
"items": "Error fetching items",
"item": "Error fetching item",
- "objects": "Error fetching objects"
+ "objects": "Error fetching objects",
+ "search-results": "Error fetching search results"
}
}
diff --git a/src/app/+collection-page/collection-page.component.html b/src/app/+collection-page/collection-page.component.html
index e385de08b4..b0a544eb37 100644
--- a/src/app/+collection-page/collection-page.component.html
+++ b/src/app/+collection-page/collection-page.component.html
@@ -1,13 +1,13 @@
-
-
+
-
-
+
+
-
+
{{'collection.page.browse.recent.head' | translate}}
+ [hideGear]="false"
+ (paginationChange)="onPaginationChange($event)">
-
-
+
+
diff --git a/src/app/+collection-page/collection-page.component.ts b/src/app/+collection-page/collection-page.component.ts
index 0bc86af045..2ca547dada 100644
--- a/src/app/+collection-page/collection-page.component.ts
+++ b/src/app/+collection-page/collection-page.component.ts
@@ -7,13 +7,13 @@ import { 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 { RemoteData } from '../core/data/remote-data';
+
+import { MetadataService } from '../core/metadata/metadata.service';
import { Bitstream } from '../core/shared/bitstream.model';
import { Collection } from '../core/shared/collection.model';
import { Item } from '../core/shared/item.model';
-import { MetadataService } from '../core/metadata/metadata.service';
-
import { fadeIn, fadeInOut } from '../shared/animations/fade';
import { hasValue, isNotEmpty } from '../shared/empty.util';
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
@@ -29,9 +29,9 @@ import { PaginationComponentOptions } from '../shared/pagination/pagination-comp
]
})
export class CollectionPageComponent implements OnInit, OnDestroy {
- collectionData: RemoteData
;
+ collectionData: Observable>;
itemData: RemoteData- ;
- logoData: RemoteData;
+ logoData: Observable>;
paginationConfig: PaginationComponentOptions;
sortConfig: SortOptions;
private subs: Subscription[] = [];
@@ -62,7 +62,10 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
this.collectionId = params.id;
this.collectionData = this.collectionDataService.findById(this.collectionId);
this.metadata.processRemoteData(this.collectionData);
- this.subs.push(this.collectionData.payload.subscribe((collection) => this.logoData = collection.logo));
+ this.subs.push(this.collectionData
+ .map((rd: RemoteData) => rd.payload)
+ .filter((collection: Collection) => hasValue(collection))
+ .subscribe((collection: Collection) => this.logoData = collection.logo));
const page = +params.page || this.paginationConfig.currentPage;
const pageSize = +params.pageSize || this.paginationConfig.pageSize;
@@ -84,12 +87,14 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
}
updatePage(searchOptions) {
- this.itemData = this.itemDataService.findAll({
+ this.subs.push(this.itemDataService.findAll({
scopeID: this.collectionId,
currentPage: searchOptions.pagination.currentPage,
elementsPerPage: searchOptions.pagination.pageSize,
sort: searchOptions.sort
- });
+ }).subscribe((rd: RemoteData
- ) => {
+ this.itemData = rd;
+ }));
}
ngOnDestroy(): void {
@@ -99,4 +104,17 @@ export class CollectionPageComponent implements OnInit, OnDestroy {
isNotEmpty(object: any) {
return isNotEmpty(object);
}
+
+ onPaginationChange(event) {
+ this.updatePage({
+ pagination: {
+ currentPage: event.page,
+ pageSize: event.pageSize
+ },
+ sort: {
+ field: event.sortField,
+ direction: event.sortDirection
+ }
+ })
+ }
}
diff --git a/src/app/+community-page/community-page.component.html b/src/app/+community-page/community-page.component.html
index 3935ffccae..e9f91e3f10 100644
--- a/src/app/+community-page/community-page.component.html
+++ b/src/app/+community-page/community-page.component.html
@@ -1,10 +1,10 @@
-