[Library | Trunk]: Replace static links with property url

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59090 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-07-13 14:42:34 +00:00
parent b76db39510
commit 034a9e00a7
16 changed files with 590 additions and 707 deletions

View File

@ -1,5 +1,6 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {RouterHelper} from '../../../utils/routerHelper.class'; import {RouterHelper} from '../../../utils/routerHelper.class';
import {properties} from "../../../../../environments/environment";
//Usage Example "<project-title [project]="X" > </project-title>" //Usage Example "<project-title [project]="X" > </project-title>"
@ -8,12 +9,12 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
template: ` template: `
<span *ngIf="externalPortalUrl" class="project-title"> <span *ngIf="externalPortalUrl" class="project-title">
<span><a <span><a
[href]="externalPortalUrl + '/search/project?projectId='+project['openaireId']">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</a></span> [href]="externalPortalUrl + projectUrl + '?projectId='+project['openaireId']">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</a></span>
</span> </span>
<span *ngIf="!externalPortalUrl" class="project-title"> <span *ngIf="!externalPortalUrl" class="project-title">
<span><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" <span><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
routerLinkActive="router-link-active" routerLinkActive="router-link-active"
routerLink="/search/project">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} </a></span> [routerLink]="projectUrl">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} </a></span>
</span> </span>
<div *ngIf="project['funderName']"> <div *ngIf="project['funderName']">
@ -28,6 +29,7 @@ export class ProjectTitleFormatter {
@Input() externalPortalUrl: string = null; @Input() externalPortalUrl: string = null;
public url: string; public url: string;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public projectUrl = properties.searchLinkToProject.split('?')[0];
constructor() { constructor() {
} }

View File

@ -14,7 +14,7 @@
Claims Administrator Claims Administrator
<a *ngIf="project" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" <a *ngIf="project" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
routerLinkActive="router-link-active" routerLinkActive="router-link-active"
routerLink="/search/project" > [routerLink]="properties.searchLinkToProject.split('?')[0]">
{{project['name']}} ({{project['funderName']}}) {{project['name']}} ({{project['funderName']}})
</a> </a>

View File

@ -21,6 +21,7 @@ import {ClaimsByTokenService} from './claimsByToken.service';
import {Session} from '../../login/utils/helper.class'; import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {properties} from "../../../../environments/environment";
@Component({ @Component({
@ -69,7 +70,6 @@ export class ClaimsByTokenComponent {
public totalPendingResults:any = {count: 0}; public totalPendingResults:any = {count: 0};
public activeCuratedPage:any = {page: 1}; public activeCuratedPage:any = {page: 1};
public totalCuratedResults:any = {count: 0}; public totalCuratedResults:any = {count: 0};
dtTrigger: Subject<any>[] = []; dtTrigger: Subject<any>[] = [];
private triggered: boolean = false; private triggered: boolean = false;
@ -82,7 +82,7 @@ export class ClaimsByTokenComponent {
@ViewChild (ModalSelect) selectModal : ModalSelect; @ViewChild (ModalSelect) selectModal : ModalSelect;
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild (ModalLoading) loading : ModalLoading ;
properties:EnvProperties; properties:EnvProperties = properties;
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
@ -96,11 +96,6 @@ export class ClaimsByTokenComponent {
this.curated_status = this.errorCodes.LOADING; this.curated_status = this.errorCodes.LOADING;
} }
ngOnInit() { ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
});
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.mode = "pending"; this.mode = "pending";
this.openaireId = params['openaireId']; this.openaireId = params['openaireId'];

View File

@ -1,88 +1,90 @@
import {Component, Input,Output, EventEmitter} from '@angular/core'; import {Component, Input, Output, EventEmitter} from '@angular/core';
import {ClaimProject} from '../../claim-utils/claimHelper.class'; import {ClaimProject} from '../../claim-utils/claimHelper.class';
import {RouterHelper} from '../../../utils/routerHelper.class'; import {RouterHelper} from '../../../utils/routerHelper.class';
import {properties} from "../../../../../environments/environment";
@Component({ @Component({
selector: 'claim-selected-projects', selector: 'claim-selected-projects',
template: ` template: `
<div class="">
<div>
<div class="" > <ul class="uk-list uk-list-divider">
<li class="list-group-item" *ngFor="let project of projects">
<div> <a [queryParams]="routerHelper.createQueryParam('projectId',project.projectId)"
<!--h5 class=" uk-margin uk-h5 uk-text-primary" *ngIf="projects.length > 0 "> Selected Projects ({{projects.length | number}}) </h5--> routerLinkActive="router-link-active"
<ul class="uk-list uk-list-divider"> [routerLink]="projectUrl">{{project.funderName}}
<li class="list-group-item" *ngFor="let project of projects"> | {{project.projectName}} {{(project.projectAcronym) ? '(' + project.projectAcronym + ')' : ''}}
<a [queryParams]="routerHelper.createQueryParam('projectId',project.projectId)" routerLinkActive="router-link-active" routerLink="/search/project" >{{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} <!--[{{project.startDate}} - {{project.endDate}}]--></a> <!--[{{project.startDate}} - {{project.endDate}}]--></a>
<span (click)="removeProject(project)" aria-hidden="true" class="uk-icon-button icon-button-small "> <span (click)="removeProject(project)" aria-hidden="true" class="uk-icon-button icon-button-small ">
<span class="uk-icon"> <span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg> <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close"
</span> ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path
</span> fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</li> </span>
</ul> </span>
</div> </li>
<!--div *ngIf="projects.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any projects</div--> </ul>
</div> </div>
<!--div *ngIf="projects.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any projects</div-->
</div>`
`
}) })
export class ClaimSelectedProjectsComponent { export class ClaimSelectedProjectsComponent {
ngOnInit() { ngOnInit() {
var myDate = new Date(); var myDate = new Date();
this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; this.todayDate = (myDate.getFullYear() + "-" + myDate.getMonth() + 1) + "-" + myDate.getDate();
this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; this.nextDate = ((myDate.getFullYear() + 100) + "-" + myDate.getMonth() + 1) + "-" + myDate.getDate();
// if(this.linkType == "project"){ // if(this.linkType == "project"){
this.showsearch = true this.showsearch = true
// }else{ // }else{
// this.showsearch = false; // this.showsearch = false;
// } // }
//2015-05-01 //2015-05-01
} }
@Input() projects: ClaimProject[]; @Input() projects: ClaimProject[];
@Input() show='home'; @Input() show = 'home';
@Input() title='Projects'; @Input() title = 'Projects';
@Input() linkType:string = "project"; @Input() linkType: string = "project";
@Input() hideType; @Input() hideType;
@Input() bulkMode:boolean = false; @Input() bulkMode: boolean = false;
@Input() linkToResults:boolean = true; @Input() linkToResults: boolean = true;
@Output() projectsChange = new EventEmitter(); @Output() projectsChange = new EventEmitter();
@Output() showChange = new EventEmitter(); @Output() showChange = new EventEmitter();
showsearch:boolean = false; showsearch: boolean = false;
@Input() localStoragePrefix:string = ""; @Input() localStoragePrefix: string = "";
todayDate = ''; todayDate = '';
nextDate = ''; nextDate = '';
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public projectUrl = properties.searchLinkToProject.split('?')[0];
removeProject(item:any){
var index:number =this.projects.indexOf(item); removeProject(item: any) {
if (index > -1) { var index: number = this.projects.indexOf(item);
this.projects.splice(index, 1); if (index > -1) {
if(this.projects != null){ this.projects.splice(index, 1);
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects)); if (this.projects != null) {
} localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
} }
this.projectsChange.emit({ }
value: this.projects this.projectsChange.emit({
}); value: this.projects
} });
showType(type){ }
if(type != this.show){
this.show = type; showType(type) {
this.showChange.emit({ if (type != this.show) {
value: this.show this.show = type;
}); this.showChange.emit({
} value: this.show
} });
projectSelected($event) { }
// this.showsearch = false; }
}
projectSelected($event) {
// this.showsearch = false;
}
} }

View File

@ -1,33 +1,34 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router'; import {Router, ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser'; import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {ErrorCodes} from '../utils/properties/errorCodes'; import {ErrorCodes} from '../utils/properties/errorCodes';
import{EnvProperties} from '../utils/properties/env-properties'; import {EnvProperties} from '../utils/properties/env-properties';
import {RouterHelper} from '../utils/routerHelper.class'; import {RouterHelper} from '../utils/routerHelper.class';
import {FetchDataproviders} from '../utils/fetchEntitiesClasses/fetchDataproviders.class'; import {FetchDataproviders} from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../services/searchDataproviders.service'; import {SearchDataprovidersService} from '../services/searchDataproviders.service';
import {OrganizationService} from '../services/organization.service'; import {OrganizationService} from '../services/organization.service';
import {PiwikService} from '../utils/piwik/piwik.service'; import {PiwikService} from '../utils/piwik/piwik.service';
import { SEOService } from '../sharedComponents/SEO/SEO.service'; import {SEOService} from '../sharedComponents/SEO/SEO.service';
import {ZenodoInformationClass} from './utils/zenodoInformation.class'; import {ZenodoInformationClass} from './utils/zenodoInformation.class';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'deposit-result', selector: 'deposit-result',
template: ` template: `
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" > <div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Share {{requestFor}}" type="other"></schema2jsonld> <schema2jsonld *ngIf="url" [URL]="url" name="Share {{requestFor}}" type="other"></schema2jsonld>
<div class="uk-container "> <div class="uk-container ">
<div class="uk-article-title custom-article-title uk-margin-bottom"> <div class="uk-article-title custom-article-title uk-margin-bottom">
Share {{requestFor}} Share {{requestFor}}
</div> </div>
<helper position="top"></helper> <helper position="top"></helper>
<div class="uk-grid helper-grid"> <div class="uk-grid helper-grid">
<helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper> <helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper>
@ -51,25 +52,31 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<h4 *ngIf=" organization && (fetchDataproviders.searchUtils.status == errorCodes.DONE || <h4 *ngIf=" organization && (fetchDataproviders.searchUtils.status == errorCodes.DONE ||
(fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0))" (fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0))"
class="organization"> class="organization">
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank"> <a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
<span><i class="custom-external"></i>{{organization['name']}}</span> <span><i class="custom-external"></i>{{organization['name']}}</span>
</a> </a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span> <span *ngIf="organization['url']==''">{{organization['name']}}</span>
</h4> </h4>
<div *ngIf="subjectResults" class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted"> <div *ngIf="subjectResults" class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
<form class= "uk-margin uk-text-center uk-margin-top"> <form class="uk-margin uk-text-center uk-margin-top">
<input type="text" [(ngModel)]="subject" class=" uk-input uk-width-1-2" name="subject" placeholder="Search for classifications..." /> <input type="text" [(ngModel)]="subject" class=" uk-input uk-width-1-2" name="subject"
placeholder="Search for classifications..."/>
<button class=" uk-button portal-button" type="submit" (click)="newSubject()" > <button class=" uk-button portal-button" type="submit" (click)="newSubject()">
Search Search
</button> </button>
</form> </form>
<div *ngIf="subject.length > 0" class=" uk-text-center "> <div *ngIf="subject.length > 0" class=" uk-text-center ">
<span>Keywords: {{subject}}<span> <span>Keywords: {{subject}}<span>
<a class=" " (click)="subject=''; newSubject()"> <span aria-hidden="true" class="uk-icon-button icon-button-small "> <a class=" " (click)="subject=''; newSubject()"> <span aria-hidden="true"
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg> class="uk-icon-button icon-button-small ">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.06"
d="M16,16 L4,4"></path><path fill="none" stroke="#000"
stroke-width="1.06"
d="M16,4 L4,16"></path></svg>
</span> </span>
</a> </a>
@ -78,63 +85,83 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div> </div>
</div> </div>
<p class="uk-text-meta" <p class="uk-text-meta"
*ngIf=" fetchDataproviders.searchUtils.status == errorCodes.DONE || *ngIf=" fetchDataproviders.searchUtils.status == errorCodes.DONE ||
(fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0)"> (fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0)">
Please use the information below and contact your repository to deposit your <span class="uk-text-lowercase">{{requestFor}}</span>. Please use the information below and contact your repository to deposit your <span
class="uk-text-lowercase">{{requestFor}}</span>.
</p> </p>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE || <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE ||
(fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0)" (fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0)"
class="uk-align-center uk-margin-remove-bottom"> class="uk-align-center uk-margin-remove-bottom">
<search-paging [type]="'content providers'" [(searchUtils)] = "fetchDataproviders.searchUtils" [(results)] = "fetchDataproviders.results" <search-paging [type]="'content providers'" [(searchUtils)]="fetchDataproviders.searchUtils"
[(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" [(results)]="fetchDataproviders.results"
[loadPaging]="fetchDataproviders.loadPaging" [oldTotalResults]="fetchDataproviders.oldTotalResults"> [(parameterNames)]="parameterNames" [(parameterValues)]="parameterValues"
[loadPaging]="fetchDataproviders.loadPaging"
[oldTotalResults]="fetchDataproviders.oldTotalResults">
</search-paging> </search-paging>
</div> </div>
<div *ngIf="status == errorCodes.LOADING || fetchDataproviders.searchUtils.status == errorCodes.LOADING" <div *ngIf="status == errorCodes.LOADING || fetchDataproviders.searchUtils.status == errorCodes.LOADING"
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span> class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span>
</div> </div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE" class=" uk-margin uk-margin-remove-top other-results"> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE"
<div *ngFor="let result of fetchDataproviders.results" [title] = "result.compatibilityUNKNOWN ? 'Incompatible content provider' : ''" [class]="'uk-margin-small-top uk-card uk-padding-small uk-animation-fade '+(result.compatibilityUNKNOWN ? 'li-disabled ' : 'uk-card-default' ) "> class=" uk-margin uk-margin-remove-top other-results">
<div *ngFor="let result of fetchDataproviders.results"
[title]="result.compatibilityUNKNOWN ? 'Incompatible content provider' : ''"
[class]="'uk-margin-small-top uk-card uk-padding-small uk-animation-fade '+(result.compatibilityUNKNOWN ? 'li-disabled ' : 'uk-card-default' ) ">
<h5> <h5>
<span *ngIf="!result.compatibilityUNKNOWN" class="" title ="Compatible Content Provider" > <span *ngIf="!result.compatibilityUNKNOWN" class="" title="Compatible Content Provider">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1" points="4,10 8,15 17,4"></polyline></svg> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check"
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1"
points="4,10 8,15 17,4"></polyline></svg>
</span> </span>
<a *ngIf="!result.compatibilityUNKNOWN" [queryParams]="{datasourceId: result.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"> <a *ngIf="!result.compatibilityUNKNOWN" [queryParams]="{datasourceId: result.id}"
routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
<span *ngIf="result['title'].name" [innerHTML]="result['title'].name"></span> <span *ngIf="result['title'].name" [innerHTML]="result['title'].name"></span>
<span *ngIf="!result['title'].name">[no title available]</span> <span *ngIf="!result['title'].name">[no title available]</span>
</a> </a>
<p *ngIf="result.compatibilityUNKNOWN && result['title'].name" [innerHTML]="result['title'].name"></p> <p *ngIf="result.compatibilityUNKNOWN && result['title'].name"
[innerHTML]="result['title'].name"></p>
<p *ngIf="result.compatibilityUNKNOWN && !result['title'].name">[no title available]</p> <p *ngIf="result.compatibilityUNKNOWN && !result['title'].name">[no title available]</p>
</h5> </h5>
<approved-by-community [contentProviderId]="result.id"></approved-by-community> <approved-by-community [contentProviderId]="result.id"></approved-by-community>
<span *ngIf="result['type'] != undefined && result['type'] != ''" class="uk-label custom-label label-blue label-dataprovider" title="Type"> {{result['type']}}</span> <span *ngIf="result['type'] != undefined && result['type'] != ''"
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''" class="uk-label custom-label label-compatibility" title="Compatibility">{{result.compatibility}}</span> class="uk-label custom-label label-blue label-dataprovider"
title="Type"> {{result['type']}}</span>
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''"
class="uk-label custom-label label-compatibility"
title="Compatibility">{{result.compatibility}}</span>
<div *ngIf="subjectResults && result['organizations'] != undefined && result['organizations'].length > 0"> <div
<span> Organization: </span> *ngIf="subjectResults && result['organizations'] != undefined && result['organizations'].length > 0">
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index"> <span> Organization: </span>
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index">
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"--> <!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> <a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}"
routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
{{organization.name}}</a><span {{organization.name}}</a><span
*ngIf="!organization.id"> *ngIf="!organization.id">
{{organization.name}}</span><span {{organization.name}}</span><span
*ngIf="(i < result['organizations'].length-1) && (i < 9)">,</span> *ngIf="(i < result['organizations'].length-1) && (i < 9)">,</span>
</span> </span>
<span *ngIf="result['organizations'].length > 10">...</span> <span *ngIf="result['organizations'].length > 10">...</span>
</div> </div>
<div *ngIf="result['countries'] && result['countries'].length > 0"> <div *ngIf="result['countries'] && result['countries'].length > 0">
Country: <span *ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < ( result['countries'].slice(0,10).length-1))?", ":""}}{{(i == result['countries'].slice(0,10).length-1 && result['countries'].length > 10)?"...":""}}</span> Country: <span
*ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < (result['countries'].slice(0, 10).length - 1)) ? ", " : ""}}{{(i == result['countries'].slice(0, 10).length - 1 && result['countries'].length > 10) ? "..." : ""}}</span>
</div> </div>
<div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''"> <div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span> <span>Website URL: </span>
<span> <span>
<a href="{{result['websiteURL']}}" target="_blank" class="custom-external custom-icon"> <a href="{{result['websiteURL']}}" target="_blank" class="custom-external custom-icon">
{{result['websiteURL']}} {{result['websiteURL']}}
</a> </a>
@ -142,7 +169,7 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div> </div>
<div *ngIf="result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''"> <div *ngIf="result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''">
<span>OAI-PMH URL: </span> <span>OAI-PMH URL: </span>
<span> <span>
<a href="{{result['OAIPMHURL']}}" target="_blank" class="custom-external custom-icon"> <a href="{{result['OAIPMHURL']}}" target="_blank" class="custom-external custom-icon">
{{result['OAIPMHURL']}} {{result['OAIPMHURL']}}
</a> </a>
@ -150,50 +177,52 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div> </div>
<div *ngIf="subjectResults && result['subjects'] && result['subjects'].length > 0"> <div *ngIf="subjectResults && result['subjects'] && result['subjects'].length > 0">
Subject: <span *ngFor="let subject of result['subjects'].slice(0,10) let i = index">{{subject}}{{(i < ( result['subjects'].slice(0,10).length-1))?", ":""}}{{(i == result['subjects'].slice(0,10).length-1 && result['subjects'].length > 10)?"...":""}}</span> Subject: <span
*ngFor="let subject of result['subjects'].slice(0,10) let i = index">{{subject}}{{(i < (result['subjects'].slice(0, 10).length - 1)) ? ", " : ""}}{{(i == result['subjects'].slice(0, 10).length - 1 && result['subjects'].length > 10) ? "..." : ""}}</span>
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="!subjectResults"> <div *ngIf="!subjectResults">
<div *ngIf="status == errorCodes.NOT_FOUND || status == errorCodes.ERROR || <div *ngIf="status == errorCodes.NOT_FOUND || status == errorCodes.ERROR ||
status == errorCodes.NOT_AVAILABLE || status == errorCodes.NONE" class = "alert alert-warning"> status == errorCodes.NOT_AVAILABLE || status == errorCodes.NONE"
<div *ngIf="status == errorCodes.NOT_FOUND && organizationId != ''"> class="alert alert-warning">
No organization with ID: {{organizationId}} found. <div *ngIf="status == errorCodes.NOT_FOUND && organizationId != ''">
</div> No organization with ID: {{organizationId}} found.
<div *ngIf="status == errorCodes.ERROR && organizationId != ''"> </div>
An error occured. <div *ngIf="status == errorCodes.ERROR && organizationId != ''">
</div> An error occured.
<span *ngIf="status == errorCodes.NOT_AVAILABLE && organizationId != ''"> </div>
<span *ngIf="status == errorCodes.NOT_AVAILABLE && organizationId != ''">
Service temprorarily unavailable. Please try again later. Service temprorarily unavailable. Please try again later.
</span> </span>
<div *ngIf="status == errorCodes.NONE"> <div *ngIf="status == errorCodes.NONE">
No ID for organization. No ID for organization.
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="status == errorCodes.DONE && fetchDataproviders.searchUtils.status != errorCodes.DONE <div *ngIf="status == errorCodes.DONE && fetchDataproviders.searchUtils.status != errorCodes.DONE
&& fetchDataproviders.searchUtils.status != errorCodes.LOADING" class = "alert alert-warning"> && fetchDataproviders.searchUtils.status != errorCodes.LOADING" class="alert alert-warning">
<span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR"> <span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR">
An error occured. An error occured.
</span> </span>
<span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE"> <span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE">
Service temprorarily unavailable. Please try again later. Service temprorarily unavailable. Please try again later.
</span> </span>
<span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.OUT_OF_BOUND"> <span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.OUT_OF_BOUND">
Requested page out of bounds. Requested page out of bounds.
</span> </span>
<div *ngIf="!subjectResults"> <div *ngIf="!subjectResults">
No content providers found for institution: No content providers found for institution:
<a *ngIf="organization['url']!=''" target="_blank" href="{{organization.url}}"> <a *ngIf="organization['url']!=''" target="_blank" href="{{organization.url}}">
<span>{{organization['name']}} (<i class="custom-external"></i>)</span> <span>{{organization['name']}} (<i class="custom-external"></i>)</span>
</a> </a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span> <span *ngIf="organization['url']==''">{{organization['name']}}</span>
. .
</div> </div>
<div *ngIf="subjectResults"> <div *ngIf="subjectResults">
No content providers found<span *ngIf="subject != ''"> with classification "{{subject}}"</span>. No content providers found<span *ngIf="subject != ''"> with classification "{{subject}}"</span>.
</div> </div>
</div> </div>
</div> </div>
@ -202,7 +231,8 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<div class="uk-card uk-card-default uk-card-body portal-card"> <div class="uk-card uk-card-default uk-card-body portal-card">
Deposit your {{requestFor}} in Deposit your {{requestFor}} in
<a href="{{zenodoInformation.url}}" target="_blank" uk-tooltip="title: Zenodo is OpenAIRE's catch-all repository hosted by CERN."> <a href="{{zenodoInformation.url}}" target="_blank"
uk-tooltip="title: Zenodo is OpenAIRE's catch-all repository hosted by CERN.">
{{zenodoInformation.name}} (<i class="custom-external"></i>)</a> {{zenodoInformation.name}} (<i class="custom-external"></i>)</a>
<div class="uk-margin-top" *ngIf="zenodoInformation && zenodoInformation.shareInZenodoUrl"> <div class="uk-margin-top" *ngIf="zenodoInformation && zenodoInformation.shareInZenodoUrl">
<a href="{{zenodoInformation.shareInZenodoUrl}}">More Zenodo communities</a> <a href="{{zenodoInformation.shareInZenodoUrl}}">More Zenodo communities</a>
@ -216,16 +246,20 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<helper position="right" before="false"></helper> <helper position="right" before="false"></helper>
</div> </div>
</div> </div>
<button class=" uk-button uk-button-primary uk-margin-small-top" type="submit" (click)="goToDeposit()"> <button class=" uk-button uk-button-primary uk-margin-small-top" type="submit" (click)="goToDeposit()">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-left" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span> Back <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline fill="none" stroke="#000"
stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
Back
</button> </button>
<helper position="bottom"></helper> <helper position="bottom"></helper>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
` `
}) })
export class DepositResultComponent { export class DepositResultComponent {
@ -234,208 +268,206 @@ export class DepositResultComponent {
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
// Type of entity: Publication or Research Data // Type of entity: Publication or Research Data
@Input() requestFor: string = "Publications"; @Input() requestFor: string = "Publications";
public organization: {"name": string, "url": string}; public organization: { "name": string, "url": string };
public organizationId: string = ""; public organizationId: string = "";
// Id of the new selected organization to be searched // Id of the new selected organization to be searched
public selectedId: string = ""; public selectedId: string = "";
@Input() subjectResults: boolean = false; @Input() subjectResults: boolean = false;
@Input() subject: string = ""; @Input() subject: string = "";
public status: number; public status: number;
public warningMessage: string = ""; public warningMessage: string = "";
public fetchDataproviders : FetchDataproviders; public fetchDataproviders: FetchDataproviders;
public linkToSearchDataproviders: string = ""; public linkToSearchDataproviders: string = "";
public parameterNames:string[] =[]; public parameterNames: string[] = [];
public parameterValues:string[] =[]; public parameterValues: string[] = [];
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
sub: any;
sub: any; piwiksub: any; piwiksub: any;
properties:EnvProperties; properties: EnvProperties = properties;
url=null; url = null;
constructor ( private _router: Router, constructor(private _router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _organizationService: OrganizationService, private _organizationService: OrganizationService,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _piwikService:PiwikService, private _piwikService: PiwikService,
private seoService: SEOService) { private seoService: SEOService) {
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
var title = "Deposit "+this.requestFor; var title = "Deposit " + this.requestFor;
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor; var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit " + this.requestFor;
this.updateTitle(title); this.updateTitle(title);
this.updateDescription(description); this.updateDescription(description);
}
ngOnInit() {
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false);
this.updateUrl(this.properties.baseLink + this._router.url);
this.url = this.properties.baseLink + this._router.url;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, "Deposit " + this.requestFor, this.piwikSiteId).subscribe();
} }
ngOnInit() { this.sub = this.route.queryParams.subscribe(params => {
this.route.data this.fetchDataproviders.searchUtils.page = (params['page'] === undefined) ? 1 : +params['page'];
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; if (this.subjectResults) {
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false); this.status = this.errorCodes.DONE;
this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.url = data.envSpecific.baseLink+this._router.url; this.subject = params['subject'];
if (!this.subject) {
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ this.subject = "";
this.piwiksub = this._piwikService.trackView(this.properties, "Deposit "+this.requestFor, this.piwikSiteId).subscribe();
}
});
this.sub = this.route.queryParams.subscribe(params => {
this.fetchDataproviders.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
if(this.subjectResults) {
this.status = this.errorCodes.DONE;
this.subject = params['subject'];
if(!this.subject) {
this.subject = "";
}
this.parameterNames.push('subject');
this.parameterValues.push(this.subject);
this.searchDataprovidersBySubject();
} else {
if(this.organizationId) {
this.searchDataproviders();
} else {
this.organizationId = params['organizationId'];
this.parameterNames.push('organizationId');
this.parameterValues.push(this.organizationId);
if(this.organizationId){
this.getOrganizationInfo();
}
}
this.selectedId = "";
}
});
}
ngDoCheck() {
if(!this.subjectResults && (this.organizationId == "" || this.organizationId == undefined)) {
this.organizationId = "";
this.status = this.errorCodes.NONE;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
} }
}
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
}
public newSubject() {
this._router.navigate( ['participate/deposit-subject-result'], { queryParams: { "subject": this.subject } } );
}
public searchDataprovidersBySubject() {
this.parameterNames = [];
this.parameterValues = [];
this.parameterNames.push('subject'); this.parameterNames.push('subject');
this.parameterValues.push(this.subject); this.parameterValues.push(this.subject);
this.fetchDataproviders.getResultsBySubjectsForDeposit( (this.subject =="")?"*":this.subject, this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties); this.searchDataprovidersBySubject();
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders; } else {
} if (this.organizationId) {
this.searchDataproviders();
private searchDataproviders() {
// if(this.organization != undefined) {
// this.fetchDataproviders.getResults(this.organization.name, false, 1, 10);
// } else if(this.organizationId != undefined) {
this.fetchDataproviders.getResultsForDeposit( this.organizationId,this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties);
//}
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
}
private getOrganizationInfo () {
this.fetchDataproviders.oldTotalResults = 0;
this.fetchDataproviders.searchUtils.totalResults = 0;
this._organizationService.getOrganizationNameAndUrlById(this.organizationId,this.properties).subscribe(
data => {
if(data == null) {
this.status = this.errorCodes.NOT_FOUND;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
} else {
this.organization = data;
this.status = this.errorCodes.DONE;
this.searchDataproviders();
}
},
err => {
//console.log(err)
this.handleError("Error getting organization name and url for id: "+this.organizationId, err);
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
if(err.status == '404') {
this.status = this.errorCodes.NOT_FOUND;
} else if(err.status == '500') {
this.status = this.errorCodes.ERROR;
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
}
}
);
}
public goToDeposit() {
if(this.requestFor == "Publications") {
this._router.navigate( ['participate/deposit-publications'] );
} else if(this.requestFor == "Research Data") {
this._router.navigate( ['participate/deposit-datasets'] );
}
}
public valueChanged($event){
this.selectedId = $event.value;
}
public organizationSelected(id: string) {
if(id && id.length > 0 && id != this.organizationId){
this.organization = null;
this.status = this.errorCodes.LOADING;
if(this.requestFor == "Publications") {
this._router.navigate( ['participate/deposit-publications-result'], { queryParams: { "organizationId": id } } );
} else if(this.requestFor == "Research Data") {
this._router.navigate( ['participate/deposit-datasets-result'], { queryParams: { "organizationId": id } } );
}
} else { } else {
this.warningMessage = "No new organization selected"; this.organizationId = params['organizationId'];
this.parameterNames.push('organizationId');
this.parameterValues.push(this.organizationId);
if (this.organizationId) {
this.getOrganizationInfo();
}
} }
this.selectedId = "";
}
});
}
ngDoCheck() {
if (!this.subjectResults && (this.organizationId == "" || this.organizationId == undefined)) {
this.organizationId = "";
this.status = this.errorCodes.NONE;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
} }
}
private updateDescription(description:string) {
this._meta.updateTag({content:description},"name='description'"); ngOnDestroy() {
this._meta.updateTag({content:description},"property='og:description'"); this.sub.unsubscribe();
if (this.piwiksub) {
this.piwiksub.unsubscribe();
} }
private updateTitle(title:string){ }
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); public newSubject() {
this._title.setTitle(_title); this._router.navigate(['participate/deposit-subject-result'], {queryParams: {"subject": this.subject}});
this._meta.updateTag({content:_title},"property='og:title'"); }
public searchDataprovidersBySubject() {
this.parameterNames = [];
this.parameterValues = [];
this.parameterNames.push('subject');
this.parameterValues.push(this.subject);
this.fetchDataproviders.getResultsBySubjectsForDeposit((this.subject == "") ? "*" : this.subject, this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties);
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
}
private searchDataproviders() {
// if(this.organization != undefined) {
// this.fetchDataproviders.getResults(this.organization.name, false, 1, 10);
// } else if(this.organizationId != undefined) {
this.fetchDataproviders.getResultsForDeposit(this.organizationId, this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties);
//}
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
}
private getOrganizationInfo() {
this.fetchDataproviders.oldTotalResults = 0;
this.fetchDataproviders.searchUtils.totalResults = 0;
this._organizationService.getOrganizationNameAndUrlById(this.organizationId, this.properties).subscribe(
data => {
if (data == null) {
this.status = this.errorCodes.NOT_FOUND;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
} else {
this.organization = data;
this.status = this.errorCodes.DONE;
this.searchDataproviders();
}
},
err => {
//console.log(err)
this.handleError("Error getting organization name and url for id: " + this.organizationId, err);
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
if (err.status == '404') {
this.status = this.errorCodes.NOT_FOUND;
} else if (err.status == '500') {
this.status = this.errorCodes.ERROR;
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
}
}
);
}
public goToDeposit() {
if (this.requestFor == "Publications") {
this._router.navigate(['participate/deposit-publications']);
} else if (this.requestFor == "Research Data") {
this._router.navigate(['participate/deposit-datasets']);
} }
private updateUrl(url:string){ }
this._meta.updateTag({content:url},"property='og:url'");
} public valueChanged($event) {
this.selectedId = $event.value;
private handleError(message: string, error) { }
console.error("Deposit Result Page: "+message, error);
public organizationSelected(id: string) {
if (id && id.length > 0 && id != this.organizationId) {
this.organization = null;
this.status = this.errorCodes.LOADING;
if (this.requestFor == "Publications") {
this._router.navigate(['participate/deposit-publications-result'], {queryParams: {"organizationId": id}});
} else if (this.requestFor == "Research Data") {
this._router.navigate(['participate/deposit-datasets-result'], {queryParams: {"organizationId": id}});
}
} else {
this.warningMessage = "No new organization selected";
} }
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "OpenAIRE | ";
var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private handleError(message: string, error) {
console.error("Deposit Result Page: " + message, error);
}
} }

