Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library

This commit is contained in:
Alex Martzios 2021-11-10 15:08:22 +02:00
commit 9318da43a3
6 changed files with 52 additions and 17 deletions

View File

@ -4,6 +4,7 @@ import {HttpClient} from '@angular/common/http';
import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {catchError, map} from 'rxjs/operators';
import {properties} from "../../../../../environments/environment";
@Injectable()
@ -55,7 +56,7 @@ export class SearchDataciteService {
entity.result.DOI = item.attributes.doi;
entity.id = item.attributes.doi;
entity.title = item.attributes.title;
entity.result.url = 'http://dx.doi.org/' + item.attributes.doi;
entity.result.url = properties.doiURL + item.attributes.doi;
entity.result.source = 'datacite';
entity.type = 'dataset';
entity.result.date = item.attributes.published;

View File

@ -4,6 +4,7 @@ import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators";
import {StringUtils} from "../../../utils/string-utils.class";
import {properties} from "../../../../../environments/environment";
@Injectable()
@ -114,7 +115,7 @@ export class SearchOrcidService {
const id = item['external-ids']['external-id'][j];
if (id['external-id-type'] == "doi") {
entity.result.DOI = id['external-id-value'];
entity.result.url = "http://dx.doi.org/" + entity.result.DOI;
entity.result.url = properties.doiURL + entity.result.DOI;
break;
}else if (id['external-id-type'] == "handle" && !handleId) {
handleId= id['external-id-value'];

View File

@ -17,7 +17,7 @@ import {properties} from "../../../../environments/environment";
<div *ngIf="fetchResults.searchUtils.status == errorCodes.DONE && !loading">
<div class="uk-text-muted uk-text-small uk-margin-bottom">
*Only top 100 content providers that host research outcomes and are aggregated by {{collectedFromName}} are shown.
*Only top 100 content providers that host research outcomes which are also available via the Federated Research Data Repository are shown.
</div>
<no-load-paging *ngIf="results.length >pageSize"
[type]="'content providers'"

View File

@ -1,6 +1,7 @@
import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview";
import {Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core';
import {properties} from "../../../../environments/environment";
@Injectable({
providedIn: 'root'
@ -15,6 +16,8 @@ export class ParsingFunctions {
public closed = 'assets/common-assets/lock.svg';
public unknown = 'assets/common-assets/question.svg';
private instanceWithDoiExists: boolean = false;
constructor() {
}
@ -150,7 +153,7 @@ export class ParsingFunctions {
addPublisherToHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[],
publisher: string, journal: Journal,
identifiers: Map<string, string[]>/*, title: { "name": string, "url": string, "accessMode": string}*/) {
if (publisher && identifiers != null && identifiers.has('doi')) {
if (!this.instanceWithDoiExists && publisher && identifiers != null && identifiers.has('doi')) {
if (hostedBy_collectedFrom == null) {
hostedBy_collectedFrom = [];
}
@ -172,7 +175,7 @@ export class ParsingFunctions {
available.downloadName = publisher;
}
let url = "https://dx.doi.org/" + identifiers.get("doi")[0];
let url = properties.doiURL + identifiers.get("doi")[0];
available.downloadUrl = new Array<string>();
available.accessMode = new Array<string>();
@ -311,6 +314,9 @@ export class ParsingFunctions {
available.accessMode = new Array<string>();
available.downloadUrl = new Array<string>();
available['downloadUrl'].push(url);
if(url.includes("doi.org/")) {
this.instanceWithDoiExists = true;
}
if (instance.hasOwnProperty("accessright")) {
if (url) {
available['accessMode'].push(instance['accessright'].classname);
@ -352,7 +358,7 @@ export class ParsingFunctions {
} else {
available.icon = this.unknown;
}
hostedBy_collectedFrom.push(available);
}

View File

@ -25,16 +25,16 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-bold uk-text-uppercase">{{key}}: </span>
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
<a *ngIf="key=='doi'" [href]="properties.doiURL + item" target="_blank" class="uk-display-inline">
{{item}} <span class="custom-external custom-icon space"></span>
{{item}} <span class="custom-external custom-icon"></span>
</a>
<a *ngIf="key=='pmc'" [href]="properties.pmcURL + item" target="_blank">
{{item}} <span class="custom-external custom-icon space"></span>
{{item}} <span class="custom-external custom-icon"></span>
</a>
<a *ngIf="key=='pmid'" [href]="properties.pmidURL + item" target="_blank">
{{item}} <span class="custom-external custom-icon space"></span>
{{item}} <span class="custom-external custom-icon"></span>
</a>
<a *ngIf="key=='handle'" [href]="properties.handleURL + item" target="_blank">
{{item}} <span class="custom-external custom-icon space"></span>
{{item}} <span class="custom-external custom-icon"></span>
</a>
<ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container>
</ng-container>

View File

@ -1,4 +1,5 @@
import {Component, Input} from '@angular/core';
import {properties} from "../../../../environments/environment";
@Component({
selector: 'showSubjects',
@ -11,15 +12,18 @@ import {Component, Input} from '@angular/core';
<ng-container *ngIf="classifiedSubjects && classifiedSubjects.size > 0">
<div *ngFor="let key of getKeys(classifiedSubjects)" style="line-height: 20px">
<span uk-icon="tag"></span>
<span class="uk-text-bold uk-text-uppercase"> {{key}}: </span>
<span class="uk-text-bold"> {{key}}: </span>
<ng-container *ngFor="let subject of classifiedSubjects.get(key)">
<span class="uk-display-inline-block label-classified">{{subject}}</span>
<span class="uk-display-inline-block label-classified">
<span *ngIf="specialSubjects.indexOf(subject) == -1 ">{{subject}}</span>
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1" [href]="properties.domain + properties.searchLinkToAdvancedResults +'?f0=resultsubject&fv0='+getSubjectParameter(subject) ">{{subject}}</a>
</span>
</ng-container>
</div>
</ng-container>
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-break">
<span uk-icon="tag"></span>
<span class="uk-text-bold uk-text-uppercase"> free text keywords: </span>
<span class="uk-text-bold"> free text keywords: </span>
<span *ngIf="subjects && subjects.length > 0">{{subjects.join(', ')}}</span>
<span *ngIf="(subjects && subjects.length > 0) && (otherSubjects && otherSubjects.size > 0)">, </span>
<span *ngIf="otherSubjects && otherSubjects.size > 0">
@ -40,16 +44,39 @@ export class ShowSubjectsComponent {
@Input() subjects: string[];
@Input() otherSubjects: Map<string, string[]>;
@Input() classifiedSubjects: Map<string, string[]>;
properties = properties;
specialSubjects = [
"Physics::Optics",
"Astrophysics::Cosmology and Extragalactic Astrophysics",
"Computer Science::Information Theory",
"Physics::Accelerator Physics",
"Condensed Matter::Superconductivity",
"Physics::Atomic Physics",
"Computer Science::Robotics",
"Computer Science::Computer Science and Game Theory",
"Computer Science::Neural and Evolutionary Computation",
"Mathematics::Combinatorics",
"Mathematics::Probability",
"Computer Science::Operating Systems",
"lcsh:Medicine",
"lcsh:Science",
"lcsh:Biology (General)",
"lcsh:Chemistry",
"lcsh:Engineering (General). Civil engineering (General)",
"lcsh:Technology"
];
// private showClassifiedSbj: boolean = false;
constructor() {
}
ngOnInit() {
}
public getKeys(map) {
return Array.from(map.keys());
}
getSubjectParameter(param){
return '"' +encodeURIComponent(param)+'"';
}
}