From 8dbf6c5d7610eea40055fedba8f39ab36c012d3b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 31 Oct 2019 11:10:39 +0000 Subject: [PATCH] [Trunk | Library]: Deposit Pages: 1. utils/properties/searchFields.ts: in 'DEPOSIT_DATASOURCE_KEYWORD_FIELDS' use field 'datasourcetypeuiname' instead of 'datasourcetypename' and use field 'datasourcesubject' with 'all' operator. 2. services/searchDataproviders.service.ts: [Bug fix]: Add subject only when there is some content. 3. searchPages/searchUtils/searchPage.component.ts: Add quotes in keyword for query (could cause problems with special keywords e.g. 'and and'). 4. deposit/depositFirstPage.component.ts & deposit/searchDataprovidersToDeposit.component.ts: Use same placeholder in search form and add search by 'type'. 5. deposit/searchResultsInDeposit.component.html: Change 'NOT OPENAIRE COMPATIBLE' label with 'Not yet registered' and change tooltip from 'Compatibility' to 'OpenAIRE compatibility'. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57485 d315682c-612b-4755-9ff5-7f18f6832af3 --- deposit/depositFirstPage.component.ts | 2 +- deposit/searchDataprovidersToDeposit.component.ts | 2 +- deposit/searchResultsInDeposit.component.html | 4 ++-- searchPages/searchUtils/searchPage.component.ts | 9 ++++++--- services/searchDataproviders.service.ts | 4 +++- utils/properties/searchFields.ts | 5 +++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/deposit/depositFirstPage.component.ts b/deposit/depositFirstPage.component.ts index ca21c4b2..ce711337 100644 --- a/deposit/depositFirstPage.component.ts +++ b/deposit/depositFirstPage.component.ts @@ -197,7 +197,7 @@ export class DepositFirstPageComponent { public keyword: string; public depositRoute: string; - public searchPlaceHolder = "Search by title, country, organization, subject..."; + public searchPlaceHolder = "Search by title, country, organization, subject, type..."; properties:EnvProperties; public routerHelper:RouterHelper = new RouterHelper(); diff --git a/deposit/searchDataprovidersToDeposit.component.ts b/deposit/searchDataprovidersToDeposit.component.ts index 0292f9ad..0663d6c2 100644 --- a/deposit/searchDataprovidersToDeposit.component.ts +++ b/deposit/searchDataprovidersToDeposit.component.ts @@ -30,7 +30,7 @@ import {RouterHelper} from "../utils/routerHelper.class"; {{result['type']}}{{' '}} - {{result.compatibility}}{{' '}} - NOT OPENAIRE COMPATIBLE{{' '}} + {{result.compatibility}}{{' '}} + Not yet registered{{' '}}
Countries
diff --git a/searchPages/searchUtils/searchPage.component.ts b/searchPages/searchUtils/searchPage.component.ts index 47e34f8a..03fa5bdd 100644 --- a/searchPages/searchUtils/searchPage.component.ts +++ b/searchPages/searchUtils/searchPage.component.ts @@ -229,7 +229,8 @@ export class SearchPageComponent { keywordQuery += " or "; } let field = this.keywordFields[i]; - keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(keyword); + //keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(keyword); + keywordQuery += field.name+field.equalityOperator+StringUtils.quote(StringUtils.URIEncode(keyword)); } } else { keywordQuery += "&q=" + StringUtils.URIEncode(keyword); @@ -389,7 +390,8 @@ export class SearchPageComponent { allLimits+=(allLimits.length==0?"?":"&")+'keyword=' + this.searchUtils.keyword; this.parameterNames.push("keyword"); this.parameterValues.push(this.searchUtils.keyword); - } + //this.parameterValues.push(StringUtils.quote(this.searchUtils.keyword)); + } if(this.searchUtils.page != 1 && includePage){ allLimits+=((allLimits.length == 0)?'?':'&') + 'page=' + this.searchUtils.page; } @@ -463,7 +465,8 @@ export class SearchPageComponent { keywordQuery += " or "; } let field = this.keywordFields[i]; - keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(this.searchUtils.keyword); + //keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(this.searchUtils.keyword); + keywordQuery += field.name+field.equalityOperator+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)); } } else { keywordQuery += "&q=" + StringUtils.URIEncode(this.searchUtils.keyword); diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index 010a6cc9..95769d19 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -343,7 +343,9 @@ export class SearchDataprovidersService { let length = Array.isArray(resData['subjects']) ? resData['subjects'].length : 1; for(let i=0; i