[Library|Trunk]

Claims:
	update search forms and filters according to the new design (Projects, Results)
	add result type as Refine field
	add range filter component
	make basket stiky
	make alert close to work
	change research results -> research outcomes

Range Filters:
	add showQuickButtons
	smaller input, - between the inputs
	

Search:
	change research results -> research outcomes in placeholder
	NewSearchPage: make static method that creates range query 

Fields:
	add resulttypeId
	change Year range to Active within for projects

	



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58697 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-05-14 14:38:50 +00:00
parent 81b260efdf
commit a142f0e457
15 changed files with 482 additions and 165 deletions

View File

@ -3,7 +3,15 @@
<!-- <helper div="link-project-form" tooltip=true></helper> --> <!-- <helper div="link-project-form" tooltip=true></helper> -->
</div> </div>
<input class=" uk-input uk-width-large" [(ngModel)]="keyword" name="keyword" placeholder="Search for projects..."/> <!-- <input class=" uk-input uk-width-large" [(ngModel)]="keyword" name="keyword" placeholder="Search for projects..."/>-->
<div class="uk-inline">
<a *ngIf="keyword.length > 0" class="uk-form-icon uk-form-icon-flip"
(click)="keyword = ''"
uk-icon="icon: close"></a>
<input type="text" class="uk-input uk-width-xlarge@l uk-width-large@m uk-width-medium"
placeholder="Search for projects..." aria-describedby="sizing-addon2"
[(ngModel)]="keyword" name="keyword">
</div>
<span class="input-group-btn space"> <span class="input-group-btn space">
<button (click)="search(page,size)" type="submit" class=" uk-button portal-button">Search</button> <button (click)="search(page,size)" type="submit" class=" uk-button portal-button">Search</button>
</span> </span>
@ -59,19 +67,68 @@
</div> </div>
</div> --> </div> -->
<div *ngIf="countFilters()>0" class="uk-grid uk-flex uk-flex-bottom">
<div class="uk-grid">
<h5 class="uk-text-bold">Filters</h5>
<a *ngIf="countFilters()>1" (click)="clearFilters()"
[class]="((openaireResultsStatus ==
errorCodes.LOADING)?'uk-disabled uk-link-muted':'')+' portal-link '">
Clear All
</a>
</div>
<div *ngIf="countFilters()>0" class="uk-grid uk-grid-small uk-text-small uk-margin-small-top " uk-grid>
<ng-container *ngFor="let filter of rangeFilters " >
<ng-container *ngIf = "filter.selectedFromAndToValues">
<span [title]="'Remove '+ filter.selectedFromAndToValues" (click) = "removeRangeFilter(filter) " >
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left">{{filter.selectedFromAndToValues}}</span>
</a>
</span>
</span>
</ng-container>
</ng-container>
<ul class="uk-list"> <ng-container *ngFor="let filter of filters " >
<ng-container *ngIf = "filter.countSelectedValues > 0">
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "
[title]="'Remove '+value.name" (click) = "removeFilter(value, filter) " >
<!-- if no grid on the div above, remove it and move class 'selectedFilterLabel' on top span -->
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left" [innerHtml]="(value.name.length > 34)?value.name.substring(0,34)+'...':value.name"></span>
</a>
</span>
</span>
</ng-container>
</ng-container>
</div>
</div>
<!--<ul class="uk-list">
<li class="uk-open"> <li class="uk-open">
<h5 class="uk-margin-bottom-remove ">Years range <h5 class="uk-margin-bottom-remove ">Active between
</h5> </h5>
<div aria-expanded="false"> <div aria-expanded="false">
<div class="searchFilterBoxValues "> <div class="searchFilterBoxValues ">
<form class="uk-inline"> <form class="uk-inline">
<input class=" uk-input uk-width-2-5" [(ngModel)]="startYear" name="keyword" <input class=" uk-input uk-width-2-5" [(ngModel)]="startYear" name="keyword"
placeholder="Start year"/> placeholder="Year (e.g 1990)"/>
<input class=" uk-input uk-width-2-5" [(ngModel)]="endYear" name="keyword" <input class=" uk-input uk-width-2-5" [(ngModel)]="endYear" name="keyword"
placeholder="End year"/> placeholder="Year (e.g 1990)"/>
<button type="submit" (click)="yearChanged()" style="cursor: pointer;" class="uk-icon"><svg width="20" <button type="submit" (click)="yearChanged()" style="cursor: pointer;" class="uk-icon"><svg width="20"
height="20" height="20"
viewBox="0 0 20 20" viewBox="0 0 20 20"
@ -84,12 +141,20 @@
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>-->
<ng-container *ngFor="let filter of rangeFilters">
<li>
<range-filter [isDisabled]="openaireResultsStatus ==
errorCodes.LOADING" [filter]="filter" (onFilterChange)="dateFilterChanged(filter)"
[showQuickButtons]="false"
></range-filter>
</li>
</ng-container>
<search-filter *ngFor="let filter of filters " [isDisabled]="false" [filter]="filter" [showResultCount]=true <search-filter *ngFor="let filter of filters " [isDisabled]="false" [filter]="filter" [showResultCount]=true
(onFilterChange)="filterChanged($event)"></search-filter> (onFilterChange)="filterChanged($event)"></search-filter>
</div> </div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column"> <div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix portal-hr "> <!-- <div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix portal-hr ">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="openaireResultsNum>0" class="uk-width-1-2"> <div *ngIf="openaireResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{openaireResultsNum|number}}</span> projects, page <span <span class="portal-color">{{openaireResultsNum|number}}</span> projects, page <span
@ -102,6 +167,26 @@
(pageChange)="openaireResultsPageChange($event)"></paging-no-load> (pageChange)="openaireResultsPageChange($event)"></paging-no-load>
</div> </div>
</div> </div>
</div>-->
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix ">
<div class= "paging-hr searchPaging uk-margin-small-bottom"
*ngIf="(openaireResultsNum > 0) || (openaireResultsStatus == errorCodes.LOADING)">
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="openaireResultsNum > 0">
{{openaireResultsNum|number}}
<span class="uk-text-muted uk-text-uppercase"> projects, page </span>
{{openaireResultsPage | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(openaireResultsNum)|number)}}
</div>
<div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand uk-padding-remove-left">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword"
[size]="size" (pageChange)="openaireResultsPageChange($event)"></paging-no-load>
</div>
</div>
</div>
</div> </div>
<div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" <div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div> role="alert"><span class="loading-gif uk-align-center"></span></div>

View File

