[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:
parent
f729962ed2
commit
8dbf6c5d76
|
@ -197,7 +197,7 @@ export class DepositFirstPageComponent {
|
||||||
|
|
||||||
public keyword: string;
|
public keyword: string;
|
||||||
public depositRoute: string;
|
public depositRoute: string;
|
||||||
public searchPlaceHolder = "Search by title, country, organization, subject...";
|
public searchPlaceHolder = "Search by title, country, organization, subject, type...";
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
public routerHelper:RouterHelper = new RouterHelper();
|
public routerHelper:RouterHelper = new RouterHelper();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {RouterHelper} from "../utils/routerHelper.class";
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<search-page pageTitle="Deposit Browse & Search repositories" [hasPrefix]=false
|
<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"
|
type="content providers" entityType="dataprovider" [(filters)] = "filters"
|
||||||
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
|
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
|
|
||||||
<div class="uk-padding uk-padding-remove-vertical">
|
<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['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-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="Compatibility">NOT OPENAIRE COMPATIBLE</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-margin-top" *ngIf="result['countries'] && result['countries'].length > 0">
|
||||||
<div class="uk-text-muted">Countries</div>
|
<div class="uk-text-muted">Countries</div>
|
||||||
|
|
|
@ -229,7 +229,8 @@ export class SearchPageComponent {
|
||||||
keywordQuery += " or ";
|
keywordQuery += " or ";
|
||||||
}
|
}
|
||||||
let field = this.keywordFields[i];
|
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 {
|
} else {
|
||||||
keywordQuery += "&q=" + StringUtils.URIEncode(keyword);
|
keywordQuery += "&q=" + StringUtils.URIEncode(keyword);
|
||||||
|
@ -389,6 +390,7 @@ export class SearchPageComponent {
|
||||||
allLimits+=(allLimits.length==0?"?":"&")+'keyword=' + this.searchUtils.keyword;
|
allLimits+=(allLimits.length==0?"?":"&")+'keyword=' + this.searchUtils.keyword;
|
||||||
this.parameterNames.push("keyword");
|
this.parameterNames.push("keyword");
|
||||||
this.parameterValues.push(this.searchUtils.keyword);
|
this.parameterValues.push(this.searchUtils.keyword);
|
||||||
|
//this.parameterValues.push(StringUtils.quote(this.searchUtils.keyword));
|
||||||
}
|
}
|
||||||
if(this.searchUtils.page != 1 && includePage){
|
if(this.searchUtils.page != 1 && includePage){
|
||||||
allLimits+=((allLimits.length == 0)?'?':'&') + 'page=' + this.searchUtils.page;
|
allLimits+=((allLimits.length == 0)?'?':'&') + 'page=' + this.searchUtils.page;
|
||||||
|
@ -463,7 +465,8 @@ export class SearchPageComponent {
|
||||||
keywordQuery += " or ";
|
keywordQuery += " or ";
|
||||||
}
|
}
|
||||||
let field = this.keywordFields[i];
|
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 {
|
} else {
|
||||||
keywordQuery += "&q=" + StringUtils.URIEncode(this.searchUtils.keyword);
|
keywordQuery += "&q=" + StringUtils.URIEncode(this.searchUtils.keyword);
|
||||||
|
|
|
@ -343,8 +343,10 @@ export class SearchDataprovidersService {
|
||||||
let length = Array.isArray(resData['subjects']) ? resData['subjects'].length : 1;
|
let length = Array.isArray(resData['subjects']) ? resData['subjects'].length : 1;
|
||||||
for(let i=0; i<length; i++) {
|
for(let i=0; i<length; i++) {
|
||||||
let subject = Array.isArray(resData['subjects']) ? resData['subjects'][i] :resData['subjects'];
|
let subject = Array.isArray(resData['subjects']) ? resData['subjects'][i] :resData['subjects'];
|
||||||
|
if(subject.content) {
|
||||||
subjects.push(subject.content);
|
subjects.push(subject.content);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return subjects;
|
return subjects;
|
||||||
}
|
}
|
||||||
getDataproviderType(resData: any): string {
|
getDataproviderType(resData: any): string {
|
||||||
|
|
|
@ -102,8 +102,9 @@ export class SearchFields {
|
||||||
{"name": "relorganizationshortname", "equalityOperator": "="},
|
{"name": "relorganizationshortname", "equalityOperator": "="},
|
||||||
{"name": "datasourceofficialname", "equalityOperator": "="},
|
{"name": "datasourceofficialname", "equalityOperator": "="},
|
||||||
{"name": "datasourceenglishname", "equalityOperator": "="},
|
{"name": "datasourceenglishname", "equalityOperator": "="},
|
||||||
{"name": "datasourcetypename", "equalityOperator": " exact "},
|
{"name": "datasourcetypeuiname", "equalityOperator": " exact "},
|
||||||
{"name": "country", "equalityOperator": " exact "}
|
{"name": "country", "equalityOperator": " exact "},
|
||||||
|
{"name": "datasourcesubject", "equalityOperator": " all "}
|
||||||
];
|
];
|
||||||
public DEPOSIT_DATASOURCE_REFINE_FIELDS:string[] = ["datasourcetypeuiname", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"];
|
public DEPOSIT_DATASOURCE_REFINE_FIELDS:string[] = ["datasourcetypeuiname", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue