diff --git a/src/app/+admin/admin-access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/+admin/admin-access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index 65b0f6a6d0..f266ace392 100644 --- a/src/app/+admin/admin-access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/+admin/admin-access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -62,7 +62,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { ngOnInit() { this.subs.push(this.groupDataService.getActiveGroup().subscribe((group: Group) => { if (group != null) { - this.groups = this.groupDataService.findAllByHref(group._links.groups.href, { + this.groups = this.groupDataService.findAllByHref(group._links.subgroups.href, { currentPage: 1, elementsPerPage: this.config.pageSize }) @@ -100,7 +100,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { return this.groupDataService.getActiveGroup().pipe(take(1), mergeMap((group: Group) => { if (group != null) { - return this.groupDataService.findAllByHref(group._links.groups.href, { + return this.groupDataService.findAllByHref(group._links.subgroups.href, { currentPage: 0, elementsPerPage: Number.MAX_SAFE_INTEGER }) @@ -157,7 +157,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { this.groups = this.groupDataService.searchGroups(query.trim(), { currentPage: 1, elementsPerPage: this.config.pageSize - }, followLink('epersons')); + }); } /** @@ -166,7 +166,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { */ public forceUpdateGroups(activeGroup: Group) { this.groupDataService.clearGroupsRequests(); - this.groups = this.groupDataService.findAllByHref(activeGroup._links.groups.href, { + this.groups = this.groupDataService.findAllByHref(activeGroup._links.subgroups.href, { currentPage: 1, elementsPerPage: this.config.pageSize }) diff --git a/src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts b/src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts index ef86a914e1..660591478d 100644 --- a/src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts +++ b/src/app/+admin/admin-access-control/group-registry/groups-registry.component.ts @@ -75,7 +75,7 @@ export class GroupsRegistryComponent implements OnInit { * Update the list of groups by fetching it from the rest api or cache */ private updateGroups(options) { - this.groups = this.groupService.getGroups(options, followLink('epersons'), followLink('groups')); + this.groups = this.groupService.getGroups(options, followLink('epersons'), followLink('subgroups')); } /** @@ -87,7 +87,7 @@ export class GroupsRegistryComponent implements OnInit { this.groups = this.groupService.searchGroups(query.trim(), { currentPage: 1, elementsPerPage: this.config.pageSize - }, followLink('epersons')); + }); } /** @@ -130,7 +130,7 @@ export class GroupsRegistryComponent implements OnInit { * @param group */ getSubgroups(group: Group): Observable>> { - return this.groupService.findAllByHref(group._links.groups.href); + return this.groupService.findAllByHref(group._links.subgroups.href); } /** diff --git a/src/app/core/eperson/group-data.service.ts b/src/app/core/eperson/group-data.service.ts index b36f4887ae..be8006f392 100644 --- a/src/app/core/eperson/group-data.service.ts +++ b/src/app/core/eperson/group-data.service.ts @@ -124,7 +124,7 @@ export class GroupDataService extends DataService { * @param id The group id to delete */ public deleteGroup(group: Group): Observable { - return this.delete(group); + return this.delete(group.id); } /** diff --git a/src/app/core/eperson/models/group.model.ts b/src/app/core/eperson/models/group.model.ts index dcdfefb0b0..e496babddc 100644 --- a/src/app/core/eperson/models/group.model.ts +++ b/src/app/core/eperson/models/group.model.ts @@ -39,7 +39,7 @@ export class Group extends DSpaceObject { @deserialize _links: { self: HALLink; - groups: HALLink; + subgroups: HALLink; epersons: HALLink; }; @@ -48,7 +48,7 @@ export class Group extends DSpaceObject { * Will be undefined unless the groups {@link HALLink} has been resolved. */ @link(GROUP, true) - public groups?: Observable>>; + public subgroups?: Observable>>; /** * The list of EPeople in this group diff --git a/src/app/submission/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index f8f096d4bd..0bdb1a58f5 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -2,7 +2,6 @@ import { ChangeDetectorRef, Component, Inject } from '@angular/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, Subscription} from 'rxjs'; import { distinctUntilChanged, filter, find, flatMap, map, reduce, take, tap } from 'rxjs/operators'; -import { followLink } from '../../../shared/utils/follow-link-config.model'; import { SectionModelComponent } from '../models/section.model'; import { hasValue, isNotEmpty, isNotUndefined, isUndefined } from '../../../shared/empty.util'; @@ -23,7 +22,6 @@ import { Group } from '../../../core/eperson/models/group.model'; import { SectionsService } from '../sections.service'; import { SubmissionService } from '../../submission.service'; import { Collection } from '../../../core/shared/collection.model'; -import { ResourcePolicy } from '../../../core/shared/resource-policy.model'; import { AccessConditionOption } from '../../../core/config/models/config-access-condition-option.model'; import { PaginatedList } from '../../../core/data/paginated-list'; @@ -205,7 +203,7 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent { mapGroups$.push( this.groupService.findById(accessCondition.selectGroupUUID).pipe( find((rd: RemoteData) => !rd.isResponsePending && rd.hasSucceeded), - flatMap((group: RemoteData) => group.payload.groups), + flatMap((group: RemoteData) => group.payload.subgroups), find((rd: RemoteData>) => !rd.isResponsePending && rd.hasSucceeded), map((rd: RemoteData>) => ({ accessCondition: accessCondition.name,