From eb1f91160a8f27882309536dd685b8a8250ebc0d Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 2 Jul 2020 15:53:43 +0000 Subject: [PATCH] [Library|Trunk] Search: createKeywordQuery() add properly the operator when it is needed. LAnding result: set properly the type when the route changes and it is result. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59042 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/result/resultLanding.component.ts | 3 ++- searchPages/searchUtils/newSearchPage.component.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index d397c780..685c1423 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -159,7 +159,8 @@ export class ResultLandingComponent { this.linkToSearchPage = this.properties.searchLinkToOrps; this.id = data['orpId']; this.title = "Other Research Product"; - } else if (data["id"]) { + } else if (data["id"]){ + this.type = "result"; this.id = data["id"]; this.updateTitle("Research Result"); this.linkToLandingPage = this.properties.searchLinkToOrp; diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 624be1b4..bb7c21cb 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -701,7 +701,7 @@ export class NewSearchPageComponent { } else { params += this.createQuotedKeywordQuery(this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId,countParams,true); }*/ - params +=(countParams == 0 ? "" : " " + this.selectedFields[i].operatorId + " ") + NewSearchPageComponent.createKeywordQuery(this.entityType,this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams); + params += NewSearchPageComponent.createKeywordQuery(this.entityType,this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams); //TODO deposit case // console.log(this.usedBy) // console.log(this.keywordFields) @@ -774,10 +774,9 @@ export class NewSearchPageComponent { let countDoubleQuote = (fieldValue.match(/"/g) || []).length; let quotedParts = []; if(countQuote % 2 == 0 && countDoubleQuote % 2 ==0){ - console.log("Allow quoting"); quotedParts = (fieldValue)?fieldValue.match(/(["'])(.*?)*?\1/g):[]; } - // params+= (countParams == 0 ? "" : fieldOperator) + + params+= (countParams == 0 ? "" : fieldOperator); params+= " ("; if(forceQuotted){ return this.getQuotedQueryPart(fieldId, '"'+ fieldValue+'"',isSearchAll);