Add countTotal for projects, organizations and content providers

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50980 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-02-28 16:44:33 +00:00
parent 8125c9ae0c
commit b3cee9f450
3 changed files with 30 additions and 14 deletions

View File

@ -44,7 +44,7 @@
</div>
</div>
</div>
<!-- <div>
<div>
<div class="uk-card uk-card-default uk-card-small uk-card-body">
<div *ngIf="projectTotal != null">
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/projects"><h3 class="uk-card-title">{{projectTotal}}</h3>
@ -52,22 +52,22 @@
</div>
</div>
</div>
<div>
<!-- <div>
<div class="uk-card uk-card-default uk-card-small uk-card-body">
<div *ngIf="organizationTotal != null">
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/organizations"><h3 class="uk-card-title">{{organizationTotals}}</h3>
<p>organizations</p></a>
</div>
</div>
</div>
</div> -->
<div>
<div class="uk-card uk-card-default uk-card-small uk-card-body">
<div *ngIf="dataproviderTotal != null">
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/dataproviders"><h3 class="uk-card-title">{{dataproviderTotal}}</h3>
<div *ngIf="contentProviderTotal != null">
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/dataproviders"><h3 class="uk-card-title">{{contentProviderTotal}}</h3>
<p>content providers</p></a>
</div>
</div>
</div> -->
</div>
</div>
<div class="uk-grid-small uk-margin-medium uk-grid" uk-grid="">

View File

@ -27,6 +27,9 @@ export class CommunityComponent {
public publicationTotal = null;
public researchDataTotal = null;
public softwareTotal = null;
public projectTotal = null;
public contentProviderTotal = null;
public organizationTotal = null;
params: any;
properties:EnvProperties;
@ -76,6 +79,7 @@ export class CommunityComponent {
communityId => {
this.communityId = communityId['communityId'];
});
this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe (
community => {
this.community = community;
@ -98,6 +102,24 @@ export class CommunityComponent {
this.softwareTotal = softwareTotal;
});
this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/projects').subscribe(
projectTotal => {
this.projectTotal = projectTotal;
console.log(projectTotal);
});
this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/contentproviders').subscribe(
contentProviderTotal => {
this.contentProviderTotal = contentProviderTotal;
console.log(contentProviderTotal);
});
// this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/organizations').subscribe(
// organizationTotal => {
// this.organizationTotal = organizationTotal;
// console.log(organizationTotal);
// });
this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(
publicationResults => {
this.publicationResults = publicationResults;

View File

@ -17,14 +17,8 @@ export class CommunityService {
return this.http.get(url).map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
}
countTotal(url:string): any {
let total;
return total;
countTotal(url:string) {
return this.http.get(url).map(res => <any> res.json()).map(res => res.length);
}
getResults(url: string) {