Skip to content

Commit

Permalink
Merge branch 'dspace-cris-7' of bitbucket.org:4Science/dspace-angular…
Browse files Browse the repository at this point in the history
… into DSC-472
  • Loading branch information
Sufiyan Shaikh committed Mar 8, 2022
2 parents c3f78de + a627519 commit d8ef53c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/+explore/explore.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('ExploreComponent', () => {
style: 'col-md-6',
order: 'desc',
sortField: 'dc.date.accessioned',
numberOfItems: 5,
titleKey: 'lastPublications'
};

Expand Down
1 change: 1 addition & 0 deletions src/app/core/layout/models/section.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface TopSection extends SectionComponent {
order: string;
titleKey: string;
componentType: 'top';
numberOfItems: number;
}

export interface SearchSection extends SectionComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe('TopSectionComponent', () => {
style: 'col-md-6',
order: 'desc',
sortField: 'dc.date.accessioned',
numberOfItems: 5,
titleKey: undefined
};

Expand Down Expand Up @@ -119,6 +120,7 @@ describe('TopSectionComponent', () => {
style: 'col-md-6',
order: 'desc',
sortField: 'dc.date.foo',
numberOfItems: 5,
titleKey: 'lastPublications'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export class TopSectionComponent implements OnInit {
paginatedSearchOptions: PaginatedSearchOptions;

ngOnInit() {

const order = this.topSection.order;
const numberOfItems = this.topSection.numberOfItems;
const sortDirection = order && order.toUpperCase() === 'ASC' ? SortDirection.ASC : SortDirection.DESC;
const pagination: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
id: 'search-object-pagination',
pageSize: 5,
pageSize: numberOfItems,
currentPage: 1
});

Expand Down

0 comments on commit d8ef53c

Please sign in to comment.