From c004a7939fa4a4180eea3a68eb5996ce8818ceaa Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 14 Feb 2020 15:08:54 +0000 Subject: [PATCH] [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 --- dashboard/sharedComponents/sidebar/layout.service.ts | 4 ++-- services/searchResearchResults.service.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index f098f5bb..4d753d0a 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -78,8 +78,8 @@ export class LayoutService { } - get hasAdminMenu(): BehaviorSubject { - return this._hasAdminMenuSubject; + get hasAdminMenu(): Observable { + return this._hasAdminMenuSubject.asObservable(); } setHasAdminMenu(value: boolean) { diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 572880c4..0c3c37cc 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -31,7 +31,7 @@ export class SearchResearchResultsService { url += "&page="+(page-1)+"&size="+size+"&format=json"; 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 { @@ -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']; var result: SearchResult = new SearchResult(); - result.entityType = resultType; - + if(resData['resulttype']) { + result.entityType = resData['resulttype']['classname']; + } else { + result.entityType = resultType; + } result.types = new Array(); let types = new Set();