[Library|Trunk]

Changes for Aggregator portal:
	use a customFilter in search pages, and pass it through the components
	for landing  pages check if a route is available in order to add linking and deposit links



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56059 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-06-12 14:13:56 +00:00
parent 64eebccc47
commit 504fdfaa3c
34 changed files with 199 additions and 60 deletions

View File

@ -246,13 +246,13 @@
</li> </li>
</ul> </ul>
<button class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('/participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this dataset to... </span> Link this dataset to...
</button> </button>
<div uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('/participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >

View File

@ -65,6 +65,7 @@ export class DatasetComponent {
constructor (private _datasetService: DatasetService, constructor (private _datasetService: DatasetService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
@ -221,4 +222,13 @@ export class DatasetComponent {
public scroll() { public scroll() {
HelperFunctions.scroll(); HelperFunctions.scroll();
} }
isRouteAvailable(routeToCheck:string){
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
return true;
}
}
return false;
}
} }

View File

@ -179,13 +179,14 @@
</li> </li>
</ul> </ul>
<button class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('/participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this product to... </span> Link this product to...
</button> </button>
<div uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('/participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent
!important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >

View File

@ -65,6 +65,7 @@ export class OrpComponent {
constructor (private _orpService: OrpService, constructor (private _orpService: OrpService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
@ -207,4 +208,13 @@ export class OrpComponent {
} }
return totalPages; return totalPages;
} }
isRouteAvailable(routeToCheck:string){
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
return true;
}
}
return false;
}
} }

View File

@ -453,7 +453,7 @@
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV) <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV)
</a> </a>
</li> </li>
<li> <li *ngIf="isRouteAvailable('/participate/deposit-publications') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications"> <a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications">
<span class="uk-icon"> <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg>
@ -490,7 +490,7 @@
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV) <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> Get {{projectInfo.funder}} report (CSV)
</a> </a>
</li> </li>
<li> <li *ngIf="isRouteAvailable('/participate/deposit-datasets') ">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets"> <a routerLinkActive="router-link-active" routerLink="/participate/deposit-datasets">
<span class="uk-icon"> <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg>
@ -502,13 +502,13 @@
</ul> </ul>
</div> </div>
<button class=" uk-button portal-button uk-margin-small-top uk-width-1-1"> <button *ngIf="isRouteAvailable('/participate/direct-claim') " class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this project to... </span> Link this project to...
</button> </button>
<div uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;" class=" uk-margin-remove-top uk-padding-small"> <div *ngIf="isRouteAvailable('/participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;" class=" uk-margin-remove-top uk-padding-small">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >

View File

@ -105,6 +105,7 @@ properties:EnvProperties;
constructor ( private _projectService: ProjectService, constructor ( private _projectService: ProjectService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private _searchPublicationsService: SearchPublicationsService, private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService, private _searchDatasetsService: SearchDatasetsService,
private _searchSoftwareService: SearchSoftwareService, private _searchSoftwareService: SearchSoftwareService,
@ -492,4 +493,13 @@ actionsAfterGettingProjectInfo(){
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Project Landing Page: "+message, error); console.error("Project Landing Page: "+message, error);
} }
isRouteAvailable(routeToCheck:string){
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
return true;
}
}
return false;
}
} }

View File

@ -427,13 +427,14 @@
</li> </li>
</ul> </ul>
<button class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('/participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this publication to... </span> Link this publication to...
</button> </button>
<div class=" uk-margin-remove-top uk-padding-small" uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('/participate/direct-claim')" class=" uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim"> <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim">

View File

@ -76,6 +76,7 @@ export class PublicationComponent {
constructor ( private _publicationService: PublicationService, constructor ( private _publicationService: PublicationService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
@ -361,4 +362,13 @@ export class PublicationComponent {
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Publication Landing Page: "+message, error); console.error("Publication Landing Page: "+message, error);
} }
isRouteAvailable(routeToCheck:string){
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
return true;
}
}
return false;
}
} }

View File

