[Trunk | Library]:

1. searchResult.ts: "description" is parsed for all entities except from "organization".
2. searchProjects.service.ts & searchDataproviders.service.ts: Parse "description" (for "projects" it is "summary")
3. searchResult.component.ts: Default value for "showSubjects" set to true.


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

View File

@ -15,7 +15,7 @@ export class SearchResultComponent implements OnInit {
@Input() status: number;
@Input() type: string;
@Input() showLoading: boolean = false;
@Input() showSubjects: boolean = false;
@Input() showSubjects: boolean = true;
@Input() showOrganizations: boolean = true;
@Input() custom_class: string = "search-results";
@Input() properties: EnvProperties;

View File

@ -13,6 +13,8 @@ import {map} from "rxjs/operators";
@Injectable()
export class SearchDataprovidersService {
private sizeOfDescription: number = 270;
constructor(private http: HttpClient ) {}
searchDataproviders (params: string, refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties, usedBy: string="search" ):any {
@ -303,6 +305,16 @@ export class SearchDataprovidersService {
result['type'] = this.getDataproviderType(resData);
if(!Array.isArray(resData['description'])) {
result.description = (resData['description']) ? String(resData['description']) : "";
} else {
result.description = (resData['description'][0]) ? String(resData['description'][0]) : "";
}
if (result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription) + "...";
}
let typeid: string = resData['datasourcetype'].classid;
//console.info(typeid);
if(typeid != "entityregistry" && typeid != "entityregistry::projects" && typeid != "entityregistry::repositories") {

View File

@ -151,6 +151,16 @@ export class SearchProjectsService {
result.id = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
if(!Array.isArray(resData['summary'])) {
result.description = (resData['summary']) ? String(resData['summary']) : "";
} else {
result.description = (resData['summary'][0]) ? String(resData['summary'][0]) : "";
}
if (result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription) + "...";
}
if(resData['rels'].hasOwnProperty("rel")) {
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;

View File

@ -27,12 +27,14 @@ export class SearchResult {
title: ResultTitle;
id: string;
DOI: string;
//publications & datasets & orp & software & projects & dataproviders:
description: string;
//publications & datasets & orp & software & organizations:
projects: Project[];
//datasets & orp & publications & software
description: string;
year: string;
embargoEndDate: Date | string;
authors: Author[];