[Trunk | Library]:

1. env-properties.ts: Added properties "orcidTokenURL", "orcidClientId".
2. orcid-work.component.ts & myOrcidLinks.component.ts: Set tokenUrl using properties.orcidTokenURL and properties.orcidClientId (not local strings).
3. searchMyOrcidResults.component.ts: Remove check for "development" environment (Menu is not added in production).
4. searchResult.component.ts: Parse previewResult.identifiers to set previewResult.orcidPutCodes only when environment is not "production" and portalType is "explore".
5. result-preview.component.html: Show ORCID dates or <orcid-work> only when environment is not "production" and portalType is "explore".
6. resultLanding.component.html: Show <orcid-work> only when environment is not "production" and portalType is "explore".


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60494 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-02-24 20:33:37 +00:00
parent 35ccd215a1
commit 584e3a0b16
7 changed files with 14 additions and 11 deletions

View File

@ -101,7 +101,7 @@
</a>
</li>
<!-- ORCID -->
<li *ngIf="properties.environment == 'development'">
<li *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore'">
<orcid-work [resultId]="id" [resultLandingInfo]="resultLandingInfo" [pids]="pidsArrayString" [pageType]="'landing'">
</orcid-work>
</li>

View File

@ -180,8 +180,8 @@ export class MyOrcidLinksComponent {
this.searchUtils.page =1;
if(typeof document !== 'undefined') {
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
+ "client_id="+this.clientId
this.tokenUrl = properties.orcidTokenURL
+ "client_id="+properties.orcidClientId
// + "&response_type=code&scope=/activities/update"
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
+ "&response_type=code&scope=/activities/update /read-limited"

View File

@ -78,7 +78,7 @@ export class searcMyOrcidResultsComponent {
this.previewResults.push(this.getResultPreview(result));
}
if (this.properties.environment == 'development' && Session.isLoggedIn() && this.results && this.results.length > 0) {
if (Session.isLoggedIn() && this.results && this.results.length > 0) {
this.orcidService.getLocalWorksByPids(this.previewResults.map(
previewResult => {
if (previewResult.identifiers) {

View File

@ -440,8 +440,8 @@ export class OrcidWorkComponent {
private orcidService: OrcidService,
private resultLandingService: ResultLandingService) {
if(typeof document !== 'undefined') {
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
+ "client_id="+this.clientId
this.tokenUrl = properties.orcidTokenURL
+ "client_id="+properties.orcidClientId
// + "&response_type=code&scope=/activities/update"
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
+ "&response_type=code&scope=/activities/update /read-limited"

View File

@ -5,6 +5,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
import {HttpClient} from "@angular/common/http";
import {OrcidService} from "../../orcid/orcid.service";
import {Session} from "../../login/utils/helper.class";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'search-result',
@ -39,7 +40,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
this.previewResults.push(this.getResultPreview(result));
}
if(this.properties.environment == 'development' && Session.isLoggedIn() && this.results && this.results.length > 0) {
if(this.properties.environment != 'production' && properties.adminToolsPortalType == "explore" && Session.isLoggedIn() && this.results && this.results.length > 0) {
this.orcidService.getPutCodes(this.previewResults.map(
previewResult => {
if(previewResult.identifiers) {
@ -54,7 +55,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
for (let i = 0; i < this.previewResults.length; i++) {
if(this.previewResults[i].identifiers) {
this.previewResults[i].orcidPutCodes = putCodes[i];
console.debug(i, this.previewResults[i].orcidPutCodes);
// console.debug(i, this.previewResults[i].orcidPutCodes);
}
}
}, error => {

View File

@ -33,6 +33,8 @@ export interface EnvProperties {
searchOrcidURL?: string;
orcidURL?: string;
orcidAPIURL?: string;
orcidTokenURL?: string;
orcidClientId?: string;
doiURL?: string;
pmcURL?: string;
pmidURL?: string;

View File

@ -263,7 +263,7 @@
</div>
</div>
<!--&& loggedIn -->
<div *ngIf="(result.pop_inf && result.DOI) || (properties.environment == 'development' && ((showOrcid && result.identifiers && result.identifiers.size > 0) || (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)))"
<div *ngIf="(result.pop_inf && result.DOI) || (properties.environment != 'production' && properties.adminToolsPortalType == 'explore' && ((showOrcid && result.identifiers && result.identifiers.size > 0) || (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)))"
class="result-preview-bottom">
<!-- Impact Factors-->
<span class="uk-flex uk-flex-top">
@ -339,14 +339,14 @@
</div>
</ng-container>
<!-- && loggedIn -->
<span *ngIf="properties.environment == 'development' && showOrcid && result.identifiers && result.identifiers.size > 0"
<span *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore' && showOrcid && result.identifiers && result.identifiers.size > 0"
class="uk-width-1-3 uk-width-expand@s">
<!-- class="uk-flex uk-flex-middle uk-flex-right uk-width-expand">-->
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0" [resultId]="result.relcanId" [type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
</orcid-work>
</span>
<span *ngIf="properties.environment == 'development' && (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)"
<span *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore' && (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)"
class="uk-width-expand uk-text-right">
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
<span class="uk-text-muted">Added in ORCID:</span>