Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into more-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ybnd committed Jan 12, 2024
2 parents 5af4f89 + c55d518 commit 6ff2170
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ <h3>{{messagePrefix + '.headMembers' | translate}}</h3>
<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 @@ <h3 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 @@ -62,6 +62,8 @@ import { PaginationServiceStub } from '../../../../shared/testing/pagination-ser
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
import { MembersListComponent } from './members-list.component';

// todo: optimize imports

describe('MembersListComponent', () => {
let component: MembersListComponent;
let fixture: ComponentFixture<MembersListComponent>;
Expand Down Expand Up @@ -99,9 +101,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 @@ -33,6 +33,9 @@ import {
} from '../../../../core/shared/operators';
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
import { getEPersonEditRoute } from '../../../access-control-routing-paths';

// todo: optimize imports

/**
* Keys to keep track of specific subscriptions
Expand Down Expand Up @@ -141,6 +144,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
14 changes: 3 additions & 11 deletions src/app/core/eperson/eperson-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import {
take,
} from 'rxjs/operators';

import {
getEPersonEditRoute,
getEPersonsRoute,
} from '../../access-control/access-control-routing-paths';
import { getEPersonEditRoute } from '../../access-control/access-control-routing-paths';
import {
EPeopleRegistryCancelEPersonAction,
EPeopleRegistryEditEPersonAction,
Expand Down Expand Up @@ -72,6 +69,8 @@ import { PageInfo } from '../shared/page-info.model';
import { EPerson } from './models/eperson.model';
import { EPERSON } from './models/eperson.resource-type';

// todo: optimize imports

const ePeopleRegistryStateSelector = (state: AppState) => state.epeopleRegistry;
const editEPersonSelector = createSelector(ePeopleRegistryStateSelector, (ePeopleRegistryState: EPeopleRegistryState) => ePeopleRegistryState.editEPerson);

Expand Down Expand Up @@ -349,13 +348,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 @@ -62,6 +62,8 @@ import { PaginationServiceStub } from '../../../../shared/testing/pagination-ser
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
import { ReviewersListComponent } from './reviewers-list.component';

// todo: optimize imports

// NOTE: Because ReviewersListComponent extends MembersListComponent, the below tests ONLY validate
// features which are *unique* to ReviewersListComponent. All other features are tested in the
// members-list.component.spec.ts file.
Expand Down Expand Up @@ -102,9 +104,6 @@ describe('ReviewersListComponent', () => {
clearLinkRequests() {
// empty
},
getEPeoplePageRouterLink(): string {
return '/access-control/epeople';
},
};
groupsDataServiceStub = {
activeGroup: activeGroup,
Expand Down

0 comments on commit 6ff2170

Please sign in to comment.