mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Make no. of communities per pagination / expansion configurable
Adds new config settings for no. of communities to display on the home page & community-list page. Resolves #1749, resolves #1750
This commit is contained in:
@@ -175,6 +175,10 @@ browseBy:
|
||||
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
|
||||
defaultLowerLimit: 1900
|
||||
|
||||
browseCommunities:
|
||||
communityListPageSize: 20
|
||||
topLevelPageSize: 5
|
||||
|
||||
# Item Config
|
||||
item:
|
||||
edit:
|
||||
|
@@ -23,6 +23,7 @@ import { followLink } from '../shared/utils/follow-link-config.model';
|
||||
import { FlatNode } from './flat-node.model';
|
||||
import { ShowMoreFlatNode } from './show-more-flat-node.model';
|
||||
import { FindListOptions } from '../core/data/find-list-options.model';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
// Helper method to combine an flatten an array of observables of flatNode arrays
|
||||
export const combineAndFlatten = (obsList: Observable<FlatNode[]>[]): Observable<FlatNode[]> =>
|
||||
@@ -80,7 +81,7 @@ const communityListStateSelector = (state: AppState) => state.communityList;
|
||||
const expandedNodesSelector = createSelector(communityListStateSelector, (communityList: CommunityListState) => communityList.expandedNodes);
|
||||
const loadingNodeSelector = createSelector(communityListStateSelector, (communityList: CommunityListState) => communityList.loadingNode);
|
||||
|
||||
export const MAX_COMCOLS_PER_PAGE = 20;
|
||||
export const MAX_COMCOLS_PER_PAGE = environment.browseCommunities.communityListPageSize;
|
||||
|
||||
/**
|
||||
* Service class for the community list, responsible for the creating of the flat list used by communityList dataSource
|
||||
|
@@ -12,6 +12,7 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
/**
|
||||
* this component renders the Top-Level Community list
|
||||
@@ -54,7 +55,7 @@ export class TopLevelCommunityListComponent implements OnInit, OnDestroy {
|
||||
private paginationService: PaginationService) {
|
||||
this.config = new PaginationComponentOptions();
|
||||
this.config.id = this.pageId;
|
||||
this.config.pageSize = 5;
|
||||
this.config.pageSize = environment.browseCommunities.topLevelPageSize;
|
||||
this.config.currentPage = 1;
|
||||
this.sortConfig = new SortOptions('dc.title', SortDirection.ASC);
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ interface AppConfig extends Config {
|
||||
defaultLanguage: string;
|
||||
languages: LangConfig[];
|
||||
browseBy: BrowseByConfig;
|
||||
browseCommunities: BrowseCommunitiesConfig;
|
||||
item: ItemConfig;
|
||||
collection: CollectionPageConfig;
|
||||
themes: ThemeConfig[];
|
||||
|
12
src/config/browse-communities-config.interface.ts
Normal file
12
src/config/browse-communities-config.interface.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Config } from './config.interface';
|
||||
|
||||
export interface BrowseCommunitiesConfig extends Config {
|
||||
/**
|
||||
* Number of entries in the expandable community list (per show more).
|
||||
*/
|
||||
communityListPageSize: number;
|
||||
/**
|
||||
* Number of entries in the paginated (home page) top level community list.
|
||||
*/
|
||||
topLevelPageSize: number;
|
||||
}
|
@@ -210,6 +210,11 @@ export class DefaultAppConfig implements AppConfig {
|
||||
defaultLowerLimit: 1900
|
||||
};
|
||||
|
||||
browseCommunities: BrowseCommunitiesConfig = {
|
||||
communityListPageSize: 20,
|
||||
topLevelPageSize: 5
|
||||
}
|
||||
|
||||
// Item Config
|
||||
item: ItemConfig = {
|
||||
edit: {
|
||||
|
@@ -204,6 +204,10 @@ export const environment: BuildConfig = {
|
||||
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
|
||||
defaultLowerLimit: 1900,
|
||||
},
|
||||
browseCommunities: {
|
||||
communityListPageSize: 20,
|
||||
topLevelPageSize: 5
|
||||
},
|
||||
item: {
|
||||
edit: {
|
||||
undoTimeout: 10000 // 10 seconds
|
||||
|
Reference in New Issue
Block a user