@ -5,7 +5,10 @@ import {ClaimEntity, ClaimProject} from './claimHelper.class';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {StringUtils} from "../../utils/string-utils.class"; import {StringUtils} from "../../utils/string-utils.class";
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
import {SearchFields} from "../../utils/properties/searchFields";
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
declare var UIkit:any; declare var UIkit:any;
@ -54,10 +57,14 @@ export class ClaimProjectsSearchFormComponent {
public refineFieldsQuery: string = "&refine=true&fields=funder"; public refineFieldsQuery: string = "&refine=true&fields=funder";
filters = []; filters = [];
prevFilters = []; prevFilters = [];
startYear = ""; // startYear = "";
endYear = ""; // endYear = "";
public rangeFilters: RangeFilter[] = [];
public searchFields: SearchFields = new SearchFields();
public rangeFields:string[][] = this.searchFields.PROJECT_RANGE_FIELDS;
constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) { constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) {
this.elementRef = myElement; this.elementRef = myElement;
this.rangeFilters = RangeFilter.parse(this.rangeFields,"project");
} }
@ -205,12 +212,12 @@ export class ClaimProjectsSearchFormComponent {
query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
} }
if(this.startYear.length > 0 ){ /*if(this.startYear.length > 0 ){
query+='&fq=projectstartyear exact \"'+this.startYear+'\"' query+='&fq=projectstartyear exact \"'+this.startYear+'\"'
} }
if(this.endYear.length > 0 ){ if(this.endYear.length > 0 ){
query+='&fq=projectendyear exact \"'+this.endYear+'\"' query+='&fq=projectendyear exact \"'+this.endYear+'\"'
} }*/
let allFqs = ""; let allFqs = "";
for (let filter of this.filters){ for (let filter of this.filters){
if(filter.countSelectedValues > 0){ if(filter.countSelectedValues > 0){
@ -228,6 +235,11 @@ export class ClaimProjectsSearchFormComponent {
} }
} }
} }
for (let i=0; i<this.rangeFilters.length; i++){
let filter = this.rangeFilters[i];
//selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
allFqs+= NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i],filter.selectedFromValue, filter.selectedToValue, " within ", ">=" ,"<=", "and" )
}
return query+allFqs; return query+allFqs;
} }
@ -276,4 +288,72 @@ export class ClaimProjectsSearchFormComponent {
} }
return totalPages; return totalPages;
} }
getSelectedValues(filter): any {
var selected = [];
if (filter.countSelectedValues > 0) {
for (var i = 0; i < filter.values.length; i++) {
if (filter.values[i].selected) {
selected.push(filter.values[i]);
}
}
}
return selected;
}
dateFilterChanged(filter:RangeFilter) {
if (filter.selectedFromValue && filter.selectedToValue) {
filter.selectedFromAndToValues = filter.selectedFromValue + "-" + filter.selectedToValue;
} else if (filter.selectedFromValue) {
filter.selectedFromAndToValues = "From " + filter.selectedFromValue;
} else if (filter.selectedToValue) {
filter.selectedFromAndToValues = "Until " + filter.selectedToValue;
}
this.filterChanged(null);
}
private removeFilter(value: Value, filter: Filter) {
filter.countSelectedValues--;
if (value.selected == true) {
value.selected = false;
}
// this.search(false);
this.filterChanged(null);
}
public countFilters(): number {
let filters = 0;
for (let filter of this.filters) {
if (filter.countSelectedValues > 0) {
filters += filter.countSelectedValues;
}
}
for (let filter of this.rangeFilters) {
if (filter.selectedFromValue || filter.selectedToValue) {
filters += 1;
}
}
return filters;
}
private clearFilters() {
for (let i = 0; i < this.filters.length; i++) {
for (let j = 0; j < this.filters[i].countSelectedValues; j++) {
if (this.filters[i].values[j].selected) {
this.filters[i].values[j].selected = false;
}
this.filters[i].countSelectedValues = 0;
}
}
for(let filter of this.rangeFilters){
this.removeRangeFilter(filter);
}
this.filterChanged(null);
}
public removeRangeFilter(filter: RangeFilter) {
filter.selectedFromValue = null;
filter.selectedToValue = null;
filter.selectedFromAndToValues = null;
this.filterChanged(null);
}
} }

View File

@ -15,13 +15,14 @@ import {ClaimResultsModule} from './claimResults.module';
import {PagingModule } from '../../utils/paging.module'; import {PagingModule } from '../../utils/paging.module';
import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module'; import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module';
import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module";
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, CommonModule, SharedModule, CommonModule,
// LoadingModalModule, // LoadingModalModule,
ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule, ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule,
PagingModule, SearchFilterModule, ClaimResultsModule PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule
], ],
providers:[ providers:[
], ],

View File

