From 05b131edb92a90d3c141fca5339a6c40ed901da6 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Wed, 24 Aug 2022 17:05:08 +0200 Subject: [PATCH] 93803: Rename findAllByHref to findListByHref To avoid confusion with FindAllData: - findAll is a "feature" to retrieve all resources from the endpoint itself ~ a plain GET - findAllByHref is retrieves lists of resources in general --- .../eperson-form.component.spec.ts | 2 +- .../eperson-form/eperson-form.component.ts | 6 ++-- .../members-list.component.spec.ts | 2 +- .../members-list/members-list.component.ts | 4 +-- .../subgroups-list.component.spec.ts | 2 +- .../subgroup-list/subgroups-list.component.ts | 4 +-- .../groups-registry.component.spec.ts | 4 +-- .../groups-registry.component.ts | 4 +-- .../collection-item-mapper.component.spec.ts | 4 +-- .../collection-item-mapper.component.ts | 2 +- ...page-sub-collection-list.component.spec.ts | 2 +- ...-page-sub-community-list.component.spec.ts | 2 +- src/app/core/browse/browse.service.spec.ts | 16 ++++----- src/app/core/browse/browse.service.ts | 14 ++++---- .../core/cache/builders/link.service.spec.ts | 10 +++--- src/app/core/cache/builders/link.service.ts | 2 +- .../core/data/base/base-data.service.spec.ts | 34 +++++++++---------- src/app/core/data/base/base-data.service.ts | 4 +-- src/app/core/data/base/find-all-data.ts | 2 +- .../data/base/hal-data-service.interface.ts | 2 +- src/app/core/data/base/search-data.ts | 2 +- src/app/core/data/bitstream-data.service.ts | 2 +- src/app/core/data/bundle-data.service.spec.ts | 6 ++-- src/app/core/data/bundle-data.service.ts | 2 +- src/app/core/data/collection-data.service.ts | 2 +- src/app/core/data/comcol-data.service.ts | 2 +- src/app/core/data/community-data.service.ts | 2 +- src/app/core/data/entity-type.service.ts | 2 +- src/app/core/data/external-source.service.ts | 2 +- .../core/data/href-only-data.service.spec.ts | 20 +++++------ src/app/core/data/href-only-data.service.ts | 8 ++--- .../data/processes/process-data.service.ts | 2 +- src/app/core/data/relationship.service.ts | 2 +- .../data/version-history-data.service.spec.ts | 10 +++--- .../core/data/version-history-data.service.ts | 2 +- .../core/metadata/metadata.service.spec.ts | 4 +-- src/app/core/metadata/metadata.service.ts | 2 +- .../resource-policy.service.ts | 2 +- .../vocabularies/vocabulary.service.spec.ts | 4 +-- .../vocabularies/vocabulary.service.ts | 2 +- ...top-level-community-list.component.spec.ts | 2 +- .../item-collection-mapper.component.spec.ts | 2 +- .../item-collection-mapper.component.ts | 2 +- .../edit-relationship-list.component.spec.ts | 2 +- .../browse-by/browse-by.component.spec.ts | 2 +- .../mocks/href-only-data.service.mock.ts | 4 +-- .../collection-select.component.spec.ts | 2 +- .../item-select/item-select.component.spec.ts | 2 +- src/app/shared/rss-feed/rss.component.spec.ts | 2 +- 49 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts index 4957958658..a96c238f93 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts @@ -177,7 +177,7 @@ describe('EPersonFormComponent', () => { }); groupsDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '' }); diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index 05fc3189d0..7d607647e3 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -265,7 +265,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { this.formGroup = this.formBuilderService.createFormGroup(this.formModel); this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => { if (eperson != null) { - this.groups = this.groupsDataService.findAllByHref(eperson._links.groups.href, { + this.groups = this.groupsDataService.findListByHref(eperson._links.groups.href, { currentPage: 1, elementsPerPage: this.config.pageSize }); @@ -297,7 +297,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { }), switchMap(([eperson, findListOptions]) => { if (eperson != null) { - return this.groupsDataService.findAllByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object')); + return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object')); } return observableOf(undefined); }) @@ -554,7 +554,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy { */ private updateGroups(options) { this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => { - this.groups = this.groupsDataService.findAllByHref(eperson._links.groups.href, options); + this.groups = this.groupsDataService.findListByHref(eperson._links.groups.href, options); })); } } diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts index 0b19b17100..8d0ddf0a85 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts @@ -53,7 +53,7 @@ describe('MembersListComponent', () => { activeGroup: activeGroup, epersonMembers: epersonMembers, subgroupMembers: subgroupMembers, - findAllByHref(href: string): Observable>> { + findListByHref(href: string): Observable>> { return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), groupsDataServiceStub.getEPersonMembers())); }, searchByScope(scope: string, query: string): Observable>> { diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index 54d144da51..eb6a38b5cf 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -129,7 +129,7 @@ export class MembersListComponent implements OnInit, OnDestroy { this.subs.set(SubKey.MembersDTO, this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( switchMap((currentPagination) => { - return this.ePersonDataService.findAllByHref(this.groupBeingEdited._links.epersons.href, { + return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, { currentPage: currentPagination.currentPage, elementsPerPage: currentPagination.pageSize } @@ -171,7 +171,7 @@ export class MembersListComponent implements OnInit, OnDestroy { return this.groupDataService.getActiveGroup().pipe(take(1), mergeMap((group: Group) => { if (group != null) { - return this.ePersonDataService.findAllByHref(group._links.epersons.href, { + return this.ePersonDataService.findListByHref(group._links.epersons.href, { currentPage: 1, elementsPerPage: 9999 }, false) diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts index bee5126e09..1ca6c88c5f 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts @@ -65,7 +65,7 @@ describe('SubgroupsListComponent', () => { getSubgroups(): Group { return this.activeGroup; }, - findAllByHref(href: string): Observable>> { + findListByHref(href: string): Observable>> { return this.subgroups$.pipe( map((currentGroups: Group[]) => { return createSuccessfulRemoteDataObject(buildPaginatedList(new PageInfo(), currentGroups)); diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index 9930dd61ea..5f1700e07d 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -115,7 +115,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { this.subs.set( SubKey.Members, this.paginationService.getCurrentPagination(this.config.id, this.config).pipe( - switchMap((config) => this.groupDataService.findAllByHref(this.groupBeingEdited._links.subgroups.href, { + switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, { currentPage: config.currentPage, elementsPerPage: config.pageSize }, @@ -139,7 +139,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy { if (activeGroup.uuid === possibleSubgroup.uuid) { return observableOf(false); } else { - return this.groupDataService.findAllByHref(activeGroup._links.subgroups.href, { + return this.groupDataService.findListByHref(activeGroup._links.subgroups.href, { currentPage: 1, elementsPerPage: 9999 }) diff --git a/src/app/access-control/group-registry/groups-registry.component.spec.ts b/src/app/access-control/group-registry/groups-registry.component.spec.ts index 99586ee5f0..239939e70d 100644 --- a/src/app/access-control/group-registry/groups-registry.component.spec.ts +++ b/src/app/access-control/group-registry/groups-registry.component.spec.ts @@ -69,7 +69,7 @@ describe('GroupRegistryComponent', () => { mockGroups = [GroupMock, GroupMock2]; mockEPeople = [EPersonMock, EPersonMock2]; ePersonDataServiceStub = { - findAllByHref(href: string): Observable>> { + findListByHref(href: string): Observable>> { switch (href) { case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid2/epersons': return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ @@ -97,7 +97,7 @@ describe('GroupRegistryComponent', () => { }; groupsDataServiceStub = { allGroups: mockGroups, - findAllByHref(href: string): Observable>> { + findListByHref(href: string): Observable>> { switch (href) { case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid2/groups': return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({ diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts index 1770762a34..6ba501fcc4 100644 --- a/src/app/access-control/group-registry/groups-registry.component.ts +++ b/src/app/access-control/group-registry/groups-registry.component.ts @@ -213,7 +213,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { * @param group */ getMembers(group: Group): Observable>> { - return this.ePersonDataService.findAllByHref(group._links.epersons.href).pipe(getFirstSucceededRemoteData()); + return this.ePersonDataService.findListByHref(group._links.epersons.href).pipe(getFirstSucceededRemoteData()); } /** @@ -221,7 +221,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy { * @param group */ getSubgroups(group: Group): Observable>> { - return this.groupService.findAllByHref(group._links.subgroups.href).pipe(getFirstSucceededRemoteData()); + return this.groupService.findListByHref(group._links.subgroups.href).pipe(getFirstSucceededRemoteData()); } /** diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index 142604c9b2..8304b01daa 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -94,7 +94,7 @@ describe('CollectionItemMapperComponent', () => { const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([])); const itemDataServiceStub = { mapToCollection: () => createSuccessfulRemoteDataObject$({}), - findAllByHref: () => observableOf(emptyList) + findListByHref: () => observableOf(emptyList), }; const activatedRouteStub = { parent: { @@ -152,7 +152,7 @@ describe('CollectionItemMapperComponent', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index 3172616efc..7911be8e64 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -143,7 +143,7 @@ export class CollectionItemMapperComponent implements OnInit { if (shouldUpdate === true) { this.shouldUpdate$.next(false); } - return this.itemDataService.findAllByHref(collectionRD.payload._links.mappedItems.href, Object.assign(options, { + return this.itemDataService.findListByHref(collectionRD.payload._links.mappedItems.href, Object.assign(options, { sort: this.defaultSortOptions }),!shouldUpdate, false, followLink('owningCollection')).pipe( getAllSucceededRemoteData() diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts index c0ce5369ff..60b1c78f8c 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -135,7 +135,7 @@ describe('CommunityPageSubCollectionList Component', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts index 3392ada994..c3db1bd17d 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -131,7 +131,7 @@ describe('CommunityPageSubCommunityListComponent Component', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/core/browse/browse.service.spec.ts b/src/app/core/browse/browse.service.spec.ts index db802dcbdd..46ac8c44f4 100644 --- a/src/app/core/browse/browse.service.spec.ts +++ b/src/app/core/browse/browse.service.spec.ts @@ -139,13 +139,13 @@ describe('BrowseService', () => { }); describe('when getBrowseEntriesFor is called with a valid browse definition id', () => { - it('should call hrefOnlyDataService.findAllByHref with the expected href', () => { + it('should call hrefOnlyDataService.findListByHref with the expected href', () => { const expected = browseDefinitions[1]._links.entries.href; scheduler.schedule(() => service.getBrowseEntriesFor(new BrowseEntrySearchOptions(browseDefinitions[1].id)).subscribe()); scheduler.flush(); - expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findAllByHref)).toBeObservable(cold('(a|)', { + expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { a: expected })); }); @@ -153,20 +153,20 @@ describe('BrowseService', () => { }); describe('when findList is called with a valid browse definition id', () => { - it('should call hrefOnlyDataService.findAllByHref with the expected href', () => { + it('should call hrefOnlyDataService.findListByHref with the expected href', () => { const expected = browseDefinitions[1]._links.items.href + '?filterValue=' + encodeURIComponent(mockAuthorName); scheduler.schedule(() => service.getBrowseItemsFor(mockAuthorName, undefined, new BrowseEntrySearchOptions(browseDefinitions[1].id)).subscribe()); scheduler.flush(); - expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findAllByHref)).toBeObservable(cold('(a|)', { + expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { a: expected })); }); }); describe('when getBrowseItemsFor is called with a valid filter value and authority key', () => { - it('should call hrefOnlyDataService.findAllByHref with the expected href', () => { + it('should call hrefOnlyDataService.findListByHref with the expected href', () => { const expected = browseDefinitions[1]._links.items.href + '?filterValue=' + encodeURIComponent(mockAuthorName) + '&filterAuthority=' + encodeURIComponent(mockAuthorityKey); @@ -174,7 +174,7 @@ describe('BrowseService', () => { scheduler.schedule(() => service.getBrowseItemsFor(mockAuthorName, mockAuthorityKey, new BrowseEntrySearchOptions(browseDefinitions[1].id)).subscribe()); scheduler.flush(); - expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findAllByHref)).toBeObservable(cold('(a|)', { + expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { a: expected })); }); @@ -267,11 +267,11 @@ describe('BrowseService', () => { describe('when getFirstItemFor is called with a valid browse definition id', () => { const expectedURL = browseDefinitions[1]._links.items.href + '?page=0&size=1'; - it('should call hrefOnlyDataService.findAllByHref with the expected href', () => { + it('should call hrefOnlyDataService.findListByHref with the expected href', () => { scheduler.schedule(() => service.getFirstItemFor(browseDefinitions[1].id).subscribe()); scheduler.flush(); - expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findAllByHref)).toBeObservable(cold('(a|)', { + expect(getFirstUsedArgumentOfSpyMethod(hrefOnlyDataService.findListByHref)).toBeObservable(cold('(a|)', { a: expectedURL })); }); diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index 05e625d6c1..8fd11ad048 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -96,7 +96,7 @@ export class BrowseService { return href; }) ); - return this.hrefOnlyDataService.findAllByHref(href$); + return this.hrefOnlyDataService.findListByHref(href$); } /** @@ -141,7 +141,7 @@ export class BrowseService { return href; }), ); - return this.hrefOnlyDataService.findAllByHref(href$); + return this.hrefOnlyDataService.findListByHref(href$); } /** @@ -172,7 +172,7 @@ export class BrowseService { }) ); - return this.hrefOnlyDataService.findAllByHref(href$).pipe( + return this.hrefOnlyDataService.findListByHref(href$).pipe( getFirstSucceededRemoteData(), getFirstOccurrence() ); @@ -184,7 +184,7 @@ export class BrowseService { * @param items */ getPrevBrowseItems(items: RemoteData>): Observable>> { - return this.hrefOnlyDataService.findAllByHref(items.payload.prev); + return this.hrefOnlyDataService.findListByHref(items.payload.prev); } /** @@ -192,7 +192,7 @@ export class BrowseService { * @param items */ getNextBrowseItems(items: RemoteData>): Observable>> { - return this.hrefOnlyDataService.findAllByHref(items.payload.next); + return this.hrefOnlyDataService.findListByHref(items.payload.next); } /** @@ -200,7 +200,7 @@ export class BrowseService { * @param entries */ getPrevBrowseEntries(entries: RemoteData>): Observable>> { - return this.hrefOnlyDataService.findAllByHref(entries.payload.prev); + return this.hrefOnlyDataService.findListByHref(entries.payload.prev); } /** @@ -208,7 +208,7 @@ export class BrowseService { * @param entries */ getNextBrowseEntries(entries: RemoteData>): Observable>> { - return this.hrefOnlyDataService.findAllByHref(entries.payload.next); + return this.hrefOnlyDataService.findListByHref(entries.payload.next); } /** diff --git a/src/app/core/cache/builders/link.service.spec.ts b/src/app/core/cache/builders/link.service.spec.ts index ee44cfccb4..0ddfe05870 100644 --- a/src/app/core/cache/builders/link.service.spec.ts +++ b/src/app/core/cache/builders/link.service.spec.ts @@ -33,8 +33,8 @@ class TestModel implements HALResource { @Injectable() class TestDataService { - findAllByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { - return 'findAllByHref'; + findListByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { + return 'findListByHref'; } findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { @@ -65,7 +65,7 @@ describe('LinkService', () => { } }); testDataService = new TestDataService(); - spyOn(testDataService, 'findAllByHref').and.callThrough(); + spyOn(testDataService, 'findListByHref').and.callThrough(); spyOn(testDataService, 'findByHref').and.callThrough(); TestBed.configureTestingModule({ providers: [LinkService, { @@ -119,8 +119,8 @@ describe('LinkService', () => { }); service.resolveLink(testModel, followLink('predecessor', { findListOptions: { some: 'options ' } as any }, followLink('successor'))); }); - it('should call dataservice.findAllByHref with the correct href, findListOptions, and nested links', () => { - expect(testDataService.findAllByHref).toHaveBeenCalledWith(testModel._links.predecessor.href, { some: 'options ' } as any, true, true, followLink('successor')); + it('should call dataservice.findListByHref with the correct href, findListOptions, and nested links', () => { + expect(testDataService.findListByHref).toHaveBeenCalledWith(testModel._links.predecessor.href, { some: 'options ' } as any, true, true, followLink('successor')); }); }); describe('either way', () => { diff --git a/src/app/core/cache/builders/link.service.ts b/src/app/core/cache/builders/link.service.ts index a02f9841ad..b7af54abf7 100644 --- a/src/app/core/cache/builders/link.service.ts +++ b/src/app/core/cache/builders/link.service.ts @@ -74,7 +74,7 @@ export class LinkService { try { if (matchingLinkDef.isList) { - return service.findAllByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); + return service.findListByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); } else { return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); } diff --git a/src/app/core/data/base/base-data.service.spec.ts b/src/app/core/data/base/base-data.service.spec.ts index 973b9d5095..cd8b8c3e32 100644 --- a/src/app/core/data/base/base-data.service.spec.ts +++ b/src/app/core/data/base/base-data.service.spec.ts @@ -370,7 +370,7 @@ describe('BaseDataService', () => { }); - describe(`findAllByHref`, () => { + describe(`findListByHref`, () => { let findListOptions; beforeEach(() => { findListOptions = { currentPage: 5 }; @@ -383,7 +383,7 @@ describe('BaseDataService', () => { spyOn(rdbService, 'buildList').and.returnValue(cold('a', { a: remoteDataMocks.Success })); spyOn(service as any, 'reRequestStaleRemoteData').and.returnValue(() => cold('a', { a: remoteDataMocks.Success })); - service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow); + service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow); expect(service.buildHrefFromFindOptions).toHaveBeenCalledWith(selfLink, findListOptions, [], ...linksToFollow); }); }); @@ -394,11 +394,11 @@ describe('BaseDataService', () => { spyOn(rdbService, 'buildList').and.returnValue(cold('a', { a: remoteDataMocks.Success })); spyOn(service as any, 'reRequestStaleRemoteData').and.returnValue(() => cold('a', { a: remoteDataMocks.Success })); - service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow); + service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow); expect((service as any).createAndSendGetRequest).toHaveBeenCalledWith(jasmine.anything(), true); expectObservable(rdbService.buildList.calls.argsFor(0)[0]).toBe('(a|)', { a: 'bingo!' }); - service.findAllByHref(selfLink, findListOptions, false, true, ...linksToFollow); + service.findListByHref(selfLink, findListOptions, false, true, ...linksToFollow); expect((service as any).createAndSendGetRequest).toHaveBeenCalledWith(jasmine.anything(), false); expectObservable(rdbService.buildList.calls.argsFor(1)[0]).toBe('(a|)', { a: 'bingo!' }); }); @@ -410,29 +410,29 @@ describe('BaseDataService', () => { spyOn(rdbService, 'buildList').and.returnValue(cold('a', { a: remoteDataMocks.Success })); spyOn(service as any, 'reRequestStaleRemoteData').and.returnValue(() => cold('a', { a: remoteDataMocks.Success })); - service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow); + service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow); expect(rdbService.buildList).toHaveBeenCalledWith(jasmine.anything() as any, ...linksToFollow); expectObservable(rdbService.buildList.calls.argsFor(0)[0]).toBe('(a|)', { a: 'bingo!' }); }); }); - it(`should call reRequestStaleRemoteData with reRequestOnStale and the exact same findAllByHref call as a callback`, () => { + it(`should call reRequestStaleRemoteData with reRequestOnStale and the exact same findListByHref call as a callback`, () => { testScheduler.run(({ cold, expectObservable }) => { spyOn(service, 'buildHrefFromFindOptions').and.returnValue('bingo!'); spyOn(rdbService, 'buildList').and.returnValue(cold('a', { a: remoteDataMocks.SuccessStale })); spyOn(service as any, 'reRequestStaleRemoteData').and.returnValue(() => cold('a', { a: remoteDataMocks.SuccessStale })); - service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow); + service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow); expect((service as any).reRequestStaleRemoteData.calls.argsFor(0)[0]).toBeTrue(); - spyOn(service, 'findAllByHref').and.returnValue(cold('a', { a: remoteDataMocks.SuccessStale })); + spyOn(service, 'findListByHref').and.returnValue(cold('a', { a: remoteDataMocks.SuccessStale })); // prove that the spy we just added hasn't been called yet - expect(service.findAllByHref).not.toHaveBeenCalled(); + expect(service.findListByHref).not.toHaveBeenCalled(); // call the callback passed to reRequestStaleRemoteData (service as any).reRequestStaleRemoteData.calls.argsFor(0)[1](); - // verify that findAllByHref _has_ been called now, with the same params as the original call - expect(service.findAllByHref).toHaveBeenCalledWith(jasmine.anything(), findListOptions, true, true, ...linksToFollow); + // verify that findListByHref _has_ been called now, with the same params as the original call + expect(service.findListByHref).toHaveBeenCalledWith(jasmine.anything(), findListOptions, true, true, ...linksToFollow); // ... except for selflink, which will have been turned in to an observable. - expectObservable((service.findAllByHref as jasmine.Spy).calls.argsFor(0)[0]).toBe('(a|)', { a: selfLink }); + expectObservable((service.findListByHref as jasmine.Spy).calls.argsFor(0)[0]).toBe('(a|)', { a: selfLink }); }); }); @@ -446,7 +446,7 @@ describe('BaseDataService', () => { a: 'bingo!', }; - expectObservable(service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); + expectObservable(service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); }); }); @@ -474,7 +474,7 @@ describe('BaseDataService', () => { e: remoteDataMocks.SuccessStale, }; - expectObservable(service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); + expectObservable(service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); }); }); @@ -495,7 +495,7 @@ describe('BaseDataService', () => { e: remoteDataMocks.SuccessStale, }; - expectObservable(service.findAllByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); + expectObservable(service.findListByHref(selfLink, findListOptions, true, true, ...linksToFollow)).toBe(expected, values); }); }); @@ -525,7 +525,7 @@ describe('BaseDataService', () => { e: remoteDataMocks.SuccessStale, }; - expectObservable(service.findAllByHref(selfLink, findListOptions, false, true, ...linksToFollow)).toBe(expected, values); + expectObservable(service.findListByHref(selfLink, findListOptions, false, true, ...linksToFollow)).toBe(expected, values); }); }); @@ -546,7 +546,7 @@ describe('BaseDataService', () => { e: remoteDataMocks.SuccessStale, }; - expectObservable(service.findAllByHref(selfLink, findListOptions, false, true, ...linksToFollow)).toBe(expected, values); + expectObservable(service.findListByHref(selfLink, findListOptions, false, true, ...linksToFollow)).toBe(expected, values); }); }); diff --git a/src/app/core/data/base/base-data.service.ts b/src/app/core/data/base/base-data.service.ts index faf8a4bead..d8caa6c1c8 100644 --- a/src/app/core/data/base/base-data.service.ts +++ b/src/app/core/data/base/base-data.service.ts @@ -287,7 +287,7 @@ export class BaseDataService implements HALDataServic * @param reRequestOnStale Whether or not the request should automatically be re-requested after the response becomes stale * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ - findAllByHref(href$: string | Observable, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { + findListByHref(href$: string | Observable, options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { if (typeof href$ === 'string') { href$ = observableOf(href$); } @@ -307,7 +307,7 @@ export class BaseDataService implements HALDataServic // cached completed object skipWhile((rd: RemoteData>) => useCachedVersionIfAvailable ? rd.isStale : rd.hasCompleted), this.reRequestStaleRemoteData(reRequestOnStale, () => - this.findAllByHref(href$, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)), + this.findListByHref(href$, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)), ); } diff --git a/src/app/core/data/base/find-all-data.ts b/src/app/core/data/base/find-all-data.ts index f3666b75ee..c2330af243 100644 --- a/src/app/core/data/base/find-all-data.ts +++ b/src/app/core/data/base/find-all-data.ts @@ -85,7 +85,7 @@ export class FindAllDataImpl extends BaseDataService< * Return an observable that emits object list */ findAll(options: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { - return this.findAllByHref(this.getFindAllHref(options), options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.findListByHref(this.getFindAllHref(options), options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/data/base/hal-data-service.interface.ts b/src/app/core/data/base/hal-data-service.interface.ts index af39edd7cf..6959399760 100644 --- a/src/app/core/data/base/hal-data-service.interface.ts +++ b/src/app/core/data/base/hal-data-service.interface.ts @@ -37,5 +37,5 @@ export interface HALDataService { * @param reRequestOnStale Whether or not the request should automatically be re-requested after the response becomes stale * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ - findAllByHref(href$: string | Observable, findListOptions?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig[]): Observable>>; + findListByHref(href$: string | Observable, findListOptions?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig[]): Observable>>; } diff --git a/src/app/core/data/base/search-data.ts b/src/app/core/data/base/search-data.ts index 226db8fe0d..12cae77c3a 100644 --- a/src/app/core/data/base/search-data.ts +++ b/src/app/core/data/base/search-data.ts @@ -110,7 +110,7 @@ export class SearchDataImpl extends BaseDataService[]): Observable>> { const hrefObs = this.getSearchByHref(searchMethod, options, ...linksToFollow); - return this.findAllByHref(hrefObs, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.findListByHref(hrefObs, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index 6952f50214..0e0c939d9e 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -76,7 +76,7 @@ export class BitstreamDataService extends IdentifiableDataService imp * {@link HALLink}s should be automatically resolved */ findAllByBundle(bundle: Bundle, options?: FindListOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { - return this.findAllByHref(bundle._links.bitstreams.href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.findListByHref(bundle._links.bitstreams.href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/data/bundle-data.service.spec.ts b/src/app/core/data/bundle-data.service.spec.ts index 80bf7c281c..2f047a1054 100644 --- a/src/app/core/data/bundle-data.service.spec.ts +++ b/src/app/core/data/bundle-data.service.spec.ts @@ -73,12 +73,12 @@ describe('BundleDataService', () => { describe('findAllByItem', () => { beforeEach(() => { - spyOn(service, 'findAllByHref'); + spyOn(service, 'findListByHref'); service.findAllByItem(item); }); - it('should call findAllByHref with the item\'s bundles link', () => { - expect(service.findAllByHref).toHaveBeenCalledWith(bundleLink, undefined, true, true); + it('should call findListByHref with the item\'s bundles link', () => { + expect(service.findListByHref).toHaveBeenCalledWith(bundleLink, undefined, true, true); }); }); diff --git a/src/app/core/data/bundle-data.service.ts b/src/app/core/data/bundle-data.service.ts index 77df37c510..e85c0c2bee 100644 --- a/src/app/core/data/bundle-data.service.ts +++ b/src/app/core/data/bundle-data.service.ts @@ -61,7 +61,7 @@ export class BundleDataService extends IdentifiableDataService implement * {@link HALLink}s should be automatically resolved */ findAllByItem(item: Item, options?: FindListOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { - return this.findAllByHref(item._links.bundles.href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.findListByHref(item._links.bundles.href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/data/collection-data.service.ts b/src/app/core/data/collection-data.service.ts index 36791520a9..405b35c1f9 100644 --- a/src/app/core/data/collection-data.service.ts +++ b/src/app/core/data/collection-data.service.ts @@ -280,7 +280,7 @@ export class CollectionDataService extends ComColDataService { * @param findListOptions Pagination and search options. */ findMappedCollectionsFor(item: Item, findListOptions?: FindListOptions): Observable>> { - return this.findAllByHref(item._links.mappedCollections.href, findListOptions); + return this.findListByHref(item._links.mappedCollections.href, findListOptions); } diff --git a/src/app/core/data/comcol-data.service.ts b/src/app/core/data/comcol-data.service.ts index 1b1ac3b27b..6392f389b6 100644 --- a/src/app/core/data/comcol-data.service.ts +++ b/src/app/core/data/comcol-data.service.ts @@ -98,7 +98,7 @@ export abstract class ComColDataService extend const href$ = this.getFindByParentHref(parentUUID).pipe( map((href: string) => this.buildHrefFromFindOptions(href, options)) ); - return this.findAllByHref(href$, options, true, true, ...linksToFollow); + return this.findListByHref(href$, options, true, true, ...linksToFollow); } /** diff --git a/src/app/core/data/community-data.service.ts b/src/app/core/data/community-data.service.ts index e40ad06ddb..8623d414b2 100644 --- a/src/app/core/data/community-data.service.ts +++ b/src/app/core/data/community-data.service.ts @@ -42,7 +42,7 @@ export class CommunityDataService extends ComColDataService { findTop(options: FindListOptions = {}, ...linksToFollow: FollowLinkConfig[]): Observable>> { const hrefObs = this.getFindAllHref(options, this.topLinkPath); - return this.findAllByHref(hrefObs, undefined, true, true, ...linksToFollow); + return this.findListByHref(hrefObs, undefined, true, true, ...linksToFollow); } protected getFindByParentHref(parentUUID: string): Observable { diff --git a/src/app/core/data/entity-type.service.ts b/src/app/core/data/entity-type.service.ts index 0acb4adb03..393c0414d5 100644 --- a/src/app/core/data/entity-type.service.ts +++ b/src/app/core/data/entity-type.service.ts @@ -145,7 +145,7 @@ export class EntityTypeService extends BaseDataService implements Find */ getEntityTypeRelationships(entityTypeId: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { const href$ = this.getRelationshipTypesEndpoint(entityTypeId); - return this.relationshipTypeService.findAllByHref(href$, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.relationshipTypeService.findListByHref(href$, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/data/external-source.service.ts b/src/app/core/data/external-source.service.ts index 434b563191..e273bedb00 100644 --- a/src/app/core/data/external-source.service.ts +++ b/src/app/core/data/external-source.service.ts @@ -74,7 +74,7 @@ export class ExternalSourceService extends IdentifiableDataService { }); }); - describe(`findAllByHref`, () => { + describe(`findListByHref`, () => { beforeEach(() => { - spy = spyOn((service as any).dataService, 'findAllByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); + spy = spyOn((service as any).dataService, 'findListByHref').and.returnValue(createSuccessfulRemoteDataObject$(null)); }); - it(`should delegate to findAllByHref on the internal DataService`, () => { - service.findAllByHref(href, findListOptions, false, false, ...followLinks); + it(`should delegate to findListByHref on the internal DataService`, () => { + service.findListByHref(href, findListOptions, false, false, ...followLinks); expect(spy).toHaveBeenCalledWith(href, findListOptions, false, false, ...followLinks); }); describe(`when findListOptions is omitted`, () => { - it(`should call findAllByHref on the internal DataService with findListOptions = {}`, () => { - service.findAllByHref(href); + it(`should call findListByHref on the internal DataService with findListOptions = {}`, () => { + service.findListByHref(href); expect(spy).toHaveBeenCalledWith(jasmine.anything(), {}, jasmine.anything(), jasmine.anything()); }); }); describe(`when useCachedVersionIfAvailable is omitted`, () => { - it(`should call findAllByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { - service.findAllByHref(href); + it(`should call findListByHref on the internal DataService with useCachedVersionIfAvailable = true`, () => { + service.findListByHref(href); expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), true, jasmine.anything()); }); }); describe(`when reRequestOnStale is omitted`, () => { - it(`should call findAllByHref on the internal DataService with reRequestOnStale = true`, () => { - service.findAllByHref(href); + it(`should call findListByHref on the internal DataService with reRequestOnStale = true`, () => { + service.findListByHref(href); expect(spy).toHaveBeenCalledWith(jasmine.anything(), jasmine.anything(), jasmine.anything(), true); }); }); diff --git a/src/app/core/data/href-only-data.service.ts b/src/app/core/data/href-only-data.service.ts index b234d5d85a..0a765de101 100644 --- a/src/app/core/data/href-only-data.service.ts +++ b/src/app/core/data/href-only-data.service.ts @@ -27,8 +27,8 @@ import { dataService } from './base/data-service.decorator'; * Additionally, this service may be used to retrieve objects by `href` regardless of their type * For example * ``` - * const items$: Observable>> = hrefOnlyDataService.findAllByHref(href); - * const sites$: Observable>> = hrefOnlyDataService.findAllByHref(href); + * const items$: Observable>> = hrefOnlyDataService.findListByHref(href); + * const sites$: Observable>> = hrefOnlyDataService.findListByHref(href); * ``` * This means we cannot extend from {@link BaseDataService} directly because the method signatures would not match. */ @@ -82,7 +82,7 @@ export class HrefOnlyDataService implements HALDataService { * @param linksToFollow List of {@link FollowLinkConfig} that indicate which * {@link HALLink}s should be automatically resolved */ - findAllByHref(href: string | Observable, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { - return this.dataService.findAllByHref(href, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + findListByHref(href: string | Observable, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]): Observable>> { + return this.dataService.findListByHref(href, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } } diff --git a/src/app/core/data/processes/process-data.service.ts b/src/app/core/data/processes/process-data.service.ts index 0a276cd7f2..9c484fed2d 100644 --- a/src/app/core/data/processes/process-data.service.ts +++ b/src/app/core/data/processes/process-data.service.ts @@ -50,7 +50,7 @@ export class ProcessDataService extends IdentifiableDataService impleme */ getFiles(processId: string): Observable>> { const href$ = this.getFilesEndpoint(processId); - return this.bitstreamDataService.findAllByHref(href$); + return this.bitstreamDataService.findListByHref(href$); } /** diff --git a/src/app/core/data/relationship.service.ts b/src/app/core/data/relationship.service.ts index 50c84912f6..fe64a95e8a 100644 --- a/src/app/core/data/relationship.service.ts +++ b/src/app/core/data/relationship.service.ts @@ -196,7 +196,7 @@ export class RelationshipService extends IdentifiableDataService i * should be automatically resolved */ getItemRelationshipsArray(item: Item, ...linksToFollow: FollowLinkConfig[]): Observable { - return this.findAllByHref(item._links.relationships.href, undefined, true, false, ...linksToFollow).pipe( + return this.findListByHref(item._links.relationships.href, undefined, true, false, ...linksToFollow).pipe( getFirstSucceededRemoteData(), getRemoteDataPayload(), map((rels: PaginatedList) => rels.page), diff --git a/src/app/core/data/version-history-data.service.spec.ts b/src/app/core/data/version-history-data.service.spec.ts index 1991c5c193..03bf6c8bcb 100644 --- a/src/app/core/data/version-history-data.service.spec.ts +++ b/src/app/core/data/version-history-data.service.spec.ts @@ -106,7 +106,7 @@ describe('VersionHistoryDataService', () => { }); versionService = jasmine.createSpyObj('objectCache', { findByHref: jasmine.createSpy('findByHref'), - findAllByHref: jasmine.createSpy('findAllByHref'), + findListByHref: jasmine.createSpy('findListByHref'), getHistoryFromVersion: jasmine.createSpy('getHistoryFromVersion'), }); halService = new HALEndpointServiceStub(url); @@ -132,8 +132,8 @@ describe('VersionHistoryDataService', () => { result = service.getVersions('1'); }); - it('should call versionService.findAllByHref', () => { - expect(versionService.findAllByHref).toHaveBeenCalled(); + it('should call versionService.findListByHref', () => { + expect(versionService.findListByHref).toHaveBeenCalled(); }); }); @@ -141,8 +141,8 @@ describe('VersionHistoryDataService', () => { beforeEach(waitForAsync(() => { service.getVersions(versionHistoryId); })); - it('findAllByHref should have been called', () => { - expect(versionService.findAllByHref).toHaveBeenCalled(); + it('findListByHref should have been called', () => { + expect(versionService.findListByHref).toHaveBeenCalled(); }); }); diff --git a/src/app/core/data/version-history-data.service.ts b/src/app/core/data/version-history-data.service.ts index 75bc1a4b14..b331c4f2e4 100644 --- a/src/app/core/data/version-history-data.service.ts +++ b/src/app/core/data/version-history-data.service.ts @@ -77,7 +77,7 @@ export class VersionHistoryDataService extends IdentifiableDataService searchOptions ? searchOptions.toRestUrl(href) : href) ); - return this.versionDataService.findAllByHref(hrefObs, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); + return this.versionDataService.findListByHref(hrefObs, undefined, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow); } /** diff --git a/src/app/core/metadata/metadata.service.spec.ts b/src/app/core/metadata/metadata.service.spec.ts index 632816d90b..66d9b9921c 100644 --- a/src/app/core/metadata/metadata.service.spec.ts +++ b/src/app/core/metadata/metadata.service.spec.ts @@ -52,7 +52,7 @@ describe('MetadataService', () => { findRoot: createSuccessfulRemoteDataObject$({ dspaceVersion: 'mock-dspace-version' }) }); bitstreamDataService = jasmine.createSpyObj({ - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([MockBitstream3])) + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([MockBitstream3])), }); bundleDataService = jasmine.createSpyObj({ findByItemAndName: mockBundleRD$([MockBitstream3]) @@ -361,7 +361,7 @@ describe('MetadataService', () => { it('should link to first Bitstream with allowed format', fakeAsync(() => { const bitstreams = [MockBitstream3, MockBitstream3, MockBitstream1]; (bundleDataService.findByItemAndName as jasmine.Spy).and.returnValue(mockBundleRD$(bitstreams)); - (bitstreamDataService.findAllByHref as jasmine.Spy).and.returnValues( + (bitstreamDataService.findListByHref as jasmine.Spy).and.returnValues( ...mockBitstreamPages$(bitstreams).map(bp => createSuccessfulRemoteDataObject$(bp)), ); diff --git a/src/app/core/metadata/metadata.service.ts b/src/app/core/metadata/metadata.service.ts index 3a438edab0..9d5ee80bba 100644 --- a/src/app/core/metadata/metadata.service.ts +++ b/src/app/core/metadata/metadata.service.ts @@ -379,7 +379,7 @@ export class MetadataService { return EMPTY; } else { // Otherwise retrieve the next page - return this.bitstreamDataService.findAllByHref( + return this.bitstreamDataService.findListByHref( paginatedList.next, undefined, true, diff --git a/src/app/core/resource-policy/resource-policy.service.ts b/src/app/core/resource-policy/resource-policy.service.ts index ac5236dd4e..f432a3b24e 100644 --- a/src/app/core/resource-policy/resource-policy.service.ts +++ b/src/app/core/resource-policy/resource-policy.service.ts @@ -121,7 +121,7 @@ export class ResourcePolicyService extends IdentifiableDataService>> { - return this.findAllByHref(collection._links.defaultAccessConditions.href, findListOptions); + return this.findListByHref(collection._links.defaultAccessConditions.href, findListOptions); } /** diff --git a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts index 7255f029ec..ed379c812a 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts @@ -419,7 +419,7 @@ describe('VocabularyService', () => { spyOn((service as any).vocabularyEntryDetailDataService, 'findById').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'findAll').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'findByHref').and.callThrough(); - spyOn((service as any).vocabularyEntryDetailDataService, 'findAllByHref').and.callThrough(); + spyOn((service as any).vocabularyEntryDetailDataService, 'findListByHref').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'searchBy').and.callThrough(); spyOn((service as any).vocabularyEntryDetailDataService, 'getSearchByHref').and.returnValue(observableOf(searchRequestURL)); spyOn((service as any).vocabularyEntryDetailDataService, 'getFindAllHref').and.returnValue(observableOf(entryDetailChildrenRequestURL)); @@ -494,7 +494,7 @@ describe('VocabularyService', () => { scheduler.schedule(() => service.getEntryDetailChildren('testValue', hierarchicalVocabulary.id, pageInfo).subscribe()); scheduler.flush(); - expect((service as any).vocabularyEntryDetailDataService.findAllByHref).toHaveBeenCalledWith(entryDetailChildrenRequestURL, options, true, true); + expect((service as any).vocabularyEntryDetailDataService.findListByHref).toHaveBeenCalledWith(entryDetailChildrenRequestURL, options, true, true); }); it('should return a RemoteData> for the object with the given URL', () => { diff --git a/src/app/core/submission/vocabularies/vocabulary.service.ts b/src/app/core/submission/vocabularies/vocabulary.service.ts index deb26c5a2d..d29b19d97b 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.ts @@ -282,7 +282,7 @@ export class VocabularyService { pageInfo.currentPage ); return this.vocabularyEntryDetailDataService.getFindAllHref(options, linkPath).pipe( - mergeMap((href) => this.vocabularyEntryDetailDataService.findAllByHref(href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)) + mergeMap((href) => this.vocabularyEntryDetailDataService.findListByHref(href, options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)), ); } diff --git a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts index 2561770942..17feaa9bbf 100644 --- a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts +++ b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts @@ -126,7 +126,7 @@ describe('TopLevelCommunityList Component', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts index 56fe29d576..f9962643f8 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts @@ -89,7 +89,7 @@ describe('ItemCollectionMapperComponent', () => { /* eslint-enable no-empty,@typescript-eslint/no-empty-function */ }; const collectionDataServiceStub = { - findAllByHref: () => observableOf(mockCollectionsRD) + findListByHref: () => observableOf(mockCollectionsRD), }; const searchServiceStub = Object.assign(new SearchServiceStub(), { search: () => observableOf(mockCollectionsRD), diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts index f179ebc325..d94abfaa9f 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts @@ -123,7 +123,7 @@ export class ItemCollectionMapperComponent implements OnInit { if (shouldUpdate === true) { this.shouldUpdate$.next(false); } - return this.collectionDataService.findAllByHref( + return this.collectionDataService.findListByHref( this.itemDataService.getMappedCollectionsEndpoint(item.id), undefined, !shouldUpdate, diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts index 2403d8f443..de22b9eab0 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts @@ -187,7 +187,7 @@ describe('EditRelationshipListComponent', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/shared/browse-by/browse-by.component.spec.ts b/src/app/shared/browse-by/browse-by.component.spec.ts index 840c2bad1f..a102c7ae53 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -80,7 +80,7 @@ describe('BrowseByComponent', () => { const mockItemsRD$ = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockItems)); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/shared/mocks/href-only-data.service.mock.ts b/src/app/shared/mocks/href-only-data.service.mock.ts index 6b668c8187..ba7d02ec25 100644 --- a/src/app/shared/mocks/href-only-data.service.mock.ts +++ b/src/app/shared/mocks/href-only-data.service.mock.ts @@ -6,10 +6,10 @@ import { createPaginatedList } from '../testing/utils.test'; export function getMockHrefOnlyDataService( findByHref$: Observable> = createNoContentRemoteDataObject$(), - findAllByHref$: Observable>> = createSuccessfulRemoteDataObject$(createPaginatedList([])) + findListByHref$: Observable>> = createSuccessfulRemoteDataObject$(createPaginatedList([])), ) { return jasmine.createSpyObj('hrefOnlyDataService', { findByHref: findByHref$, - findAllByHref: findAllByHref$, + findListByHref: findListByHref$, }); } diff --git a/src/app/shared/object-select/collection-select/collection-select.component.spec.ts b/src/app/shared/object-select/collection-select/collection-select.component.spec.ts index 1b89fd32c1..0b1ae83ca7 100644 --- a/src/app/shared/object-select/collection-select/collection-select.component.spec.ts +++ b/src/app/shared/object-select/collection-select/collection-select.component.spec.ts @@ -55,7 +55,7 @@ describe('CollectionSelectComponent', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/shared/object-select/item-select/item-select.component.spec.ts b/src/app/shared/object-select/item-select/item-select.component.spec.ts index 49754c40dd..5131060cb2 100644 --- a/src/app/shared/object-select/item-select/item-select.component.spec.ts +++ b/src/app/shared/object-select/item-select/item-select.component.spec.ts @@ -81,7 +81,7 @@ describe('ItemSelectComponent', () => { }); const groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', }); diff --git a/src/app/shared/rss-feed/rss.component.spec.ts b/src/app/shared/rss-feed/rss.component.spec.ts index fc19c65e60..fd7f2c5321 100644 --- a/src/app/shared/rss-feed/rss.component.spec.ts +++ b/src/app/shared/rss-feed/rss.component.spec.ts @@ -66,7 +66,7 @@ describe('RssComponent', () => { sort: new SortOptions('dc.title', SortDirection.ASC), })); groupDataService = jasmine.createSpyObj('groupsDataService', { - findAllByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), + findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])), getGroupRegistryRouterLink: '', getUUIDFromString: '', });