From f65fcb42169a2a98f759052c0d6decc577d65748 Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Mon, 5 Mar 2018 13:47:46 +0000 Subject: [PATCH] Add subjects git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51036 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/communities/communities.service.ts | 28 +++++++++++++++++++++ src/app/community/community.component.html | 10 +++++--- src/app/community/community.component.ts | 2 +- src/app/community/community.service.ts | 29 +++++++++++++++++++++- src/app/utils/communityInfo.ts | 4 +-- 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/app/communities/communities.service.ts b/src/app/communities/communities.service.ts index ce24476..3398244 100644 --- a/src/app/communities/communities.service.ts +++ b/src/app/communities/communities.service.ts @@ -46,6 +46,20 @@ export class CommunitiesService { } } + if(resData[0].subjects != null) { + if(result['subjects'] == undefined) { + result['subjects'] = new Array(); + } + + let subjects = resData[0].subjects; + let length = Array.isArray(subjects) ? subjects.length : 1; + + for(let i=0; i(); + } + + let subjects = resData.subjects; + let length = Array.isArray(subjects) ? subjects.length : 1; + + for(let i=0; i {{community.description}}

-

Nature Life science Environment

-
-

Curated by: {{manager}} Created: 26-01-2018

+
+

{{subject}} 

+

+ Curated by: {{manager}} + + Created: 26-01-2018 +

diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 5fa1d8b..6556801 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -84,7 +84,7 @@ export class CommunityComponent { community => { this.community = community; this.params = {community: encodeURIComponent('"'+community.queryId+'"')}; - //console.log(community); + console.log(community); }); this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid='+this.communityId).subscribe( diff --git a/src/app/community/community.service.ts b/src/app/community/community.service.ts index 90e961e..994b0ae 100644 --- a/src/app/community/community.service.ts +++ b/src/app/community/community.service.ts @@ -112,7 +112,6 @@ export class CommunityService { community['description'] = resData[0].description; if(resData[0].managers != null) { - if(community['managers'] == undefined) { community['managers'] = new Array(); } @@ -126,6 +125,20 @@ export class CommunityService { } } + if(resData[0].subjects != null) { + if(community['subjects'] == undefined) { + community['subjects'] = new Array(); + } + + let subjects = resData[0].subjects; + let length = Array.isArray(subjects) ? subjects.length : 1; + + for(let i=0; i(); + } + + let subjects = resData.subjects; + let length = Array.isArray(subjects) ? subjects.length : 1; + + for(let i=0; i