@ -1,10 +1,18 @@
<form class=" uk-margin-top"> <form class=" uk-margin-top">
<div class="uk-margin-small-bottom">Start searching Research Results and add them to the Basket to Link <div class="uk-margin-small-bottom">Start searching Research Outcomes and add them to the Basket to Link
<!-- <helper div="link-entity-form" styleName="" tooltip=true></helper> --> <!-- <helper div="link-entity-form" styleName="" tooltip=true></helper> -->
</div> </div>
<input class=" uk-input uk-width-large form-control" [(ngModel)]="keyword" name="keyword" <!-- <input class=" uk-input uk-width-large form-control" [(ngModel)]="keyword" name="keyword"-->
placeholder="Search for research results..."/> <!-- placeholder="Search for research outcomes..."/>-->
<div class="uk-inline">
<a *ngIf="keyword.length > 0" class="uk-form-icon uk-form-icon-flip"
(click)="keyword = ''"
uk-icon="icon: close"></a>
<input type="text" class="uk-input uk-width-xlarge@l uk-width-large@m uk-width-medium"
placeholder="Search for research outcomes..." aria-describedby="sizing-addon2"
[(ngModel)]="keyword" name="keyword">
</div>
<span class="input-group-btn space"> <span class="input-group-btn space">
<button (click)="search(true)" type="submit" class=" uk-button portal-button">Search</button> <button (click)="search(true)" type="submit" class=" uk-button portal-button">Search</button>
</span> </span>
@ -14,14 +22,14 @@
</form> </form>
<div *ngIf="!showSearchResults"> <div *ngIf="!showSearchResults">
<div class="uk-text-center uk-text-large uk-text-muted uk-margin-large-top"> <div class="uk-text-center uk-text-large uk-text-muted uk-margin-large-top">
No research results yet...<br>Start searching for research results to add them in the Basket No research outcomes yet...<br>Start searching for research outcomes to add them in the Basket
</div> </div>
</div> </div>
<div *ngIf="showSearchResults" class="uk-margin-top uk-animation"> <div *ngIf="showSearchResults" class="uk-margin-top uk-animation">
<ul class="uk-tab" uk-tab="animation: uk-animation-fade"> <ul class="uk-tab" uk-tab="animation: uk-animation-fade">
<li (click)="clickTab('openaire')" [class]="(activeTab == 'openaire')?'uk-active':''"><a>Openaire <span <li (click)="clickTab('openaire')" [class]="(activeTab == 'openaire')?'uk-active':''"><a>Openaire <span
*ngIf="!(totalOpenaireCount==0 && openaireResultsStatus === errorCodes.LOADING)"> *ngIf="!(openaireResultsNum==0 && openaireResultsStatus === errorCodes.LOADING)">
({{totalOpenaireCount| number}})</span></a> ({{openaireResultsNum| number}})</span></a>
</li> </li>
<li (click)="clickTab('crossref')" [class]="(activeTab == 'crossref')?'uk-active':''"><a>Crossref <li (click)="clickTab('crossref')" [class]="(activeTab == 'crossref')?'uk-active':''"><a>Crossref
<span <span
@ -44,15 +52,23 @@
<div *ngIf="crossrefStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" <div *ngIf="crossrefStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available role="alert">Service not available
</div> </div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0" class="uk-clearfix portal-hr"> <div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0" class="uk-clearfix ">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="crossrefResultsNum>0" class="uk-width-1-2"> <!-- <div *ngIf="crossrefResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{crossrefResultsNum|number}}</span> results, page <span <span class="portal-color">{{crossrefResultsNum|number}}</span> research outcomes, page <span
class="portal-color">{{crossrefPage | number}}</span> of <span class="portal-color">{{crossrefPage | number}}</span> of <span
class="portal-color">{{countTotalPages(crossrefResultsNum)|number}}</span> class="portal-color">{{countTotalPages(crossrefResultsNum)|number}}</span>
</div>-->
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="crossrefResultsNum > 0">
{{crossrefResultsNum|number}}
<span class="uk-text-muted uk-text-uppercase"> research outcomes, page </span>
{{crossrefPage | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(countTotalPages(crossrefResultsNum)|number)}}
</div> </div>
<div class="uk-width-1-2"> <div class="uk-width-1-2 uk-padding-remove-left">
<paging-no-load class="uk-float-right" [currentPage]="crossrefPage" [totalResults]="crossrefResultsNum" <paging-no-load class="uk-float-right" [currentPage]="crossrefPage" [totalResults]="crossrefResultsNum"
[term]="keyword" [term]="keyword"
[size]="size" (pageChange)="crossrefPageChange($event)"></paging-no-load> [size]="size" (pageChange)="crossrefPageChange($event)"></paging-no-load>
@ -71,42 +87,60 @@
<div *ngIf="activeTab == 'openaire'" id="openaire" class="uk-animation-fade"> <div *ngIf="activeTab == 'openaire'" id="openaire" class="uk-animation-fade">
<div class="uk-grid"> <div class="uk-grid">
<div class="search-filters uk-width-medium"> <div class="search-filters uk-width-medium">
<!-- <div class="uk-width-1-1 uk-margin-small-bottom "> <div *ngIf="countFilters()>0" class="uk-grid uk-flex uk-flex-bottom">
<div class="uk-grid">
<div *ngIf="countFilters()>0" class="uk-margin-small-bottom"> <h5 class="uk-text-bold">Filters</h5>
<a *ngIf="countFilters()>1" (click)="clearFilters()"
&lt;!&ndash;<span *ngIf = "searchUtils.keyword.length > 0"><span class="uk-text-bold">Keywords:</span> [class]="((openaireResultsStatus ==
<a (click) = "clearKeywords() " title="Remove keywords" [class]="((disableForms)?' uk-disabled':' ')+' portal-color '"><span class=" clickable " aria-hidden="true"><span class="uk-icon "> errorCodes.LOADING)?'uk-disabled uk-link-muted':'')+' portal-link '">
<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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="searchUtils.keyword"></span>
</span>&ndash;&gt;
<div *ngFor="let filter of openaireResultsfilters " >
<span *ngIf = "filter.countSelectedValues > 0"> <span class="uk-text-bold">{{filter.title}}:</span>
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >
<a [title]="'Remove '+value.name"(click) = "removeFilter(value, filter) "
[class]="((openaireResultsStatus === errorCodes.LOADING)?' uk-disabled':' ')+' portal-color '"><span class=" clickable" aria-hidden="true"><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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="(value.name.length > 25)?value.name.substring(0,25)+'...':value.name" [title]="value.name"></span><span *ngIf="!end" class=" ">, </span>
</span>
</span>
</div>
</div>
<div class="uk-margin-small-bottom uk-margin-small-top uk-grid">
<a *ngIf="countFilters()>1" (click)="clearFilters()" [class]="((openaireResultsStatus ===
errorCodes.LOADING)?'uk-disabled uk-link-muted':'')+' portal-link ' + 'uk-width-1-2'">
Clear All Clear All
</a> </a>
</div> </div>
</div>--> <div *ngIf="countFilters()>0" class="uk-grid uk-grid-small uk-text-small uk-margin-small-top " uk-grid>
<ng-container *ngFor="let filter of rangeFilters " >
<ng-container *ngIf = "filter.selectedFromAndToValues">
<span [title]="'Remove '+ filter.selectedFromAndToValues" (click) = "removeRangeFilter(filter) " >
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left">{{filter.selectedFromAndToValues}}</span>
</a>
</span>
</span>
</ng-container>
</ng-container>
<ng-container *ngFor="let filter of openaireResultsfilters " >
<ng-container *ngIf = "filter.countSelectedValues > 0">
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "
[title]="'Remove '+value.name" (click) = "removeFilter(value, filter) " >
<!-- if no grid on the div above, remove it and move class 'selectedFilterLabel' on top span -->
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<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.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left" [innerHtml]="(value.name.length > 34)?value.name.substring(0,34)+'...':value.name"></span>
</a>
</span>
</span>
</ng-container>
</ng-container>
</div>
</div>
<!-- Type filter--> <!-- Type filter-->
<ul class="uk-list" > <ul class="uk-list" >
<li class="uk-open uk-margin-small-bottom"> <!--<li class="uk-open uk-margin-small-bottom">
<h5 class="uk-margin-bottom-remove ">Result Type (4) <h5 class="uk-margin-bottom-remove ">Result Type (4)
</h5> </h5>
<div aria-expanded="false"> <div aria-expanded="false">
@ -123,40 +157,32 @@
</div> </div>
</div> </div>
</div> </div>
</li> </li>-->
<li class="uk-open">
<h5 class="uk-margin-bottom-remove">Published in
</h5>
<div aria-expanded="false">
<div class="searchFilterBoxValues ">
<form class="uk-inline">
<input class=" uk-input uk-width-small" [(ngModel)]="openaireYear" name="keyword" <ng-container *ngFor="let filter of rangeFilters">
placeholder="Year (e.g. 2010)"/> <li>
<button type="submit" (click)="yearChanged()" style="cursor: pointer;" class="uk-icon"> <range-filter [isDisabled]="openaireResultsStatus ==
<svg width="20" height="20" errorCodes.LOADING" [filter]="filter" (onFilterChange)="dateFilterChanged(filter)"
viewBox="0 0 20 20" [showQuickButtons]="false"
xmlns="http://www.w3.org/2000/svg" ></range-filter>
icon="chevron-right"
ratio="1">
<polyline
fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline>
</svg>
</button>
</form>
</div>
</div>
</li> </li>
</ng-container>
</ul> </ul>
<search-filter *ngFor="let filter of openaireResultsfilters " [isDisabled]="false" [filter]="filter" <search-filter *ngFor="let filter of openaireResultsfilters " [isDisabled]="openaireResultsStatus ==
errorCodes.LOADING" [filter]="filter"
[showResultCount]=true [showResultCount]=true
(onFilterChange)="filterChanged($event)"></search-filter> (onFilterChange)="filterChanged($event)"></search-filter>
</div> </div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column"> <div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
<div class="uk-margin-top"> <div class="uk-margin-top">
<!-- <quick-selections [resultTypes]="resultTypes"
(typeChange)="openaireTypeChanged()" [isDisabled]="openaireResultsStatus ==
errorCodes.LOADING"
[quickFilter]="quickFilter" [QFselected]="(quickFilter)?quickFilter.selected:null"
[properties]="properties">
</quick-selections>-->
<div *ngIf="openaireResultsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" <div *ngIf="openaireResultsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary"
role="alert">No Results found role="alert">No Results found
</div> </div>
@ -166,21 +192,26 @@
<div *ngIf="openaireResultsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" <div *ngIf="openaireResultsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available role="alert">Service not available
</div> </div>
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix portal-hr "> <div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix ">
<div class="uk-grid"> <div class= "paging-hr searchPaging uk-margin-small-bottom"
<div *ngIf="openaireResultsNum>0" class="uk-width-1-2"> *ngIf="(openaireResultsNum > 0) || (openaireResultsStatus == errorCodes.LOADING)">
<span class="portal-color">{{openaireResultsNum|number}}</span> results, page <span <div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
class="portal-color">{{openaireResultsPage | number}}</span> of <span <div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
class="portal-color">{{countTotalPages(openaireResultsNum)|number}}</span> *ngIf="openaireResultsNum > 0">
{{openaireResultsNum|number}}
<span class="uk-text-muted uk-text-uppercase"> research outcomes, page </span>
{{openaireResultsPage | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(countTotalPages(openaireResultsNum)|number)}}
</div> </div>
<div class="uk-width-1-2 uk-padding-remove"> <div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand uk-padding-remove-left" *ngIf=" openaireResultsStatus != errorCodes.LOADING">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage" <paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword" [totalResults]="openaireResultsNum" [term]="keyword"
[size]="size" (pageChange)="openaireResultsPageChange($event)"></paging-no-load> [size]="size" (pageChange)="openaireResultsPageChange($event)"></paging-no-load>
</div> </div>
</div> </div>
</div> </div>
</div>
<div *ngIf="openaireResultsStatus === errorCodes.LOADING" <div *ngIf="openaireResultsStatus === errorCodes.LOADING"
class="uk-animation-fade uk-margin-top uk-width-1-1" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div> role="alert"><span class="loading-gif uk-align-center"></span></div>
@ -201,15 +232,23 @@
class="uk-alert uk-alert-primary "> No results found class="uk-alert uk-alert-primary "> No results found
</div> </div>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " <div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) "
class="uk-clearfix portal-hr"> class="uk-clearfix">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="orcidResultsNum>0" class="uk-width-1-2"> <!--<div *ngIf="orcidResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{orcidResultsNum|number}}</span> results, page <span <span class="portal-color">{{orcidResultsNum|number}}</span> research outcomes, page <span
class="portal-color">{{orcidPage | number}}</span> of <span class="portal-color">{{orcidPage | number}}</span> of <span
class="portal-color">{{countTotalPages(orcidResultsNum)|number}}</span> class="portal-color">{{countTotalPages(orcidResultsNum)|number}}</span>
</div>-->
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="orcidResultsNum > 0">
{{orcidResultsNum|number}}
<span class="uk-text-muted uk-text-uppercase"> research outcomes, page </span>
{{orcidPage | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(countTotalPages(orcidResultsNum)|number)}}
</div> </div>
<div class="uk-width-1-2"> <div class="uk-width-1-2 uk-padding-remove-left">
<paging-no-load class="uk-float-right" [currentPage]="orcidPage" [totalResults]="orcidResultsNum" <paging-no-load class="uk-float-right" [currentPage]="orcidPage" [totalResults]="orcidResultsNum"
[term]="keyword" [size]="size" [term]="keyword" [size]="size"
(pageChange)="orcidPageChange($event)"></paging-no-load> (pageChange)="orcidPageChange($event)"></paging-no-load>
@ -258,15 +297,23 @@
role="alert">Service not available role="alert">Service not available
</div> </div>
<div class="uk-margin-top"> <div class="uk-margin-top">
<div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0" class="uk-clearfix portal-hr"> <div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0" class="uk-clearfix ">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="dataciteResultsNum>0" class="uk-width-1-2"> <!-- <div *ngIf="dataciteResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{dataciteResultsNum|number}}</span> results, page <span <span class="portal-color">{{dataciteResultsNum|number}}</span> research outcomes, page <span
class="portal-color">{{datacitePage | number}}</span> of <span class="portal-color">{{datacitePage | number}}</span> of <span
class="portal-color">{{countTotalPages(dataciteResultsNum)|number}}</span> class="portal-color">{{countTotalPages(dataciteResultsNum)|number}}</span>
</div>-->
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase"
*ngIf="dataciteResultsNum > 0">
{{dataciteResultsNum|number}}
<span class="uk-text-muted uk-text-uppercase"> research outcomes, page </span>
{{datacitePage | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(countTotalPages(dataciteResultsNum)|number)}}
</div> </div>
<div class="uk-width-1-2 "> <div class="uk-width-1-2 uk-padding-remove-left">
<paging-no-load class="uk-float-right" [currentPage]="datacitePage" [totalResults]="dataciteResultsNum" <paging-no-load class="uk-float-right" [currentPage]="datacitePage" [totalResults]="dataciteResultsNum"
[term]="keyword" [term]="keyword"
[size]="size" (pageChange)="datacitePageChange($event)"></paging-no-load> [size]="size" (pageChange)="datacitePageChange($event)"></paging-no-load>