View File

@ -16,7 +16,6 @@
<span><span>Deposit in Zenodo</span><span uk-icon="arrow-right"></span></span> <span><span>Deposit in Zenodo</span><span uk-icon="arrow-right"></span></span>
</a> </a>
</div> </div>
<ul class="uk-margin-top uk-list uk-margin search-results "> <ul class="uk-margin-top uk-list uk-margin search-results ">
<li *ngFor="let result of results" class="uk-animation-fade"> <li *ngFor="let result of results" class="uk-animation-fade">
<div class="uk-card uk-card-default uk-padding uk-card-hover"> <div class="uk-card uk-card-default uk-padding uk-card-hover">
@ -25,65 +24,4 @@
</result-preview> </result-preview>
</div> </div>
</li> </li>
<!--<li *ngFor="let result of results" class="uk-animation-fade">
<div class=" uk-card uk-card-small uk-card-default uk-card-body uk-padding-remove-horizontal">
<h3 class="uk-card-title uk-margin-remove uk-padding uk-padding-remove-vertical">
<div [title] = result.title.accessMode class="uk-h5 uk-grid uk-margin-small-bottom">
<a *ngIf="result.id && !result.compatibilityUNKNOWN" class="uk-width-expand uk-text-bold uk-flex uk-flex-middle"
[queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
<p *ngIf="result['title'].name || result.acronym"><span *ngIf="result.acronym">{{result.acronym}}</span><span *ngIf="result.acronym && result['title'].name">-</span><span *ngIf="result['title'].name" [innerHTML]="result['title'].name"></span><span *ngIf="result.code"> ({{result.code}})</span></p>
<p *ngIf="!result['title'].name && !result.acronym">[no title available]<span *ngIf="result.code"> ({{result.code}})</span></p>
</a>
<div *ngIf="!result.id || result.compatibilityUNKNOWN" class="uk-width-expand uk-text-bold uk-flex uk-flex-middle">
<p *ngIf="result['title'].name || result.acronym"><span *ngIf="result.acronym">{{result.acronym}}</span><span *ngIf="result.acronym && result['title'].name">-</span><span *ngIf="result['title'].name" [innerHTML]="result['title'].name"></span><span *ngIf="result.code"> ({{result.code}})</span></p>
<p *ngIf="!result['title'].name && !result.acronym">[no title available]<span *ngIf="result.code"> ({{result.code}})</span></p>
</div>
<span class="uk-width-expand uk-flex uk-flex-bottom uk-flex-right">
<a *ngIf="result['websiteURL']" href="{{result['websiteURL']}}" target="_blank" type="submit" class="uk-float-right uk-button portal-button uk-padding uk-padding-remove-vertical uk-margin-small-left">
<span><span>Go to website</span><span uk-icon="arrow-right"></span></span>
&lt;!&ndash; <span class="uk-button-text ">Visit repository to deposit</span>&ndash;&gt;
</a>
</span>
</div>
</h3>
<hr>
<div class="uk-padding uk-padding-remove-vertical">
<span *ngIf="result['type'] != undefined && result['type'] != ''" class="uk-label custom-label label-blue label-dataprovider" title="Type"> {{result['type']}}</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] != 'not available'" class="uk-label custom-label label-compatibility" title="OpenAIRE Compatibility">{{result.compatibility}}</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] == 'not available'" class="uk-label custom-label label-danger" title="OpenAIRE Compatibility">Not yet registered</span>{{' '}}
<div class="uk-margin-top" *ngIf="result['countries'] && result['countries'].length > 0">
<div class="uk-text-muted">Countries</div>
<span *ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < ( result['countries'].slice(0,10).length-1))?"; ":""}}{{(i == result['countries'].slice(0,10).length-1 && result['countries'].length > 10)?"...":""}}</span>
</div>
<div class="uk-margin-top" *ngIf="result['organizations'] != undefined && result['organizations'].length > 0">
<div class="uk-text-muted">Organizations</div>
<div>
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index">
<a *ngIf="organization.id && !result.compatibilityUNKNOWN" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
<u>{{organization.name}}</u>
</a>
<span *ngIf="!organization.id || result.compatibilityUNKNOWN">{{organization.name}}</span>
<span *ngIf="(i < result['organizations'].length-1) && (i < 9)">;{{" "}}</span>
</span>
<span *ngIf="result['organizations'].length > 10">...</span>
</div>
</div>
<div class="uk-margin-top" *ngIf="result['subjects'] && result['subjects'].length > 0">
<div class="uk-text-muted">Subjects</div>
<span *ngFor="let subject of result['subjects'].slice(0,10) let i = index">{{subject}}{{(i < ( result['subjects'].slice(0,10).length-1))?"; ":""}}{{(i == result['subjects'].slice(0,10).length-1 && result['subjects'].length > 10)?"...":""}}</span>
</div>
<div class="uk-margin-top" *ngIf="result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''">
<div class="uk-text-muted">OAI-PMH</div>
<span>
<a href="{{result['OAIPMHURL']}}" target="_blank" class="custom-external custom-icon">
<u>{{result['OAIPMHURL']}}</u>
</a>
</span>
</div>
</div>
&lt;!&ndash; <p>Lorem ipsum <a href="#">dolor</a> sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>&ndash;&gt;
</div>
</li>-->
</ul> </ul>

