Revision 60494
Added by Konstantina Galouni over 3 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchResult.component.ts | ||
---|---|---|
5 | 5 |
import {HttpClient} from "@angular/common/http"; |
6 | 6 |
import {OrcidService} from "../../orcid/orcid.service"; |
7 | 7 |
import {Session} from "../../login/utils/helper.class"; |
8 |
import {properties} from "../../../../environments/environment"; |
|
8 | 9 |
|
9 | 10 |
@Component({ |
10 | 11 |
selector: 'search-result', |
... | ... | |
39 | 40 |
this.previewResults.push(this.getResultPreview(result)); |
40 | 41 |
} |
41 | 42 |
|
42 |
if(this.properties.environment == 'development' && Session.isLoggedIn() && this.results && this.results.length > 0) {
|
|
43 |
if(this.properties.environment != 'production' && properties.adminToolsPortalType == "explore" && Session.isLoggedIn() && this.results && this.results.length > 0) {
|
|
43 | 44 |
this.orcidService.getPutCodes(this.previewResults.map( |
44 | 45 |
previewResult => { |
45 | 46 |
if(previewResult.identifiers) { |
... | ... | |
54 | 55 |
for (let i = 0; i < this.previewResults.length; i++) { |
55 | 56 |
if(this.previewResults[i].identifiers) { |
56 | 57 |
this.previewResults[i].orcidPutCodes = putCodes[i]; |
57 |
console.debug(i, this.previewResults[i].orcidPutCodes); |
|
58 |
// console.debug(i, this.previewResults[i].orcidPutCodes);
|
|
58 | 59 |
} |
59 | 60 |
} |
60 | 61 |
}, error => { |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.component.html | ||
---|---|---|
101 | 101 |
</a> |
102 | 102 |
</li> |
103 | 103 |
<!-- ORCID --> |
104 |
<li *ngIf="properties.environment == 'development'">
|
|
104 |
<li *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore'">
|
|
105 | 105 |
<orcid-work [resultId]="id" [resultLandingInfo]="resultLandingInfo" [pids]="pidsArrayString" [pageType]="'landing'"> |
106 | 106 |
</orcid-work> |
107 | 107 |
</li> |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/orcid/my-orcid-links/searchMyOrcidResults.component.ts | ||
---|---|---|
78 | 78 |
this.previewResults.push(this.getResultPreview(result)); |
79 | 79 |
} |
80 | 80 |
|
81 |
if (this.properties.environment == 'development' && Session.isLoggedIn() && this.results && this.results.length > 0) {
|
|
81 |
if (Session.isLoggedIn() && this.results && this.results.length > 0) { |
|
82 | 82 |
this.orcidService.getLocalWorksByPids(this.previewResults.map( |
83 | 83 |
previewResult => { |
84 | 84 |
if (previewResult.identifiers) { |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/orcid/my-orcid-links/myOrcidLinks.component.ts | ||
---|---|---|
180 | 180 |
this.searchUtils.page =1; |
181 | 181 |
|
182 | 182 |
if(typeof document !== 'undefined') { |
183 |
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
|
|
184 |
+ "client_id="+this.clientId
|
|
183 |
this.tokenUrl = properties.orcidTokenURL
|
|
184 |
+ "client_id="+properties.orcidClientId
|
|
185 | 185 |
// + "&response_type=code&scope=/activities/update" |
186 | 186 |
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited" |
187 | 187 |
+ "&response_type=code&scope=/activities/update /read-limited" |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/orcid/orcid-work.component.ts | ||
---|---|---|
440 | 440 |
private orcidService: OrcidService, |
441 | 441 |
private resultLandingService: ResultLandingService) { |
442 | 442 |
if(typeof document !== 'undefined') { |
443 |
this.tokenUrl = "https://sandbox.orcid.org/oauth/authorize?"
|
|
444 |
+ "client_id="+this.clientId
|
|
443 |
this.tokenUrl = properties.orcidTokenURL
|
|
444 |
+ "client_id="+properties.orcidClientId
|
|
445 | 445 |
// + "&response_type=code&scope=/activities/update" |
446 | 446 |
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited" |
447 | 447 |
+ "&response_type=code&scope=/activities/update /read-limited" |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/properties/env-properties.ts | ||
---|---|---|
33 | 33 |
searchOrcidURL?: string; |
34 | 34 |
orcidURL?: string; |
35 | 35 |
orcidAPIURL?: string; |
36 |
orcidTokenURL?: string; |
|
37 |
orcidClientId?: string; |
|
36 | 38 |
doiURL?: string; |
37 | 39 |
pmcURL?: string; |
38 | 40 |
pmidURL?: string; |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/result-preview/result-preview.component.html | ||
---|---|---|
263 | 263 |
</div> |
264 | 264 |
</div> |
265 | 265 |
<!--&& loggedIn --> |
266 |
<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)))"
|
|
266 |
<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)))"
|
|
267 | 267 |
class="result-preview-bottom"> |
268 | 268 |
<!-- Impact Factors--> |
269 | 269 |
<span class="uk-flex uk-flex-top"> |
... | ... | |
339 | 339 |
</div> |
340 | 340 |
</ng-container> |
341 | 341 |
<!-- && loggedIn --> |
342 |
<span *ngIf="properties.environment == 'development' && showOrcid && result.identifiers && result.identifiers.size > 0"
|
|
342 |
<span *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore' && showOrcid && result.identifiers && result.identifiers.size > 0"
|
|
343 | 343 |
class="uk-width-1-3 uk-width-expand@s"> |
344 | 344 |
<!-- class="uk-flex uk-flex-middle uk-flex-right uk-width-expand">--> |
345 | 345 |
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0" [resultId]="result.relcanId" [type]="result.resultType" [pageType]="'search'" |
346 | 346 |
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"> |
347 | 347 |
</orcid-work> |
348 | 348 |
</span> |
349 |
<span *ngIf="properties.environment == 'development' && (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)"
|
|
349 |
<span *ngIf="properties.environment != 'production' && properties.adminToolsPortalType == 'explore' && (result.orcidUpdateDates?.length > 0 || result.orcidCreationDates?.length > 0)"
|
|
350 | 350 |
class="uk-width-expand uk-text-right"> |
351 | 351 |
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block"> |
352 | 352 |
<span class="uk-text-muted">Added in ORCID:</span> |
Also available in: Unified diff
[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".