Skip to content

Commit 8610f0b

Browse files
floriangantneratarix83
authored andcommitted
orcid sync settings for product entity
1 parent a1edb01 commit 8610f0b

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ export class OrcidQueueComponent implements OnInit, OnDestroy {
120120
switch (orcidQueue.recordType.toLowerCase()) {
121121
case 'publication':
122122
return 'fas fa-book';
123+
case 'product':
124+
return 'fas fa-database';
123125
case 'funding':
124126
return 'fa fa-wallet';
125127
case 'project':

src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,29 @@ <h2>{{'person.orcid.sync.setting' | translate}}</h2>
4949
</div>
5050
</div>
5151
</div>
52+
<div class="col-md mb-3">
53+
<div class="card h-100" data-test="sync-mode-product">
54+
<div class="card-header">{{ 'person.page.orcid.products-references'| translate }}</div>
55+
<div class="card-body">
56+
<div class="container">
57+
<div class="row">
58+
<ds-alert [type]="'alert-info'">
59+
{{ 'person.page.orcid.synchronization-mode-product-message' | translate}}
60+
</ds-alert>
61+
</div>
62+
<div class="form-group">
63+
<div *ngFor="let option of syncProductOptions" class="row form-check">
64+
<input type="radio" [(ngModel)]="currentSyncProduct"
65+
name="syncProducts" id="productOption_{{option.value}}" [value]="option.value"
66+
required>
67+
<label for="productOption_{{option.value}}"
68+
class="ml-2">{{option.label | translate}}</label>
69+
</div>
70+
</div>
71+
</div>
72+
</div>
73+
</div>
74+
</div>
5275
<div class="col-md mb-3">
5376
<div class="card h-100" data-test="sync-mode-funding">
5477
<div class="card-header">{{ 'person.page.orcid.funding-preferences'| translate }}</div>

src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export class OrcidSyncSettingsComponent implements OnInit {
4040
*/
4141
currentSyncPublications: string;
4242

43+
/**
44+
* The current synchronization mode for product
45+
*/
46+
currentSyncProduct: string;
47+
4348
/**
4449
* The current synchronization mode for funding
4550
*/
@@ -55,6 +60,11 @@ export class OrcidSyncSettingsComponent implements OnInit {
5560
*/
5661
syncPublicationOptions: { value: string, label: string }[];
5762

63+
/**
64+
* The synchronization options for products
65+
*/
66+
syncProductOptions: { value: string, label: string }[];
67+
5868
/**
5969
* The synchronization options for funding
6070
*/
@@ -98,6 +108,14 @@ export class OrcidSyncSettingsComponent implements OnInit {
98108
};
99109
});
100110

111+
this.syncProductOptions = ['DISABLED', 'ALL']
112+
.map((value) => {
113+
return {
114+
label: this.messagePrefix + '.sync-products.' + value.toLowerCase(),
115+
value: value,
116+
};
117+
});
118+
101119
this.syncFundingOptions = ['DISABLED', 'ALL']
102120
.map((value) => {
103121
return {
@@ -119,6 +137,7 @@ export class OrcidSyncSettingsComponent implements OnInit {
119137

120138
this.currentSyncMode = this.getCurrentPreference('dspace.orcid.sync-mode', ['BATCH', 'MANUAL'], 'MANUAL');
121139
this.currentSyncPublications = this.getCurrentPreference('dspace.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED');
140+
this.currentSyncProduct = this.getCurrentPreference('dspace.orcid.sync-products', ['DISABLED', 'ALL'], 'DISABLED');
122141
this.currentSyncFunding = this.getCurrentPreference('dspace.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED');
123142
}
124143

@@ -131,6 +150,7 @@ export class OrcidSyncSettingsComponent implements OnInit {
131150
const operations: Operation[] = [];
132151
this.fillOperationsFor(operations, '/orcid/mode', form.value.syncMode);
133152
this.fillOperationsFor(operations, '/orcid/publications', form.value.syncPublications);
153+
this.fillOperationsFor(operations, '/orcid/products', form.value.syncProducts);
134154
this.fillOperationsFor(operations, '/orcid/fundings', form.value.syncFundings);
135155

136156
const syncProfileValue = this.syncProfileOptions

src/assets/i18n/en.json5

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6900,6 +6900,8 @@
69006900

69016901
"person.page.orcid.funding-preferences": "Funding preferences",
69026902

6903+
"person.page.orcid.product-preferences": "Product preferences",
6904+
69036905
"person.page.orcid.publications-preferences": "Publication preferences",
69046906

69056907
"person.page.orcid.remove-orcid-message": "If you need to remove your ORCID, please contact the repository administrator",
@@ -6930,6 +6932,14 @@
69306932

69316933
"person.page.orcid.sync-publications.disabled": "Disabled",
69326934

6935+
"person.page.orcid.sync-products.all": "All products",
6936+
6937+
"person.page.orcid.sync-products.mine": "My products",
6938+
6939+
"person.page.orcid.sync-products.my_selected": "Selected products",
6940+
6941+
"person.page.orcid.sync-products.disabled": "Disabled",
6942+
69336943
"person.page.orcid.sync-queue.discard": "Discard the change and do not synchronize with the ORCID registry",
69346944

69356945
"person.page.orcid.sync-queue.discard.error": "The discarding of the ORCID queue record failed",
@@ -6968,6 +6978,8 @@
69686978

69696979
"person.page.orcid.sync-queue.tooltip.publication": "Publication",
69706980

6981+
"person.page.orcid.sync-queue.tooltip.product": "Product",
6982+
69716983
"person.page.orcid.sync-queue.tooltip.project": "Project",
69726984

69736985
"person.page.orcid.sync-queue.tooltip.affiliation": "Affiliation",

0 commit comments

Comments
 (0)