In order to fix the performance issues described in the above tickets, we need a way to search across all Groups and all EPersons which are not yet a member of a specific Group in the system.
Therefore, this PR suggests two new REST API endpoints:
GET /api/eperson/groups/search/isNotMemberOf?group=<:uuid>&query=<:string>
Will search across all Groups which are not yet a member of the Group specified by group=<:uuid>.
This is the same as searching all Groups which are NOT listed under the /api/eperson/groups/<:uuid>/subgroups endpoint for that Group specified by group=<:uuid>
GET /api/eperson/epersons/search/isNotMemberOf?group=<:uuid>&query=<:string>
Will search across all EPersons which are not yet a member of the Group specified by group=<:uuid>.
This is the same as searching all EPersons which are NOT listed under the /api/eperson/groups/<:uuid>/epersons endpoint for that Group specified by group=<:uuid>
Additional Details on Performance Issue
These new endpoints are required to fix the behavior issues in the Angular UI code. Currently, our Angular UI includes code which requests every EPerson in a Group or every Subgroup in a Group in order to determine whether a given EPerson or Group is already included in a given parent Group.
(Replaces #237)
Required by https://github.com/DSpace/DSpace/issues/9052 and https://github.com/DSpace/dspace-angular/issues/2512
Description
In order to fix the performance issues described in the above tickets, we need a way to search across all Groups and all EPersons which are not yet a member of a specific Group in the system.
Therefore, this PR suggests two new REST API endpoints:
GET /api/eperson/groups/search/isNotMemberOf?group=<:uuid>&query=<:string>
group=<:uuid>
./api/eperson/groups/<:uuid>/subgroups
endpoint for that Group specified bygroup=<:uuid>
GET /api/eperson/epersons/search/isNotMemberOf?group=<:uuid>&query=<:string>
group=<:uuid>
./api/eperson/groups/<:uuid>/epersons
endpoint for that Group specified bygroup=<:uuid>
Additional Details on Performance Issue
These new endpoints are required to fix the behavior issues in the Angular UI code. Currently, our Angular UI includes code which requests every EPerson in a Group or every Subgroup in a Group in order to determine whether a given EPerson or Group is already included in a given parent Group.
For example:
isMemberOfGroup
inmembers-list.component.ts
: https://github.com/DSpace/dspace-angular/blob/main/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts#L216C1-L233C3isSubgroupOfGroup
insubgroups-list.component.ts
: https://github.com/DSpace/dspace-angular/blob/main/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts#L138-L159This UI behavior will cause performance issues when a Group has a large number of members (either EPerson or Subgroup).
This performance issue will be fixed by now creating performance-friendly endpoints to find non-members.