[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 {RouterHelper} from '../../../utils/routerHelper.class';
import {properties} from "../../../../../environments/environment";
//Usage Example "<project-title [project]="X" > </project-title>"
@ -8,12 +9,12 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
template: `
<span *ngIf="externalPortalUrl" class="project-title">
<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 *ngIf="!externalPortalUrl" class="project-title">
<span><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
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>
<div *ngIf="project['funderName']">
@ -28,6 +29,7 @@ export class ProjectTitleFormatter {
@Input() externalPortalUrl: string = null;
public url: string;
public routerHelper: RouterHelper = new RouterHelper();
public projectUrl = properties.searchLinkToProject.split('?')[0];
constructor() {
}

View File

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

View File

@ -21,6 +21,7 @@ import {ClaimsByTokenService} from './claimsByToken.service';
import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {properties} from "../../../../environments/environment";
@Component({
@ -69,7 +70,6 @@ export class ClaimsByTokenComponent {
public totalPendingResults:any = {count: 0};
public activeCuratedPage:any = {page: 1};
public totalCuratedResults:any = {count: 0};
dtTrigger: Subject<any>[] = [];
private triggered: boolean = false;
@ -82,7 +82,7 @@ export class ClaimsByTokenComponent {
@ViewChild (ModalSelect) selectModal : ModalSelect;
@ViewChild (ModalLoading) loading : ModalLoading ;
properties:EnvProperties;
properties:EnvProperties = properties;
public routerHelper:RouterHelper = new RouterHelper();
@ -96,11 +96,6 @@ export class ClaimsByTokenComponent {
this.curated_status = this.errorCodes.LOADING;
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
});
this.sub = this.route.queryParams.subscribe(params => {
this.mode = "pending";
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 {RouterHelper} from '../../../utils/routerHelper.class';
import {properties} from "../../../../../environments/environment";
@Component({
selector: 'claim-selected-projects',
template: `
<div class="" >
<div class="">
<div>
<!--h5 class=" uk-margin uk-h5 uk-text-primary" *ngIf="projects.length > 0 "> Selected Projects ({{projects.length | number}}) </h5-->
<ul class="uk-list uk-list-divider">
<li class="list-group-item" *ngFor="let project of projects">
<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>
<a [queryParams]="routerHelper.createQueryParam('projectId',project.projectId)"
routerLinkActive="router-link-active"
[routerLink]="projectUrl">{{project.funderName}}
| {{project.projectName}} {{(project.projectAcronym) ? '(' + project.projectAcronym + ')' : ''}}
<!--[{{project.startDate}} - {{project.endDate}}]--></a>
<span (click)="removeProject(project)" aria-hidden="true" class="uk-icon-button icon-button-small ">
<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"
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>
</li>
</ul>
</div>
<!--div *ngIf="projects.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any projects</div-->
</div>
`
</div>`
})
export class ClaimSelectedProjectsComponent {
ngOnInit() {
ngOnInit() {
var myDate = new Date();
this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.todayDate = (myDate.getFullYear() + "-" + myDate.getMonth() + 1) + "-" + myDate.getDate();
this.nextDate = ((myDate.getFullYear() + 100) + "-" + myDate.getMonth() + 1) + "-" + myDate.getDate();
// if(this.linkType == "project"){
this.showsearch = true
// }else{
// this.showsearch = false;
// }
//2015-05-01
}
}
@Input() projects: ClaimProject[];
@Input() show='home';
@Input() title='Projects';
@Input() linkType:string = "project";
@Input() hideType;
@Input() bulkMode:boolean = false;
@Input() linkToResults:boolean = true;
@Output() projectsChange = new EventEmitter();
@Output() showChange = new EventEmitter();
showsearch:boolean = false;
@Input() localStoragePrefix:string = "";
todayDate = '';
nextDate = '';
public routerHelper:RouterHelper = new RouterHelper();
@Input() projects: ClaimProject[];
@Input() show = 'home';
@Input() title = 'Projects';
@Input() linkType: string = "project";
@Input() hideType;
@Input() bulkMode: boolean = false;
@Input() linkToResults: boolean = true;
@Output() projectsChange = new EventEmitter();
@Output() showChange = new EventEmitter();
showsearch: boolean = false;
@Input() localStoragePrefix: string = "";
todayDate = '';
nextDate = '';
public routerHelper: RouterHelper = new RouterHelper();
public projectUrl = properties.searchLinkToProject.split('?')[0];
removeProject(item:any){
var index:number =this.projects.indexOf(item);
removeProject(item: any) {
var index: number = this.projects.indexOf(item);
if (index > -1) {
this.projects.splice(index, 1);
if(this.projects != null){
if (this.projects != null) {
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
}
}
this.projectsChange.emit({
value: this.projects
});
}
showType(type){
if(type != this.show){
}
showType(type) {
if (type != this.show) {
this.show = type;
this.showChange.emit({
value: this.show
});
}
}
projectSelected($event) {
}
}
projectSelected($event) {
// this.showsearch = false;
}
}
}

View File

@ -5,21 +5,22 @@ import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs';
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 {FetchDataproviders} from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchDataprovidersService} from '../services/searchDataproviders.service';
import {OrganizationService} from '../services/organization.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 {properties} from "../../../environments/environment";
@Component({
selector: 'deposit-result',
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 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>
@ -59,17 +60,23 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</h4>
<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">
<input type="text" [(ngModel)]="subject" class=" uk-input uk-width-1-2" name="subject" placeholder="Search for classifications..." />
<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..."/>
<button class=" uk-button portal-button" type="submit" (click)="newSubject()" >
<button class=" uk-button portal-button" type="submit" (click)="newSubject()">
Search
</button>
</form>
<div *ngIf="subject.length > 0" class=" uk-text-center ">
<span>Keywords: {{subject}}<span>
<a class=" " (click)="subject=''; newSubject()"> <span aria-hidden="true" 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>
<a class=" " (click)="subject=''; newSubject()"> <span aria-hidden="true"
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>
</a>
@ -81,45 +88,64 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<p class="uk-text-meta"
*ngIf=" fetchDataproviders.searchUtils.status == errorCodes.DONE ||
(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>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE ||
(fetchDataproviders.searchUtils.status == errorCodes.LOADING && !fetchDataproviders.loadPaging && fetchDataproviders.oldTotalResults > 0)"
class="uk-align-center uk-margin-remove-bottom">
<search-paging [type]="'content providers'" [(searchUtils)] = "fetchDataproviders.searchUtils" [(results)] = "fetchDataproviders.results"
[(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues"
[loadPaging]="fetchDataproviders.loadPaging" [oldTotalResults]="fetchDataproviders.oldTotalResults">
<search-paging [type]="'content providers'" [(searchUtils)]="fetchDataproviders.searchUtils"
[(results)]="fetchDataproviders.results"
[(parameterNames)]="parameterNames" [(parameterValues)]="parameterValues"
[loadPaging]="fetchDataproviders.loadPaging"
[oldTotalResults]="fetchDataproviders.oldTotalResults">
</search-paging>
</div>
<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 *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE" 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' ) ">
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE"
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>
<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>
<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>
</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">[no title available]</span>
</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>
</h5>
<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['compatibility'] != undefined && result['compatibility'] != ''" class="uk-label custom-label label-compatibility" title="Compatibility">{{result.compatibility}}</span>
<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'] != ''"
class="uk-label custom-label label-compatibility"
title="Compatibility">{{result.compatibility}}</span>
<div *ngIf="subjectResults && result['organizations'] != undefined && result['organizations'].length > 0">
<div
*ngIf="subjectResults && result['organizations'] != undefined && result['organizations'].length > 0">
<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.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
*ngIf="!organization.id">
@ -130,7 +156,8 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<span *ngIf="result['organizations'].length > 10">...</span>
</div>
<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 *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span>
@ -150,14 +177,16 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div>
<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 *ngIf="!subjectResults">
<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"
class="alert alert-warning">
<div *ngIf="status == errorCodes.NOT_FOUND && organizationId != ''">
No organization with ID: {{organizationId}} found.
</div>
@ -173,7 +202,7 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div>
</div>
<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">
An error occured.
</span>
@ -202,7 +231,8 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
<div class="uk-card uk-card-default uk-card-body portal-card">
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>
<div class="uk-margin-top" *ngIf="zenodoInformation && zenodoInformation.shareInZenodoUrl">
<a href="{{zenodoInformation.shareInZenodoUrl}}">More Zenodo communities</a>
@ -217,7 +247,11 @@ import {ZenodoInformationClass} from './utils/zenodoInformation.class';
</div>
</div>
<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>
<helper position="bottom"></helper>
</div>
@ -235,7 +269,7 @@ export class DepositResultComponent {
// Type of entity: Publication or Research Data
@Input() requestFor: string = "Publications";
public organization: {"name": string, "url": string};
public organization: { "name": string, "url": string };
public organizationId: string = "";
// Id of the new selected organization to be searched
@ -247,26 +281,26 @@ export class DepositResultComponent {
public status: number;
public warningMessage: string = "";
public fetchDataproviders : FetchDataproviders;
public fetchDataproviders: FetchDataproviders;
public linkToSearchDataproviders: string = "";
public parameterNames:string[] =[];
public parameterValues:string[] =[];
public parameterNames: string[] = [];
public parameterValues: string[] = [];
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();
sub: any;
piwiksub: any;
properties: EnvProperties = properties;
url = null;
sub: any; piwiksub: any;
properties:EnvProperties;
url=null;
constructor ( private _router: Router,
constructor(private _router: Router,
private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService,
private _organizationService: OrganizationService,
private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService,
private _piwikService: PiwikService,
private seoService: SEOService) {
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
@ -274,34 +308,30 @@ export class DepositResultComponent {
this.status = this.errorCodes.LOADING;
var title = "Deposit "+this.requestFor;
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor;
var title = "Deposit " + this.requestFor;
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit " + this.requestFor;
this.updateTitle(title);
this.updateDescription(description);
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false);
this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.url = data.envSpecific.baseLink+this._router.url;
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();
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
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'];
this.fetchDataproviders.searchUtils.page = (params['page'] === undefined) ? 1 : +params['page'];
if(this.subjectResults) {
if (this.subjectResults) {
this.status = this.errorCodes.DONE;
this.subject = params['subject'];
if(!this.subject) {
if (!this.subject) {
this.subject = "";
}
this.parameterNames.push('subject');
@ -309,14 +339,14 @@ export class DepositResultComponent {
this.searchDataprovidersBySubject();
} else {
if(this.organizationId) {
if (this.organizationId) {
this.searchDataproviders();
} else {
this.organizationId = params['organizationId'];
this.parameterNames.push('organizationId');
this.parameterValues.push(this.organizationId);
if(this.organizationId){
if (this.organizationId) {
this.getOrganizationInfo();
}
}
@ -326,7 +356,7 @@ export class DepositResultComponent {
}
ngDoCheck() {
if(!this.subjectResults && (this.organizationId == "" || this.organizationId == undefined)) {
if (!this.subjectResults && (this.organizationId == "" || this.organizationId == undefined)) {
this.organizationId = "";
this.status = this.errorCodes.NONE;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
@ -335,13 +365,13 @@ export class DepositResultComponent {
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
public newSubject() {
this._router.navigate( ['participate/deposit-subject-result'], { queryParams: { "subject": this.subject } } );
this._router.navigate(['participate/deposit-subject-result'], {queryParams: {"subject": this.subject}});
}
public searchDataprovidersBySubject() {
@ -350,7 +380,7 @@ export class DepositResultComponent {
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.fetchDataproviders.getResultsBySubjectsForDeposit((this.subject == "") ? "*" : this.subject, this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties);
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
}
@ -358,18 +388,18 @@ export class DepositResultComponent {
// 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.fetchDataproviders.getResultsForDeposit(this.organizationId, this.requestFor, this.fetchDataproviders.searchUtils.page, this.fetchDataproviders.searchUtils.size, this.properties);
//}
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
}
private getOrganizationInfo () {
private getOrganizationInfo() {
this.fetchDataproviders.oldTotalResults = 0;
this.fetchDataproviders.searchUtils.totalResults = 0;
this._organizationService.getOrganizationNameAndUrlById(this.organizationId,this.properties).subscribe(
this._organizationService.getOrganizationNameAndUrlById(this.organizationId, this.properties).subscribe(
data => {
if(data == null) {
if (data == null) {
this.status = this.errorCodes.NOT_FOUND;
this.fetchDataproviders.searchUtils.status = this.errorCodes.NONE;
} else {
@ -380,12 +410,12 @@ export class DepositResultComponent {
},
err => {
//console.log(err)
this.handleError("Error getting organization name and url for id: "+this.organizationId, 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') {
if (err.status == '404') {
this.status = this.errorCodes.NOT_FOUND;
} else if(err.status == '500') {
} else if (err.status == '500') {
this.status = this.errorCodes.ERROR;
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
@ -395,47 +425,49 @@ export class DepositResultComponent {
}
public goToDeposit() {
if(this.requestFor == "Publications") {
this._router.navigate( ['participate/deposit-publications'] );
} else if(this.requestFor == "Research Data") {
this._router.navigate( ['participate/deposit-datasets'] );
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){
public valueChanged($event) {
this.selectedId = $event.value;
}
public organizationSelected(id: string) {
if(id && id.length > 0 && id != this.organizationId){
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 } } );
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 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);
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'");
this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url:string){
this._meta.updateTag({content:url},"property='og:url'");
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private handleError(message: string, error) {
console.error("Deposit Result Page: "+message, 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>
</a>
</div>
<ul class="uk-margin-top uk-list uk-margin search-results ">
<li *ngFor="let result of results" class="uk-animation-fade">
<div class="uk-card uk-card-default uk-padding uk-card-hover">
@ -25,65 +24,4 @@
</result-preview>
</div>
</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>

View File

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

View File

@ -25,6 +25,7 @@ import {StringUtils} from "../../utils/string-utils.class";
import {SearchResult} from "../../utils/entities/searchResult";
import {ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service";
import {properties} from "../../../../environments/environment";
@Component({
@ -120,13 +121,13 @@ export class DataProviderComponent {
public indexUpdateDate: Date;
public showFeedback: boolean = false;
public feedbackFields: string [] = ['Name', 'Organizations','Country', 'Other'];
public feedbackFields: string [] = ['Name', 'Organizations', 'Country', 'Other'];
sub: any;
piwiksub: any;
subInfo: any;
relatedDatasourcesSub: any;
properties: EnvProperties;
properties: EnvProperties = properties;
constructor(private _dataproviderService: DataProviderService,
private _piwikService: PiwikService,
@ -151,9 +152,6 @@ export class DataProviderComponent {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if (typeof document !== 'undefined') {
this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {
@ -165,9 +163,7 @@ export class DataProviderComponent {
}
//this.getDivContents();
this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url);
});
this.updateUrl(this.properties.baseLink + this._router.url);
this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider");
this.updateDescription("");
@ -177,7 +173,12 @@ export class DataProviderComponent {
this.getDataProviderInfo(this.datasourceId);
} else {
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();
@ -273,8 +274,13 @@ export class DataProviderComponent {
err => {
//console.log(err);
this.handleError("Error getting content provider for id: " + this.datasourceId, err);
if(err.status == 404) {
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "dataprovider"}});
if (err.status == 404) {
this._router.navigate(['/error'], {
queryParams: {
"page": this._location.path(true),
"page_type": "dataprovider"
}
});
}
this.errorMessage = 'No dataProvider found';
this.showLoading = false;
@ -379,7 +385,7 @@ export class DataProviderComponent {
// 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']);
} else {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId]);
@ -557,8 +563,10 @@ export class DataProviderComponent {
)
) {
this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe(
data => {},
err => {},
data => {
},
err => {
},
() => {
//this.preprocessRelatedDatasources();
this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results;
@ -656,7 +664,7 @@ export class DataProviderComponent {
}
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() {
@ -687,16 +695,16 @@ export class DataProviderComponent {
console.error("Content Provider Landing Page: " + message, error);
}
private getEntityName (entityType:string, plural:boolean, full:boolean): string {
if(entityType == "publication") {
private getEntityName(entityType: string, plural: boolean, full: boolean): string {
if (entityType == "publication") {
return "publication" + (plural ? "s" : "");
} else if(entityType == "dataset") {
} else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
} else if(entityType == "software") {
} else if (entityType == "software") {
return "software";
} else if(entityType == "other") {
} else if (entityType == "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" : ""));
} else {
return entityType + (plural ? "s" : "");
@ -708,7 +716,7 @@ export class DataProviderComponent {
}
public onSelectActiveTab(activeTabId) {
if(this.activeTab != "activaTabId") { // tab really changed
if (this.activeTab != "activaTabId") { // tab really changed
if (activeTabId == 'summary') {
this.activeTab = 'summary';
} else if (activeTabId == 'publications') {
@ -723,13 +731,13 @@ export class DataProviderComponent {
} else if (activeTabId == 'other') {
this.activeTab = "other";
this.searchOrps(1, this.searchNumber);
} else if(activeTabId == 'projects') {
} else if (activeTabId == 'projects') {
this.activeTab = "projects";
this.searchProjects(1, this.searchNumber);
} else if(activeTabId == 'datasources') {
} else if (activeTabId == 'datasources') {
this.activeTab = "datasources";
this.searchDatasources(1, this.searchNumber);
} else if(activeTabId == 'relatedDatasources') {
} else if (activeTabId == 'relatedDatasources') {
this.activeTab = "relatedDatasources";
this.searchRelatedDatasources(1, this.searchNumber);
} else if (activeTabId == 'statistics') {

View File

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

View File

@ -6,110 +6,11 @@ import { ErrorCodes} from '../../utils/properties/errorCodes';
import { RouterHelper } from '../../utils/routerHelper.class';
import { EnvProperties } from '../../utils/properties/env-properties';
import {AlertModal} from "../../utils/modal/alert";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'relatedDatasourcesTab',
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]"
[type]="'related content providers'" tab_error_class=true>
</errorMessages>
@ -140,7 +41,7 @@ import {AlertModal} from "../../utils/modal/alert";
<ng-container *ngFor="let result of results; let i=index">
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
<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()">
{{result.name}}
</a>
@ -190,10 +91,13 @@ export class RelatedDatasourcesTabComponent {
public page: number = 1;
public pageSize: number = 10;
public dataProviderUrl;
constructor () {}
ngOnInit() {}
ngOnInit() {
this.dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
}
ngOnDestroy() {}

View File

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

View File

@ -167,7 +167,7 @@
<div class="uk-text-muted">Related Organizations</div>
<ul class="uk-list organizations uk-margin-remove-top">
<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)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span>
</a>
@ -212,8 +212,7 @@
versions</a>
</span>
</div>
<availableOn [properties]="properties"
[availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
</div>
</div>
<div *ngIf="!hasPrimaryInfo && !hasSecondaryInfo"

View File

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

View File

@ -6,6 +6,7 @@ import {EnvProperties} from '../properties/env-properties';
import {isPlatformBrowser} from "@angular/common";
import {Author} from "../result-preview/result-preview";
import {AlertModal} from "../modal/alert";
import {properties} from "../../../../environments/environment";
@Component({
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"
(click)="onClick()"
[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
</a>
</div>
@ -79,7 +80,7 @@ export class ShowAuthorsComponent {
@Input() modal: AlertModal;
public numberOfAuthors: number;
public properties: EnvProperties;
public properties: EnvProperties = properties;
public routerHelper: RouterHelper = new RouterHelper();
testBrowser: boolean;
@ -89,9 +90,6 @@ export class ShowAuthorsComponent {
}
ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
});
this.numberOfAuthors = this.authorsLimit;
}

View File

@ -242,7 +242,7 @@
<span class="provider uk-display-inline-block">
<span class="uk-text-muted">Provider: </span>
<!-- 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();">
{{from.collectedName}}
<!-- <span class="custom-external space"></span>-->

View File

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