Skip to content

Commit 77c11fb

Browse files
committed
Merged dspace-cris-2023_02_x into 2023_02_x_DSC-1437
2 parents 27f38e6 + cffcf46 commit 77c11fb

6 files changed

Lines changed: 86 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
@@ -126,6 +126,8 @@ export class OrcidQueueComponent implements OnInit, OnDestroy {
126126
return 'fa fa-wallet';
127127
case 'project':
128128
return 'fas fa-wallet';
129+
case 'patent':
130+
return 'fas fa-file';
129131
case 'education':
130132
return 'fas fa-school';
131133
case 'affiliation':

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ <h2>{{'person.orcid.sync.setting' | translate}}</h2>
9494
</div>
9595
</div>
9696
</div>
97+
<div class="col-md mb-3">
98+
<div class="card h-100" data-test="sync-mode-patent">
99+
<div class="card-header">{{ 'person.page.orcid.patent-preferences'| translate }}</div>
100+
<div class="card-body">
101+
<div class="container">
102+
<div class="row">
103+
<ds-alert [type]="'alert-info'">
104+
{{ 'person.page.orcid.synchronization-mode-patent-message' | translate}}
105+
</ds-alert>
106+
</div>
107+
<div class="form-group">
108+
<div *ngFor="let option of syncPatentOptions" class="row form-check">
109+
<input type="radio" [(ngModel)]="currentSyncPatent"
110+
name="syncPatents" id="patentOption_{{option.value}}" [value]="option.value"
111+
required>
112+
<label for="patentOption_{{option.value}}" class="ml-2">{{option.label | translate}}</label>
113+
</div>
114+
</div>
115+
</div>
116+
</div>
117+
</div>
118+
</div>
97119
<div class="col-md mb-3">
98120
<div class="card h-100" data-test="profile-preferences">
99121
<div class="card-header">{{ 'person.page.orcid.profile-preferences'| translate }}</div>

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ describe('OrcidSyncSettingsComponent test suite', () => {
117117
'confidence': -1,
118118
'place': 0
119119
}],
120+
'dspace.orcid.sync-patents': [{
121+
'value': 'DISABLED',
122+
'language': null,
123+
'authority': null,
124+
'confidence': -1,
125+
'place': 0
126+
}],
120127
'person.identifier.orcid': [{
121128
'value': 'orcid-id',
122129
'language': null,
@@ -167,13 +174,15 @@ describe('OrcidSyncSettingsComponent test suite', () => {
167174

168175
it('should create cards properly', () => {
169176
const modes = fixture.debugElement.query(By.css('[data-test="sync-mode"]'));
177+
const patent = fixture.debugElement.query(By.css('[data-test="sync-mode-patent"]'));
170178
const publication = fixture.debugElement.query(By.css('[data-test="sync-mode-publication"]'));
171179
const product = fixture.debugElement.query(By.css('[data-test="sync-mode-product"]'));
172180
const funding = fixture.debugElement.query(By.css('[data-test="sync-mode-funding"]'));
173181
const preferences = fixture.debugElement.query(By.css('[data-test="profile-preferences"]'));
174182
expect(modes).toBeTruthy();
175183
expect(publication).toBeTruthy();
176184
expect(product).toBeTruthy();
185+
expect(patent).toBeTruthy();
177186
expect(funding).toBeTruthy();
178187
expect(preferences).toBeTruthy();
179188
});
@@ -183,6 +192,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
183192
expect(comp.currentSyncPublications).toBe('ALL');
184193
expect(comp.currentSyncProduct).toBe('DISABLED');
185194
expect(comp.currentSyncFunding).toBe('DISABLED');
195+
expect(comp.currentSyncPatent).toBe('DISABLED');
186196
});
187197

188198
describe('form submit', () => {
@@ -193,6 +203,7 @@ describe('OrcidSyncSettingsComponent test suite', () => {
193203
syncMode: new UntypedFormControl('MANUAL'),
194204
syncFundings: new UntypedFormControl('ALL'),
195205
syncProducts: new UntypedFormControl('ALL'),
206+
syncPatents: new UntypedFormControl('ALL'),
196207
syncPublications: new UntypedFormControl('ALL'),
197208
syncProfile_BIOGRAPHICAL: new UntypedFormControl(true),
198209
syncProfile_IDENTIFIERS: new UntypedFormControl(true),
@@ -208,6 +219,10 @@ describe('OrcidSyncSettingsComponent test suite', () => {
208219
path: '/orcid/mode',
209220
op: 'replace',
210221
value: 'MANUAL'
222+
}, {
223+
path: '/orcid/patents',
224+
op: 'replace',
225+
value: 'ALL'
211226
}, {
212227
path: '/orcid/publications',
213228
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
@@ -35,6 +35,11 @@ export class OrcidSyncSettingsComponent implements OnInit {
3535
*/
3636
currentSyncMode: string;
3737

38+
/**
39+
* The current synchronization mode for patents
40+
*/
41+
currentSyncPatent: string;
42+
3843
/**
3944
* The current synchronization mode for publications
4045
*/
@@ -55,6 +60,11 @@ export class OrcidSyncSettingsComponent implements OnInit {
5560
*/
5661
syncModes: { value: string, label: string }[];
5762

63+
/**
64+
* The synchronization options for patents
65+
*/
66+
syncPatentOptions: { value: string, label: string }[];
67+
5868
/**
5969
* The synchronization options for publications
6070
*/
@@ -116,6 +126,14 @@ export class OrcidSyncSettingsComponent implements OnInit {
116126
};
117127
});
118128

129+
this.syncPatentOptions = ['DISABLED', 'ALL']
130+
.map((value) => {
131+
return {
132+
label: this.messagePrefix + '.sync-patents.' + value.toLowerCase(),
133+
value: value,
134+
};
135+
});
136+
119137
this.syncFundingOptions = ['DISABLED', 'ALL']
120138
.map((value) => {
121139
return {
@@ -136,6 +154,7 @@ export class OrcidSyncSettingsComponent implements OnInit {
136154
});
137155

138156
this.currentSyncMode = this.getCurrentPreference('dspace.orcid.sync-mode', ['BATCH', 'MANUAL'], 'MANUAL');
157+
this.currentSyncPatent = this.getCurrentPreference('dspace.orcid.sync-patents', ['DISABLED', 'ALL'], 'DISABLED');
139158
this.currentSyncPublications = this.getCurrentPreference('dspace.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED');
140159
this.currentSyncProduct = this.getCurrentPreference('dspace.orcid.sync-products', ['DISABLED', 'ALL'], 'DISABLED');
141160
this.currentSyncFunding = this.getCurrentPreference('dspace.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED');
@@ -149,6 +168,7 @@ export class OrcidSyncSettingsComponent implements OnInit {
149168
onSubmit(form: UntypedFormGroup): void {
150169
const operations: Operation[] = [];
151170
this.fillOperationsFor(operations, '/orcid/mode', form.value.syncMode);
171+
this.fillOperationsFor(operations, '/orcid/patents', form.value.syncPatents);
152172
this.fillOperationsFor(operations, '/orcid/publications', form.value.syncPublications);
153173
this.fillOperationsFor(operations, '/orcid/products', form.value.syncProducts);
154174
this.fillOperationsFor(operations, '/orcid/fundings', form.value.syncFundings);

src/app/menu.resolver.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,19 @@ export class MenuResolver implements Resolve<boolean> {
271271
this.authorizationService.isAuthorized(FeatureID.CanEditItem),
272272
]).subscribe(([isCollectionAdmin, isCommunityAdmin, isSiteAdmin, canSubmit, canEditItem]) => {
273273
const newSubMenuList = [
274+
/* Communities and Collections */
275+
{
276+
id: `browse_global_communities_and_collections`,
277+
active: false,
278+
visible: !environment.layout.navbar.showCommunityCollection && isCollectionAdmin,
279+
model: {
280+
type: MenuItemType.LINK,
281+
text: `menu.section.communities_and_collections`,
282+
link: `/community-list`
283+
} as LinkMenuItemModel,
284+
icon: 'users',
285+
index: 0
286+
},
274287
{
275288
id: 'new_community',
276289
parentID: 'new',

src/assets/i18n/en.json5

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6902,6 +6902,8 @@
69026902

69036903
"person.page.orcid.products-preferences": "Product preferences",
69046904

6905+
"person.page.orcid.patent-preferences": "Patent preferences",
6906+
69056907
"person.page.orcid.publications-preferences": "Publication preferences",
69066908

69076909
"person.page.orcid.remove-orcid-message": "If you need to remove your ORCID, please contact the repository administrator",
@@ -6924,6 +6926,14 @@
69246926

69256927
"person.page.orcid.sync-fundings.disabled": "Disabled",
69266928

6929+
"person.page.orcid.sync-patents.all": "All patents",
6930+
6931+
"person.page.orcid.sync-patents.mine": "My patents",
6932+
6933+
"person.page.orcid.sync-patents.my_selected": "Selected patents",
6934+
6935+
"person.page.orcid.sync-patents.disabled": "Disabled",
6936+
69276937
"person.page.orcid.sync-publications.all": "All publications",
69286938

69296939
"person.page.orcid.sync-publications.mine": "My publications",
@@ -6976,6 +6986,8 @@
69766986

69776987
"person.page.orcid.sync-queue.tooltip.delete": "Remove this entry from the ORCID registry",
69786988

6989+
"person.page.orcid.sync-queue.tooltip.patent": "Patent",
6990+
69796991
"person.page.orcid.sync-queue.tooltip.publication": "Publication",
69806992

69816993
"person.page.orcid.sync-queue.tooltip.product": "Product",
@@ -7060,6 +7072,8 @@
70607072

70617073
"person.page.orcid.synchronization-mode-funding-message": "Select whether to send your linked Project entities to your ORCID record's list of funding information.",
70627074

7075+
"person.page.orcid.synchronization-mode-patent-message": "Select whether to send your linked Patent entities to your ORCID record's list of works.",
7076+
70637077
"person.page.orcid.synchronization-mode-publication-message": "Select whether to send your linked Publication entities to your ORCID record's list of works.",
70647078

70657079
"person.page.orcid.synchronization-mode-product-message": "Select whether to send your linked Product entities to your ORCID record's list of works.",

0 commit comments

Comments
 (0)