mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
[CST-5668] Fixed orcid page
This commit is contained in:
@@ -162,7 +162,7 @@ export class ResearcherProfileService {
|
||||
* @returns the check result
|
||||
*/
|
||||
isLinkedToOrcid(item: Item): boolean {
|
||||
return item.hasMetadata('cris.orcid.authenticated');
|
||||
return item.hasMetadata('dspace.orcid.authenticated');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +214,7 @@ export class ResearcherProfileService {
|
||||
op:'remove'
|
||||
}];
|
||||
|
||||
return this.findById(item.firstMetadata('cris.owner').authority).pipe(
|
||||
return this.findById(item.firstMetadata('dspace.object.owner').authority).pipe(
|
||||
switchMap((profile) => this.patch(profile, operations)),
|
||||
getFinishedRemoteData()
|
||||
);
|
||||
@@ -227,7 +227,7 @@ export class ResearcherProfileService {
|
||||
this.configurationService.findByPropertyName('orcid.scope').pipe(getFirstSucceededRemoteDataPayload())]
|
||||
).pipe(
|
||||
map(([authorizeUrl, clientId, scopes]) => {
|
||||
const redirectUri = environment.rest.baseUrl + '/api/cris/orcid/' + profile.id + '/?url=' + encodeURIComponent(this.router.url);
|
||||
const redirectUri = environment.rest.baseUrl + '/api/eperson/orcid/' + profile.id + '/?url=' + encodeURIComponent(this.router.url);
|
||||
return authorizeUrl.values[0] + '?client_id=' + clientId.values[0] + '&redirect_uri=' + redirectUri + '&response_type=code&scope='
|
||||
+ scopes.values.join(' ');
|
||||
}));
|
||||
|
@@ -33,7 +33,7 @@ export class OrcidAuthComponent implements OnInit {
|
||||
private itemService: ItemDataService,
|
||||
private route: ActivatedRoute,
|
||||
@Inject(NativeWindowService) private _window: NativeWindowRef,
|
||||
) {
|
||||
) {
|
||||
this.itemService.findById(this.route.snapshot.paramMap.get('id'), true, true).pipe(getFirstCompletedRemoteData()).subscribe((data: RemoteData<Item>) => {
|
||||
this.item = data.payload;
|
||||
});
|
||||
@@ -49,10 +49,10 @@ export class OrcidAuthComponent implements OnInit {
|
||||
}
|
||||
|
||||
getOrcidAuthorizations(): string[] {
|
||||
return this.item.allMetadataValues('cris.orcid.scope');
|
||||
return this.item.allMetadataValues('dspace.orcid.scope');
|
||||
}
|
||||
|
||||
isLinkedToOrcid(): boolean {
|
||||
isLinkedToOrcid(): boolean {
|
||||
return this.researcherProfileService.isLinkedToOrcid(this.item);
|
||||
}
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
<ds-orcid-auth></ds-orcid-auth>
|
||||
<ds-orcid-setting></ds-orcid-setting>
|
||||
<ds-orcid-setting *ngIf="isLinkedToOrcid()"></ds-orcid-setting>
|
||||
|
@@ -1,4 +1,14 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {Component, Inject} from '@angular/core';
|
||||
import {ConfigurationDataService} from '../../core/data/configuration-data.service';
|
||||
import {ResearcherProfileService} from '../../core/profile/researcher-profile.service';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {NotificationsService} from '../../shared/notifications/notifications.service';
|
||||
import {ItemDataService} from '../../core/data/item-data.service';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {NativeWindowRef, NativeWindowService} from '../../core/services/window.service';
|
||||
import {getFirstCompletedRemoteData} from '../../core/shared/operators';
|
||||
import {RemoteData} from '../../core/data/remote-data';
|
||||
import {Item} from '../../core/shared/item.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-orcid-page',
|
||||
@@ -6,4 +16,22 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['./orcid-page.component.scss']
|
||||
})
|
||||
export class OrcidPageComponent {
|
||||
|
||||
item: Item;
|
||||
|
||||
constructor(
|
||||
private itemService: ItemDataService,
|
||||
private researcherProfileService: ResearcherProfileService,
|
||||
private route: ActivatedRoute,
|
||||
@Inject(NativeWindowService) private _window: NativeWindowRef,
|
||||
) {
|
||||
this.itemService.findById(this.route.snapshot.paramMap.get('id'), true, true).pipe(getFirstCompletedRemoteData()).subscribe((data: RemoteData<Item>) => {
|
||||
this.item = data.payload;
|
||||
});
|
||||
}
|
||||
|
||||
isLinkedToOrcid(): boolean {
|
||||
return this.researcherProfileService.isLinkedToOrcid(this.item);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -77,9 +77,9 @@ export class OrcidSettingComponent implements OnInit {
|
||||
};
|
||||
});
|
||||
|
||||
const syncProfilePreferences = this.item.allMetadataValues('cris.orcid.sync-profile');
|
||||
const syncProfilePreferences = this.item.allMetadataValues('dspace.orcid.sync-profile');
|
||||
|
||||
this.syncProfileOptions = ['AFFILIATION', 'EDUCATION', 'BIOGRAPHICAL', 'IDENTIFIERS']
|
||||
this.syncProfileOptions = ['BIOGRAPHICAL', 'IDENTIFIERS']
|
||||
.map((value) => {
|
||||
return {
|
||||
label: this.messagePrefix + '.sync-profile.' + value.toLowerCase(),
|
||||
@@ -88,9 +88,9 @@ export class OrcidSettingComponent implements OnInit {
|
||||
};
|
||||
});
|
||||
|
||||
this.currentSyncMode = this.getCurrentPreference('cris.orcid.sync-mode', ['BATCH, MANUAL'], 'MANUAL');
|
||||
this.currentSyncPublications = this.getCurrentPreference('cris.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED');
|
||||
this.currentSyncFundings = this.getCurrentPreference('cris.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED');
|
||||
this.currentSyncMode = this.getCurrentPreference('dspace.orcid.sync-mode', ['BATCH, MANUAL'], 'MANUAL');
|
||||
this.currentSyncPublications = this.getCurrentPreference('dspace.orcid.sync-publications', ['DISABLED', 'ALL'], 'DISABLED');
|
||||
this.currentSyncFundings = this.getCurrentPreference('dspace.orcid.sync-fundings', ['DISABLED', 'ALL'], 'DISABLED');
|
||||
}
|
||||
|
||||
onSubmit(form: FormGroup) {
|
||||
@@ -110,7 +110,7 @@ export class OrcidSettingComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
this.researcherProfileService.findById(this.item.firstMetadata('cris.owner').authority).pipe(
|
||||
this.researcherProfileService.findById(this.item.firstMetadata('dspace.object.owner').authority).pipe(
|
||||
switchMap((profile) => this.researcherProfileService.patch(profile, operations)),
|
||||
getFinishedRemoteData()
|
||||
).subscribe((remoteData) => {
|
||||
|
Reference in New Issue
Block a user