From 368969bc22f9456fb2b43dd52cb7b1365366b851 Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Wed, 14 Mar 2018 14:38:57 +0000 Subject: [PATCH] Add communitiesAPI link in env-properties, Use communityAPI and communitiesAPI instead of links for community and communities component git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51238 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/communities/communities.component.ts | 11 ++++++----- src/app/community/community.component.ts | 15 +++++++++++---- src/assets/env-properties.json | 3 ++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts index 225cbe9..29ae486 100644 --- a/src/app/communities/communities.component.ts +++ b/src/app/communities/communities.component.ts @@ -56,12 +56,13 @@ export class CommunitiesComponent { if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE").subscribe(); } + + this._communitiesService.getCommunities(this.properties.communitiesAPI).subscribe( + communitiesResults => { + this.communitiesResults = communitiesResults; + //console.log(communitiesResults); + }); }); - this._communitiesService.getCommunities('https://dev-openaire.d4science.org/openaire/community/communities').subscribe( - communitiesResults => { - this.communitiesResults = communitiesResults; - //console.log(communitiesResults); - }); } public ngOnDestroy() { diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 39b5456..05c4420 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -75,13 +75,20 @@ export class CommunityComponent { this.communityId = communityId['communityId']; }); - this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe ( + this._communityService.getCommunity(this.properties.communityAPI+this.communityId).subscribe ( community => { this.community = community; this.params = {community: encodeURIComponent('"'+community.queryId+'"')}; //console.log(community); }); + // this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe ( + // community => { + // this.community = community; + // this.params = {community: encodeURIComponent('"'+community.queryId+'"')}; + // //console.log(community); + // }); + this._searchEntriesService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid='+this.communityId).subscribe( publicationTotal => { this.publicationTotal = publicationTotal; @@ -97,19 +104,19 @@ export class CommunityComponent { this.softwareTotal = softwareTotal; }); - this._searchEntriesService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/projects').subscribe( + this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/projects').subscribe( projectTotal => { this.projectTotal = projectTotal; //console.log(projectTotal); }); - this._searchEntriesService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/contentproviders').subscribe( + this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/contentproviders').subscribe( contentProviderTotal => { this.contentProviderTotal = contentProviderTotal; //console.log(contentProviderTotal); }); - // this._searchEntriesService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/organizations').subscribe( + // this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/organizations').subscribe( // organizationTotal => { // this.organizationTotal = organizationTotal; // console.log(organizationTotal); diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index 168833c..5b23477 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -60,7 +60,8 @@ "adminToolsCommunity" :"openaire", - "communityAPI": "https://dev-openaire.d4science.org/openaire/community/", + "communityAPI": "https://dev-openaire.d4science.org/openaire/community/", + "communitiesAPI": "https://dev-openaire.d4science.org/openaire/community/communities", "csvLimit": 2000, "pagingLimit": 20,