@ -242,13 +242,13 @@
</li--> </li-->
</ul> </ul>
<button class=" uk-button portal-button uk-width-1-1 "> <button *ngIf="isRouteAvailable('/participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon"> <span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg> <svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this software to... </span> Link this software to...
</button> </button>
<div uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"> <div *ngIf="isRouteAvailable('/participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical"> <ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>"> <li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >

View File

@ -60,6 +60,7 @@ export class SoftwareComponent {
constructor (private _softwareService: SoftwareService, constructor (private _softwareService: SoftwareService,
private _piwikService:PiwikService, private _piwikService:PiwikService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router,
private _meta: Meta, private _meta: Meta,
private _title: Title, private _title: Title,
private _router: Router, private _router: Router,
@ -202,4 +203,13 @@ export class SoftwareComponent {
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Software Landing Page: "+message, error); console.error("Software Landing Page: "+message, error);
} }
isRouteAvailable(routeToCheck:string){
for (let i = 0; i < this.router.config.length; i++) {
let routePath:string = this.router.config[i].path;
if(routePath == routeToCheck){
return true;
}
}
return false;
}
} }

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component'; import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -38,6 +38,8 @@ export class AdvancedSearchDatasetsComponent {
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];
@ -100,6 +102,7 @@ export class AdvancedSearchDatasetsComponent {
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component'; import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -52,6 +52,7 @@ export class AdvancedSearchOrganizationsComponent {
public isPiwikEnabled; public isPiwikEnabled;
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
@Input() customFilter:SearchCustomFilter= null;
public resourcesQuery = "(oaftype exact organization)"; public resourcesQuery = "(oaftype exact organization)";
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) { constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
@ -93,6 +94,7 @@ public resourcesQuery = "(oaftype exact organization)";
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size);

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component'; import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -38,6 +38,8 @@ export class AdvancedSearchOrpsComponent {
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];
@ -100,6 +102,7 @@ export class AdvancedSearchOrpsComponent {
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component'; import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -53,6 +53,7 @@ export class AdvancedSearchPublicationsComponent {
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
public pagingLimit: number = 0; public pagingLimit: number = 0;
public isPiwikEnabled; public isPiwikEnabled;
public sort: boolean = true; public sort: boolean = true;
@ -105,6 +106,7 @@ export class AdvancedSearchPublicationsComponent {
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}); });

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component'; import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -37,6 +37,7 @@ export class AdvancedSearchSoftwareComponent {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];
@ -101,6 +102,7 @@ export class AdvancedSearchSoftwareComponent {
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -155,7 +155,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" > <div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" >
<browse-entities [(properties)]=properties entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId ></browse-entities> <browse-entities [(properties)]=properties entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -175,7 +175,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='research data'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='research data'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId ></browse-entities> <browse-entities [(properties)]=properties entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -194,7 +194,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='software'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='software'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId ></browse-entities> <browse-entities [(properties)]=properties entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -213,7 +213,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='other research products'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='other research products'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="other" baseUrl="/search/find/other" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId ></browse-entities> <browse-entities [(properties)]=properties entityName="other" baseUrl="/search/find/other" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -269,11 +269,12 @@
</div> </div>
<search-result [(results)]="fetchOrganizations.results" <search-result [(results)]="fetchOrganizations.results"
[(status)]= "fetchOrganizations.searchUtils.status" showLoading = true [(status)]= "fetchOrganizations.searchUtils.status" showLoading = true
type="organization" urlParam="organizationId" [(properties)]=properties> type="organization" urlParam="organizationId" [(properties)]=properties >
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="organization" baseUrl="/search/find/organizations" [refineFields]=searchFields.ORGANIZATION_REFINE_FIELDS></browse-entities> <browse-entities [(properties)]=properties entityName="organization"
baseUrl="/search/find/organizations" [refineFields]=searchFields.ORGANIZATION_REFINE_FIELDS [customFilter]="customFilter"></browse-entities>
</div> </div>
</div> </div>

View File

@ -33,6 +33,7 @@ import {ConfigurationService} from '../../utils/configuration/configurat
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service'; import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.Default, changeDetection: ChangeDetectionStrategy.Default,
@ -101,6 +102,7 @@ export class SearchComponent {
@Input() logoURL; @Input() logoURL;
@Input() name; @Input() name;
@Input() connectCommunityId =null; @Input() connectCommunityId =null;
@Input() customFilter:SearchCustomFilter= null;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE"; @Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE";
@ -171,13 +173,18 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.showOrganizations = false; this.showOrganizations = false;
this.showDataProviders = false; this.showDataProviders = false;
} }
if((this.customFilter && this.customFilter.queryFieldName=="country")){
this.showProjects = false;
// this.showOrganizations = false;
this.showDataProviders = false;
}
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.reloadTabs(); this.reloadTabs();
this.keyword = (params['keyword'])?params['keyword']:""; this.keyword = (params['keyword'])?params['keyword']:"";
if(this.keyword !=null && this.keyword.length > 0){ if(this.keyword !=null && this.keyword.length > 0){
//if showPublications == false will set another entity as the first //if showPublications == false will setValues another entity as the first
if(this.showPublications){ if(this.showPublications){
this.activeTab = "publications"; this.activeTab = "publications";
this.searchPublications(); this.searchPublications();
@ -249,7 +256,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&& this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadPublications = false; this.reloadPublications = false;
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter);
this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword; this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword;
} }
} }
@ -260,7 +267,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&& this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadDatasets = false; this.reloadDatasets = false;
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter);
this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword; this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword;
} }
} }
@ -273,7 +280,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || ( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )*/) { this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )*/) {
this.reloadSoftware = false; this.reloadSoftware = false;
this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter);
this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword; this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword;
} }
} }
@ -284,7 +291,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&& this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadOrps = false; this.reloadOrps = false;
this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter);
this.linkToSearchOrps =this.properties.searchLinkToOrps; this.linkToSearchOrps =this.properties.searchLinkToOrps;
} }
} }
@ -356,6 +363,9 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
private count() { private count() {
var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null;
if(this.customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
}
if(this.activeTab != "publications" && this.showPublications){ if(this.activeTab != "publications" && this.showPublications){
this.fetchPublications.searchUtils.status = this.errorCodes.LOADING; this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
this.fetchPublications.results = []; this.fetchPublications.results = [];

View File

@ -9,7 +9,7 @@ import {Observable} from 'rxjs';
import {Filter, Value, AdvancedField} from '../searchUtils/searchHelperClasses.class'; import {Filter, Value, AdvancedField} from '../searchUtils/searchHelperClasses.class';
import {SearchResult} from '../../utils/entities/searchResult'; import {SearchResult} from '../../utils/entities/searchResult';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass} from './searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from './searchUtils.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ModalLoading} from '../../utils/modal/loading.component';
import {StringUtils, Dates} from '../../utils/string-utils.class'; import {StringUtils, Dates} from '../../utils/string-utils.class';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
@ -43,6 +43,7 @@ export class AdvancedSearchPageComponent {
@Input() oldTotalResults: number = 0; @Input() oldTotalResults: number = 0;
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() sort: boolean = false; @Input() sort: boolean = false;
@Input() searchFormClass: string = "searchForm"; @Input() searchFormClass: string = "searchForm";
piwiksub: any; piwiksub: any;
@ -256,6 +257,10 @@ export class AdvancedSearchPageComponent {
//community //community
if(this.connectCommunityId ){ if(this.connectCommunityId ){
params += (countParams == 0 ? "" : " and " ) + "communityId exact "+'"' + this.connectCommunityId +'"' + " "; params += (countParams == 0 ? "" : " and " ) + "communityId exact "+'"' + this.connectCommunityId +'"' + " ";
countParams++;
}
if(this.customFilter){
params+= (countParams == 0 ? "" : " and " ) + this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId ));
} }
return params; return params;

View File

@ -9,7 +9,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass} from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
@ -24,7 +24,7 @@ import {StringUtils} from '../../utils/string-utils.class';
<div *ngIf="status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger" role="alert">No filters found</div--> <div *ngIf="status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger" role="alert">No filters found</div-->
<errorMessages [status]="[status]" [type]="'results'"></errorMessages> <errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<div class ="uk-grid"> <div class ="uk-grid" *ngIf="status ===errorCodes.DONE">
<div *ngFor= "let filter of filters" class = "uk-margin-bottom uk-width-1-3@l uk-width-1-3@m uk-width-1-2@s"> <div *ngFor= "let filter of filters" class = "uk-margin-bottom uk-width-1-3@l uk-width-1-3@m uk-width-1-2@s">
<browse-statistic [baseUrl]=baseUrl [filter]=filter ></browse-statistic> <browse-statistic [baseUrl]=baseUrl [filter]=filter ></browse-statistic>
</div> </div>
@ -41,6 +41,7 @@ export class BrowseEntitiesComponent {
@Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS; @Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS;
@Input() properties:EnvProperties; @Input() properties:EnvProperties;
@Input() connectCommunityId =null; @Input() connectCommunityId =null;
@Input() customFilter:SearchCustomFilter= null;
public sub: any; public sub: any;
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
@ -74,7 +75,9 @@ private getStats(){
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null;
if(this.customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
}
this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName, this.properties,refineParams).subscribe( this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName, this.properties,refineParams).subscribe(
data => { data => {
//console.info("Get Stats for "+this.entityName+ ": [Total:"+data[0]+" ] [fields: "+data[1].length+"]"); //console.info("Get Stats for "+this.entityName+ ": [Total:"+data[0]+" ] [fields: "+data[1].length+"]");

View File

@ -7,7 +7,7 @@ import {Title, Meta} from '@angular/platform-browser';
import {Filter, Value} from './searchHelperClasses.class'; import {Filter, Value} from './searchHelperClasses.class';
import {SearchFields} from '../../utils/properties/searchFields'; import {SearchFields} from '../../utils/properties/searchFields';
import {SearchUtilsClass} from './searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from './searchUtils.class';
import {DOI, StringUtils} from '../../utils/string-utils.class'; import {DOI, StringUtils} from '../../utils/string-utils.class';
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ModalLoading} from '../../utils/modal/loading.component';
@ -48,6 +48,7 @@ export class SearchPageComponent {
@Input() searchFormClass: string = "searchForm"; @Input() searchFormClass: string = "searchForm";
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() sort: boolean = false; @Input() sort: boolean = false;
@Input() mapUrl: string = ""; @Input() mapUrl: string = "";
@Input() mapTooltipType: string ="content providers"; @Input() mapTooltipType: string ="content providers";
@ -175,7 +176,9 @@ export class SearchPageComponent {
if(this.connectCommunityId ){ if(this.connectCommunityId ){
allFqs+= "&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId ))); allFqs+= "&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )));
} }
if(this.customFilter){
allFqs+= "&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
}
var keyword = params['keyword']; var keyword = params['keyword'];
var doiQuery = ""; var doiQuery = "";
var keywordQuery = ""; var keywordQuery = "";

View File

@ -8,3 +8,28 @@ export class SearchUtilsClass{
totalResultsNoFilters:number; // for organization landing - tab with projects totalResultsNoFilters:number; // for organization landing - tab with projects
sortBy: string = ""; sortBy: string = "";
} }
export class SearchCustomFilter{
fieldName:string; //Country
queryFieldName:string; //country
valueId:string; //gr
valueName:string; // Greece
isApplied:boolean;
constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
this.isApplied = true;
this.fieldName = fieldName;
this.queryFieldName = queryFieldName;
this.valueId = valueId;
this.valueName = valueName;
}
// public setFilter(filter:SearchCustomFilter){
// if(!filter){
// return;
// }
// this.fieldName = filter.fieldName;
// this.queryFieldName = filter.queryFieldName;
// this.valueId = filter.valueId;
// this.valueName = filter.valueName;
// }
}

View File

@ -9,7 +9,7 @@ import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -47,6 +47,7 @@ export class SearchDatasetsComponent {
public baseUrl:string; public baseUrl:string;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils:SearchUtilsClass = new SearchUtilsClass();
private sub: any; private sub: any;
@ -109,6 +110,7 @@ properties: EnvProperties;
} }
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -8,7 +8,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@Component({ @Component({
@ -53,6 +53,7 @@ export class SearchOrganizationsComponent {
pagingLimit = 0; pagingLimit = 0;
properties: EnvProperties; properties: EnvProperties;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@Input() customFilter:SearchCustomFilter= null;
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) { constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
@ -93,6 +94,7 @@ properties: EnvProperties;
this.searchUtils.size = 10; this.searchUtils.size = 10;
} }
this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
}); });

