From a142f0e457059e0fd96e38891db433ff57b48c1f Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 14 May 2020 14:38:50 +0000 Subject: [PATCH] [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 --- .../claimProjectSearchForm.component.html | 99 +++++++- .../claimProjectSearchForm.component.ts | 90 ++++++- .../claimProjectSearchForm.module.ts | 13 +- .../claimResultSearchForm.component.html | 219 +++++++++++------- .../claimResultSearchForm.component.ts | 139 +++++++---- .../claimResultSearchForm.module.ts | 6 +- claims/linking/linkingGeneric.component.html | 11 +- searchPages/find/search.component.ts | 2 +- searchPages/find/searchAll.component.ts | 2 +- .../searchUtils/newSearchPage.component.ts | 42 +++- .../other-portals.component.html | 4 +- .../open-aire-jsonld-converter.service.ts | 4 +- utils/properties/searchFields.ts | 5 +- utils/rangeFilter/rangeFilter.component.html | 10 +- utils/rangeFilter/rangeFilter.component.ts | 1 + 15 files changed, 482 insertions(+), 165 deletions(-) diff --git a/claims/claim-utils/claimProjectSearchForm.component.html b/claims/claim-utils/claimProjectSearchForm.component.html index a781010b..34072d4a 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.html +++ b/claims/claim-utils/claimProjectSearchForm.component.html @@ -3,7 +3,15 @@ - + +
+ + +
@@ -59,19 +67,68 @@ --> +
+
+
Filters
+ + Clear All + +
+ +
+ + + +
  • + +
  • +
    -
    + +
    +
    +
    +
    + {{openaireResultsNum|number}} + projects, page + {{openaireResultsPage | number}} + of + {{(totalPages(openaireResultsNum)|number)}} +
    +
    + +
    +
    +
    diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 88222230..e5442576 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -5,7 +5,10 @@ import {ClaimEntity, ClaimProject} from './claimHelper.class'; import {EnvProperties} from '../../utils/properties/env-properties'; import {ErrorCodes} from '../../utils/properties/errorCodes'; 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; @@ -54,10 +57,14 @@ export class ClaimProjectsSearchFormComponent { public refineFieldsQuery: string = "&refine=true&fields=funder"; filters = []; prevFilters = []; - startYear = ""; - endYear = ""; + // startYear = ""; + // 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) { 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)); } - if(this.startYear.length > 0 ){ + /*if(this.startYear.length > 0 ){ query+='&fq=projectstartyear exact \"'+this.startYear+'\"' } if(this.endYear.length > 0 ){ query+='&fq=projectendyear exact \"'+this.endYear+'\"' - } + }*/ let allFqs = ""; for (let filter of this.filters){ if(filter.countSelectedValues > 0){ @@ -228,6 +235,11 @@ export class ClaimProjectsSearchFormComponent { } } } + for (let i=0; i=" ,"<=", "and" ) + } return query+allFqs; } @@ -276,4 +288,72 @@ export class ClaimProjectsSearchFormComponent { } 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); + } } diff --git a/claims/claim-utils/claimProjectSearchForm.module.ts b/claims/claim-utils/claimProjectSearchForm.module.ts index dcce3256..90384234 100644 --- a/claims/claim-utils/claimProjectSearchForm.module.ts +++ b/claims/claim-utils/claimProjectSearchForm.module.ts @@ -15,14 +15,15 @@ import {ClaimResultsModule} from './claimResults.module'; import {PagingModule } from '../../utils/paging.module'; import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module'; +import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module"; @NgModule({ - imports: [ - SharedModule, CommonModule, - // LoadingModalModule, - ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule, - PagingModule, SearchFilterModule, ClaimResultsModule - ], + imports: [ + SharedModule, CommonModule, + // LoadingModalModule, + ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule, + PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule + ], providers:[ ], declarations: [ diff --git a/claims/claim-utils/claimResultSearchForm.component.html b/claims/claim-utils/claimResultSearchForm.component.html index d77743a0..b6bae769 100644 --- a/claims/claim-utils/claimResultSearchForm.component.html +++ b/claims/claim-utils/claimResultSearchForm.component.html @@ -1,10 +1,18 @@
    -
    Start searching Research Results and add them to the Basket to Link +
    Start searching Research Outcomes and add them to the Basket to Link
    - + + +
    + + +
    @@ -14,14 +22,14 @@
    - No research results yet...
    Start searching for research results to add them in the Basket + No research outcomes yet...
    Start searching for research outcomes to add them in the Basket
    -
    +
    -
    - {{crossrefResultsNum|number}} results, page + {{crossrefResultsNum|number}} research outcomes, page {{crossrefPage | number}} of {{countTotalPages(crossrefResultsNum)|number}} +
    --> +
    + {{crossrefResultsNum|number}} + research outcomes, page + {{crossrefPage | number}} + of + {{(countTotalPages(crossrefResultsNum)|number)}}
    -
    - + @@ -166,18 +192,23 @@ -
    -
    -
    - {{openaireResultsNum|number}} results, page {{openaireResultsPage | number}} of {{countTotalPages(openaireResultsNum)|number}} - -
    -
    - +
    +
    +
    +
    + {{openaireResultsNum|number}} + research outcomes, page + {{openaireResultsPage | number}} + of + {{(countTotalPages(openaireResultsNum)|number)}} +
    +
    + +
    @@ -201,15 +232,23 @@ class="uk-alert uk-alert-primary "> No results found
    + class="uk-clearfix">
    -
    - {{orcidResultsNum|number}} results, page + {{orcidResultsNum|number}} research outcomes, page {{orcidPage | number}} of {{countTotalPages(orcidResultsNum)|number}} +
    --> +
    + {{orcidResultsNum|number}} + research outcomes, page + {{orcidPage | number}} + of + {{(countTotalPages(orcidResultsNum)|number)}}
    -
    +
    @@ -258,15 +297,23 @@ role="alert">Service not available
    -
    +
    -
    - {{dataciteResultsNum|number}} results, page + {{dataciteResultsNum|number}} research outcomes, page {{datacitePage | number}} of {{countTotalPages(dataciteResultsNum)|number}} +
    --> +
    + {{dataciteResultsNum|number}} + research outcomes, page + {{datacitePage | number}} + of + {{(countTotalPages(dataciteResultsNum)|number)}}
    -
    +
    diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts index 5f7a0273..19a4979a 100644 --- a/claims/claim-utils/claimResultSearchForm.component.ts +++ b/claims/claim-utils/claimResultSearchForm.component.ts @@ -10,6 +10,10 @@ import {EnvProperties} from '../../utils/properties/env-properties'; import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {Observable, forkJoin} from "rxjs"; 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({ selector: 'claim-result-search-form', templateUrl: 'claimResultSearchForm.component.html', @@ -62,15 +66,15 @@ export class ClaimResultSearchFormComponent { // 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 openaireRefineFields: string[] = ["relfunder", "resultbestaccessright", "instancetypename"]; - public openaireRefineFieldsQuery: string = "&refine=true&fields=relfunder&fields=resultbestaccessright&fields=instancetypename"; + public openaireRefineFields: string[] = ["resulttypeid","relfunder", "resultbestaccessright", "instancetypename"]; + public openaireRefineFieldsQuery: string = "&refine=true&fields=resulttypeid&fields=relfunder&fields=resultbestaccessright&fields=instancetypename"; // public fieldIdsMap=this.searchFields.RESULT_FIELDS; openaireResults: ClaimEntity[] = []; openaireResultsNum: number; openaireResultsPage: number = 1; openaireResultsStatus: number = this.errorCodes.NONE; - openaireResultsType = "publication"; + // openaireResultsType = "publication"; orcidResults: ClaimEntity[]; orcidResultsNum: number; @@ -91,6 +95,18 @@ export class ClaimResultSearchFormComponent { reloadDatacite: 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, private _searchCrossrefService: SearchCrossrefService, private _searchOrcidService: SearchOrcidService, @@ -98,7 +114,7 @@ export class ClaimResultSearchFormComponent { const myDate = new Date(); this.todayDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate(); this.nextDate = (myDate.getFullYear() + 100) + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate(); - + this.rangeFilters = RangeFilter.parse(this.rangeFields,"result"); } ngOnInit() { @@ -164,16 +180,7 @@ export class ClaimResultSearchFormComponent { } searchOpenaire(keyword, size, page, keywordChanged) { - - 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 ); - - } + this.searchResearchResults("publication", keyword, size, page, true, "publication"); } 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) { this.openaireResultsStatus = this.errorCodes.LOADING; this.openaireResultsPrevFilters = this.openaireResultsfilters; @@ -281,10 +288,13 @@ export class ClaimResultSearchFormComponent { } - } + }*/ 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 => { this.setOpenaireResults(data, mainResults, page, type); }, @@ -296,10 +306,10 @@ export class ClaimResultSearchFormComponent { public setOpenaireResults(data, mainResults: boolean, page, type) { if (data != null) { - if (mainResults) { + this.openaireResultsPage = page; this.openaireResultsNum = data[0]; - this.setOpenaireResultsCount(type, this.openaireResultsNum); + // this.setOpenaireResultsCount(type, this.openaireResultsNum); if(data[2] && data[2].length > 0){ this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters) } @@ -308,11 +318,6 @@ export class ClaimResultSearchFormComponent { if (this.openaireResultsNum == 0) { this.openaireResultsStatus = this.errorCodes.NONE; } - } else { - this.setOpenaireResultsCount(type, data[0]); - } - this.totalOpenaireCount +=+data[0]; - } else { if (mainResults) { this.openaireResultsStatus = this.errorCodes.ERROR; @@ -563,7 +568,7 @@ export class ClaimResultSearchFormComponent { createOpenaireQueryParams():string { let query = ""; - if (this.DOIs.length > 0) { +/* if (this.DOIs.length > 0) { let doisParams = ""; for (let i = 0; i < this.DOIs.length; i++) { doisParams += (doisParams.length > 0 ? "&" : "") + 'doi="' + this.DOIs[i] + '"'; @@ -571,11 +576,17 @@ export class ClaimResultSearchFormComponent { query += doisParams; } else if(this.keyword.length > 0){ query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); - } - if(this.openaireYear.length > 0 ){ - query+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"' - } + }*/ + if(this.keyword.length>0){ + query+=NewSearchPageComponent.createKeywordQuery("result",this.keyword,"q","="); + } + return query; + } + createOpenaireRefineQueryParams():string { let allFqs = ""; + if(this.openaireYear.length > 0 ){ + allFqs+='&fq=resultacceptanceyear exact \"'+this.openaireYear+'\"' + } for (let filter of this.openaireResultsfilters){ if(filter.countSelectedValues > 0){ let count_selected=0; @@ -592,7 +603,30 @@ export class ClaimResultSearchFormComponent { } } } - return query+allFqs; + for (let i=0; i=" ,"<=", "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) { - this.openaireResultsType = type; + public openaireTypeChanged() { + // this.openaireResultsType = type; this.reloadOpenaire = true; this.openaireYear = ""; this.openaireResultsfilters = []; @@ -750,8 +784,8 @@ export class ClaimResultSearchFormComponent { if (value.selected == true) { value.selected = false; } - this.search(false); - + // this.search(false); + this.filterChanged(null); } public countFilters(): number { @@ -761,10 +795,11 @@ export class ClaimResultSearchFormComponent { filters += filter.countSelectedValues; } } - if (this.keyword.length > 0) { - filters++; + for (let filter of this.rangeFilters) { + if (filter.selectedFromValue || filter.selectedToValue) { + filters += 1; + } } - return filters; } @@ -777,9 +812,21 @@ export class ClaimResultSearchFormComponent { 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) { // console.log("filterChanged"); this.reloadOpenaire = true; @@ -822,7 +869,7 @@ export class ClaimResultSearchFormComponent { } return totalPages; } - getTotalOpenaireNumber():number{ +/* getTotalOpenaireNumber():number{ let count = 0; for(let i=0; i
    - +
    -
    +
    +
    LINKS BASKET
    @@ -285,7 +288,9 @@
    +
    +
    diff --git a/searchPages/find/search.component.ts b/searchPages/find/search.component.ts index 19bbcb2b..d1f8ab61 100644 --- a/searchPages/find/search.component.ts +++ b/searchPages/find/search.component.ts @@ -96,7 +96,7 @@ export class SearchComponent { @Input() name; @Input() customFilter: SearchCustomFilter = 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; diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index 7353bceb..f27ddc78 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -93,7 +93,7 @@ export class SearchAllComponent { @Input() name; @Input() customFilter: SearchCustomFilter = 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; diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index b9636409..801bdb9f 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -975,7 +975,7 @@ export class NewSearchPageComponent { // 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); if (selectedFromValue && selectedToValue) { let equalityOp = this.fieldIdsMap[filterId].equalityOperator; @@ -1011,7 +1011,8 @@ export class NewSearchPageComponent { if(selectedFromValue || selectedToValue) { 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; } + // 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 * used in paging, advanced search link, Goto() diff --git a/sharedComponents/other-portals/other-portals.component.html b/sharedComponents/other-portals/other-portals.component.html index 75f60f2f..5eea5298 100644 --- a/sharedComponents/other-portals/other-portals.component.html +++ b/sharedComponents/other-portals/other-portals.component.html @@ -5,7 +5,7 @@ Researcher?
    - Explore all OA research results. Link all your research. Build your profile + Explore all OA research outcomes. Link all your research. Build your profile

    @@ -51,7 +51,7 @@ Research manager?

    diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts index 35c9f067..97fa5bc7 100644 --- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts +++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts @@ -128,9 +128,9 @@ convertDatasource(datasource: any, URL, otherUrl): Organization { private getTitle(result: any): String[] { const title = _.get(result, "result.metadata.oaf:entity.oaf:result.title", null); if(title && Array.isArray(title) ){ - return title[0].content; + return (title[0] && title[0].content)?title[0].content:""; }else{ - return title.content; + return (title && title.content)?title.content:""; } } diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index 477d2f11..b3948d3a 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -45,7 +45,8 @@ export class SearchFields { ["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"}, ["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 @@ -70,7 +71,7 @@ export class SearchFields { ["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"}, ["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}, ["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"}, diff --git a/utils/rangeFilter/rangeFilter.component.html b/utils/rangeFilter/rangeFilter.component.html index dadf7b2a..ed085927 100644 --- a/utils/rangeFilter/rangeFilter.component.html +++ b/utils/rangeFilter/rangeFilter.component.html @@ -10,10 +10,12 @@