Make the size of a browse result page configurable.

This commit is contained in:
Mark H. Wood
2022-08-16 16:32:38 -04:00
parent 45887154b6
commit 7a3284f6bc
4 changed files with 20 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ import { StartsWithType } from '../../shared/starts-with/starts-with-decorator';
import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator';
import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationService } from '../../core/pagination/pagination.service';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { environment } from 'src/environments/environment';
@Component({ @Component({
selector: 'ds-browse-by-metadata-page', selector: 'ds-browse-by-metadata-page',
@@ -52,7 +53,7 @@ export class BrowseByMetadataPageComponent implements OnInit {
paginationConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { paginationConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
id: 'bbm', id: 'bbm',
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: environment.browseBy.pageSize,
}); });
/** /**

View File

@@ -1,21 +1,30 @@
import { Config } from './config.interface'; import { Config } from './config.interface';
/** /**
* Config that determines how the dropdown list of years are created for browse-by-date components * Config that determines how the dropdown list of years are created for
* browse-by-date components.
*/ */
export interface BrowseByConfig extends Config { export interface BrowseByConfig extends Config {
/** /**
* The max amount of years to display using jumps of one year (current year - oneYearLimit) * The max amount of years to display using jumps of one year
* (current year - oneYearLimit)
*/ */
oneYearLimit: number; oneYearLimit: number;
/** /**
* Limit for years to display using jumps of five years (current year - fiveYearLimit) * Limit for years to display using jumps of five years
* (current year - fiveYearLimit)
*/ */
fiveYearLimit: number; fiveYearLimit: number;
/** /**
* The absolute lowest year to display in the dropdown when no lowest date can be found for all items * The absolute lowest year to display in the dropdown when no lowest date can
* be found for all items.
*/ */
defaultLowerLimit: number; defaultLowerLimit: number;
/**
* Number of entries in the viewport of a paginated browse-by list.
*/
pageSize: number;
} }

View File

@@ -193,7 +193,9 @@ export class DefaultAppConfig implements AppConfig {
// Limit for years to display using jumps of five years (current year - fiveYearLimit) // Limit for years to display using jumps of five years (current year - fiveYearLimit)
fiveYearLimit: 30, fiveYearLimit: 30,
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
defaultLowerLimit: 1900 defaultLowerLimit: 1900,
// The number of entries in a paginated browse results list.
pageSize: 20
}; };
// Item Page Config // Item Page Config

View File

@@ -192,6 +192,8 @@ export const environment: BuildConfig = {
fiveYearLimit: 30, fiveYearLimit: 30,
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) // The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
defaultLowerLimit: 1900, defaultLowerLimit: 1900,
// The number of entries in a paginated browse results list.
pageSize: 20,
}, },
item: { item: {
edit: { edit: {