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 3e88826952e..5dfd48f61b7 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 @@ -118,8 +118,14 @@ export class OrcidQueueComponent implements OnInit, OnDestroy { switch (orcidQueue.recordType.toLowerCase()) { case 'publication': return 'fas fa-book'; + case 'product': + return 'fas fa-database'; + case 'funding': + return 'fa fa-wallet'; case 'project': return 'fas fa-wallet'; + case 'patent': + return 'fas fa-file'; case 'education': return 'fas fa-school'; case 'affiliation': diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html index ee9a15268a5..dd71ddcd4b3 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html @@ -49,6 +49,29 @@

{{'person.orcid.sync.setting' | translate}}

+
+
+
{{ 'person.page.orcid.product-preferences'| translate }}
+
+
+
+ + {{ 'person.page.orcid.synchronization-mode-product-message' | translate}} + +
+
+
+ + +
+
+
+
+
+
{{ 'person.page.orcid.funding-preferences'| translate }}
@@ -71,6 +94,28 @@

{{'person.orcid.sync.setting' | translate}}

+
+
+
{{ 'person.page.orcid.patent-preferences'| translate }}
+
+
+
+ + {{ 'person.page.orcid.synchronization-mode-patent-message' | translate}} + +
+
+
+ + +
+
+
+
+
+
{{ 'person.page.orcid.profile-preferences'| translate }}
diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts index 38a6df909eb..c658a873fec 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts @@ -117,6 +117,13 @@ describe('OrcidSyncSettingsComponent test suite', () => { 'confidence': -1, 'place': 0 }], + 'dspace.orcid.sync-patents': [{ + 'value': 'DISABLED', + 'language': null, + 'authority': null, + 'confidence': -1, + 'place': 0 + }], 'person.identifier.orcid': [{ 'value': 'orcid-id', 'language': null, @@ -168,11 +175,15 @@ describe('OrcidSyncSettingsComponent test suite', () => { it('should create cards properly', () => { const modes = fixture.debugElement.query(By.css('[data-test="sync-mode"]')); + const patent = fixture.debugElement.query(By.css('[data-test="sync-mode-patent"]')); const publication = fixture.debugElement.query(By.css('[data-test="sync-mode-publication"]')); + const product = fixture.debugElement.query(By.css('[data-test="sync-mode-product"]')); const funding = fixture.debugElement.query(By.css('[data-test="sync-mode-funding"]')); const preferences = fixture.debugElement.query(By.css('[data-test="profile-preferences"]')); expect(modes).toBeTruthy(); expect(publication).toBeTruthy(); + expect(product).toBeTruthy(); + expect(patent).toBeTruthy(); expect(funding).toBeTruthy(); expect(preferences).toBeTruthy(); }); @@ -180,7 +191,9 @@ describe('OrcidSyncSettingsComponent test suite', () => { it('should init sync modes properly', () => { expect(comp.currentSyncMode).toBe('MANUAL'); expect(comp.currentSyncPublications).toBe('ALL'); + expect(comp.currentSyncProduct).toBe('DISABLED'); expect(comp.currentSyncFunding).toBe('DISABLED'); + expect(comp.currentSyncPatent).toBe('DISABLED'); }); describe('form submit', () => { @@ -190,6 +203,8 @@ describe('OrcidSyncSettingsComponent test suite', () => { formGroup = new UntypedFormGroup({ syncMode: new UntypedFormControl('MANUAL'), syncFundings: new UntypedFormControl('ALL'), + syncProducts: new UntypedFormControl('ALL'), + syncPatents: new UntypedFormControl('ALL'), syncPublications: new UntypedFormControl('ALL'), syncProfile_BIOGRAPHICAL: new UntypedFormControl(true), syncProfile_IDENTIFIERS: new UntypedFormControl(true), @@ -204,10 +219,18 @@ describe('OrcidSyncSettingsComponent test suite', () => { path: '/orcid/mode', op: 'replace', value: 'MANUAL' + }, { + path: '/orcid/patents', + op: 'replace', + value: 'ALL' }, { path: '/orcid/publications', op: 'replace', value: 'ALL' + }, { + path: '/orcid/products', + op: 'replace', + value: 'ALL' }, { path: '/orcid/fundings', op: 'replace', diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts index 422041d340f..0ae218437e3 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts @@ -31,10 +31,22 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { * The current synchronization mode */ currentSyncMode: string; + + /** + * The current synchronization mode for patents + */ + currentSyncPatent: string; + /** * The current synchronization mode for publications */ currentSyncPublications: string; + + /** + * The current synchronization mode for product + */ + currentSyncProduct: string; + /** * The current synchronization mode for funding */ @@ -43,10 +55,22 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { * The synchronization options */ syncModes: { value: string, label: string }[]; + + /** + * The synchronization options for patents + */ + syncPatentOptions: { value: string, label: string }[]; + /** * The synchronization options for publications */ syncPublicationOptions: { value: string, label: string }[]; + + /** + * The synchronization options for products + */ + syncProductOptions: { value: string, label: string }[]; + /** * The synchronization options for funding */ @@ -115,6 +139,22 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { }; }); + this.syncProductOptions = ['DISABLED', 'ALL'] + .map((value) => { + return { + label: this.messagePrefix + '.sync-products.' + value.toLowerCase(), + value: value, + }; + }); + + this.syncPatentOptions = ['DISABLED', 'ALL'] + .map((value) => { + return { + label: this.messagePrefix + '.sync-patents.' + value.toLowerCase(), + value: value, + }; + }); + this.syncFundingOptions = ['DISABLED', 'ALL'] .map((value) => { return { @@ -148,7 +188,9 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { onSubmit(form: UntypedFormGroup): void { const operations: Operation[] = []; this.fillOperationsFor(operations, '/orcid/mode', form.value.syncMode); + this.fillOperationsFor(operations, '/orcid/patents', form.value.syncPatents); this.fillOperationsFor(operations, '/orcid/publications', form.value.syncPublications); + this.fillOperationsFor(operations, '/orcid/products', form.value.syncProducts); this.fillOperationsFor(operations, '/orcid/fundings', form.value.syncFundings); const syncProfileValue = this.syncProfileOptions @@ -170,11 +212,11 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { take(1) ) .subscribe((remoteData: RemoteData) => { - if (remoteData.hasFailed) { - this.notificationsService.error(this.translateService.get(this.messagePrefix + '.synchronization-settings-update.error')); - } else { + if (remoteData.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.messagePrefix + '.synchronization-settings-update.success')); this.settingsUpdated.emit(); + } else { + this.notificationsService.error(this.translateService.get(this.messagePrefix + '.synchronization-settings-update.error')); } }); } @@ -190,18 +232,28 @@ export class OrcidSyncSettingsComponent implements OnInit, OnDestroy { item.pipe( filter(hasValue), map(i => this.getCurrentPreference(i, 'dspace.orcid.sync-mode', ['BATCH', 'MANUAL'], 'MANUAL')), - takeUntil(this.#destroy$) + takeUntil(this.#destroy$), ).subscribe(val => this.currentSyncMode = val); item.pipe( filter(hasValue), map(i => this.getCurrentPreference(i, 'dspace.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED')), - takeUntil(this.#destroy$) + takeUntil(this.#destroy$), ).subscribe(val => this.currentSyncPublications = val); item.pipe( filter(hasValue), map(i => this.getCurrentPreference(i, 'dspace.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED')), - takeUntil(this.#destroy$) + takeUntil(this.#destroy$), ).subscribe(val => this.currentSyncFunding = val); + item.pipe( + filter(hasValue), + map(i => this.getCurrentPreference(i, 'dspace.orcid.sync-patents', ['DISABLED', 'ALL'], 'DISABLED')), + takeUntil(this.#destroy$), + ).subscribe(val => this.currentSyncPatent = val); + item.pipe( + filter(hasValue), + map(i => this.getCurrentPreference(i, 'dspace.orcid.sync-products', ['DISABLED', 'ALL'], 'DISABLED')), + takeUntil(this.#destroy$), + ).subscribe(val => this.currentSyncProduct = val); } /** diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 99ce1962544..d6e513de0cd 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -3202,14 +3202,22 @@ "pagination.sort-direction": "Sort Options", + "patent.listelement.badge": "Patent", + "person.listelement.badge": "Person", + "product.listelement.badge": "Product", + "person.listelement.no-title": "No name found", "person.page.birthdate": "Birth Date", + "patent.page.edit": "Edit this item", + "person.page.edit": "Edit this item", + "product.page.edit": "Edit this item", + "person.page.email": "Email Address", "person.page.firstname": "First Name", @@ -3226,8 +3234,12 @@ "person.page.staffid": "Staff ID", + "patent.page.titleprefix": "Patent: ", + "person.page.titleprefix": "Person: ", + "product.page.titleprefix": "Product: ", + "person.search.results.head": "Person Search Results", "person-relationships.search.results.head": "Person Search Results", @@ -4348,10 +4360,18 @@ "submission.sections.describe.relationship-lookup.search-tab.tab-title.isPublicationOfAuthor": "Publication of the Author", + "submission.sections.describe.relationship-lookup.search-tab.tab-title.isCreatorOfProduct": "Creator of the Product", + + "submission.sections.describe.relationship-lookup.search-tab.tab-title.isInventorOfPatent": "Inventor of the Patent", + "submission.sections.describe.relationship-lookup.selection-tab.title.openAIREFunding": "Funding OpenAIRE API", "submission.sections.describe.relationship-lookup.selection-tab.title.isProjectOfPublication": "Project", + "submission.sections.describe.relationship-lookup.selection-tab.title.isCreatorOfProduct": "Creator of the Product", + + "submission.sections.describe.relationship-lookup.selection-tab.title.isInventorOfPatent": "Inventor of the Patent", + "submission.sections.describe.relationship-lookup.title.isProjectOfPublication": "Projects", "submission.sections.describe.relationship-lookup.title.isFundingAgencyOfProject": "Funder of the Project", @@ -4394,6 +4414,10 @@ "submission.sections.describe.relationship-lookup.title.isPublicationOfAuthor": "Publication", + "submission.sections.describe.relationship-lookup.title.isCreatorOfProduct": "Product", + + "submission.sections.describe.relationship-lookup.title.isInventorOfPatent": "Patent", + "submission.sections.describe.relationship-lookup.search-tab.toggle-dropdown": "Toggle dropdown", "submission.sections.describe.relationship-lookup.selection-tab.settings": "Settings", @@ -5096,6 +5120,10 @@ "person.page.orcid.funding-preferences": "Funding preferences", + "person.page.orcid.product-preferences": "Product preferences", + + "person.page.orcid.patent-preferences": "Patent preferences", + "person.page.orcid.publications-preferences": "Publication preferences", "person.page.orcid.remove-orcid-message": "If you need to remove your ORCID, please contact the repository administrator", @@ -5118,6 +5146,14 @@ "person.page.orcid.sync-fundings.disabled": "Disabled", + "person.page.orcid.sync-patents.all": "All patents", + + "person.page.orcid.sync-patents.mine": "My patents", + + "person.page.orcid.sync-patents.my_selected": "Selected patents", + + "person.page.orcid.sync-patents.disabled": "Disabled", + "person.page.orcid.sync-publications.all": "All publications", "person.page.orcid.sync-publications.mine": "My publications", @@ -5126,6 +5162,14 @@ "person.page.orcid.sync-publications.disabled": "Disabled", + "person.page.orcid.sync-products.all": "All products", + + "person.page.orcid.sync-products.mine": "My products", + + "person.page.orcid.sync-products.my_selected": "Selected products", + + "person.page.orcid.sync-products.disabled": "Disabled", + "person.page.orcid.sync-queue.discard": "Discard the change and do not synchronize with the ORCID registry", "person.page.orcid.sync-queue.discard.error": "The discarding of the ORCID queue record failed", @@ -5162,8 +5206,12 @@ "person.page.orcid.sync-queue.tooltip.delete": "Remove this entry from the ORCID registry", + "person.page.orcid.sync-queue.tooltip.patent": "Patent", + "person.page.orcid.sync-queue.tooltip.publication": "Publication", + "person.page.orcid.sync-queue.tooltip.product": "Product", + "person.page.orcid.sync-queue.tooltip.project": "Project", "person.page.orcid.sync-queue.tooltip.affiliation": "Affiliation", @@ -5244,8 +5292,12 @@ "person.page.orcid.synchronization-mode-funding-message": "Select whether to send your linked Project entities to your ORCID record's list of funding information.", + "person.page.orcid.synchronization-mode-patent-message": "Select whether to send your linked Patent entities to your ORCID record's list of works.", + "person.page.orcid.synchronization-mode-publication-message": "Select whether to send your linked Publication entities to your ORCID record's list of works.", + "person.page.orcid.synchronization-mode-product-message": "Select whether to send your linked Product entities to your ORCID record's list of works.", + "person.page.orcid.synchronization-mode-profile-message": "Select whether to send your biographical data or personal identifiers to your ORCID record.", "person.page.orcid.synchronization-settings-update.success": "The synchronization settings have been updated successfully",