View File

@ -9,7 +9,7 @@ import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -45,6 +45,7 @@ export class SearchOrpsComponent {
public baseUrl:string; public baseUrl:string;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils:SearchUtilsClass = new SearchUtilsClass();
private sub: any; private sub: any;
@ -106,6 +107,7 @@ properties: EnvProperties;
} }
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -10,7 +10,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass} from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -70,6 +70,7 @@ export class SearchPublicationsComponent {
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
pagingLimit = 0; pagingLimit = 0;
public sort: boolean = true; public sort: boolean = true;
@ -118,6 +119,7 @@ properties: EnvProperties;
} }
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}); });

View File

@ -9,7 +9,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchPageComponent } from '../searchUtils/searchPage.component';
import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -27,7 +27,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [oldTotalResults]="oldTotalResults"
searchFormClass="softwareSearchForm" searchFormClass="softwareSearchForm"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLinks
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
[(connectCommunityId)]=connectCommunityId [(connectCommunityId)]=connectCommunityId
@ -41,6 +41,7 @@ export class SearchSoftwareComponent {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string; @Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
public results =[]; public results =[];
@ -108,6 +109,7 @@ properties: EnvProperties;
} }
this.searchPage.connectCommunityId = this.connectCommunityId; this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -99,7 +99,7 @@ export class OrganizationService {
} }
if(!this.organizationInfo.projects.has(relation['funding']['funder'].name)) { if(!this.organizationInfo.projects.has(relation['funding']['funder'].name)) {
this.organizationInfo.projects.set(relation['funding']['funder'].name, this.organizationInfo.projects.setValues(relation['funding']['funder'].name,
new Array<{ "name": string, "id": string, "code": string, new Array<{ "name": string, "id": string, "code": string,
"acronym": string, "funder": string, "funderId": string, "acronym": string, "funder": string, "funderId": string,
"fundingStream": string, "fundingLevel1": string, "fundingLevel2": string, "fundingStream": string, "fundingLevel1": string, "fundingLevel2": string,

View File

@ -182,11 +182,14 @@ export class SearchOrganizationsService {
return this.numOfOrganizations(url, properties); return this.numOfOrganizations(url, properties);
} }
numOfSearchOrganizations(params: string, properties:EnvProperties ):any { numOfSearchOrganizations(params: string, properties:EnvProperties, refineParams:string=null ):any {
let url = properties.searchAPIURLLAst+"organizations/count?format=json"; let url = properties.searchAPIURLLAst+"organizations/count?format=json";
if(params != "") { if(params != "") {
url += "&q=" + StringUtils.URIEncode(params); url += "&q=" + StringUtils.URIEncode(params);
} }
if(refineParams!= null && refineParams != '' ) {
url += refineParams;
}
return this.numOfOrganizations(url, properties); return this.numOfOrganizations(url, properties);
} }
} }

View File

@ -12,11 +12,13 @@
</a> </a>
<a *ngIf="community && !homeurl" class="uk-navbar-item uk-logo" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank"> <a *ngIf="community && !homeurl" class="uk-navbar-item uk-logo" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank">
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName" class="uk-margin-left uk-text-large">
{{community.name}} </div>
</a> </a>
<a *ngIf="community && homeurl" class="uk-navbar-item uk-logo" routerLinkActive="uk-link" routerLink="/" > <a *ngIf="community && homeurl" class="uk-navbar-item uk-logo" routerLinkActive="uk-link" routerLink="/" >
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName" class="uk-margin-left uk-text-large">
{{community.name}} </div>
</a> </a>
</div> </div>
@ -114,12 +116,13 @@
<a *ngIf="community && homeurl" routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item"> <a *ngIf="community && homeurl" routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item">
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName" class="uk-margin-left uk-text-large"> {{community.name}} </div>
</a> </a>
<a *ngIf="community && !homeurl" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank" class="uk-logo uk-navbar-item"> <a *ngIf="community && !homeurl" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank" class="uk-logo uk-navbar-item">
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName"
class="uk-margin-left uk-text-large"> {{community.name}} </div>
</a> </a>
</div> </div>
<div class="uk-navbar-left uk-visible@m uk-hidden@l uk-width-1-3"> <div class="uk-navbar-left uk-visible@m uk-hidden@l uk-width-1-3">
@ -128,17 +131,19 @@
</a> </a>
<a *ngIf="community && homeurl" routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item"> <a *ngIf="community && homeurl" routerLinkActive="uk-link" routerLink="/" class="uk-logo uk-navbar-item">
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName"
class="uk-margin-left uk-text-large"> {{community.name}} </div>
</a> </a>
<a *ngIf="community && !homeurl" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank" class="uk-logo uk-navbar-item"> <a *ngIf="community && !homeurl" [href]="'https://'+(properties.environment =='beta'?'beta.':'')+community.id+'.openaire.eu'" target="_blank" class="uk-logo uk-navbar-item">
<img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height"> <img *ngIf="community.logoUrl && community.logoUrl.length > 0" src="{{community.logoUrl}}" [alt]=community.name class="uk-responsive-height">
<div *ngIf="!community.logoUrl || community.logoUrl.length == 0" class="uk-margin-left uk-text-large"> {{community.name}} </div> <div *ngIf="!community.logoUrl || community.logoUrl.length == 0 || showCommunityName"
class="uk-margin-left uk-text-large"> {{community.name}} </div>
</a> </a>
</div> </div>
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> --> <!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
<div *ngIf="!onlyTop" class="uk-navbar-right uk-position-top-right"> <div *ngIf="!onlyTop" class="uk-navbar-right uk-position-top-right">
<ul *ngIf= "isClient" class="uk-navbar-nav"> <ul *ngIf= "isClient" [class]="'uk-navbar-nav'+(!userMenu?' uk-margin-right':'')">
<ng-container *ngFor="let menu of menuItems"> <ng-container *ngFor="let menu of menuItems">
<li class="uk-parent" *ngIf="isAtleastOneEnabled(menu.rootItem.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)"> <li class="uk-parent" *ngIf="isAtleastOneEnabled(menu.rootItem.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)">
<!--a routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="" aria-expanded="false">{{menu.rootItem.title}}</a--> <!--a routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="" aria-expanded="false">{{menu.rootItem.title}}</a-->

View File

@ -20,7 +20,7 @@ export class NavigationBarComponent {
// @Input() logOutUrl; // @Input() logOutUrl;
// @Input() APIUrl; // @Input() APIUrl;
@Input() communityId; @Input() communityId;
// @Input() cookieDomain; @Input() showCommunityName:boolean = false;
@Input() userMenuItems:MenuItem[] ; @Input() userMenuItems:MenuItem[] ;
@Input() menuItems:RootMenuItem [] ; @Input() menuItems:RootMenuItem [] ;
@Input() community: {id:string, name:string, logoUrl:string}; @Input() community: {id:string, name:string, logoUrl:string};

View File

@ -1,7 +1,7 @@
import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {SearchDatasetsService} from '../../services/searchDatasets.service';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -40,7 +40,7 @@ export class FetchDatasets{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -59,7 +59,9 @@ export class FetchDatasets{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null;
if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
}
this.subResults = this._searchDatasetsService.searchDatasets(parameters,refineParams, page, size, "", [], properties).subscribe( this.subResults = this._searchDatasetsService.searchDatasets(parameters,refineParams, page, size, "", [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];

View File

@ -1,7 +1,7 @@
import {SearchOrpsService} from '../../services/searchOrps.service'; import {SearchOrpsService} from '../../services/searchOrps.service';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -41,7 +41,7 @@ export class FetchOrps{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -59,6 +59,9 @@ export class FetchOrps{
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null;
if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
}
this.subResults = this._searchOrpsService.searchOrps(parameters,refineParams, page, size, "", [], properties).subscribe( this.subResults = this._searchOrpsService.searchOrps(parameters,refineParams, page, size, "", [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];

View File

@ -3,7 +3,7 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -52,7 +52,7 @@ export class FetchPublications {
} }
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -72,6 +72,9 @@ export class FetchPublications {
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null;
if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
}
this.subResults = this._searchPublicationsService.searchPublications(parameters,refineParams, page, size, "", [], properties).subscribe( this.subResults = this._searchPublicationsService.searchPublications(parameters,refineParams, page, size, "", [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];

View File

@ -1,7 +1,7 @@
import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {SearchSoftwareService} from '../../services/searchSoftware.service';
import { ErrorCodes} from '../../utils/properties/errorCodes'; import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
@ -41,7 +41,7 @@ export class FetchSoftware{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -60,7 +60,9 @@ export class FetchSoftware{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null;
if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
}
this.subResults = this._searchSoftwareService.searchSoftware(parameters,refineParams, page, size, "", [], properties).subscribe( this.subResults = this._searchSoftwareService.searchSoftware(parameters,refineParams, page, size, "", [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];