From 1e4e5756f78c510eed4f289ae595ab31232ac93f Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 23 Nov 2020 16:09:45 +0000 Subject: [PATCH] [Aggregator|Trunk] - Home search form: Add custom filter parameters when switching from simple to advanced search pages or change entities - add custom filter in advanced search results git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-aggregator-portal/trunk@59939 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/home/home.component.html | 10 ++++---- src/app/home/home.component.ts | 23 ++++++++++++++++++- .../searchResearchResults.component.ts | 2 +- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 6c1adca..4bc05b6 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -10,7 +10,7 @@
@@ -43,20 +43,20 @@
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 3dbf610..456be21 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -332,7 +332,28 @@ export class HomeComponent { parameterNames.push("f0"); parameterValues.push("q"); } - console.log( this.routerHelper.createQueryParams(parameterNames, parameterValues)) + if(this.customFilter){ + parameterNames.push(this.customFilter.queryFieldName); + parameterValues.push(this.customFilter.valueId); + parameterNames.push("cf"); + parameterValues.push("true"); + } this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)}); } + getQueryParamsForAdvancedSearch(entity){ + let params = {}; + if (entity == "result") { + if (this.resultsQuickFilter) { + params["qf"] = "" + this.resultsQuickFilter.selected; + } + } + if(this.keyword.length > 0) { + params["fv0"] = "" + this.keyword; + params["f0"] = "q"; + } + if(this.customFilter){ + params = this.customFilter.getParameters(params); + } + return params; + } } diff --git a/src/app/searchPages/advanced/searchResearchResults.component.ts b/src/app/searchPages/advanced/searchResearchResults.component.ts index 3e29634..8709483 100644 --- a/src/app/searchPages/advanced/searchResearchResults.component.ts +++ b/src/app/searchPages/advanced/searchResearchResults.component.ts @@ -8,7 +8,7 @@ import {properties} from "../../../environments/environment"; @Component({ selector: 'openaire-search-results', template: ` - + ` })