[Library | Trunk]: Fix entity type in parse results.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58102 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-02-14 15:08:54 +00:00
parent 9da07c3568
commit c004a7939f
2 changed files with 8 additions and 5 deletions

View File

@ -78,8 +78,8 @@ export class LayoutService {
} }
get hasAdminMenu(): BehaviorSubject<boolean> { get hasAdminMenu(): Observable<boolean> {
return this._hasAdminMenuSubject; return this._hasAdminMenuSubject.asObservable();
} }
setHasAdminMenu(value: boolean) { setHasAdminMenu(value: boolean) {

View File

@ -31,7 +31,7 @@ export class SearchResearchResultsService {
url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&page="+(page-1)+"&size="+size+"&format=json";
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")])); .pipe(map(res => [res['meta'].total, this.parseResults('ss', res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]));
} }
searchById (resultType:string, id: string, properties:EnvProperties ):any { searchById (resultType:string, id: string, properties:EnvProperties ):any {
@ -153,8 +153,11 @@ export class SearchResearchResultsService {
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result']; let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result'];
var result: SearchResult = new SearchResult(); var result: SearchResult = new SearchResult();
result.entityType = resultType; if(resData['resulttype']) {
result.entityType = resData['resulttype']['classname'];
} else {
result.entityType = resultType;
}
result.types = new Array<string>(); result.types = new Array<string>();
let types = new Set<string>(); let types = new Set<string>();