[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:
parent
35ccd215a1
commit
584e3a0b16
|
@ -101,7 +101,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- ORCID -->
|
<!-- 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 [resultId]="id" [resultLandingInfo]="resultLandingInfo" [pids]="pidsArrayString" [pageType]="'landing'">
|
||||||
</orcid-work>
|
</orcid-work>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -180,8 +180,8 @@ export class MyOrcidLinksComponent {
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
|
|
||||||
if(typeof document !== 'undefined') {
|
if(typeof document !== 'undefined') {
|
||||||
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
|
this.tokenUrl = properties.orcidTokenURL
|
||||||
+ "client_id="+this.clientId
|
+ "client_id="+properties.orcidClientId
|
||||||
// + "&response_type=code&scope=/activities/update"
|
// + "&response_type=code&scope=/activities/update"
|
||||||
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
||||||
+ "&response_type=code&scope=/activities/update /read-limited"
|
+ "&response_type=code&scope=/activities/update /read-limited"
|
||||||
|
|
|
@ -78,7 +78,7 @@ export class searcMyOrcidResultsComponent {
|
||||||
this.previewResults.push(this.getResultPreview(result));
|
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(
|
this.orcidService.getLocalWorksByPids(this.previewResults.map(
|
||||||
previewResult => {
|
previewResult => {
|
||||||
if (previewResult.identifiers) {
|
if (previewResult.identifiers) {
|
||||||
|
|
|
@ -440,8 +440,8 @@ export class OrcidWorkComponent {
|
||||||
private orcidService: OrcidService,
|
private orcidService: OrcidService,
|
||||||
private resultLandingService: ResultLandingService) {
|
private resultLandingService: ResultLandingService) {
|
||||||
if(typeof document !== 'undefined') {
|
if(typeof document !== 'undefined') {
|
||||||
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
|
this.tokenUrl = properties.orcidTokenURL
|
||||||
+ "client_id="+this.clientId
|
+ "client_id="+properties.orcidClientId
|
||||||
// + "&response_type=code&scope=/activities/update"
|
// + "&response_type=code&scope=/activities/update"
|
||||||
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
||||||
+ "&response_type=code&scope=/activities/update /read-limited"
|
+ "&response_type=code&scope=/activities/update /read-limited"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
|
||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import {OrcidService} from "../../orcid/orcid.service";
|
import {OrcidService} from "../../orcid/orcid.service";
|
||||||
import {Session} from "../../login/utils/helper.class";
|
import {Session} from "../../login/utils/helper.class";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'search-result',
|
selector: 'search-result',
|
||||||
|
@ -39,7 +40,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
||||||
this.previewResults.push(this.getResultPreview(result));
|
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(
|
this.orcidService.getPutCodes(this.previewResults.map(
|
||||||
previewResult => {
|
previewResult => {
|
||||||
if(previewResult.identifiers) {
|
if(previewResult.identifiers) {
|
||||||
|
@ -54,7 +55,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
||||||
for (let i = 0; i < this.previewResults.length; i++) {
|
for (let i = 0; i < this.previewResults.length; i++) {
|
||||||
if(this.previewResults[i].identifiers) {
|
if(this.previewResults[i].identifiers) {
|
||||||
this.previewResults[i].orcidPutCodes = putCodes[i];
|
this.previewResults[i].orcidPutCodes = putCodes[i];
|
||||||
console.debug(i, this.previewResults[i].orcidPutCodes);
|
// console.debug(i, this.previewResults[i].orcidPutCodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|
|
@ -33,6 +33,8 @@ export interface EnvProperties {
|
||||||
searchOrcidURL?: string;
|
searchOrcidURL?: string;
|
||||||
orcidURL?: string;
|
orcidURL?: string;
|
||||||
orcidAPIURL?: string;
|
orcidAPIURL?: string;
|
||||||
|
orcidTokenURL?: string;
|
||||||
|
orcidClientId?: string;
|
||||||
doiURL?: string;
|
doiURL?: string;
|
||||||
pmcURL?: string;
|
pmcURL?: string;
|
||||||
pmidURL?: string;
|
pmidURL?: string;
|
||||||
|
|
|
@ -263,7 +263,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--&& loggedIn -->
|
<!--&& 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">
|
class="result-preview-bottom">
|
||||||
<!-- Impact Factors-->
|
<!-- Impact Factors-->
|
||||||
<span class="uk-flex uk-flex-top">
|
<span class="uk-flex uk-flex-top">
|
||||||
|
@ -339,14 +339,14 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- && loggedIn -->
|
<!-- && 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-width-1-3 uk-width-expand@s">
|
||||||
<!-- class="uk-flex uk-flex-middle uk-flex-right uk-width-expand">-->
|
<!-- 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'"
|
<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">
|
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
|
||||||
</orcid-work>
|
</orcid-work>
|
||||||
</span>
|
</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">
|
class="uk-width-expand uk-text-right">
|
||||||
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
|
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
|
||||||
<span class="uk-text-muted">Added in ORCID:</span>
|
<span class="uk-text-muted">Added in ORCID:</span>
|
||||||
|
|
Loading…
Reference in New Issue