diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts index f72405ce13..9a7950f77d 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts @@ -12,6 +12,7 @@ import { SortDirection, SortOptions } from '../../core/cache/models/sort-options import { CollectionDataService } from '../../core/data/collection-data.service'; import { PaginationService } from '../../core/pagination/pagination.service'; import { switchMap } from 'rxjs/operators'; +import { hasValue } from '../../shared/empty.util'; @Component({ selector: 'ds-community-page-sub-collection-list', @@ -23,7 +24,7 @@ export class CommunityPageSubCollectionListComponent implements OnInit, OnDestro @Input() community: Community; /** - * Optional page size (defaults to 5) + * Optional page size. Overrides communityList.pageSize configuration for this component. */ @Input() pageSize: number; @@ -55,7 +56,9 @@ export class CommunityPageSubCollectionListComponent implements OnInit, OnDestro ngOnInit(): void { this.config = new PaginationComponentOptions(); this.config.id = this.pageId; - this.pageSize ? this.config.pageSize = this.pageSize : this.config.pageSize = 5; + if(hasValue(this.pageSize)) { + this.config.pageSize = this.pageSize + } this.config.currentPage = 1; this.sortConfig = new SortOptions('dc.title', SortDirection.ASC); this.initPage(); diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts index 5ba89490b9..aeb5efab6a 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts @@ -12,6 +12,7 @@ import { CommunityDataService } from '../../core/data/community-data.service'; import { takeUntilCompletedRemoteData } from '../../core/shared/operators'; import { switchMap } from 'rxjs/operators'; import { PaginationService } from '../../core/pagination/pagination.service'; +import { hasValue } from '../../shared/empty.util'; @Component({ selector: 'ds-community-page-sub-community-list', @@ -26,7 +27,7 @@ export class CommunityPageSubCommunityListComponent implements OnInit, OnDestroy @Input() community: Community; /** - * Optional page size (defaults to 5). + * Optional page size. Overrides communityList.pageSize configuration for this component. */ @Input() pageSize: number; @@ -58,7 +59,9 @@ export class CommunityPageSubCommunityListComponent implements OnInit, OnDestroy ngOnInit(): void { this.config = new PaginationComponentOptions(); this.config.id = this.pageId; - this.pageSize ? this.config.pageSize = this.pageSize : this.config.pageSize = 5; + if(hasValue(this.pageSize)) { + this.config.pageSize = this.pageSize + } this.config.currentPage = 1; this.sortConfig = new SortOptions('dc.title', SortDirection.ASC); this.initPage();