View File

@ -41,7 +41,7 @@
title="Compatibility"> title="Compatibility">
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider"> [routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
@ -49,7 +49,7 @@
</span> </span>
<a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id" <a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
routerLink="/search/dataprovider"> [routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{dataProviderInfo.compatibility.name}} {{dataProviderInfo.compatibility.name}}
</a> </a>
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id"> <span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
@ -212,7 +212,7 @@
[title]="organization.name"> [title]="organization.name">
<a *ngIf="organization.id" <a *ngIf="organization.id"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
routerLink="/search/organization"> [routerLink]="properties.searchLinkToOrganization.split('?')[0]">
<u>{{(organization.acronym) ? organization.acronym : ''}}</u> <u>{{(organization.acronym) ? organization.acronym : ''}}</u>
<u>{{(!organization.acronym && organization.name) ? organization.name : ''}}</u> <u>{{(!organization.acronym && organization.name) ? organization.name : ''}}</u>
</a> </a>

View File

@ -25,6 +25,7 @@ import {StringUtils} from "../../utils/string-utils.class";
import {SearchResult} from "../../utils/entities/searchResult"; import {SearchResult} from "../../utils/entities/searchResult";
import {ResultPreview} from "../../utils/result-preview/result-preview"; import {ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service"; import {IndexInfoService} from "../../utils/indexInfo.service";
import {properties} from "../../../../environments/environment";
@Component({ @Component({
@ -37,16 +38,16 @@ export class DataProviderComponent {
@Input() communityId = null; @Input() communityId = null;
public dataProviderInfo: DataProviderInfo; public dataProviderInfo: DataProviderInfo;
public datasourceId: string; public datasourceId: string;
// Message variables // Message variables
public warningMessage = ""; public warningMessage = "";
public errorMessage = ""; public errorMessage = "";
public showLoading: boolean = true; public showLoading: boolean = true;
// Variable to specify requests with either collectedFrom or hostedBy // Variable to specify requests with either collectedFrom or hostedBy
public paramsForSearchLink = {}; public paramsForSearchLink = {};
public resultParamsForSearchLink = {}; public resultParamsForSearchLink = {};
// Metrics tab variables // Metrics tab variables
public metricsClicked: boolean; public metricsClicked: boolean;
public viewsFrameUrl: string; public viewsFrameUrl: string;
@ -54,7 +55,7 @@ export class DataProviderComponent {
public totalViews: number; public totalViews: number;
public totalDownloads: number; public totalDownloads: number;
public pageViews: number; public pageViews: number;
// Statistics tab variables // Statistics tab variables
public statsClicked: boolean = false; public statsClicked: boolean = false;
public docsTimelineUrl: string; public docsTimelineUrl: string;
@ -62,10 +63,10 @@ export class DataProviderComponent {
public docsFunderUrl: string; public docsFunderUrl: string;
public dataProjectsUrl: string; public dataProjectsUrl: string;
public pubsProjectsUrl: string; public pubsProjectsUrl: string;
@ViewChild('statisticsModal') statisticsModal; @ViewChild('statisticsModal') statisticsModal;
@ViewChild('relatedDatasourcesModal') relatedDatasourcesModal; @ViewChild('relatedDatasourcesModal') relatedDatasourcesModal;
// Variables for publications, research data, projects, content providers, related content providers tabs // Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications: FetchResearchResults; public fetchPublications: FetchResearchResults;
public fetchDatasets: FetchResearchResults; public fetchDatasets: FetchResearchResults;
@ -79,24 +80,24 @@ export class DataProviderComponent {
public fetchAggregatorsOrps: FetchResearchResults; public fetchAggregatorsOrps: FetchResearchResults;
public fetchAggregatorsResults: FetchResearchResults; public fetchAggregatorsResults: FetchResearchResults;
public searchNumber: number = 5; public searchNumber: number = 5;
public aggregationStatusIsInitialized: boolean = false; public aggregationStatusIsInitialized: boolean = false;
public loadingRelatedDatasources: boolean = true; public loadingRelatedDatasources: boolean = true;
// Active tab variable for responsiveness - show tabs only if main request is completed // Active tab variable for responsiveness - show tabs only if main request is completed
public activeTab: string = ""; public activeTab: string = "";
public showTabs: boolean = false; public showTabs: boolean = false;
public firstTab: string = ""; public firstTab: string = "";
public _numberOfTabs: number = 0; public _numberOfTabs: number = 0;
public tabsAreInitialized: boolean = false; public tabsAreInitialized: boolean = false;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null; public pageContents = null;
public divContents = null; public divContents = null;
// Request results of each tab only the one time (first time tab is clicked) // Request results of each tab only the one time (first time tab is clicked)
private reloadPublications: boolean = true; private reloadPublications: boolean = true;
private reloadDatasets: boolean = true; private reloadDatasets: boolean = true;
@ -105,29 +106,29 @@ export class DataProviderComponent {
private reloadProjects: boolean = true; private reloadProjects: boolean = true;
private reloadDataproviders: boolean = true; private reloadDataproviders: boolean = true;
private reloadRelatedDatasources: boolean = true; private reloadRelatedDatasources: boolean = true;
// Organizations variables for view more/less functionality // Organizations variables for view more/less functionality
public thresholdOrganizations: number = 20; public thresholdOrganizations: number = 20;
public showNumOrganizations: number = 20; public showNumOrganizations: number = 20;
// Subjects variables for view more/less functionality // Subjects variables for view more/less functionality
public thresholdSubjects: number = 20; public thresholdSubjects: number = 20;
public showNumSubjects: number = 20; public showNumSubjects: number = 20;
// Description variables for view more/less functionality // Description variables for view more/less functionality
public thresholdDescription: number = 670; public thresholdDescription: number = 670;
public showNumDescription: number = 670; public showNumDescription: number = 670;
public indexUpdateDate: Date; public indexUpdateDate: Date;
public showFeedback: boolean = false; public showFeedback: boolean = false;
public feedbackFields: string [] = ['Name', 'Organizations','Country', 'Other']; public feedbackFields: string [] = ['Name', 'Organizations', 'Country', 'Other'];
sub: any; sub: any;
piwiksub: any; piwiksub: any;
subInfo: any; subInfo: any;
relatedDatasourcesSub: any; relatedDatasourcesSub: any;
properties: EnvProperties; properties: EnvProperties = properties;
constructor(private _dataproviderService: DataProviderService, constructor(private _dataproviderService: DataProviderService,
private _piwikService: PiwikService, private _piwikService: PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -147,43 +148,43 @@ export class DataProviderComponent {
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService); this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
this.fetchProjects = new FetchProjects(this._searchProjectsService); this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
} }
ngOnInit() { ngOnInit() {
this.route.data if (typeof document !== 'undefined') {
.subscribe((data: { envSpecific: EnvProperties }) => { this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
this.properties = data.envSpecific; if (lastIndexUpdate) {
if (typeof document !== 'undefined') { this.indexUpdateDate = new Date(lastIndexUpdate);
this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { } else if (this.properties.lastIndexUpdate) {
if (lastIndexUpdate) { this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
this.indexUpdateDate = new Date(lastIndexUpdate);
} else if (this.properties.lastIndexUpdate) {
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
}
});
} }
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
}); });
}
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.baseLink + this._router.url);
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider"); this.updateTitle("Content provider");
this.updateDescription(""); this.updateDescription("");
this.datasourceId = data['datasourceId']; this.datasourceId = data['datasourceId'];
if (this.datasourceId && StringUtils.isOpenAIREID(this.datasourceId)) { if (this.datasourceId && StringUtils.isOpenAIREID(this.datasourceId)) {
this.initializeValues(); this.initializeValues();
this.getDataProviderInfo(this.datasourceId); this.getDataProviderInfo(this.datasourceId);
} else { } else {
this.showLoading = false; this.showLoading = false;
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "dataprovider"}}); this._router.navigate(['/error'], {
queryParams: {
"page": this._location.path(true),
"page_type": "dataprovider"
}
});
} }
HelperFunctions.scroll(); HelperFunctions.scroll();
}); });
} }
public initializeValues() { public initializeValues() {
this._numberOfTabs = 0; this._numberOfTabs = 0;
this.tabsAreInitialized = false; this.tabsAreInitialized = false;
@ -204,19 +205,19 @@ export class DataProviderComponent {
this.statsClicked = false; this.statsClicked = false;
this.metricsClicked = false; this.metricsClicked = false;
} }
private getPageContents() { private getPageContents() {
this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents; this.pageContents = contents;
}) })
} }
private getDivContents() { private getDivContents() {
this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.divContents = contents; this.divContents = contents;
}) })
} }
ngOnDestroy() { ngOnDestroy() {
if (this.sub) { if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
@ -227,19 +228,19 @@ export class DataProviderComponent {
if (this.subInfo) { if (this.subInfo) {
this.subInfo.unsubscribe(); this.subInfo.unsubscribe();
} }
if (this.relatedDatasourcesSub) { if (this.relatedDatasourcesSub) {
this.relatedDatasourcesSub.unsubscribe(); this.relatedDatasourcesSub.unsubscribe();
} }
} }
private getDataProviderInfo(id: string) { private getDataProviderInfo(id: string) {
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage = ""; this.errorMessage = "";
this.showLoading = true; this.showLoading = true;
this.dataProviderInfo = null; this.dataProviderInfo = null;
this.showTabs = false; this.showTabs = false;
if (this.datasourceId == null || this.datasourceId == '') { if (this.datasourceId == null || this.datasourceId == '') {
this.showLoading = false; this.showLoading = false;
@ -263,9 +264,9 @@ export class DataProviderComponent {
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
} }
this.showLoading = false; this.showLoading = false;
// if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { // if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
// this.activeTab = this.dataProviderInfo.tabs[0].name; // this.activeTab = this.dataProviderInfo.tabs[0].name;
// } // }
@ -273,8 +274,13 @@ export class DataProviderComponent {
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting content provider for id: " + this.datasourceId, err); this.handleError("Error getting content provider for id: " + this.datasourceId, err);
if(err.status == 404) { if (err.status == 404) {
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "dataprovider"}}); this._router.navigate(['/error'], {
queryParams: {
"page": this._location.path(true),
"page_type": "dataprovider"
}
});
} }
this.errorMessage = 'No dataProvider found'; this.errorMessage = 'No dataProvider found';
this.showLoading = false; this.showLoading = false;
@ -283,7 +289,7 @@ export class DataProviderComponent {
); );
} }
} }
private getDataProviderAggregationStatus(originalId: string) { private getDataProviderAggregationStatus(originalId: string) {
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe( this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
data => { data => {
@ -298,12 +304,12 @@ export class DataProviderComponent {
} }
); );
} }
private updateDescription(description: string) { private updateDescription(description: string) {
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'"); this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'"); this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
} }
private updateTitle(title: string) { private updateTitle(title: string) {
var _prefix = ""; var _prefix = "";
// if(this.communityId) { // if(this.communityId) {
@ -313,51 +319,51 @@ export class DataProviderComponent {
this._title.setTitle(title); this._title.setTitle(title);
this._meta.updateTag({content: title}, "property='og:title'"); this._meta.updateTag({content: title}, "property='og:title'");
} }
private updateUrl(url: string) { private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'"); this._meta.updateTag({content: url}, "property='og:url'");
} }
private initTabs() { private initTabs() {
//if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { //if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.reloadPublications = true; this.reloadPublications = true;
this.reloadDatasets = true; this.reloadDatasets = true;
this.reloadSoftware = true; this.reloadSoftware = true;
this.reloadOrps = true; this.reloadOrps = true;
this.reloadProjects = true; this.reloadProjects = true;
this.reloadDataproviders = true; this.reloadDataproviders = true;
this.reloadRelatedDatasources = true; this.reloadRelatedDatasources = true;
this.statsClicked = false; this.statsClicked = false;
//this.search(this.dataProviderInfo.tabs[0].content, 1, 10); //this.search(this.dataProviderInfo.tabs[0].content, 1, 10);
this.count(1, 0); this.count(1, 0);
this.metricsClicked = false; this.metricsClicked = false;
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; /*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/ */
this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
/* /*
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
*/ */
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) { //if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
//if(this.dataProviderInfo.tabs.some(function (tab) { //if(this.dataProviderInfo.tabs.some(function (tab) {
// return tab.name === 'Publications'; // return tab.name === 'Publications';
//})) { //})) {
// this.relatedDataprovidersResultsType = 'publications'; // this.relatedDataprovidersResultsType = 'publications';
// this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService); // this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService);
// //} else { // //} else {
// // this.relatedDataprovidersResultsType = 'datasets'; // // this.relatedDataprovidersResultsType = 'datasets';
// this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService); // this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService);
// //} // //}
// this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService); // this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService);
// this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService); // this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService);
this.fetchAggregatorsResults = new FetchResearchResults(this._searchResearchResultsService); this.fetchAggregatorsResults = new FetchResearchResults(this._searchResearchResultsService);
//} //}
// if (this.dataProviderInfo.resultsBy == "collectedFrom") { // if (this.dataProviderInfo.resultsBy == "collectedFrom") {
// //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and"; // //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
@ -368,9 +374,9 @@ export class DataProviderComponent {
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["resulthostingdatasourceid", this.datasourceId]); // this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["resulthostingdatasourceid", this.datasourceId]);
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs', 'qf'], [this.datasourceId, 'and', 'false']); // this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs', 'qf'], [this.datasourceId, 'and', 'false']);
// } // }
} }
public getParamsForSearchLink(type: string = "") { public getParamsForSearchLink(type: string = "") {
let resultsBy: string = ""; let resultsBy: string = "";
// if(this.dataProviderInfo.resultsBy == "collectedFrom") { // if(this.dataProviderInfo.resultsBy == "collectedFrom") {
@ -378,36 +384,36 @@ export class DataProviderComponent {
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") { // } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
// resultsBy = "resulthostingdatasourceid"; // resultsBy = "resulthostingdatasourceid";
// } // }
if(type) { if (type) {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf', 'sortBy'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId, type, "false", 'resultdateofacceptance,descending']); return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf', 'sortBy'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId, type, "false", 'resultdateofacceptance,descending']);
} else { } else {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId]); return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId]);
} }
} }
private count(page: number, size: number) { private count(page: number, size: number) {
//for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) { //for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) {
//let content: string = this.dataProviderInfo.tabs[i].content; //let content: string = this.dataProviderInfo.tabs[i].content;
//if (content == 'publicationsTab') { //if (content == 'publicationsTab') {
this.countPublications(page, size); this.countPublications(page, size);
//} else if (content == 'datasetsTab') { //} else if (content == 'datasetsTab') {
this.countDatasets(page, size); this.countDatasets(page, size);
//} else if (content == 'softwareTab') { //} else if (content == 'softwareTab') {
this.countSoftware(page, size); this.countSoftware(page, size);
//} else if (content == 'orpsTab') { //} else if (content == 'orpsTab') {
this.countOrps(page, size); this.countOrps(page, size);
//} else if (content == 'projectsTab') { //} else if (content == 'projectsTab') {
this.countProjects(page, size); this.countProjects(page, size);
//} else if (content == 'datasourcesTab') { //} else if (content == 'datasourcesTab') {
this.countDatasources(page, size); this.countDatasources(page, size);
//}// else if(content=='relatedDatasourcesTab') { //}// else if(content=='relatedDatasourcesTab') {
// this.countRelatedDatasources(page, size); // this.countRelatedDatasources(page, size);
//} //}
//} //}
} }
public search(content: string, page: number, size: number) { public search(content: string, page: number, size: number) {
if (content == 'publicationsTab') { if (content == 'publicationsTab') {
this.searchPublications(page, size); this.searchPublications(page, size);
@ -429,7 +435,7 @@ export class DataProviderComponent {
this.statsClicked = !this.statsClicked; this.statsClicked = !this.statsClicked;
} }
} }
private searchPublications(page: number, size: number) { private searchPublications(page: number, size: number) {
if (this.reloadPublications && if (this.reloadPublications &&
(this.fetchPublications.searchUtils.status == this.errorCodes.LOADING || (this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
@ -440,11 +446,11 @@ export class DataProviderComponent {
} }
this.reloadPublications = false; this.reloadPublications = false;
} }
private countPublications(page: number, size: number) { private countPublications(page: number, size: number) {
this.fetchPublications.getResultsForDataproviders("publication", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchPublications.getResultsForDataproviders("publication", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
private searchDatasets(page: number, size: number) { private searchDatasets(page: number, size: number) {
if (this.reloadDatasets && if (this.reloadDatasets &&
(this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING || (this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
@ -455,11 +461,11 @@ export class DataProviderComponent {
} }
this.reloadDatasets = false; this.reloadDatasets = false;
} }
private countDatasets(page: number, size: number) { private countDatasets(page: number, size: number) {
this.fetchDatasets.getResultsForDataproviders("dataset", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchDatasets.getResultsForDataproviders("dataset", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
private searchSoftware(page: number, size: number) { private searchSoftware(page: number, size: number) {
if (this.reloadSoftware && if (this.reloadSoftware &&
(this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || (this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
@ -470,11 +476,11 @@ export class DataProviderComponent {
} }
this.reloadSoftware = false; this.reloadSoftware = false;
} }
private countSoftware(page: number, size: number) { private countSoftware(page: number, size: number) {
this.fetchSoftware.getResultsForDataproviders("software", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchSoftware.getResultsForDataproviders("software", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
private searchOrps(page: number, size: number) { private searchOrps(page: number, size: number) {
if (this.reloadOrps && if (this.reloadOrps &&
(this.fetchOrps.searchUtils.status == this.errorCodes.LOADING || (this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
@ -485,11 +491,11 @@ export class DataProviderComponent {
} }
this.reloadOrps = false; this.reloadOrps = false;
} }
private countOrps(page: number, size: number) { private countOrps(page: number, size: number) {
this.fetchOrps.getResultsForDataproviders("other", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); this.fetchOrps.getResultsForDataproviders("other", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
} }
private searchProjects(page: number, size: number) { private searchProjects(page: number, size: number) {
if (this.reloadProjects && if (this.reloadProjects &&
(this.fetchProjects.searchUtils.status == this.errorCodes.LOADING || (this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
@ -500,11 +506,11 @@ export class DataProviderComponent {
} }
this.reloadProjects = false; this.reloadProjects = false;
} }
private countProjects(page: number, size: number) { private countProjects(page: number, size: number) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
private searchDatasources(page: number, size: number) { private searchDatasources(page: number, size: number) {
if (this.reloadDataproviders && if (this.reloadDataproviders &&
(this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING || (this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
@ -515,14 +521,14 @@ export class DataProviderComponent {
} }
this.reloadDataproviders = false; this.reloadDataproviders = false;
} }
private countDatasources(page: number, size: number) { private countDatasources(page: number, size: number) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties); this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
} }
private searchRelatedDatasources(page: number, size: number) { private searchRelatedDatasources(page: number, size: number) {
// Currently no counting is done for this tab. Following condition is always false // Currently no counting is done for this tab. Following condition is always false
// if (this.reloadRelatedDatasources && // if (this.reloadRelatedDatasources &&
// (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING || // (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
// this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE) // this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
@ -557,24 +563,26 @@ export class DataProviderComponent {
) )
) { ) {
this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe( this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe(
data => {}, data => {
err => {}, },
err => {
},
() => { () => {
//this.preprocessRelatedDatasources(); //this.preprocessRelatedDatasources();
this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results; this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results;
this.loadingRelatedDatasources = false; this.loadingRelatedDatasources = false;
} }
); );
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties); this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
} else { } else {
this.loadingRelatedDatasources = false; this.loadingRelatedDatasources = false;
} }
this.reloadRelatedDatasources = false; this.reloadRelatedDatasources = false;
} }
private countRelatedDatasources(page: number, size: number) { private countRelatedDatasources(page: number, size: number) {
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties); // this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties); // this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
@ -582,8 +590,8 @@ export class DataProviderComponent {
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties); // this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties); this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
} }
// private preprocessRelatedDatasources() { // private preprocessRelatedDatasources() {
// if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE || // if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE || // this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
@ -648,7 +656,7 @@ export class DataProviderComponent {
// } // }
// this.loadingRelatedDatasources = false; // this.loadingRelatedDatasources = false;
// } // }
public metricsResults($event) { public metricsResults($event) {
this.totalViews = $event.totalViews; this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads; this.totalDownloads = $event.totalDownloads;
@ -656,9 +664,9 @@ export class DataProviderComponent {
} }
public get hasMetrics(): boolean { public get hasMetrics(): boolean {
return !(this.totalViews && this.totalDownloads && this.pageViews) || this.totalViews > 0 || this.totalDownloads > 0||this.pageViews > 0; return !(this.totalViews && this.totalDownloads && this.pageViews) || this.totalViews > 0 || this.totalDownloads > 0 || this.pageViews > 0;
} }
public openStatistics() { public openStatistics() {
this.statsClicked = true; this.statsClicked = true;
this.statisticsModal.cancelButton = false; this.statisticsModal.cancelButton = false;
@ -666,7 +674,7 @@ export class DataProviderComponent {
this.statisticsModal.alertTitle = "Statistics of"; this.statisticsModal.alertTitle = "Statistics of";
this.statisticsModal.open(); this.statisticsModal.open();
} }
public openRelatedDatasources() { public openRelatedDatasources() {
this.searchRelatedDatasources(1, 0); this.searchRelatedDatasources(1, 0);
this.relatedDatasourcesModal.cancelButton = false; this.relatedDatasourcesModal.cancelButton = false;
@ -674,41 +682,41 @@ export class DataProviderComponent {
this.relatedDatasourcesModal.alertTitle = "Related content providers of"; this.relatedDatasourcesModal.alertTitle = "Related content providers of";
this.relatedDatasourcesModal.open(); this.relatedDatasourcesModal.open();
} }
public scroll() { public scroll() {
HelperFunctions.scroll(); HelperFunctions.scroll();
} }
public removeUnknown(array: string[]): string[] { public removeUnknown(array: string[]): string[] {
return array.filter(value => value.toLowerCase() !== 'unknown'); return array.filter(value => value.toLowerCase() !== 'unknown');
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Content Provider Landing Page: " + message, error); console.error("Content Provider Landing Page: " + message, error);
} }
private getEntityName (entityType:string, plural:boolean, full:boolean): string { private getEntityName(entityType: string, plural: boolean, full: boolean): string {
if(entityType == "publication") { if (entityType == "publication") {
return "publication" + (plural ? "s" : ""); return "publication" + (plural ? "s" : "");
} else if(entityType == "dataset") { } else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
} else if(entityType == "software") { } else if (entityType == "software") {
return "software"; return "software";
} else if(entityType == "other") { } else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other"); return (full ? ("other research product" + (plural ? "s" : "")) : "other");
} else if(entityType == "dataprovider") { } else if (entityType == "dataprovider") {
return (full ? ("content provider" + (plural ? "s" : "")) : "dataprovider" + (plural ? "s" : "")); return (full ? ("content provider" + (plural ? "s" : "")) : "dataprovider" + (plural ? "s" : ""));
} else { } else {
return entityType + (plural ? "s" : ""); return entityType + (plural ? "s" : "");
} }
} }
public getResultPreview(result: SearchResult, type: string): ResultPreview { public getResultPreview(result: SearchResult, type: string): ResultPreview {
return ResultPreview.searchResultConvert(result, type); return ResultPreview.searchResultConvert(result, type);
} }
public onSelectActiveTab(activeTabId) { public onSelectActiveTab(activeTabId) {
if(this.activeTab != "activaTabId") { // tab really changed if (this.activeTab != "activaTabId") { // tab really changed
if (activeTabId == 'summary') { if (activeTabId == 'summary') {
this.activeTab = 'summary'; this.activeTab = 'summary';
} else if (activeTabId == 'publications') { } else if (activeTabId == 'publications') {
@ -723,13 +731,13 @@ export class DataProviderComponent {
} else if (activeTabId == 'other') { } else if (activeTabId == 'other') {
this.activeTab = "other"; this.activeTab = "other";
this.searchOrps(1, this.searchNumber); this.searchOrps(1, this.searchNumber);
} else if(activeTabId == 'projects') { } else if (activeTabId == 'projects') {
this.activeTab = "projects"; this.activeTab = "projects";
this.searchProjects(1, this.searchNumber); this.searchProjects(1, this.searchNumber);
} else if(activeTabId == 'datasources') { } else if (activeTabId == 'datasources') {
this.activeTab = "datasources"; this.activeTab = "datasources";
this.searchDatasources(1, this.searchNumber); this.searchDatasources(1, this.searchNumber);
} else if(activeTabId == 'relatedDatasources') { } else if (activeTabId == 'relatedDatasources') {
this.activeTab = "relatedDatasources"; this.activeTab = "relatedDatasources";
this.searchRelatedDatasources(1, this.searchNumber); this.searchRelatedDatasources(1, this.searchNumber);
} else if (activeTabId == 'statistics') { } else if (activeTabId == 'statistics') {
@ -738,14 +746,14 @@ export class DataProviderComponent {
} }
} }
} }
public get hasAggregationStatusInfo(): boolean { public get hasAggregationStatusInfo(): boolean {
return (!!this.dataProviderInfo.aggregationStatus && return (!!this.dataProviderInfo.aggregationStatus &&
((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1) ((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1)
|| (!!this.dataProviderInfo.aggregationStatus.fundedContent && parseInt(this.dataProviderInfo.aggregationStatus.fundedContent) != -1) || (!!this.dataProviderInfo.aggregationStatus.fundedContent && parseInt(this.dataProviderInfo.aggregationStatus.fundedContent) != -1)
|| !!this.dataProviderInfo.aggregationStatus.lastUpdateDate)); || !!this.dataProviderInfo.aggregationStatus.lastUpdateDate));
} }
public get hasJournalInfo(): boolean { public get hasJournalInfo(): boolean {
return (!!this.dataProviderInfo.journal && ( return (!!this.dataProviderInfo.journal && (
!!this.dataProviderInfo.journal['journal'] || !!this.dataProviderInfo.journal['issn'] || !!this.dataProviderInfo.journal['journal'] || !!this.dataProviderInfo.journal['issn'] ||
@ -754,7 +762,7 @@ export class DataProviderComponent {
!!this.dataProviderInfo.journal['start_page'] || !!this.dataProviderInfo.journal['end_page'])); !!this.dataProviderInfo.journal['start_page'] || !!this.dataProviderInfo.journal['end_page']));
//return true; //return true;
} }
public get hasPrimaryInfo(): boolean { public get hasPrimaryInfo(): boolean {
return !!this.dataProviderInfo && ( return !!this.dataProviderInfo && (
!!this.dataProviderInfo.description || !!this.dataProviderInfo.description ||
@ -763,14 +771,14 @@ export class DataProviderComponent {
!!this.dataProviderInfo.countries || !!this.dataProviderInfo.countries ||
(!!this.dataProviderInfo.subjects && this.dataProviderInfo.subjects.length > 0)); (!!this.dataProviderInfo.subjects && this.dataProviderInfo.subjects.length > 0));
} }
public get hasSecondaryInfo(): boolean { public get hasSecondaryInfo(): boolean {
return !!this.dataProviderInfo && ( return !!this.dataProviderInfo && (
(!!this.dataProviderInfo.organizations && this.dataProviderInfo.organizations.length > 0) (!!this.dataProviderInfo.organizations && this.dataProviderInfo.organizations.length > 0)
|| !!this.dataProviderInfo.oaiPmhURL || !!this.dataProviderInfo.openDoarId || !!this.dataProviderInfo.r3DataId || !!this.dataProviderInfo.oaiPmhURL || !!this.dataProviderInfo.openDoarId || !!this.dataProviderInfo.r3DataId
); );
} }
// public numberOfTabs(): number { // public numberOfTabs(): number {
// if(this.tabsAreInitialized) { // if(this.tabsAreInitialized) {
// return this._numberOfTabs; // return this._numberOfTabs;

View File

@ -1,4 +1,5 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {properties} from "../../../../environments/environment";
@Component({ @Component({
selector: 'organizationsTab', selector: 'organizationsTab',
@ -16,7 +17,7 @@ import {Component, Input} from '@angular/core';
<div *ngFor="let item of organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)"> <div *ngFor="let item of organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
<h4 *ngIf=" item != undefined && item['id'] != undefined"> <h4 *ngIf=" item != undefined && item['id'] != undefined">
<!--a href="{{item['url']}}"--> <!--a href="{{item['url']}}"-->
<a [queryParams]="{organizationId: item.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> <a [queryParams]="{organizationId: item.id}" routerLinkActive="router-link-active" [routerLink]="url">
<p>{{item['name']}}</p> <p>{{item['name']}}</p>
</a> </a>
</h4> </h4>
@ -33,6 +34,7 @@ export class OrganizationsTabComponent {
@Input() organizations: {"name": string, "id": string}[]; @Input() organizations: {"name": string, "id": string}[];
public organizationsPage: number = 1; public organizationsPage: number = 1;
public pageSize: number = 10; public pageSize: number = 10;
public url = properties.searchLinkToDataProvider.split('?')[0];
constructor () {} constructor () {}

View File

@ -6,110 +6,11 @@ import { ErrorCodes} from '../../utils/properties/errorCodes';
import { RouterHelper } from '../../utils/routerHelper.class'; import { RouterHelper } from '../../utils/routerHelper.class';
import { EnvProperties } from '../../utils/properties/env-properties'; import { EnvProperties } from '../../utils/properties/env-properties';
import {AlertModal} from "../../utils/modal/alert"; import {AlertModal} from "../../utils/modal/alert";
import {properties} from "../../../../environments/environment";
@Component({ @Component({
selector: 'relatedDatasourcesTab', selector: 'relatedDatasourcesTab',
template: ` template: `
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status, fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"-->
<!-- [type]="'related content providers'" tab_error_class=true>-->
<!-- </errorMessages>-->
<!-- <div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE-->
<!-- || fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)-->
<!-- && !loading">-->
<!--&lt;!&ndash; <div *ngIf="results && results.size > pageSize" class="uk-margin">&ndash;&gt;-->
<!--&lt;!&ndash; <span class="uk-text-bold">{{results.size | number}} related content providers, page {{page | number}} of {{totalPages(results.size) | number}}</span>&ndash;&gt;-->
<!--&lt;!&ndash; <paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.size" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <no-load-paging *ngIf="results.size >pageSize"-->
<!-- [type]="'content providers'"-->
<!-- (pageChange)="updatePage($event)"-->
<!-- [page]="page" [pageSize]="pageSize"-->
<!-- [totalResults]="results.size">-->
<!-- </no-load-paging>-->
<!-- -->
<!-- <table class="uk-table uk-table-striped">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th class="uk-text-center">Content Provider Name</th>-->
<!-- <th *ngIf="fetchPublications.results.length > 0 || fetchPublications.searchUtils.status == errorCodes.ERROR"-->
<!-- class="uk-text-center">-->
<!-- Number of Publications-->
<!-- </th>-->
<!-- <th *ngIf="fetchDatasets.results.length > 0 || fetchDatasets.searchUtils.status == errorCodes.ERROR"-->
<!-- class="uk-text-center">-->
<!-- Number of Research Data-->
<!-- </th>-->
<!-- <th *ngIf="fetchSoftware.results.length > 0 || fetchSoftware.searchUtils.status == errorCodes.ERROR"-->
<!-- class="uk-text-center">-->
<!-- Number of Software-->
<!-- </th>-->
<!-- <th *ngIf="fetchOrps.results.length > 0 || fetchOrps.searchUtils.status == errorCodes.ERROR"-->
<!-- class="uk-text-center">-->
<!-- Number of Other Research Products-->
<!-- </th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <ng-container *ngIf="results">-->
<!-- <ng-container *ngFor="let id of getKeys(results); let i=index">-->
<!-- <tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">-->
<!-- <td class="uk-text-center">-->
<!-- <a [queryParams]="{datasourceId: id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider" (click)="onLinkClick()">-->
<!-- {{results.get(id).name}}-->
<!-- </a>-->
<!-- </td>-->
<!-- <td *ngIf="fetchPublications.results.length > 0" class="uk-text-center">-->
<!--&lt;!&ndash; *ngIf="results.get(id).countPublications > 0"&ndash;&gt;-->
<!-- <a -->
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'publications', 'false'])"-->
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
<!-- {{results.get(id).countPublications | number}}-->
<!-- </a>-->
<!--&lt;!&ndash; <span *ngIf="results.get(id).countPublications <= 0">-</span>&ndash;&gt;-->
<!-- </td>-->
<!-- <td *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
<!-- <td *ngIf="fetchDatasets.results.length > 0" class="uk-text-center">-->
<!--&lt;!&ndash; *ngIf="results.get(id).countDatasets > 0"&ndash;&gt;-->
<!-- <a -->
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'datasets', 'false'])"-->
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
<!-- {{results.get(id).countDatasets | number}}-->
<!-- </a>-->
<!--&lt;!&ndash; <span *ngIf="results.get(id).countDatasets <= 0">-</span>&ndash;&gt;-->
<!-- </td>-->
<!-- <td *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
<!-- <td *ngIf="fetchSoftware.results.length > 0" class="uk-text-center">-->
<!--&lt;!&ndash; *ngIf="results.get(id).countSoftware > 0"&ndash;&gt;-->
<!-- <a -->
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'software', 'false'])"-->
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
<!-- {{results.get(id).countSoftware | number}}-->
<!-- </a>-->
<!--&lt;!&ndash; <span *ngIf="results.get(id).countSoftware <= 0">-</span>&ndash;&gt;-->
<!-- </td>-->
<!-- <td *ngIf="fetchSoftware.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
<!-- <td *ngIf="fetchOrps.results.length > 0" class="uk-text-center">-->
<!--&lt;!&ndash; *ngIf="results.get(id).countOrps > 0"&ndash;&gt;-->
<!-- <a -->
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'other', 'false'])"-->
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
<!-- {{results.get(id).countOrps | number}}-->
<!-- </a>-->
<!--&lt;!&ndash; <span *ngIf="results.get(id).countOrps <= 0">-</span>&ndash;&gt;-->
<!-- </td>-->
<!-- <td *ngIf="fetchOrps.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
<!-- </tr>-->
<!-- </ng-container>-->
<!-- </ng-container>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<errorMessages [status]="[fetchResults.searchUtils.status]" <errorMessages [status]="[fetchResults.searchUtils.status]"
[type]="'related content providers'" tab_error_class=true> [type]="'related content providers'" tab_error_class=true>
</errorMessages> </errorMessages>
@ -140,7 +41,7 @@ import {AlertModal} from "../../utils/modal/alert";
<ng-container *ngFor="let result of results; let i=index"> <ng-container *ngFor="let result of results; let i=index">
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize"> <tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
<td class="uk-text-center"> <td class="uk-text-center">
<a [queryParams]="{datasourceId: result.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider" <a [queryParams]="{datasourceId: result.id}" routerLinkActive="router-link-active" [routerLink]="dataProviderUrl"
(click)="onLinkClick()"> (click)="onLinkClick()">
{{result.name}} {{result.name}}
</a> </a>
@ -190,10 +91,13 @@ export class RelatedDatasourcesTabComponent {
public page: number = 1; public page: number = 1;
public pageSize: number = 10; public pageSize: number = 10;
public dataProviderUrl;
constructor () {} constructor () {}
ngOnInit() {} ngOnInit() {
this.dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
}
ngOnDestroy() {} ngOnDestroy() {}

View File

@ -2,6 +2,7 @@ import {Component, Input} from '@angular/core';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {EnvProperties} from "../../utils/properties/env-properties"; import {EnvProperties} from "../../utils/properties/env-properties";
import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview"; import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview";
import {properties} from "../../../../environments/environment";
@Component({ @Component({
selector: 'availableOn', selector: 'availableOn',
@ -36,7 +37,7 @@ import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview";
</div> </div>
<div *ngIf="available.collectedName" class="provider"> <div *ngIf="available.collectedName" class="provider">
<span>Provider: </span> <span>Provider: </span>
<a *ngIf="available.collectedId" routerLink="/search/dataprovider" [queryParams]="{datasourceId: available.collectedId}"> <a *ngIf="available.collectedId" [routerLink]="dataProviderUrl" [queryParams]="{datasourceId: available.collectedId}">
{{available.collectedName}} {{available.collectedName}}
</a> </a>
<span *ngIf="!available.collectedId"> <span *ngIf="!available.collectedId">
@ -68,12 +69,12 @@ export class AvailableOnComponent {
// "accessMode": string[], "bestAccessMode": string, // "accessMode": string[], "bestAccessMode": string,
// "type": string, "year": string, icon: string // "type": string, "year": string, icon: string
// }[]; // }[];
@Input() properties: EnvProperties;
// public open = 'assets/common-assets/unlock.svg'; // public open = 'assets/common-assets/unlock.svg';
// public closed = 'assets/common-assets/lock.svg'; // public closed = 'assets/common-assets/lock.svg';
// public unknown = 'assets/common-assets/question.svg'; // public unknown = 'assets/common-assets/question.svg';
public threshold: number = 4; public threshold: number = 4;
public showNum: number = 4; public showNum: number = 4;
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
constructor() { constructor() {
} }
@ -96,7 +97,7 @@ export class AvailableOnComponent {
} }
public removeUnknown(value: string): string { public removeUnknown(value: string): string {
if(this.properties.environment === 'production') { if(properties.environment === 'production') {
if (value.toLowerCase() === 'unknown') { if (value.toLowerCase() === 'unknown') {
return null; return null;
} }

View File

@ -167,7 +167,7 @@
<div class="uk-text-muted">Related Organizations</div> <div class="uk-text-muted">Related Organizations</div>
<ul class="uk-list organizations uk-margin-remove-top"> <ul class="uk-list organizations uk-margin-remove-top">
<li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))"> <li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))">
<a [routerLink]="'/search/organization'" [queryParams]="{organizationId: organization.id}"> <a [routerLink]="organizationUrl" [queryParams]="{organizationId: organization.id}">
{{(organization.name ? organization.name : organization.shortname)}} {{(organization.name ? organization.name : organization.shortname)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span> <span *ngIf="organization.shortname">({{organization.shortname}})</span>
</a> </a>
@ -212,8 +212,7 @@
versions</a> versions</a>
</span> </span>
</div> </div>
<availableOn [properties]="properties" <availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
[availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
</div> </div>
</div> </div>
<div *ngIf="!hasPrimaryInfo && !hasSecondaryInfo" <div *ngIf="!hasPrimaryInfo && !hasSecondaryInfo"

View File

@ -37,6 +37,7 @@ export class ResultLandingComponent {
public deleteByInferenceOpened: boolean = false; public deleteByInferenceOpened: boolean = false;
public resultLandingInfo: ResultLandingInfo; public resultLandingInfo: ResultLandingInfo;
public organizationUrl = properties.searchLinkToOrganization.split('?')[0];
public relatedResults: RelationResult[]; public relatedResults: RelationResult[];
public supplementaryResults: RelationResult[]; public supplementaryResults: RelationResult[];
public relation: string = 'trust'; public relation: string = 'trust';

View File

@ -6,6 +6,7 @@ import {EnvProperties} from '../properties/env-properties';
import {isPlatformBrowser} from "@angular/common"; import {isPlatformBrowser} from "@angular/common";
import {Author} from "../result-preview/result-preview"; import {Author} from "../result-preview/result-preview";
import {AlertModal} from "../modal/alert"; import {AlertModal} from "../modal/alert";
import {properties} from "../../../../environments/environment";
@Component({ @Component({
selector: 'showAuthors', selector: 'showAuthors',
@ -51,7 +52,7 @@ import {AlertModal} from "../modal/alert";
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1" <a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
(click)="onClick()" (click)="onClick()"
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[author['orcid'],'and'])" [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[author['orcid'],'and'])"
routerLinkActive="router-link-active" routerLink="/search/advanced/research-outcomes"> routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults">
Research outcomes Research outcomes
</a> </a>
</div> </div>
@ -79,7 +80,7 @@ export class ShowAuthorsComponent {
@Input() modal: AlertModal; @Input() modal: AlertModal;
public numberOfAuthors: number; public numberOfAuthors: number;
public properties: EnvProperties; public properties: EnvProperties = properties;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
testBrowser: boolean; testBrowser: boolean;
@ -89,9 +90,6 @@ export class ShowAuthorsComponent {
} }
ngOnInit() { ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
});
this.numberOfAuthors = this.authorsLimit; this.numberOfAuthors = this.authorsLimit;
} }

View File

@ -242,7 +242,7 @@
<span class="provider uk-display-inline-block"> <span class="provider uk-display-inline-block">
<span class="uk-text-muted">Provider: </span> <span class="uk-text-muted">Provider: </span>
<!-- target="_blank"--> <!-- target="_blank"-->
<a *ngIf="from.collectedId" routerLink="/search/dataprovider" [queryParams]="{datasourceId: from.collectedId}" <a *ngIf="from.collectedId" [routerLink]="dataProviderUrl" [queryParams]="{datasourceId: from.collectedId}"
[href]="from.downloadUrl[0]" (click)="onClick();"> [href]="from.downloadUrl[0]" (click)="onClick();">
{{from.collectedName}} {{from.collectedName}}
<!-- <span class="custom-external space"></span>--> <!-- <span class="custom-external space"></span>-->

View File

@ -20,6 +20,7 @@ export class ResultPreviewComponent implements OnInit{
public urlParam: string; public urlParam: string;
public url: string; public url: string;
public beforeTitle: string[] = []; public beforeTitle: string[] = [];
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
ngOnInit(): void { ngOnInit(): void {
if (this.result.resultType === "publication") { if (this.result.resultType === "publication") {