[Trunk | Library]:

1. searchResearchResults.service.ts & resultLanding.service.ts: Do not stringify null or undefined value for description.
2. claimResultSearchForm.component.ts: Do not stringify null or undefined value for accessRights.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58234 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-03-12 10:46:02 +00:00
parent 0c2258e04d
commit 3045d7afec
3 changed files with 7 additions and 5 deletions

View File

@ -620,7 +620,7 @@ export class ClaimResultSearchFormComponent {
entity.result.url = prefixUrl + entity.id;
entity.result.source = String("openaire");
entity.result.date = (item.year && item.year != "") ? item.year : null;
entity.result.accessRights = String(item.title.accessMode);
entity.result.accessRights = (item.title && item.title.accessMode) ? String(item.title.accessMode) : "";
entity.type = type;
entity.result.embargoEndDate = (item.embargoEndDate && item.embargoEndDate != "") ? item.embargoEndDate : entity.result.embargoEndDate;

View File

@ -92,9 +92,11 @@ export class ResultLandingService {
this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance;
this.resultLandingInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.resultLandingInfo.description = String(data[0].description);
//this.resultLandingInfo.description = String(data[0].description);
this.resultLandingInfo.description = (data[0] && data[0].description) ? String(data[0].description) : "";
} else {
this.resultLandingInfo.description = String(data[0].description[0]);
//this.resultLandingInfo.description = String(data[0].description[0]);
this.resultLandingInfo.description = (data[0] && data[0].description[0]) ? String(data[0].description[0]) : "";
}
this.resultLandingInfo.embargoEndDate = data[0].embargoenddate;
}

View File

@ -266,9 +266,9 @@ export class SearchResearchResultsService {
result.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
if(!Array.isArray(resData.description)) {
result.description = String(resData.description);
result.description = (resData.description) ? String(resData.description) : "";
} else {
result.description = String(resData.description[0]);
result.description = (resData.description[0]) ? String(resData.description[0]) : "";
}
if(result.description && result.description.length > this.sizeOfDescription) {