mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-5339] Various improvements
This commit is contained in:
@@ -34,10 +34,10 @@ export class OrcidHistory extends CacheableObject {
|
|||||||
entityName: string;
|
entityName: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of the owner of this Orcid History record.
|
* The identifier of the profileItem of this Orcid History record.
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
ownerId: string;
|
profileItemId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of the entity related to this Orcid History record.
|
* The identifier of the entity related to this Orcid History record.
|
||||||
|
@@ -34,10 +34,10 @@ export class OrcidQueue extends CacheableObject {
|
|||||||
description: string;
|
description: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of the owner of this Orcid Queue record.
|
* The identifier of the profileItem of this Orcid Queue record.
|
||||||
*/
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
ownerId: string;
|
profileItemId: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifier of the entity related to this Orcid Queue record.
|
* The identifier of the entity related to this Orcid Queue record.
|
||||||
|
@@ -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 paginationOptions The pagination options object
|
||||||
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
|
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
|
||||||
* no valid cached version. Defaults to true
|
* no valid cached version. Defaults to true
|
||||||
@@ -81,9 +81,9 @@ export class OrcidQueueService {
|
|||||||
* requested after the response becomes stale
|
* requested after the response becomes stale
|
||||||
* @returns { OrcidQueue }
|
* @returns { OrcidQueue }
|
||||||
*/
|
*/
|
||||||
searchByOwnerId(itemId: string, paginationOptions: PaginationComponentOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable<RemoteData<PaginatedList<OrcidQueue>>> {
|
searchByProfileItemId(itemId: string, paginationOptions: PaginationComponentOptions, useCachedVersionIfAvailable = true, reRequestOnStale = true): Observable<RemoteData<PaginatedList<OrcidQueue>>> {
|
||||||
return this.dataService.searchBy('findByOwner', {
|
return this.dataService.searchBy('findByProfileItem', {
|
||||||
searchParams: [new RequestParam('ownerId', itemId)],
|
searchParams: [new RequestParam('profileItemId', itemId)],
|
||||||
elementsPerPage: paginationOptions.pageSize,
|
elementsPerPage: paginationOptions.pageSize,
|
||||||
currentPage: paginationOptions.currentPage
|
currentPage: paginationOptions.currentPage
|
||||||
},
|
},
|
||||||
@@ -103,8 +103,8 @@ export class OrcidQueueService {
|
|||||||
/**
|
/**
|
||||||
* This method will set linkPath to stale
|
* This method will set linkPath to stale
|
||||||
*/
|
*/
|
||||||
clearFindByOwnerRequests() {
|
clearFindByProfileItemRequests() {
|
||||||
this.requestService.setStaleByHrefSubstring(this.dataService.linkPath + '/search/findByOwner');
|
this.requestService.setStaleByHrefSubstring(this.dataService.linkPath + '/search/findByProfileItem');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ describe('OrcidQueueComponent test suite', () => {
|
|||||||
let orcidQueueService: OrcidQueueService;
|
let orcidQueueService: OrcidQueueService;
|
||||||
let orcidAuthService: jasmine.SpyObj<OrcidAuthService>;
|
let orcidAuthService: jasmine.SpyObj<OrcidAuthService>;
|
||||||
|
|
||||||
const testOwnerId = 'test-owner-id';
|
const testProfileItemId = 'test-owner-id';
|
||||||
|
|
||||||
const mockItemLinkedToOrcid: Item = Object.assign(new Item(), {
|
const mockItemLinkedToOrcid: Item = Object.assign(new Item(), {
|
||||||
bundles: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
bundles: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
@@ -88,7 +88,7 @@ describe('OrcidQueueComponent test suite', () => {
|
|||||||
function orcidQueueElement(id: number) {
|
function orcidQueueElement(id: number) {
|
||||||
return Object.assign(new OrcidQueue(), {
|
return Object.assign(new OrcidQueue(), {
|
||||||
'id': id,
|
'id': id,
|
||||||
'ownerId': testOwnerId,
|
'profileItemId': testProfileItemId,
|
||||||
'entityId': `test-entity-${id}`,
|
'entityId': `test-entity-${id}`,
|
||||||
'description': `test description ${id}`,
|
'description': `test description ${id}`,
|
||||||
'recordType': 'Publication',
|
'recordType': 'Publication',
|
||||||
@@ -99,8 +99,8 @@ describe('OrcidQueueComponent test suite', () => {
|
|||||||
|
|
||||||
const orcidQueueElements = [orcidQueueElement(1), orcidQueueElement(2)];
|
const orcidQueueElements = [orcidQueueElement(1), orcidQueueElement(2)];
|
||||||
|
|
||||||
const orcidQueueServiceSpy = jasmine.createSpyObj('orcidQueueService', ['searchByOwnerId', 'clearFindByOwnerRequests']);
|
const orcidQueueServiceSpy = jasmine.createSpyObj('orcidQueueService', ['searchByProfileItemId', 'clearFindByProfileItemRequests']);
|
||||||
orcidQueueServiceSpy.searchByOwnerId.and.returnValue(createSuccessfulRemoteDataObject$<PaginatedList<OrcidQueue>>(createPaginatedList<OrcidQueue>(orcidQueueElements)));
|
orcidQueueServiceSpy.searchByProfileItemId.and.returnValue(createSuccessfulRemoteDataObject$<PaginatedList<OrcidQueue>>(createPaginatedList<OrcidQueue>(orcidQueueElements)));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
orcidAuthService = jasmine.createSpyObj('OrcidAuthService', {
|
orcidAuthService = jasmine.createSpyObj('OrcidAuthService', {
|
||||||
|
@@ -89,12 +89,12 @@ export class OrcidQueueComponent implements OnInit, OnDestroy {
|
|||||||
debounceTime(100),
|
debounceTime(100),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
tap(() => this.processing$.next(true)),
|
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()
|
getFirstCompletedRemoteData()
|
||||||
).subscribe((result: RemoteData<PaginatedList<OrcidQueue>>) => {
|
).subscribe((result: RemoteData<PaginatedList<OrcidQueue>>) => {
|
||||||
this.processing$.next(false);
|
this.processing$.next(false);
|
||||||
this.list$.next(result);
|
this.list$.next(result);
|
||||||
this.orcidQueueService.clearFindByOwnerRequests();
|
this.orcidQueueService.clearFindByProfileItemRequests();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -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.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.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.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.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.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.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.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",
|
"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",
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user