[Trunk | Library]:
1. resultLanding.service.ts & searchResearchResults.service.ts: [Bug Fix] When parsing title, we stringify it. Make sure we do not stringify values: undefined. 2. searchResearchResults.service.ts: Changed "sortby" parameter to match /resources2 api format (search redesign). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58128 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
a069ef9546
commit
e11f388087
|
@ -102,12 +102,12 @@ export class ResultLandingService {
|
||||||
// res['result']['metadata']['oaf:entity']['oaf:result']['title']
|
// res['result']['metadata']['oaf:entity']['oaf:result']['title']
|
||||||
if(data[1] != null) {
|
if(data[1] != null) {
|
||||||
if(Array.isArray(data[1])) {
|
if(Array.isArray(data[1])) {
|
||||||
this.resultLandingInfo.title = String(data[1][0].content);
|
this.resultLandingInfo.title = (data[1][0] && data[1][0].content) ? String(data[1][0].content) : "";
|
||||||
if(data[1][1].classid === 'subtitle') {
|
if(data[1][1].classid === 'subtitle') {
|
||||||
this.resultLandingInfo.subtitle = String(data[1][1].content);
|
this.resultLandingInfo.subtitle = (data[1][1] && data[1][1].content) ? String(data[1][1].content) : "";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.resultLandingInfo.title = String(data[1].content);
|
this.resultLandingInfo.title = (data[1] && data[1].content) ? String(data[1].content) : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,12 +110,12 @@ export class SearchResearchResultsService {
|
||||||
if(params!= null && params != '' ) {
|
if(params!= null && params != '' ) {
|
||||||
url +="&query=(" + params + ")";
|
url +="&query=(" + params + ")";
|
||||||
}
|
}
|
||||||
if(refineParams!= null && refineParams != '' ) {
|
|
||||||
url += refineParams;
|
|
||||||
}
|
|
||||||
if(sortBy) {
|
if(sortBy) {
|
||||||
let sortOptions = sortBy.split(",");
|
let sortOptions = sortBy.split(",");
|
||||||
url += "sortBy "+sortOptions[0]+"/sort."+sortOptions[1]+" ";
|
url += (params ? " " : "&query=(*) ")+"sortBy "+sortOptions[0]+"/sort."+sortOptions[1]+(params ? " " : " ");
|
||||||
|
}
|
||||||
|
if(refineParams!= null && refineParams != '' ) {
|
||||||
|
url += refineParams;
|
||||||
}
|
}
|
||||||
if(refineQuery) {
|
if(refineQuery) {
|
||||||
url += "&" + refineQuery;
|
url += "&" + refineQuery;
|
||||||
|
@ -220,9 +220,9 @@ export class SearchResearchResultsService {
|
||||||
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
||||||
|
|
||||||
if(Array.isArray(resData['title'])) {
|
if(Array.isArray(resData['title'])) {
|
||||||
result['title'].name = String(resData['title'][0].content);
|
result['title'].name = (resData['title'][0] && resData['title'][0].content) ? String(resData['title'][0].content) : "";
|
||||||
} else {
|
} else {
|
||||||
result['title'].name = String(resData['title'].content);
|
result['title'].name = (resData['title'] && resData['title'].content) ? String(resData['title'].content) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||||
|
|
Loading…
Reference in New Issue