From 3ba4e27ade3c754e1dba589b5f87facfa8667a05 Mon Sep 17 00:00:00 2001 From: "Gantner, Florian Klaus" Date: Wed, 21 Feb 2024 12:40:18 +0100 Subject: [PATCH 1/6] CST-14906 orcid sync settings and labels for patent and product --- .../orcid-queue/orcid-queue.component.ts | 6 +++ .../orcid-sync-settings.component.html | 45 +++++++++++++++++++ .../orcid-sync-settings.component.spec.ts | 23 ++++++++++ .../orcid-sync-settings.component.ts | 40 +++++++++++++++++ src/assets/i18n/en.json5 | 28 ++++++++++++ 5 files changed, 142 insertions(+) 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..edbbf9dbcaf 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.products-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 f2fa9d2440b..aa16e4c54c7 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, @@ -167,11 +174,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(); }); @@ -179,7 +190,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', () => { @@ -189,6 +202,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 0bcbc295ac0..b426db40159 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 @@ -35,11 +35,21 @@ export class OrcidSyncSettingsComponent implements OnInit { */ 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 */ @@ -50,11 +60,21 @@ export class OrcidSyncSettingsComponent implements OnInit { */ 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 */ @@ -98,6 +118,22 @@ export class OrcidSyncSettingsComponent implements OnInit { }; }); + 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 { @@ -118,7 +154,9 @@ export class OrcidSyncSettingsComponent implements OnInit { }); this.currentSyncMode = this.getCurrentPreference('dspace.orcid.sync-mode', ['BATCH', 'MANUAL'], 'MANUAL'); + this.currentSyncPatent = this.getCurrentPreference('dspace.orcid.sync-patents', ['DISABLED', 'ALL'], 'DISABLED'); this.currentSyncPublications = this.getCurrentPreference('dspace.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED'); + this.currentSyncProduct = this.getCurrentPreference('dspace.orcid.sync-products', ['DISABLED', 'ALL'], 'DISABLED'); this.currentSyncFunding = this.getCurrentPreference('dspace.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED'); } @@ -130,7 +168,9 @@ export class OrcidSyncSettingsComponent implements OnInit { 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 diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 0a1804fa5c3..ad02d5defc1 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -5072,6 +5072,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", @@ -5094,6 +5098,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", @@ -5102,6 +5114,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", @@ -5138,8 +5158,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", @@ -5220,8 +5244,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", From 2c9a896550d7f2abafe7cf0fb154ad191d1b9a3e Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Fri, 23 Aug 2024 16:56:35 +0200 Subject: [PATCH 2/6] [CST-14906] Add missing labels --- src/assets/i18n/en.json5 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index ad02d5defc1..cfe72cd15c9 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -3178,14 +3178,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", @@ -3202,8 +3210,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", From 12eba67de6c32da2b3d99f3c0d2fe569a9bc23f9 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 24 Sep 2024 18:35:53 +0200 Subject: [PATCH 3/6] [CST-14906] Fix issue with notifications --- .../orcid-sync-settings/orcid-sync-settings.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b426db40159..1f622eb8d32 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 @@ -196,7 +196,7 @@ export class OrcidSyncSettingsComponent implements OnInit { } }), ).subscribe((remoteData: RemoteData) => { - if (remoteData.isSuccess) { + if (remoteData.hasSucceeded) { this.notificationsService.success(this.translateService.get(this.messagePrefix + '.synchronization-settings-update.success')); this.settingsUpdated.emit(); } else { From c3ac4eeff577ce561a45c579a247e36276bd8511 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 24 Sep 2024 19:43:30 +0200 Subject: [PATCH 4/6] [CST-14906] Fix label key --- .../orcid-sync-settings/orcid-sync-settings.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 edbbf9dbcaf..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 @@ -51,7 +51,7 @@

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

-
{{ 'person.page.orcid.products-preferences'| translate }}
+
{{ 'person.page.orcid.product-preferences'| translate }}
From 116e7974c90f618d73f7ae090300be3ed0fcd4c5 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 20 Feb 2025 20:52:14 +0100 Subject: [PATCH 5/6] [CST-14906] Fix merge --- .../orcid-sync-settings.component.ts | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) 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 d5765de662a..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 @@ -212,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')); } }); } @@ -232,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); } /** From 2a799fb8dd58068fd839fa03ae46146389138032 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 20 Feb 2025 21:08:29 +0100 Subject: [PATCH 6/6] [CST-14906] Add missing labels --- src/assets/i18n/en.json5 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 705abddb452..d6e513de0cd 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -4360,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", @@ -4406,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",