Skip to content

Commit

Permalink
Fixed ePerson link on edit group page
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrevryghem committed Nov 23, 2023
1 parent 727df56 commit 430ee38
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ <h4>{{messagePrefix + '.headMembers' | translate}}</h4>
<tr *ngFor="let eperson of (ePeopleMembersOfGroup | async)?.page">
<td class="align-middle">{{eperson.id}}</td>
<td class="align-middle">
<a (click)="ePersonDataService.startEditingNewEPerson(eperson)"
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">
<a [routerLink]="getEPersonEditRoute(eperson.id)">
{{ dsoNameService.getName(eperson) }}
</a>
</td>
Expand Down Expand Up @@ -106,8 +105,7 @@ <h4 id="search" class="border-bottom pb-2">
<tr *ngFor="let eperson of (ePeopleSearch | async)?.page">
<td class="align-middle">{{eperson.id}}</td>
<td class="align-middle">
<a (click)="ePersonDataService.startEditingNewEPerson(eperson)"
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">
<a [routerLink]="getEPersonEditRoute(eperson.id)">
{{ dsoNameService.getName(eperson) }}
</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ describe('MembersListComponent', () => {
clearLinkRequests() {
// empty
},
getEPeoplePageRouterLink(): string {
return '/access-control/epeople';
}
};
groupsDataServiceStub = {
activeGroup: activeGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { NotificationsService } from '../../../../shared/notifications/notificat
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
import { PaginationService } from '../../../../core/pagination/pagination.service';
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
import { getEPersonEditRoute } from '../../../access-control-routing-paths';

/**
* Keys to keep track of specific subscriptions
Expand Down Expand Up @@ -131,6 +132,8 @@ export class MembersListComponent implements OnInit, OnDestroy {
// current active group being edited
groupBeingEdited: Group;

readonly getEPersonEditRoute = getEPersonEditRoute;

constructor(
protected groupDataService: GroupDataService,
public ePersonDataService: EPersonDataService,
Expand Down
9 changes: 1 addition & 8 deletions src/app/core/eperson/eperson-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { PatchData, PatchDataImpl } from '../data/base/patch-data';
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
import { RestRequestMethod } from '../data/rest-request-method';
import { dataService } from '../data/base/data-service.decorator';
import { getEPersonEditRoute, getEPersonsRoute } from '../../access-control/access-control-routing-paths';
import { getEPersonEditRoute } from '../../access-control/access-control-routing-paths';

const ePeopleRegistryStateSelector = (state: AppState) => state.epeopleRegistry;
const editEPersonSelector = createSelector(ePeopleRegistryStateSelector, (ePeopleRegistryState: EPeopleRegistryState) => ePeopleRegistryState.editEPerson);
Expand Down Expand Up @@ -313,13 +313,6 @@ export class EPersonDataService extends IdentifiableDataService<EPerson> impleme
return getEPersonEditRoute(ePerson.id);
}

/**
* Get EPeople admin page
*/
public getEPeoplePageRouterLink(): string {
return getEPersonsRoute();
}

/**
* Create a new EPerson using a token
* @param eperson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ describe('ReviewersListComponent', () => {
clearLinkRequests() {
// empty
},
getEPeoplePageRouterLink(): string {
return '/access-control/epeople';
}
};
groupsDataServiceStub = {
activeGroup: activeGroup,
Expand Down

0 comments on commit 430ee38

Please sign in to comment.