diff --git a/src/app/profile-page/profile-page.component.html b/src/app/profile-page/profile-page.component.html
index e2769b38ec..29ccefa209 100644
--- a/src/app/profile-page/profile-page.component.html
+++ b/src/app/profile-page/profile-page.component.html
@@ -32,13 +32,29 @@
-
- 0">
-
{{'profile.groups.head' | translate}}
-
- - {{ dsoNameService.getName(group) }}
-
-
+
+
+
+
+
+ 0">
+
{{ 'profile.groups.head' | translate }}
+
+ - {{ dsoNameService.getName(group) }}
+
+
+
+
+
+
+
+
+
diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts
index 6e693461d2..f8cb30a447 100644
--- a/src/app/profile-page/profile-page.component.ts
+++ b/src/app/profile-page/profile-page.component.ts
@@ -9,7 +9,12 @@ import { RemoteData } from '../core/data/remote-data';
import { PaginatedList } from '../core/data/paginated-list.model';
import { filter, switchMap, tap } from 'rxjs/operators';
import { EPersonDataService } from '../core/eperson/eperson-data.service';
-import { getAllSucceededRemoteData, getFirstCompletedRemoteData, getRemoteDataPayload } from '../core/shared/operators';
+import {
+ getAllCompletedRemoteData,
+ getAllSucceededRemoteData,
+ getFirstCompletedRemoteData,
+ getRemoteDataPayload
+} from '../core/shared/operators';
import { hasValue, isNotEmpty } from '../shared/empty.util';
import { followLink } from '../shared/utils/follow-link-config.model';
import { AuthService } from '../core/auth/auth.service';
@@ -19,6 +24,8 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id';
import { ConfigurationDataService } from '../core/data/configuration-data.service';
import { ConfigurationProperty } from '../core/shared/configuration-property.model';
import { DSONameService } from '../core/breadcrumbs/dso-name.service';
+import { PaginationService } from '../core/pagination/pagination.service';
+import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
@Component({
selector: 'ds-profile-page',
@@ -79,6 +86,15 @@ export class ProfilePageComponent implements OnInit {
private currentUser: EPerson;
canChangePassword$: Observable;
+ /**
+ * Default configuration for group pagination
+ **/
+ optionsGroupsPagination = Object.assign(new PaginationComponentOptions(),{
+ id: 'page_groups',
+ currentPage: 1,
+ pageSize: 20,
+ });
+
isResearcherProfileEnabled$: BehaviorSubject = new BehaviorSubject(false);
constructor(private authService: AuthService,
@@ -88,6 +104,7 @@ export class ProfilePageComponent implements OnInit {
private authorizationService: AuthorizationDataService,
private configurationService: ConfigurationDataService,
public dsoNameService: DSONameService,
+ private paginationService: PaginationService,
) {
}
@@ -99,7 +116,18 @@ export class ProfilePageComponent implements OnInit {
getRemoteDataPayload(),
tap((user: EPerson) => this.currentUser = user)
);
- this.groupsRD$ = this.user$.pipe(switchMap((user: EPerson) => user.groups));
+ this.groupsRD$ = this.paginationService.getCurrentPagination(this.optionsGroupsPagination.id, this.optionsGroupsPagination).pipe(
+ switchMap((pageOptions: PaginationComponentOptions) => {
+ return this.epersonService.findById(this.currentUser.id, true, true, followLink('groups',{
+ findListOptions: {
+ elementsPerPage: pageOptions.pageSize,
+ currentPage: pageOptions.currentPage,
+ } }));
+ }),
+ getAllCompletedRemoteData(),
+ getRemoteDataPayload(),
+ switchMap((user: EPerson) => user?.groups),
+ );
this.canChangePassword$ = this.user$.pipe(switchMap((user: EPerson) => this.authorizationService.isAuthorized(FeatureID.CanChangePassword, user._links.self.href)));
this.specialGroupsRD$ = this.authService.getSpecialGroupsFromAuthStatus();
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index a56f1cd4f2..f53670c4e3 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -1622,6 +1622,8 @@
"error.recent-submissions": "Error fetching recent submissions",
+ "error.profile-groups": "Error retrieving profile groups",
+
"error.search-results": "Error fetching search results",
"error.invalid-search-query": "Search query is not valid. Please check Solr query syntax best practices for further information about this error.",