diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 01575db..ca6a08f 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -90,22 +90,22 @@
-

+

Most recent publications -

- + +

Most recent research data

- +

Most recent software

- +
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 4195509..a106cad 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -95,16 +95,35 @@ export class CommunityComponent { this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst+'publications/count?format=json&fq=communityid='+this.communityId).subscribe( publicationTotal => { this.publicationTotal = publicationTotal; + if (this.publicationTotal > 0) { + this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'publications?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + publicationResults => { + this.publicationResults = publicationResults; + //console.log(publicationResults); + }); + } }); this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst+'datasets/count?format=json&fq=communityid='+this.communityId).subscribe( researchDataTotal => { this.researchDataTotal = researchDataTotal; + if (this.researchDataTotal > 0) { + this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'datasets?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + researchDataResults => { + this.researchDataResults = researchDataResults; + }); + } }); this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst+'software/count?format=json&fq=communityid='+this.communityId).subscribe( softwareTotal => { this.softwareTotal = softwareTotal; + if (this.softwareTotal > 0) { + this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'software?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( + softwareResults => { + this.softwareResults = softwareResults; + }); + } }); this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/projects').subscribe( @@ -125,21 +144,6 @@ export class CommunityComponent { // console.log(organizationTotal); // }); - this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'publications?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - publicationResults => { - this.publicationResults = publicationResults; - //console.log(publicationResults); - }); - - this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'datasets?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - researchDataResults => { - this.researchDataResults = researchDataResults; - }); - - this._searchEntriesService.getResults(this.properties.searchAPIURLLAst+'software?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( - softwareResults => { - this.softwareResults = softwareResults; - }); } }); } diff --git a/src/app/searchEntries/results/results.component.ts b/src/app/searchEntries/results/results.component.ts index fbff6bb..a671139 100644 --- a/src/app/searchEntries/results/results.component.ts +++ b/src/app/searchEntries/results/results.component.ts @@ -41,8 +41,7 @@ import { CommunityInfo } from '../../openaireLibrary/connect/community/community
-
No results found
- +
No results found

@@ -73,4 +72,5 @@ export class ResultsComponent { @Input() public resultType: string; @Input() public params: any; @Input() public community: CommunityInfo; + @Input() public total: any; }