[Trunk|Library]: Bug fix: In Landing and Search Pages for results (publ, datas, soft, orp), make description string necessarily (may be number).

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55589 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-05-17 12:10:13 +00:00
parent 7e3678bc8a
commit 9719595300
8 changed files with 16 additions and 16 deletions

View File

@ -64,9 +64,9 @@ export class DatasetService {
this.datasetInfo.dateofacceptance = data[0].dateofacceptance;
this.datasetInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.datasetInfo.description = data[0].description;
this.datasetInfo.description = String(data[0].description);
} else {
this.datasetInfo.description = data[0].description[0];
this.datasetInfo.description = String(data[0].description[0]);
}
this.datasetInfo.embargoEndDate = data[0].embargoenddate;
}

View File

@ -61,9 +61,9 @@ export class OrpService {
this.orpInfo.dateofacceptance = data[0].dateofacceptance;
this.orpInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.orpInfo.description = data[0].description;
this.orpInfo.description = String(data[0].description);
} else {
this.orpInfo.description = data[0].description[0];
this.orpInfo.description = String(data[0].description[0]);
}
this.orpInfo.embargoEndDate = data[0].embargoenddate;
}

View File

@ -66,9 +66,9 @@ export class PublicationService {
this.publicationInfo.dateofacceptance = data[0].dateofacceptance;
this.publicationInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.publicationInfo.description = data[0].description;
this.publicationInfo.description = String(data[0].description);
} else {
this.publicationInfo.description = data[0].description[0];
this.publicationInfo.description = String(data[0].description[0]);
}
this.publicationInfo.embargoEndDate = data[0].embargoenddate;
}

View File

@ -63,9 +63,9 @@ export class SoftwareService {
this.softwareInfo.dateofacceptance = data[0].dateofacceptance;
this.softwareInfo.publisher = data[0].publisher;
if(!Array.isArray(data[0].description)) {
this.softwareInfo.description = data[0].description;
this.softwareInfo.description = String(data[0].description);
} else {
this.softwareInfo.description = data[0].description[0];
this.softwareInfo.description = String(data[0].description[0]);
}
this.softwareInfo.embargoEndDate = data[0].embargoenddate;
}

View File

@ -238,9 +238,9 @@ export class SearchDatasetsService {
var date:string = (resData.dateofacceptance)+""; // transform to string in case it is an integer
result.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
if(!Array.isArray(resData.description)) {
result.description = resData.description;
result.description = String(resData.description);
} else {
result.description = resData.description[0];
result.description = String(resData.description[0]);
}
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription)+"...";

View File

@ -243,9 +243,9 @@ export class SearchOrpsService {
var date:string = (resData.dateofacceptance)+""; // transform to string in case it is an integer
result.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
if(!Array.isArray(resData.description)) {
result.description = resData.description;
result.description = String(resData.description);
} else {
result.description = resData.description[0];
result.description = String(resData.description[0]);
}
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription)+"...";

View File

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

View File

@ -254,7 +254,7 @@ export class SearchSoftwareService {
var date:string = (resData.dateofacceptance)+""; // transform to string in case it is an integer
result.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
result.description = Array.isArray(resData.description) ? resData.description[0] : resData.description;
result.description = Array.isArray(resData.description) ? String(resData.description[0]) : String(resData.description);
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription)+"...";
}