[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
This commit is contained in:
konstantina.galouni 2019-10-31 11:10:39 +00:00
parent f729962ed2
commit 8dbf6c5d76
6 changed files with 16 additions and 10 deletions

View File

@ -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();

View File

@ -30,7 +30,7 @@ import {RouterHelper} from "../utils/routerHelper.class";
</div>
</div>
<search-page pageTitle="Deposit Browse & Search repositories" [hasPrefix]=false
formPlaceholderText = "Search for Content Providers"
formPlaceholderText = "Search by title, country, organization, subject, type..."
type="content providers" entityType="dataprovider" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
(queryChange)="queryChanged($event)"

View File

@ -43,8 +43,8 @@
<div class="uk-padding uk-padding-remove-vertical">
<span *ngIf="result['type'] != undefined && result['type'] != ''" class="uk-label custom-label label-blue label-dataprovider" title="Type"> {{result['type']}}</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] != 'not available'" class="uk-label custom-label label-compatibility" title="Compatibility">{{result.compatibility}}</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] == 'not available'" class="uk-label custom-label label-danger" title="Compatibility">NOT OPENAIRE COMPATIBLE</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] != 'not available'" class="uk-label custom-label label-compatibility" title="OpenAIRE Compatibility">{{result.compatibility}}</span>{{' '}}
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != '' && result['compatibility'] == 'not available'" class="uk-label custom-label label-danger" title="OpenAIRE Compatibility">Not yet registered</span>{{' '}}
<div class="uk-margin-top" *ngIf="result['countries'] && result['countries'].length > 0">
<div class="uk-text-muted">Countries</div>

View File

@ -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);

View File

@ -343,7 +343,9 @@ export class SearchDataprovidersService {
let length = Array.isArray(resData['subjects']) ? resData['subjects'].length : 1;
for(let i=0; i<length; i++) {
let subject = Array.isArray(resData['subjects']) ? resData['subjects'][i] :resData['subjects'];
subjects.push(subject.content);
if(subject.content) {
subjects.push(subject.content);
}
}
return subjects;
}

View File

@ -102,8 +102,9 @@ export class SearchFields {
{"name": "relorganizationshortname", "equalityOperator": "="},
{"name": "datasourceofficialname", "equalityOperator": "="},
{"name": "datasourceenglishname", "equalityOperator": "="},
{"name": "datasourcetypename", "equalityOperator": " exact "},
{"name": "country", "equalityOperator": " exact "}
{"name": "datasourcetypeuiname", "equalityOperator": " exact "},
{"name": "country", "equalityOperator": " exact "},
{"name": "datasourcesubject", "equalityOperator": " all "}
];
public DEPOSIT_DATASOURCE_REFINE_FIELDS:string[] = ["datasourcetypeuiname", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"];