From f7e78dccd129458c6f4828e8ac1fe309d925a64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Fern=C3=A1ndez=20Celorio?= Date: Mon, 7 Nov 2022 19:27:54 +0000 Subject: [PATCH] Use the same property for both item pages --- config/config.example.yml | 6 ++--- .../full-file-section.component.ts | 24 +++++++++---------- .../file-section/file-section.component.ts | 2 +- src/config/default-app-config.ts | 9 +++---- src/config/item-config.interface.ts | 10 +++----- src/environments/environment.test.ts | 9 +++---- 6 files changed, 23 insertions(+), 37 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 52a0720230..bb4c691f6b 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -207,13 +207,11 @@ item: undoTimeout: 10000 # 10 seconds # Show the item access status label in items lists showAccessStatuses: false - simpleView: - bitstreamPageSize: 5 - fullView: + bitstream: # Number of entries in the bitstream list in the full item view page. # Rounded to the nearest size in the list of selectable sizes on the # settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. - bitstreamPageSize: 5 + pageSize: 5 # Collection Page Config collection: diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts index 89134a321e..3be0d58c81 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -35,8 +35,17 @@ export class FullFileSectionComponent extends FileSectionComponent implements On originals$: Observable>>; licenses$: Observable>>; - originalOptions: PaginationComponentOptions; - licenseOptions: PaginationComponentOptions; + originalOptions = Object.assign(new PaginationComponentOptions(), { + id: 'obo', + currentPage: 1, + pageSize: this.appConfig.item.bitstream.pageSize + }); + + licenseOptions = Object.assign(new PaginationComponentOptions(), { + id: 'lbo', + currentPage: 1, + pageSize: this.appConfig.item.bitstream.pageSize + }); constructor( bitstreamDataService: BitstreamDataService, @@ -46,17 +55,6 @@ export class FullFileSectionComponent extends FileSectionComponent implements On @Inject(APP_CONFIG) protected appConfig: AppConfig ) { super(bitstreamDataService, notificationsService, translateService, appConfig); - this.originalOptions = Object.assign(new PaginationComponentOptions(), { - id: 'obo', - currentPage: 1, - pageSize: this.appConfig.item.fullView.bitstreamPageSize - }); - - this.licenseOptions = Object.assign(new PaginationComponentOptions(), { - id: 'lbo', - currentPage: 1, - pageSize: this.appConfig.item.fullView.bitstreamPageSize - }); } ngOnInit(): void { diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts index 2907a33482..08e792fc8b 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -44,7 +44,7 @@ export class FileSectionComponent implements OnInit { protected translateService: TranslateService, @Inject(APP_CONFIG) protected appConfig: AppConfig ) { - this.pageSize = this.appConfig.item.simpleView.bitstreamPageSize; + this.pageSize = this.appConfig.item.bitstream.pageSize; } ngOnInit(): void { diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 3940ea1c19..f87a5b868b 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -246,14 +246,11 @@ export class DefaultAppConfig implements AppConfig { }, // Show the item access status label in items lists showAccessStatuses: false, - simpleView: { - bitstreamPageSize: 5 - }, - fullView: { - // Number of entries in the bitstream list in the full item view page. + bitstream: { + // Number of entries in the bitstream list in the item view page. // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. - bitstreamPageSize: 5 + pageSize: 5 } }; diff --git a/src/config/item-config.interface.ts b/src/config/item-config.interface.ts index 1351911334..35cb5260ae 100644 --- a/src/config/item-config.interface.ts +++ b/src/config/item-config.interface.ts @@ -7,14 +7,10 @@ export interface ItemConfig extends Config { // This is used to show the access status label of items in results lists showAccessStatuses: boolean; - simpleView: { - bitstreamPageSize: number; - }; - - fullView: { - // Number of entries in the bitstream list in the full item view page. + bitstream: { + // Number of entries in the bitstream list in the item view page. // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. - bitstreamPageSize: number; + pageSize: number; } } diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 7410b17f37..ec49ff6009 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -230,14 +230,11 @@ export const environment: BuildConfig = { }, // Show the item access status label in items lists showAccessStatuses: false, - simpleView: { - bitstreamPageSize: 5 - }, - fullView: { - // Number of entries in the bitstream list in the full item view page. + bitstream: { + // Number of entries in the bitstream list in the item view page. // Rounded to the nearest size in the list of selectable sizes on the // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'. - bitstreamPageSize: 5 + pageSize: 5 } }, collection: {