+
+
{{authorMd.value}}
;
({{item.findMetadata("dc.publisher")}}, {{item.findMetadata("dc.date.issued")}})
- {{item.findMetadata("dc.description.abstract") | words : 35 : "..."}}
+
+
{{item.findMetadata("dc.description.abstract") | words : 35 : "..."}}
diff --git a/src/app/object-list/object-list.component.ts b/src/app/shared/object-list/object-list.component.ts
similarity index 80%
rename from src/app/object-list/object-list.component.ts
rename to src/app/shared/object-list/object-list.component.ts
index df570bda46..7e404d0f51 100644
--- a/src/app/object-list/object-list.component.ts
+++ b/src/app/shared/object-list/object-list.component.ts
@@ -2,21 +2,21 @@ import {
Component, Input, ViewEncapsulation, ChangeDetectionStrategy,
OnInit, Output
} from '@angular/core';
-import { RemoteData } from "../core/data/remote-data";
-import { DSpaceObject } from "../core/shared/dspace-object.model";
-import { PageInfo } from "../core/shared/page-info.model";
+import { RemoteData } from "../../core/data/remote-data";
+import { DSpaceObject } from "../../core/shared/dspace-object.model";
+import { PageInfo } from "../../core/shared/page-info.model";
import { Observable } from "rxjs";
-import { PaginationComponentOptions } from "../shared/pagination/pagination-component-options.model";
+import { PaginationComponentOptions } from "../pagination/pagination-component-options.model";
import { EventEmitter } from "@angular/common/src/facade/async";
-import { SortOptions, SortDirection } from "../core/cache/models/sort-options.model";
+import { SortOptions, SortDirection } from "../../core/cache/models/sort-options.model";
@Component({
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'ds-object-list',
- styleUrls: ['./object-list.component.css'],
- templateUrl: './object-list.component.html'
+ styleUrls: ['../../object-list/object-list.component.css'],
+ templateUrl: '../../object-list/object-list.component.html'
})
export class ObjectListComponent implements OnInit {
diff --git a/src/app/shared/pagination/pagination.component.spec.ts b/src/app/shared/pagination/pagination.component.spec.ts
index dbe63132a1..8a8b5139b9 100644
--- a/src/app/shared/pagination/pagination.component.spec.ts
+++ b/src/app/shared/pagination/pagination.component.spec.ts
@@ -31,6 +31,8 @@ import { MockTranslateLoader } from "../testing/mock-translate-loader";
import { GLOBAL_CONFIG, EnvConfig } from '../../../config';
import { ActivatedRouteStub, RouterStub } from "../testing/router-stubs";
import { HostWindowService } from "../host-window.service";
+import { EnumKeysPipe } from "../utils/enum-keys-pipe";
+import { SortOptions } from "../../core/cache/models/sort-options.model";
function createTestComponent
(html: string, type: {new (...args: any[]): T}): ComponentFixture {
@@ -138,7 +140,7 @@ describe('Pagination component', () => {
RouterTestingModule.withRoutes([
{path: 'home', component: TestComponent}
])],
- declarations: [PaginationComponent, TestComponent], // declare the test component
+ declarations: [PaginationComponent, TestComponent, EnumKeysPipe], // declare the test component
providers: [
{ provide: ActivatedRoute, useValue: activatedRouteStub },
{ provide: GLOBAL_CONFIG, useValue: EnvConfig },
@@ -156,6 +158,7 @@ describe('Pagination component', () => {
html = `
@@ -247,12 +250,12 @@ describe('Pagination component', () => {
changePage(testFixture, 3);
tick();
- expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 10 } });
+ expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 10, sortDirection: 0, sortField: 'name' } });
expect(paginationComponent.currentPage).toEqual(3);
changePageSize(testFixture, '20');
tick();
- expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 20 } });
+ expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 20, sortDirection: 0, sortField: 'name' } });
expect(paginationComponent.pageSize).toEqual(20);
}));
@@ -308,6 +311,7 @@ class TestComponent {
collection: string[] = [];
collectionSize: number;
paginationOptions = new PaginationComponentOptions();
+ sortOptions = new SortOptions();
constructor() {
this.collection = Array.from(new Array(100), (x, i) => `item ${i + 1}`);
diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts
index 6fc3994a37..62c518faa1 100644
--- a/src/app/shared/pagination/pagination.component.ts
+++ b/src/app/shared/pagination/pagination.component.ts
@@ -19,6 +19,7 @@ import { HostWindowService } from "../host-window.service";
import { HostWindowState } from "../host-window.reducer";
import { PaginationComponentOptions } from './pagination-component-options.model';
import { SortDirection, SortOptions } from "../../core/cache/models/sort-options.model";
+import { hasValue } from "../empty.util";
/**
* The default pagination controls component.
@@ -173,7 +174,7 @@ export class PaginationComponent implements OnDestroy, OnInit {
this.sortDirection = this.sortOptions.direction;
this.sortField = this.sortOptions.field;
this.routeSubscription = this.route.queryParams
- .map(queryParams => queryParams)
+ .filter(queryParams => hasValue(queryParams))
.subscribe(queryParams => {
this.currentQueryParams = queryParams;
if (this.id == queryParams['pageId']
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index 5ccfc92ab3..8c998b5b8e 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -19,6 +19,11 @@ import { ComcolPageHeaderComponent } from "./comcol-page-header/comcol-page-head
import { ComcolPageLogoComponent } from "./comcol-page-logo/comcol-page-logo.component";
import { TRUNCATE_PIPES } from "ng2-truncate";
import { EnumKeysPipe } from "./utils/enum-keys-pipe";
+import { ObjectListComponent } from "./object-list/object-list.component";
+import { ObjectListElementComponent } from "../object-list/object-list-element/object-list-element.component";
+import { ItemListElementComponent } from "../object-list/item-list-element/item-list-element.component";
+import { CommunityListElementComponent } from "../object-list/community-list-element/community-list-element.component";
+import { CollectionListElementComponent } from "../object-list/collection-list-element/collection-list-element.component";
const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -45,7 +50,12 @@ const COMPONENTS = [
ThumbnailComponent,
ComcolPageContentComponent,
ComcolPageHeaderComponent,
- ComcolPageLogoComponent
+ ComcolPageLogoComponent,
+ ObjectListComponent,
+ ObjectListElementComponent,
+ ItemListElementComponent,
+ CollectionListElementComponent,
+ CommunityListElementComponent
];
const PROVIDERS = [