View File

@ -10,6 +10,10 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {Observable, forkJoin} from "rxjs"; import {Observable, forkJoin} from "rxjs";
import 'rxjs/add/observable/forkJoin' import 'rxjs/add/observable/forkJoin'
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
import {SearchUtilsClass} from "../../searchPages/searchUtils/searchUtils.class";
import {SearchFields} from "../../utils/properties/searchFields";
@Component({ @Component({
selector: 'claim-result-search-form', selector: 'claim-result-search-form',
templateUrl: 'claimResultSearchForm.component.html', templateUrl: 'claimResultSearchForm.component.html',
@ -62,15 +66,15 @@ export class ClaimResultSearchFormComponent {
// public openaireRefineFields: string[] = ["relfunder", "relproject", "resultbestaccessright", "instancetypename", "resultlanguagename", "community"]; // public openaireRefineFields: string[] = ["relfunder", "relproject", "resultbestaccessright", "instancetypename", "resultlanguagename", "community"];
// public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=relproject&fields=resultacceptanceyear&fields=resultbestaccessright&fields=instancetypename&fields=resultlanguagename&fields=community"; // public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=relproject&fields=resultacceptanceyear&fields=resultbestaccessright&fields=instancetypename&fields=resultlanguagename&fields=community";
public openaireRefineFields: string[] = ["relfunder", "resultbestaccessright", "instancetypename"]; public openaireRefineFields: string[] = ["resulttypeid","relfunder", "resultbestaccessright", "instancetypename"];
public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=resultbestaccessright&fields=instancetypename"; public openaireRefineFieldsQuery: string = "&refine=true&fields=resulttypeid&fields=relfunder&fields=resultbestaccessright&fields=instancetypename";
// public fieldIdsMap=this.searchFields.RESULT_FIELDS; // public fieldIdsMap=this.searchFields.RESULT_FIELDS;
openaireResults: ClaimEntity[] = []; openaireResults: ClaimEntity[] = [];
openaireResultsNum: number; openaireResultsNum: number;
openaireResultsPage: number = 1; openaireResultsPage: number = 1;
openaireResultsStatus: number = this.errorCodes.NONE; openaireResultsStatus: number = this.errorCodes.NONE;
openaireResultsType = "publication"; // openaireResultsType = "publication";
orcidResults: ClaimEntity[]; orcidResults: ClaimEntity[];
orcidResultsNum: number; orcidResultsNum: number;
@ -91,6 +95,18 @@ export class ClaimResultSearchFormComponent {
reloadDatacite: boolean = false; reloadDatacite: boolean = false;
reloadOrcid: boolean = false; reloadOrcid: boolean = false;
//new search
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
filter: null,
selected: true,
filterId: "resultbestaccessright",
value: "Open Access"
};
resultTypes = {publication: true, dataset: true, software: true, other: true};
public rangeFilters: RangeFilter[] = [];
public searchFields: SearchFields = new SearchFields();
public rangeFields:string[][] = this.searchFields.RESULT_RANGE_FIELDS;
constructor(private _searchDataciteService: SearchDataciteService, constructor(private _searchDataciteService: SearchDataciteService,
private _searchCrossrefService: SearchCrossrefService, private _searchCrossrefService: SearchCrossrefService,
private _searchOrcidService: SearchOrcidService, private _searchOrcidService: SearchOrcidService,
@ -98,7 +114,7 @@ export class ClaimResultSearchFormComponent {
const myDate = new Date(); const myDate = new Date();
this.todayDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate(); this.todayDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
this.nextDate = (myDate.getFullYear() + 100) + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate(); this.nextDate = (myDate.getFullYear() + 100) + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
this.rangeFilters = RangeFilter.parse(this.rangeFields,"result");
} }
ngOnInit() { ngOnInit() {
@ -164,16 +180,7 @@ export class ClaimResultSearchFormComponent {
} }
searchOpenaire(keyword, size, page, keywordChanged) { searchOpenaire(keyword, size, page, keywordChanged) {
this.searchResearchResults("publication", keyword, size, page, true, "publication");
if (keywordChanged) {
this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "publication"),"publication");
this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "dataset"),"dataset");
this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "software"),"software");
this.callOpenaireService(keyword, size, page, (this.openaireResultsType == "other"),"other");
} else {
this.callOpenaireService(keyword, size, page, (this.openaireResultsType == this.openaireResultsType),this.openaireResultsType );
}
} }
private getCrossrefResults(term: string, size: number, page: number) { private getCrossrefResults(term: string, size: number, page: number) {
@ -261,7 +268,7 @@ export class ClaimResultSearchFormComponent {
} }
} }
private callOpenaireService(term: string, size: number, page: number, mainResults: boolean, type) { /*private callOpenaireService(term: string, size: number, page: number, mainResults: boolean, type) {
if (mainResults) { if (mainResults) {
this.openaireResultsStatus = this.errorCodes.LOADING; this.openaireResultsStatus = this.errorCodes.LOADING;
this.openaireResultsPrevFilters = this.openaireResultsfilters; this.openaireResultsPrevFilters = this.openaireResultsfilters;
@ -281,10 +288,13 @@ export class ClaimResultSearchFormComponent {
} }
} }*/
public searchResearchResults(resultType: string, term: string, size: number, page: number, mainResults: boolean, type) { public searchResearchResults(resultType: string, term: string, size: number, page: number, mainResults: boolean, type) {
this._searchResearchResultsService.search(resultType, this.createOpenaireQueryParams(), (mainResults && page==1 ?this.openaireRefineFieldsQuery:null), (mainResults?page:1), (mainResults?size:0), "", (mainResults && page==1 ?this.openaireRefineFields:[]), this.properties).subscribe( this.openaireResultsStatus = this.errorCodes.LOADING;
this.openaireResultsPrevFilters = this.openaireResultsfilters;
this.openaireResultsNum = 0;
this._searchResearchResultsService.advancedSearchResults('publication', this.createOpenaireQueryParams(), page, size, null, this.properties, this.createOpenaireRefineQueryParams(), (page==1 ?this.openaireRefineFields:[]), (page==1 ?this.openaireRefineFieldsQuery:null)).subscribe(
data => { data => {
this.setOpenaireResults(data, mainResults, page, type); this.setOpenaireResults(data, mainResults, page, type);
}, },
@ -296,10 +306,10 @@ export class ClaimResultSearchFormComponent {
public setOpenaireResults(data, mainResults: boolean, page, type) { public setOpenaireResults(data, mainResults: boolean, page, type) {
if (data != null) { if (data != null) {
if (mainResults) {
this.openaireResultsPage = page; this.openaireResultsPage = page;
this.openaireResultsNum = data[0]; this.openaireResultsNum = data[0];
this.setOpenaireResultsCount(type, this.openaireResultsNum); // this.setOpenaireResultsCount(type, this.openaireResultsNum);
if(data[2] && data[2].length > 0){ if(data[2] && data[2].length > 0){
this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters) this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters)
} }
@ -308,11 +318,6 @@ export class ClaimResultSearchFormComponent {
if (this.openaireResultsNum == 0) { if (this.openaireResultsNum == 0) {
this.openaireResultsStatus = this.errorCodes.NONE; this.openaireResultsStatus = this.errorCodes.NONE;
} }
} else {
this.setOpenaireResultsCount(type, data[0]);
}
this.totalOpenaireCount +=+data[0];
} else { } else {
if (mainResults) { if (mainResults) {
this.openaireResultsStatus = this.errorCodes.ERROR; this.openaireResultsStatus = this.errorCodes.ERROR;
@ -563,7 +568,7 @@ export class ClaimResultSearchFormComponent {
createOpenaireQueryParams():string { createOpenaireQueryParams():string {
let query = ""; let query = "";
if (this.DOIs.length > 0) { /* if (this.DOIs.length > 0) {
let doisParams = ""; let doisParams = "";
for (let i = 0; i < this.DOIs.length; i++) { for (let i = 0; i < this.DOIs.length; i++) {
doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + this.DOIs[i] + '"'; doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + this.DOIs[i] + '"';
@ -571,11 +576,17 @@ export class ClaimResultSearchFormComponent {
query += doisParams; query += doisParams;
} else if(this.keyword.length > 0){ } else if(this.keyword.length > 0){
query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
}*/
if(this.keyword.length>0){
query+=NewSearchPageComponent.createKeywordQuery("result",this.keyword,"q","=");
} }
if(this.openaireYear.length > 0 ){ return query;
query+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"'
} }
createOpenaireRefineQueryParams():string {
let allFqs = ""; let allFqs = "";
if(this.openaireYear.length > 0 ){
allFqs+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"'
}
for (let filter of this.openaireResultsfilters){ for (let filter of this.openaireResultsfilters){
if(filter.countSelectedValues > 0){ if(filter.countSelectedValues > 0){
let count_selected=0; let count_selected=0;
@ -592,7 +603,30 @@ export class ClaimResultSearchFormComponent {
} }
} }
} }
return query+allFqs; for (let i=0; i<this.rangeFilters.length; i++){
let filter = this.rangeFilters[i];
//selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
allFqs+= NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i],filter.selectedFromValue, filter.selectedToValue, " within ", ">=" ,"<=", "and" )
}
if(this.resultTypes.publication && this.resultTypes.dataset && this.resultTypes.software && this.resultTypes.other){
allFqs += "&type=results";
}else{
if(this.resultTypes.publication) {
allFqs += "&type=publications";
}
if(this.resultTypes.dataset) {
allFqs += "&type=datasets";
}
if(this.resultTypes.software) {
allFqs += "&type=software";
}
if(this.resultTypes.other) {
allFqs += "&type=other";
}
}
return allFqs;
} }
@ -707,8 +741,8 @@ export class ClaimResultSearchFormComponent {
} }
} }
public openaireTypeChanged(type) { public openaireTypeChanged() {
this.openaireResultsType = type; // this.openaireResultsType = type;
this.reloadOpenaire = true; this.reloadOpenaire = true;
this.openaireYear = ""; this.openaireYear = "";
this.openaireResultsfilters = []; this.openaireResultsfilters = [];
@ -750,8 +784,8 @@ export class ClaimResultSearchFormComponent {
if (value.selected == true) { if (value.selected == true) {
value.selected = false; value.selected = false;
} }
this.search(false); // this.search(false);
this.filterChanged(null);
} }
public countFilters(): number { public countFilters(): number {
@ -761,10 +795,11 @@ export class ClaimResultSearchFormComponent {
filters += filter.countSelectedValues; filters += filter.countSelectedValues;
} }
} }
if (this.keyword.length > 0) { for (let filter of this.rangeFilters) {
filters++; if (filter.selectedFromValue || filter.selectedToValue) {
filters += 1;
}
} }
return filters; return filters;
} }
@ -777,9 +812,21 @@ export class ClaimResultSearchFormComponent {
this.openaireResultsfilters[i].countSelectedValues = 0; this.openaireResultsfilters[i].countSelectedValues = 0;
} }
} }
for(let filter of this.rangeFilters){
this.removeRangeFilter(filter);
}
this.filterChanged(null);
}
dateFilterChanged(filter:RangeFilter) {
if (filter.selectedFromValue && filter.selectedToValue) {
filter.selectedFromAndToValues = filter.selectedFromValue + "-" + filter.selectedToValue;
} else if (filter.selectedFromValue) {
filter.selectedFromAndToValues = "From " + filter.selectedFromValue;
} else if (filter.selectedToValue) {
filter.selectedFromAndToValues = "Until " + filter.selectedToValue;
}
this.filterChanged(null);
} }
filterChanged($event) { filterChanged($event) {
// console.log("filterChanged"); // console.log("filterChanged");
this.reloadOpenaire = true; this.reloadOpenaire = true;
@ -822,7 +869,7 @@ export class ClaimResultSearchFormComponent {
} }
return totalPages; return totalPages;
} }
getTotalOpenaireNumber():number{ /* getTotalOpenaireNumber():number{
let count = 0; let count = 0;
for(let i=0; i<this.openaireResultsType.length; i++){ for(let i=0; i<this.openaireResultsType.length; i++){
if(this.openaireResultsType[i]["count]"]!=null){ if(this.openaireResultsType[i]["count]"]!=null){
@ -830,8 +877,8 @@ export class ClaimResultSearchFormComponent {
} }
} }
return count; return count;
} }*/
public _formatName(value, number){ /* public _formatName(value, number){
let maxLineLength = 29; let maxLineLength = 29;
//1 space after checkbox //1 space after checkbox
//3 space before number + parenthesis //3 space before number + parenthesis
@ -841,5 +888,13 @@ export class ClaimResultSearchFormComponent {
return value.substr(0, (maxLineLength- 3 -1 ))+'...'; return value.substr(0, (maxLineLength- 3 -1 ))+'...';
} }
return value; return value;
}*/
public removeRangeFilter(filter: RangeFilter) {
filter.selectedFromValue = null;
filter.selectedToValue = null;
filter.selectedFromAndToValues = null;
this.filterChanged(null);
} }
} }

