|
1 | | -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; |
| 1 | +import { ChangeDetectionStrategy, Component, OnInit, Inject } from '@angular/core'; |
2 | 2 | import { ActivatedRoute, Router } from '@angular/router'; |
3 | 3 | import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, Subject } from 'rxjs'; |
4 | 4 | import { filter, map, mergeMap, startWith, switchMap, take } from 'rxjs/operators'; |
@@ -29,6 +29,7 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; |
29 | 29 | import { getCollectionPageRoute } from './collection-page-routing-paths'; |
30 | 30 | import { redirectOn4xx } from '../core/shared/authorized.operators'; |
31 | 31 | import { BROWSE_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; |
| 32 | +import { APP_CONFIG, AppConfig } from '../../../src/config/app-config.interface'; |
32 | 33 |
|
33 | 34 | @Component({ |
34 | 35 | selector: 'ds-collection-page', |
@@ -69,13 +70,15 @@ export class CollectionPageComponent implements OnInit { |
69 | 70 | private authService: AuthService, |
70 | 71 | private paginationService: PaginationService, |
71 | 72 | private authorizationDataService: AuthorizationDataService, |
| 73 | + @Inject(APP_CONFIG) public appConfig: AppConfig, |
72 | 74 | ) { |
73 | | - this.paginationConfig = new PaginationComponentOptions(); |
74 | | - this.paginationConfig.id = 'cp'; |
75 | | - this.paginationConfig.pageSize = 5; |
76 | | - this.paginationConfig.currentPage = 1; |
77 | | - this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC); |
| 75 | + this.paginationConfig = Object.assign(new PaginationComponentOptions(), { |
| 76 | + id: 'cp', |
| 77 | + currentPage: 1, |
| 78 | + pageSize: this.appConfig.browseBy.pageSize, |
| 79 | + }); |
78 | 80 |
|
| 81 | + this.sortConfig = new SortOptions('dc.date.accessioned', SortDirection.DESC); |
79 | 82 | } |
80 | 83 |
|
81 | 84 | ngOnInit(): void { |
|
0 commit comments