diff --git a/config/config.example.yml b/config/config.example.yml
index 69a9ffd320f..89af133d100 100644
--- a/config/config.example.yml
+++ b/config/config.example.yml
@@ -290,6 +290,18 @@ collection:
edit:
undoTimeout: 10000 # 10 seconds
+accesscontrol:
+ epeople:
+ # Number of entries in the epeople list in the access controll page.
+ # Rounded to the nearest size in the list of selectable sizes on the
+ # settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+ groups:
+ # Number of entries in the group list in the access controll page.
+ # Rounded to the nearest size in the list of selectable sizes on the
+ # settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+
# Theme Config
themes:
# Add additional themes here. In the case where multiple themes match a route, the first one
diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.html b/src/app/access-control/epeople-registry/epeople-registry.component.html
index 4979f858193..1b8b9921f06 100644
--- a/src/app/access-control/epeople-registry/epeople-registry.component.html
+++ b/src/app/access-control/epeople-registry/epeople-registry.component.html
@@ -41,14 +41,14 @@
{{labelPrefix + 'search.head' | trans
-
- 0 && !(searching$ | async)"
- [paginationOptions]="config"
- [pageInfoState]="pageInfoState$"
- [collectionSize]="(pageInfoState$ | async)?.totalElements"
- [hideGear]="true"
- [hidePagerWhenSinglePage]="true">
+
+ 0 && !(searching$ | async)"
+ [paginationOptions]="paginationConfig"
+ [pageInfoState]="pageInfoState$"
+ [collectionSize]="(pageInfoState$ | async)?.totalElements"
+ [hideGear]="true"
+ [hidePagerWhenSinglePage]="true">
diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts
index e2cee5e9356..4cbc74753ed 100644
--- a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts
+++ b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts
@@ -27,6 +27,8 @@ import { RequestService } from '../../core/data/request.service';
import { PaginationService } from '../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
import { FindListOptions } from '../../core/data/find-list-options.model';
+import { APP_CONFIG } from 'src/config/app-config.interface';
+import { environment } from 'src/environments/environment';
describe('EPeopleRegistryComponent', () => {
let component: EPeopleRegistryComponent;
@@ -139,7 +141,8 @@ describe('EPeopleRegistryComponent', () => {
{ provide: FormBuilderService, useValue: builderService },
{ provide: Router, useValue: new RouterStub() },
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
- { provide: PaginationService, useValue: paginationService }
+ { provide: PaginationService, useValue: paginationService },
+ { provide: APP_CONFIG, useValue: environment }
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts
index 4596eec98e3..4d1d03ee833 100644
--- a/src/app/access-control/epeople-registry/epeople-registry.component.ts
+++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, OnDestroy, OnInit, Inject } from '@angular/core';
import { UntypedFormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -22,6 +22,7 @@ import { PageInfo } from '../../core/shared/page-info.model';
import { NoContent } from '../../core/shared/NoContent.model';
import { PaginationService } from '../../core/pagination/pagination.service';
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
+import { AppConfig, APP_CONFIG } from 'src/config/app-config.interface';
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
@Component({
@@ -59,11 +60,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
/**
* Pagination config used to display the list of epeople
*/
- config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
- id: 'elp',
- pageSize: 5,
- currentPage: 1
- });
+ paginationConfig: PaginationComponentOptions;
// The search form
searchForm;
@@ -92,13 +89,18 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
private paginationService: PaginationService,
public requestService: RequestService,
public dsoNameService: DSONameService,
- ) {
+ @Inject(APP_CONFIG) protected appConfig: AppConfig) {
this.currentSearchQuery = '';
this.currentSearchScope = 'metadata';
this.searchForm = this.formBuilder.group(({
scope: 'metadata',
query: '',
}));
+ this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
+ id: 'elp',
+ pageSize: this.appConfig.accesscontrol.epeople.pageSize,
+ currentPage: 1
+ });
}
ngOnInit() {
@@ -145,7 +147,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
if (hasValue(this.findListOptionsSub)) {
this.findListOptionsSub.unsubscribe();
}
- this.findListOptionsSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
+ this.findListOptionsSub = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe(
switchMap((findListOptions) => {
const query: string = data.query;
const scope: string = data.scope;
@@ -154,14 +156,14 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
queryParamsHandling: 'merge'
});
this.currentSearchQuery = query;
- this.paginationService.resetPage(this.config.id);
+ this.paginationService.resetPage(this.paginationConfig.id);
}
if (scope != null && this.currentSearchScope !== scope) {
void this.router.navigate([getEPersonsRoute()], {
queryParamsHandling: 'merge'
});
this.currentSearchScope = scope;
- this.paginationService.resetPage(this.config.id);
+ this.paginationService.resetPage(this.paginationConfig.id);
}
return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
@@ -229,7 +231,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
*/
ngOnDestroy(): void {
this.cleanupSubscribes();
- this.paginationService.clearPagination(this.config.id);
+ this.paginationService.clearPagination(this.paginationConfig.id);
}
diff --git a/src/app/access-control/group-registry/groups-registry.component.html b/src/app/access-control/group-registry/groups-registry.component.html
index 27cec262c44..e1bc59d7476 100644
--- a/src/app/access-control/group-registry/groups-registry.component.html
+++ b/src/app/access-control/group-registry/groups-registry.component.html
@@ -36,7 +36,7 @@ {{messagePrefix + 'search.head' | tra
0 && !(loading$ | async)"
- [paginationOptions]="config"
+ [paginationOptions]="paginationConfig"
[pageInfoState]="pageInfoState$"
[collectionSize]="(pageInfoState$ | async)?.totalElements"
[hideGear]="true"
diff --git a/src/app/access-control/group-registry/groups-registry.component.spec.ts b/src/app/access-control/group-registry/groups-registry.component.spec.ts
index 635ba727c26..2381b2853f4 100644
--- a/src/app/access-control/group-registry/groups-registry.component.spec.ts
+++ b/src/app/access-control/group-registry/groups-registry.component.spec.ts
@@ -34,6 +34,8 @@ import { FeatureID } from '../../core/data/feature-authorization/feature-id';
import { NoContent } from '../../core/shared/NoContent.model';
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
import { DSONameServiceMock, UNDEFINED_NAME } from '../../shared/mocks/dso-name.service.mock';
+import { environment } from 'src/environments/environment';
+import { APP_CONFIG } from 'src/config/app-config.interface';
describe('GroupsRegistryComponent', () => {
let component: GroupsRegistryComponent;
@@ -182,7 +184,8 @@ describe('GroupsRegistryComponent', () => {
{ provide: Router, useValue: new RouterMock() },
{ provide: AuthorizationDataService, useValue: authorizationService },
{ provide: PaginationService, useValue: paginationService },
- { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }
+ { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
+ { provide: APP_CONFIG, useValue: environment }
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts
index 06a048ad72d..2ffc1f6caf4 100644
--- a/src/app/access-control/group-registry/groups-registry.component.ts
+++ b/src/app/access-control/group-registry/groups-registry.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { UntypedFormBuilder } from '@angular/forms';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -38,6 +38,7 @@ import { NoContent } from '../../core/shared/NoContent.model';
import { PaginationService } from '../../core/pagination/pagination.service';
import { followLink } from '../../shared/utils/follow-link-config.model';
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
+import { APP_CONFIG, AppConfig } from 'src/config/app-config.interface';
@Component({
selector: 'ds-groups-registry',
@@ -54,11 +55,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
/**
* Pagination config used to display the list of groups
*/
- config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
- id: 'gl',
- pageSize: 5,
- currentPage: 1
- });
+ paginationConfig: PaginationComponentOptions;
/**
* A BehaviorSubject with the list of GroupDtoModel objects made from the Groups in the repository or
@@ -107,11 +104,16 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
private paginationService: PaginationService,
public requestService: RequestService,
public dsoNameService: DSONameService,
- ) {
+ @Inject(APP_CONFIG) protected appConfig: AppConfig) {
this.currentSearchQuery = '';
this.searchForm = this.formBuilder.group(({
query: this.currentSearchQuery,
}));
+ this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
+ id: 'elp',
+ pageSize: this.appConfig.accesscontrol.groups.pageSize,
+ currentPage: 1
+ });
}
ngOnInit() {
@@ -127,13 +129,13 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
this.searchSub.unsubscribe();
this.subs = this.subs.filter((sub: Subscription) => sub !== this.searchSub);
}
- this.searchSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
+ this.searchSub = this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe(
tap(() => this.loading$.next(true)),
switchMap((paginationOptions) => {
const query: string = data.query;
if (query != null && this.currentSearchQuery !== query) {
this.currentSearchQuery = query;
- this.paginationService.updateRouteWithUrl(this.config.id, [], {page: 1});
+ this.paginationService.updateRouteWithUrl(this.paginationConfig.id, [], {page: 1});
}
return this.groupService.searchGroups(this.currentSearchQuery.trim(), {
currentPage: paginationOptions.currentPage,
@@ -267,7 +269,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
*/
ngOnDestroy(): void {
this.cleanupSubscribes();
- this.paginationService.clearPagination(this.config.id);
+ this.paginationService.clearPagination(this.paginationConfig.id);
}
@@ -276,7 +278,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
this.paginationSub.unsubscribe();
}
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
- this.paginationService.clearPagination(this.config.id);
+ this.paginationService.clearPagination(this.paginationConfig.id);
}
}
diff --git a/src/config/access-control-config.interface.ts b/src/config/access-control-config.interface.ts
new file mode 100644
index 00000000000..6028fb80133
--- /dev/null
+++ b/src/config/access-control-config.interface.ts
@@ -0,0 +1,26 @@
+import { Config } from './config.interface';
+
+/**
+ * Config that determines the access control screen
+ */
+export interface AccessControlConfig extends Config {
+
+ epeople: {
+ /**
+ * Number of entries in the epeople list in the access controll page.
+ * Rounded to the nearest size in the list of selectable sizes on the settings
+ * menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ */
+ pageSize: number;
+ };
+
+ groups: {
+ /**
+ * Number of entries in the group list in the access controll page.
+ * Rounded to the nearest size in the list of selectable sizes on the settings
+ * menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ */
+ pageSize: number;
+ }
+
+}
diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts
index 69aeab7cbf8..a05518fd0a0 100644
--- a/src/config/app-config.interface.ts
+++ b/src/config/app-config.interface.ts
@@ -20,6 +20,7 @@ import { InfoConfig } from './info-config.interface';
import { CommunityListConfig } from './community-list-config.interface';
import { HomeConfig } from './homepage-config.interface';
import { MarkdownConfig } from './markdown-config.interface';
+import { AccessControlConfig } from './access-control-config.interface';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { DiscoverySortConfig } from './discovery-sort.config';
@@ -40,6 +41,7 @@ interface AppConfig extends Config {
homePage: HomeConfig;
item: ItemConfig;
collection: CollectionPageConfig;
+ accesscontrol: AccessControlConfig;
themes: ThemeConfig[];
mediaViewer: MediaViewerConfig;
bundle: BundleConfig;
diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts
index 5eced97ee20..7f89efd5c9b 100644
--- a/src/config/default-app-config.ts
+++ b/src/config/default-app-config.ts
@@ -20,6 +20,7 @@ import { InfoConfig } from './info-config.interface';
import { CommunityListConfig } from './community-list-config.interface';
import { HomeConfig } from './homepage-config.interface';
import { MarkdownConfig } from './markdown-config.interface';
+import { AccessControlConfig } from './access-control-config.interface';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { DiscoverySortConfig } from './discovery-sort.config';
@@ -296,6 +297,21 @@ export class DefaultAppConfig implements AppConfig {
}
};
+ accesscontrol: AccessControlConfig = {
+ epeople: {
+ // Number of entries in the epeople list in the access controll page.
+ // Rounded to the nearest size in the list of selectable sizes on the
+ // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+ },
+ groups: {
+ // Number of entries in the groups list in the access controll page.
+ // Rounded to the nearest size in the list of selectable sizes on the
+ // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+ }
+ };
+
// Theme Config
themes: ThemeConfig[] = [
// Add additional themes here. In the case where multiple themes match a route, the first one
diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts
index cb9d2c71303..55e69f8ed38 100644
--- a/src/environments/environment.test.ts
+++ b/src/environments/environment.test.ts
@@ -262,6 +262,20 @@ export const environment: BuildConfig = {
undoTimeout: 10000 // 10 seconds
}
},
+ accesscontrol: {
+ epeople: {
+ // Number of entries in the epeople list in the access controll page.
+ // Rounded to the nearest size in the list of selectable sizes on the
+ // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+ },
+ groups: {
+ // Number of entries in the group list in the access controll page.
+ // Rounded to the nearest size in the list of selectable sizes on the
+ // settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
+ pageSize: 5
+ }
+ },
themes: [
{
name: 'full-item-page-theme',