View File

@ -15,10 +15,12 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
import {PagingModule } from '../../utils/paging.module'; import {PagingModule } from '../../utils/paging.module';
import {HelperModule} from '../../utils/helper/helper.module'; import {HelperModule} from '../../utils/helper/helper.module';
import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module'; import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module';
import {QuickSelectionsModule} from "../../searchPages/searchUtils/quick-selections.module";
import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module";
@NgModule({ @NgModule({
imports: [SharedModule, CommonModule, SearchResearchResultsServiceModule, PagingModule, SearchCrossrefServiceModule, imports: [SharedModule, CommonModule, SearchResearchResultsServiceModule, PagingModule, SearchCrossrefServiceModule,
SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule], SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule, QuickSelectionsModule, RangeFilterModule],
providers:[ providers:[
SearchOrcidService SearchOrcidService
], ],

View File

@ -8,7 +8,7 @@
<div id="tm-main" class="uk-section uk-padding-remove-top tm-middle" *ngIf="showOptions.show != 'claim'"> <div id="tm-main" class="uk-section uk-padding-remove-top tm-middle" *ngIf="showOptions.show != 'claim'">
<div class="uk-grid"> <div class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Link your research results" type="other"></schema2jsonld> <schema2jsonld *ngIf="url" [URL]="url" name="Link your research outcomes" type="other"></schema2jsonld>
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '"> <div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div> <div>
<!-- <div class="uk-width-1-1"> <!-- <div class="uk-width-1-1">
@ -22,6 +22,7 @@
<div style="" <div style=""
[class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '"> [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div id="basketStickTop"></div>
<div class="uk-grid" *ngIf="showOptions.show!='claim'" > <div class="uk-grid" *ngIf="showOptions.show!='claim'" >
<div class="uk-width-2-3"> <div class="uk-width-2-3">
<div class="uk-margin-small-bottom"> <div class="uk-margin-small-bottom">
@ -100,6 +101,8 @@
</div> </div>
<!-- Basket--> <!-- Basket-->
<div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3" style="" > <div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3" style="" >
<div id="basket" uk-sticky=" offset: 130; top:#basketStickTop; bottom: #basketStickBottom;"
style="z-index: 0">
<div class="linksbasketheader uk-margin-bottom uk-text-bold uk-h5"> <div class="linksbasketheader uk-margin-bottom uk-text-bold uk-h5">
LINKS BASKET LINKS BASKET
</div> </div>
@ -286,6 +289,8 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div id="basketStickBottom"></div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']"></helper> <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']"></helper>
</div> </div>

View File

@ -96,7 +96,7 @@ export class SearchComponent {
@Input() name; @Input() name;
@Input() customFilter: SearchCustomFilter = 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 outcomes, projects, content providers & organizations in OpenAIRE";
public subPub; public subPub;

View File

@ -93,7 +93,7 @@ export class SearchAllComponent {
@Input() name; @Input() name;
@Input() customFilter: SearchCustomFilter = 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 outcomes, projects, content providers & organizations in OpenAIRE";
public subPub; public subPub;

View File

@ -975,7 +975,7 @@ export class NewSearchPageComponent {
// selectedToValue = value.substring(10, 14); // selectedToValue = value.substring(10, 14);
// } // }
if(this.rangeFields[i][0] == this.rangeFields[i][1]) { /*if(this.rangeFields[i][0] == this.rangeFields[i][1]) {
//console.log(selectedFromValue + " - "+selectedToValue); //console.log(selectedFromValue + " - "+selectedToValue);
if (selectedFromValue && selectedToValue) { if (selectedFromValue && selectedToValue) {
let equalityOp = this.fieldIdsMap[filterId].equalityOperator; let equalityOp = this.fieldIdsMap[filterId].equalityOperator;
@ -1011,7 +1011,8 @@ export class NewSearchPageComponent {
if(selectedFromValue || selectedToValue) { if(selectedFromValue || selectedToValue) {
fq = "&fq=" + StringUtils.URIEncode(fq); fq = "&fq=" + StringUtils.URIEncode(fq);
} }
} }*/
fq = NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i], selectedFromValue, selectedToValue, this.fieldIdsMap[filterId].equalityOperator, this.fieldIdsMap[this.rangeFields[i][0]].equalityOperator, this.fieldIdsMap[this.rangeFields[i][1]].equalityOperator, filterOp );
} }
} }
} }
@ -1022,7 +1023,44 @@ export class NewSearchPageComponent {
return allFqs; return allFqs;
} }
// createRangeFilterQuery(this.rangeFields[i], selectedFromValue, selectedToValue, this.fieldIdsMap[this.rangeFields[i][0]].equalityOperator, this.fieldIdsMap[this.rangeFields[i][1]].equalityOperator; filterOp )
public static createRangeFilterQuery(rangeField,selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){
let fq="";
if(rangeField[0] == rangeField[1]) {
//console.log(selectedFromValue + " - "+selectedToValue);
if (selectedFromValue && selectedToValue) {
fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOp + "\"" + selectedFromValue + " " + selectedToValue + "\"";
fq = "&fq=" + StringUtils.URIEncode(fq);
} else if (selectedFromValue) {
if(equalityOpFrom == " = ") {
equalityOpFrom = " >= ";
}
fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpFrom + "\"" + selectedFromValue + "\"";
fq = "&fq=" + StringUtils.URIEncode(fq);
} else if (selectedToValue) {
if(equalityOpTo == " = ") {
equalityOpTo = " <= ";
}
fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpTo + "\"" + selectedToValue + "\"";
fq = "&fq=" + StringUtils.URIEncode(fq);
}
} else {
if (selectedFromValue) {
fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[0] + equalityOpFrom + "\"" + selectedFromValue + "\"";
// fq = "&fq=" + StringUtils.URIEncode(fq);
}
if (selectedToValue) {
fq += (fq.length > 0 ? " " + filterOp + " " : "") + rangeField[1] + equalityOpTo + "\"" + selectedToValue + "\"";
// fq = "&fq=" + StringUtils.URIEncode(fq);
}
if(selectedFromValue || selectedToValue) {
fq = "&fq=" + StringUtils.URIEncode(fq);
}
}
return fq;
}
/** /**
* Sets parameterNames and parameterValues arrays * Sets parameterNames and parameterValues arrays
* used in paging, advanced search link, Goto() * used in paging, advanced search link, Goto()

View File

@ -5,7 +5,7 @@
Researcher? Researcher?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
Explore all OA research results. Link all your research. Build your profile Explore all OA research outcomes. Link all your research. Build your profile
</div> </div>
<p> <p>
<a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'explore.openaire.eu'" class="el-link uk-button uk-button-default"> <a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'explore.openaire.eu'" class="el-link uk-button uk-button-default">
@ -51,7 +51,7 @@
Research manager? Research manager?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
Use our monitoring services and easily track all relevant research results. Use our monitoring services and easily track all relevant research outcomes.
</div> </div>
<p> <p>
<a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.openaire.eu/moniotr':'monitor.openaire.eu')" class="el-link uk-button uk-button-default"> <a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.openaire.eu/moniotr':'monitor.openaire.eu')" class="el-link uk-button uk-button-default">

View File

@ -128,9 +128,9 @@ convertDatasource(datasource: any, URL, otherUrl): Organization {
private getTitle(result: any): String[] { private getTitle(result: any): String[] {
const title = _.get(result, "result.metadata.oaf:entity.oaf:result.title", null); const title = _.get(result, "result.metadata.oaf:entity.oaf:result.title", null);
if(title && Array.isArray(title) ){ if(title && Array.isArray(title) ){
return title[0].content; return (title[0] && title[0].content)?title[0].content:"";
}else{ }else{
return title.content; return (title && title.content)?title.content:"";
} }
} }

View File

@ -45,7 +45,8 @@ export class SearchFields {
["resultbestaccessright"]:{name:"Access Mode", type:"vocabulary", param:"access", operator: "ac", equalityOperator: " exact ", filterType: "radio"}, ["resultbestaccessright"]:{name:"Access Mode", type:"vocabulary", param:"access", operator: "ac", equalityOperator: " exact ", filterType: "radio"},
["collectedfrom"]:{name:"Collected From", type:"refine", param:"datasource", operator: "cl", equalityOperator: " exact ", filterType: "checkbox"}, ["collectedfrom"]:{name:"Collected From", type:"refine", param:"datasource", operator: "cl", equalityOperator: " exact ", filterType: "checkbox"},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact ", filterType: null}, ["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", operator: "og", equalityOperator: " exact ", filterType: null},
["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact ", filterType: null} ["collectedfromdatasourceid"]:{name:"Collected from Content Provider", type:"entity", param:"collectedFrom", operator: "cl", equalityOperator: " exact ", filterType: null},
["resulttypeid"]:{name:"Result type", type:"refine", param:"types", operator: "tp", equalityOperator: " exact ", filterType: "radio"}
}; };
//PROJECT //PROJECT
@ -70,7 +71,7 @@ export class SearchFields {
["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", operator: "fn2", equalityOperator: " exact ", filterType: "checkbox"}, ["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", operator: "fn2", equalityOperator: " exact ", filterType: "checkbox"},
["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", operator: "sy", equalityOperator: " <= ", filterType: "checkbox"}, ["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", operator: "sy", equalityOperator: " <= ", filterType: "checkbox"},
["projectendyear"]:{name:"End Year", type:"year", param:"endyear", operator: "ey", equalityOperator: " >= ", filterType: "checkbox"}, ["projectendyear"]:{name:"End Year", type:"year", param:"endyear", operator: "ey", equalityOperator: " >= ", filterType: "checkbox"},
["projectendyear-range-projectstartyear"]:{name:"Year range", type:"year", param:"year", operator: "ya", equalityOperator: " = ", filterType: "range"}, ["projectendyear-range-projectstartyear"]:{name:"Active within", type:"year", param:"year", operator: "ya", equalityOperator: " = ", filterType: "range"},
["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", operator: "sd", equalityOperator: " within ", filterType: null}, ["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", operator: "sd", equalityOperator: " within ", filterType: null},
["projectenddate"]:{name:"End Date", type:"date", param:"enddate", operator: "ed", equalityOperator: " within ", filterType: null}, ["projectenddate"]:{name:"End Date", type:"date", param:"enddate", operator: "ed", equalityOperator: " within ", filterType: null},
["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", operator: "sc", equalityOperator: " exact ", filterType: "radio"}, ["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", operator: "sc", equalityOperator: " exact ", filterType: "radio"},

View File

@ -10,10 +10,12 @@
<div class = "uk-animation-fade filterItem searchFilterItem uk-text-small"> <div class = "uk-animation-fade filterItem searchFilterItem uk-text-small">
<div class="searchFilterBoxValues "> <div class="searchFilterBoxValues ">
<form class="uk-inline uk-text-small form-group uk-margin-remove-bottom" #rangeForm="ngForm" fromYearAfterToYear> <form class="uk-inline uk-text-small form-group uk-margin-remove-bottom" #rangeForm="ngForm" fromYearAfterToYear>
<input class=" uk-input form-control uk-width-1-3" (focus)="focusedInput = 'from'" (blur)="focusedInput = ''" <input class=" uk-input form-control uk-width-1-3 uk-form-small" (focus)="focusedInput = 'from'"
(blur)="focusedInput = ''"
[(ngModel)]="filter.selectedFromValue" name="yearFrom" #yearFrom="ngModel" inValidYear [(ngModel)]="filter.selectedFromValue" name="yearFrom" #yearFrom="ngModel" inValidYear
placeholder="e.g. 1931" [disabled]="isDisabled"/> placeholder="e.g. 1931" [disabled]="isDisabled"/><span class="uk-margin-small-left uk-margin-small-right">-</span>
<input class=" uk-input form-control uk-width-1-3 uk-margin-left" (focus)="focusedInput = 'to'" (blur)="focusedInput = ''" <input class=" uk-input form-control uk-width-1-3 uk-form-small" (focus)="focusedInput = 'to'"
(blur)="focusedInput = ''"
[(ngModel)]="filter.selectedToValue" name="yearTo" #yearTo="ngModel" inValidYear [(ngModel)]="filter.selectedToValue" name="yearTo" #yearTo="ngModel" inValidYear
placeholder="e.g. 2020" [disabled]="isDisabled"/> placeholder="e.g. 2020" [disabled]="isDisabled"/>
<button type="submit" (click)="yearChanged()" <button type="submit" (click)="yearChanged()"
@ -38,7 +40,7 @@
Starting year must be greater than or equal to ending year. Starting year must be greater than or equal to ending year.
</div> </div>
<div> <div *ngIf="showQuickButtons">
<!-- Natalia's suggestion--> <!-- Natalia's suggestion-->
<div class="uk-margin-small uk-margin-top uk-text-left"> <div class="uk-margin-small uk-margin-top uk-text-left">

View File

@ -11,6 +11,7 @@ export class RangeFilterComponent {
@Input() filter:RangeFilter; @Input() filter:RangeFilter;
@Input() isDisabled:boolean = false; @Input() isDisabled:boolean = false;
@Input() showQuickButtons:boolean = true;
public _maxCharacters:number =28; public _maxCharacters:number =28;
public focusedInput: string = ""; public focusedInput: string = "";
public yearMin: number = Dates.yearMin; public yearMin: number = Dates.yearMin;