diff --git a/claims/claim-utils/claimProjectSearchForm.component.html b/claims/claim-utils/claimProjectSearchForm.component.html index 8bd0fe4a..cf4806ef 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.html +++ b/claims/claim-utils/claimProjectSearchForm.component.html @@ -1,11 +1,11 @@ -
+
+ [options]="showOptions.selectOptions" class="uk-width-medium@xl uk-width-auto">
-
+
@@ -14,7 +14,7 @@
-
Select funder to proceed +
Select funder or search for projects to proceed
@@ -65,7 +65,7 @@
-
{{selectedFunder.name}} has no projects. Proceed to next step.
+
No projects for funder {{selectedFunder.name}}.
{ + let option = {value : null, label: "No funder selected"}; + this.funderOptions.push(option); for(let v of data[2][0].values){ let option = {value : v, label: v.name}; this.funderOptions.push(option); @@ -107,7 +109,7 @@ export class ClaimProjectsSearchFormComponent { this.prevFilters = this.filters; //searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any { - this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, null, [], this.createOpenaireRefineQuery()).subscribe( + this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null).subscribe( // this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( data => { if (data != null) { @@ -150,7 +152,7 @@ export class ClaimProjectsSearchFormComponent { const entity: ClaimEntity = new ClaimEntity(); entity.project = new ClaimProject(); entity.project.funderId = item.funderId; - entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId.split("::")[1]); + entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId?entity.project.funderId.split("::")[1]:""); entity.project.funderName = item.funderName; entity.id = item.id; entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null; @@ -186,12 +188,6 @@ export class ClaimProjectsSearchFormComponent { } createOpenaireRefineQuery(): string { - /*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) { @@ -209,8 +205,11 @@ export class ClaimProjectsSearchFormComponent { } } } - if(this.isNoProjectFunder){ - allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id))); ; + if(this.selectedFunder){ + allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id))); + } + if(!this.isNoProjectFunder || !this.selectedFunder){ + allFqs += '&fq=(projectcode<>"unidentified")' } for (let i = 0; i < this.rangeFilters.length; i++) { let filter = this.rangeFilters[i];