Skip to content

Commit 14d99a2

Browse files
committed
Merged in dspace-cris-2023_02_x-DSC-1588 (pull request DSpace#1500)
Product entity in Orcid push
2 parents d31cd7d + 022667b commit 14d99a2

5 files changed

Lines changed: 67 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-preferences'| 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.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,20 @@ describe('OrcidSyncSettingsComponent test suite', () => {
168168
it('should create cards properly', () => {
169169
const modes = fixture.debugElement.query(By.css('[data-test="sync-mode"]'));
170170
const publication = fixture.debugElement.query(By.css('[data-test="sync-mode-publication"]'));
171+
const product = fixture.debugElement.query(By.css('[data-test="sync-mode-product"]'));
171172
const funding = fixture.debugElement.query(By.css('[data-test="sync-mode-funding"]'));
172173
const preferences = fixture.debugElement.query(By.css('[data-test="profile-preferences"]'));
173174
expect(modes).toBeTruthy();
174175
expect(publication).toBeTruthy();
176+
expect(product).toBeTruthy();
175177
expect(funding).toBeTruthy();
176178
expect(preferences).toBeTruthy();
177179
});
178180

179181
it('should init sync modes properly', () => {
180182
expect(comp.currentSyncMode).toBe('MANUAL');
181183
expect(comp.currentSyncPublications).toBe('ALL');
184+
expect(comp.currentSyncProduct).toBe('DISABLED');
182185
expect(comp.currentSyncFunding).toBe('DISABLED');
183186
});
184187

@@ -189,6 +192,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
189192
formGroup = new UntypedFormGroup({
190193
syncMode: new UntypedFormControl('MANUAL'),
191194
syncFundings: new UntypedFormControl('ALL'),
195+
syncProducts: new UntypedFormControl('ALL'),
192196
syncPublications: new UntypedFormControl('ALL'),
193197
syncProfile_BIOGRAPHICAL: new UntypedFormControl(true),
194198
syncProfile_IDENTIFIERS: new UntypedFormControl(true),
@@ -208,6 +212,10 @@ describe('OrcidSyncSettingsComponent test suite', () => {
208212
path: '/orcid/publications',
209213
op: 'replace',
210214
value: 'ALL'
215+
}, {
216+
path: '/orcid/products',
217+
op: 'replace',
218+
value: 'ALL'
211219
}, {
212220
path: '/orcid/fundings',
213221
op: 'replace',

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: 14 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.products-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",
@@ -7050,6 +7062,8 @@
70507062

70517063
"person.page.orcid.synchronization-mode-publication-message": "Select whether to send your linked Publication entities to your ORCID record's list of works.",
70527064

7065+
"person.page.orcid.synchronization-mode-product-message": "Select whether to send your linked Product entities to your ORCID record's list of works.",
7066+
70537067
"person.page.orcid.synchronization-mode-profile-message": "Select whether to send your biographical data or personal identifiers to your ORCID record.",
70547068

70557069
"person.page.orcid.synchronization-settings-update.success": "The synchronization settings have been updated successfully",

0 commit comments

Comments
 (0)