diff --git a/src/app/core/orcid/model/orcid-history.model.ts b/src/app/core/orcid/model/orcid-history.model.ts index fd7f73b9fa..ef8f30e0a3 100644 --- a/src/app/core/orcid/model/orcid-history.model.ts +++ b/src/app/core/orcid/model/orcid-history.model.ts @@ -34,10 +34,10 @@ export class OrcidHistory extends CacheableObject { entityName: string; /** - * The identifier of the owner of this Orcid History record. + * The identifier of the profileItem of this Orcid History record. */ @autoserialize - ownerId: string; + profileItemId: string; /** * The identifier of the entity related to this Orcid History record. diff --git a/src/app/core/orcid/model/orcid-queue.model.ts b/src/app/core/orcid/model/orcid-queue.model.ts index f967772208..2a1c3f1d82 100644 --- a/src/app/core/orcid/model/orcid-queue.model.ts +++ b/src/app/core/orcid/model/orcid-queue.model.ts @@ -34,10 +34,10 @@ export class OrcidQueue extends CacheableObject { description: string; /** - * The identifier of the owner of this Orcid Queue record. + * The identifier of the profileItem of this Orcid Queue record. */ @autoserialize - ownerId: string; + profileItemId: string; /** * The identifier of the entity related to this Orcid Queue record. diff --git a/src/app/core/orcid/orcid-queue.service.ts b/src/app/core/orcid/orcid-queue.service.ts index 6af8b8a4c7..30b9580b96 100644 --- a/src/app/core/orcid/orcid-queue.service.ts +++ b/src/app/core/orcid/orcid-queue.service.ts @@ -73,7 +73,7 @@ export class OrcidQueueService { } /** - * @param itemId It represent an Id of owner + * @param itemId It represent an Id of profileItem * @param paginationOptions The pagination options object * @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's * no valid cached version. Defaults to true @@ -81,9 +81,9 @@ export class OrcidQueueService { * requested after the response becomes stale * @returns { OrcidQueue } */ - searchByOwnerId(itemId: string, paginationOptions: PaginationComponentOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable>> { - return this.dataService.searchBy('findByOwner', { - searchParams: [new RequestParam('ownerId', itemId)], + searchByProfileItemId(itemId: string, paginationOptions: PaginationComponentOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable>> { + return this.dataService.searchBy('findByProfileItem', { + searchParams: [new RequestParam('profileItemId', itemId)], elementsPerPage: paginationOptions.pageSize, currentPage: paginationOptions.currentPage }, @@ -103,8 +103,8 @@ export class OrcidQueueService { /** * This method will set linkPath to stale */ - clearFindByOwnerRequests() { - this.requestService.setStaleByHrefSubstring(this.dataService.linkPath + '/search/findByOwner'); + clearFindByProfileItemRequests() { + this.requestService.setStaleByHrefSubstring(this.dataService.linkPath + '/search/findByProfileItem'); } } diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts index c39e48b8fe..9107ac34ff 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts @@ -25,7 +25,7 @@ describe('OrcidQueueComponent test suite', () => { let orcidQueueService: OrcidQueueService; let orcidAuthService: jasmine.SpyObj; - const testOwnerId = 'test-owner-id'; + const testProfileItemId = 'test-owner-id'; const mockItemLinkedToOrcid: Item = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(createPaginatedList([])), @@ -88,7 +88,7 @@ describe('OrcidQueueComponent test suite', () => { function orcidQueueElement(id: number) { return Object.assign(new OrcidQueue(), { 'id': id, - 'ownerId': testOwnerId, + 'profileItemId': testProfileItemId, 'entityId': `test-entity-${id}`, 'description': `test description ${id}`, 'recordType': 'Publication', @@ -99,8 +99,8 @@ describe('OrcidQueueComponent test suite', () => { const orcidQueueElements = [orcidQueueElement(1), orcidQueueElement(2)]; - const orcidQueueServiceSpy = jasmine.createSpyObj('orcidQueueService', ['searchByOwnerId', 'clearFindByOwnerRequests']); - orcidQueueServiceSpy.searchByOwnerId.and.returnValue(createSuccessfulRemoteDataObject$>(createPaginatedList(orcidQueueElements))); + const orcidQueueServiceSpy = jasmine.createSpyObj('orcidQueueService', ['searchByProfileItemId', 'clearFindByProfileItemRequests']); + orcidQueueServiceSpy.searchByProfileItemId.and.returnValue(createSuccessfulRemoteDataObject$>(createPaginatedList(orcidQueueElements))); beforeEach(waitForAsync(() => { orcidAuthService = jasmine.createSpyObj('OrcidAuthService', { diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts index c068465829..486ff670d5 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts @@ -89,12 +89,12 @@ export class OrcidQueueComponent implements OnInit, OnDestroy { debounceTime(100), distinctUntilChanged(), tap(() => this.processing$.next(true)), - switchMap((config: PaginationComponentOptions) => this.orcidQueueService.searchByOwnerId(this.item.id, config, false)), + switchMap((config: PaginationComponentOptions) => this.orcidQueueService.searchByProfileItemId(this.item.id, config, false)), getFirstCompletedRemoteData() ).subscribe((result: RemoteData>) => { this.processing$.next(false); this.list$.next(result); - this.orcidQueueService.clearFindByOwnerRequests(); + this.orcidQueueService.clearFindByProfileItemRequests(); }) ); } diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 71657d7a9c..5603ea27e8 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -4650,23 +4650,25 @@ "person.page.orcid.sync-queue.send.validation-error.title.required": "The title is required", - "person.page.orcid.sync-queue.send.validation-error.type.required": "The type is required", + "person.page.orcid.sync-queue.send.validation-error.type.required": "The dc.type is required", "person.page.orcid.sync-queue.send.validation-error.start-date.required": "The start date is required", "person.page.orcid.sync-queue.send.validation-error.funder.required": "The funder is required", - "person.page.orcid.sync-queue.send.validation-error.country.invalid": "Invalid ISO 3611 country", + "person.page.orcid.sync-queue.send.validation-error.country.invalid": "Invalid 2 digits ISO 3166 country", "person.page.orcid.sync-queue.send.validation-error.organization.required": "The organization is required", "person.page.orcid.sync-queue.send.validation-error.organization.name-required": "The organization's name is required", + "person.page.orcid.sync-queue.send.validation-error.publication.date-invalid" : "The publication date must be one year after 1900", + "person.page.orcid.sync-queue.send.validation-error.organization.address-required": "The organization to be sent requires an address", "person.page.orcid.sync-queue.send.validation-error.organization.city-required": "The address of the organization to be sent requires a city", - "person.page.orcid.sync-queue.send.validation-error.organization.country-required": "The address of the organization to be sent requires a valid ISO 3611 country", + "person.page.orcid.sync-queue.send.validation-error.organization.country-required": "The address of the organization to be sent requires a valid 2 digits ISO 3166 country", "person.page.orcid.sync-queue.send.validation-error.disambiguated-organization.required": "An identifier to disambiguate organizations is required. Supported ids are GRID, Ringgold, Legal Entity identifiers (LEIs) and Crossref Funder Registry identifiers",