diff --git a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts index 682cc215e0..16e0eaf844 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts @@ -481,16 +481,16 @@ describe('VocabularyService', () => { }); }); - describe('findEntryDetailByValue', () => { + describe('findEntryDetailById', () => { it('should proxy the call to vocabularyDataService.findVocabularyById', () => { - scheduler.schedule(() => service.findEntryDetailByValue('testValue', hierarchicalVocabulary.id)); + scheduler.schedule(() => service.findEntryDetailById('testValue', hierarchicalVocabulary.id)); scheduler.flush(); const expectedId = `${hierarchicalVocabulary.id}:testValue` expect((service as any).vocabularyEntryDetailDataService.findById).toHaveBeenCalledWith(expectedId); }); it('should return a RemoteData for the object with the given id', () => { - const result = service.findEntryDetailByValue('testValue', hierarchicalVocabulary.id); + const result = service.findEntryDetailById('testValue', hierarchicalVocabulary.id); const expected = cold('a|', { a: vocabularyEntryDetailParentRD }); diff --git a/src/app/core/submission/vocabularies/vocabulary.service.ts b/src/app/core/submission/vocabularies/vocabulary.service.ts index 648f4744d3..5200d703b9 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.ts @@ -283,15 +283,15 @@ export class VocabularyService { /** * Returns an observable of {@link RemoteData} of a {@link VocabularyEntryDetail}, based on its ID, with a list of {@link FollowLinkConfig}, * to automatically resolve {@link HALLink}s of the object - * @param value The entry value for which to provide detailed information. + * @param id The entry id for which to provide detailed information. * @param name The name of {@link Vocabulary} to which the entry belongs * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved * @return {Observable>} * Return an observable that emits VocabularyEntryDetail object */ - findEntryDetailByValue(value: string, name: string, ...linksToFollow: Array>): Observable> { - const id = `${name}:${value}`; - return this.vocabularyEntryDetailDataService.findById(id, ...linksToFollow); + findEntryDetailById(id: string, name: string, ...linksToFollow: Array>): Observable> { + const findId = `${name}:${id}`; + return this.vocabularyEntryDetailDataService.findById(findId, ...linksToFollow); } /** diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts index 51cf69d560..5c2616dd34 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts @@ -233,7 +233,7 @@ export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent if (isObject(valueObj[fieldName]) && valueObj[fieldName].hasAuthority() && isNotEmpty(valueObj[fieldName].authority)) { const fieldId = fieldName.replace(/\./g, '_'); const model = this.formBuilderService.findById(fieldId, this.formModel); - return$ = this.vocabularyService.findEntryDetailByValue( + return$ = this.vocabularyService.findEntryDetailById( valueObj[fieldName].authority, (model as any).vocabularyOptions.name ).pipe( diff --git a/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.spec.ts b/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.spec.ts index 944ca0bfb0..f45478f82b 100644 --- a/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.spec.ts +++ b/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.spec.ts @@ -57,7 +57,7 @@ describe('VocabularyTreeviewService test suite', () => { const vocabularyServiceStub = jasmine.createSpyObj('VocabularyService', { getVocabularyEntriesByValue: jasmine.createSpy('getVocabularyEntriesByValue'), getEntryDetailParent: jasmine.createSpy('getEntryDetailParent'), - findEntryDetailByValue: jasmine.createSpy('findEntryDetailByValue'), + findEntryDetailById: jasmine.createSpy('findEntryDetailById'), searchTopEntries: jasmine.createSpy('searchTopEntries'), getEntryDetailChildren: jasmine.createSpy('getEntryDetailChildren'), clearSearchTopRequests: jasmine.createSpy('clearSearchTopRequests') @@ -202,7 +202,7 @@ describe('VocabularyTreeviewService test suite', () => { serviceAsAny.vocabularyService.searchTopEntries.and.returnValue(hot('-c', { a: createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, [item, item2, item3])) })); - serviceAsAny.vocabularyService.findEntryDetailByValue.and.returnValue( + serviceAsAny.vocabularyService.findEntryDetailById.and.returnValue( hot('-a', { a: createSuccessfulRemoteDataObject(child2) }) @@ -303,7 +303,7 @@ describe('VocabularyTreeviewService test suite', () => { a: createSuccessfulRemoteDataObject(new PaginatedList(pageInfo, [childEntry3])) })); - serviceAsAny.vocabularyService.findEntryDetailByValue.and.returnValue(hot('-a', { + serviceAsAny.vocabularyService.findEntryDetailById.and.returnValue(hot('-a', { a: createSuccessfulRemoteDataObject(child3) })); diff --git a/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.ts b/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.ts index 698f5bb0d2..dd58a6aede 100644 --- a/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.ts +++ b/src/app/shared/vocabulary-treeview/vocabulary-treeview.service.ts @@ -188,7 +188,7 @@ export class VocabularyTreeviewService { getFirstSucceededRemoteListPayload(), flatMap((result: VocabularyEntry[]) => (result.length > 0) ? result : observableOf(null)), flatMap((entry: VocabularyEntry) => - this.vocabularyService.findEntryDetailByValue(entry.otherInformation.id, this.vocabularyName).pipe( + this.vocabularyService.findEntryDetailById(entry.otherInformation.id, this.vocabularyName).pipe( getFirstSucceededRemoteDataPayload() ) ), @@ -289,7 +289,7 @@ export class VocabularyTreeviewService { * @return Observable */ private getById(entryId: string): Observable { - return this.vocabularyService.findEntryDetailByValue(entryId, this.vocabularyName).pipe( + return this.vocabularyService.findEntryDetailById(entryId, this.vocabularyName).pipe( getFirstSucceededRemoteDataPayload() ); }