Add managers

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51025 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-03-02 15:50:01 +00:00
parent ef9312b647
commit 1e07a6e7f0
6 changed files with 74 additions and 13 deletions

View File

@ -31,11 +31,11 @@
</div>
</span>
<div class="uk-card-body">
<div *ngIf="item.title != null" >
<div *ngIf="item.title != null">
<h3 class="uk-card-title"><a [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/community">
{{item.title}}</a></h3>
</div>
<div *ngIf="item.title == null && item.shortTitle != null" >
<div *ngIf="item.title == null && item.shortTitle != null">
<h3 class="uk-card-title"><a [queryParams]="{communityId: item.communityId}" routerLinkActive="router-link-active" routerLink="/community">
{{item.shortTitle}}</a></h3>
</div>

View File

@ -21,7 +21,7 @@ export class CommunitiesComponent {
public subfunders: any;
public pageTitle = "OpenAIRE"
properties:EnvProperties;
properties:EnvProperties;
public communitiesResults = null;
@ -61,7 +61,7 @@ properties:EnvProperties;
this._communitiesService.getResults('https://dev-openaire.d4science.org/openaire/community/communities').subscribe(
communitiesResults => {
this.communitiesResults = communitiesResults;
console.log(communitiesResults);
//console.log(communitiesResults);
});
}

View File

@ -31,6 +31,21 @@ export class CommunitiesService {
result['queryId'] = resData[0].queryId;
result['logoUrl'] = resData[0].logoUrl;
result['description'] = resData[0].description;
if(resData[0].managers != null) {
if(result['managers'] == undefined) {
result['managers'] = new Array<string>();
}
let managers = resData[0].managers;
let length = Array.isArray(managers) ? managers.length : 1;
for(let i=0; i<length; i++) {
let manager = Array.isArray(managers) ? managers[i] : managers;
result.managers[i] = manager;
}
}
} else {
result['title'] = resData.name;
result['shortTitle'] = resData.shortName;
@ -38,6 +53,20 @@ export class CommunitiesService {
result['queryId'] = resData.queryId;
result['logoUrl'] = resData.logoUrl;
result['description'] = resData.description;
if(resData.managers != null) {
if(result['managers'] == undefined) {
result['managers'] = new Array<string>();
}
let managers = resData.managers;
let length = Array.isArray(managers) ? managers.length : 1;
for(let i=0; i<length; i++) {
let manager = Array.isArray(managers) ? managers[i] : managers;
result.managers[i] = manager;
}
}
}
communities.push(result);
}

View File

@ -4,8 +4,8 @@
<article class="uk-article ">
<a class="uk-button uk-button-primary uk-align-right"> Subscribe</a>
<blockquote>
<div *ngIf="communityId != null && community != null">
<div *ngIf="communityId != null && community != null">
<blockquote>
<div *ngIf="community.title != null">
<p> {{community.title}}</p>
</div>
@ -15,10 +15,12 @@
<div *ngIf="community.description != null">
<p> {{community.description}}</p>
</div>
</div>
</blockquote>
<p><span class="uk-label">Nature</span>&nbsp;<span class=" uk-label uk-label-danger">Life science</span>&nbsp;<span class="uk-label uk-label-success">Environment</span></p>
<p> <span>Curated by: Tom</span> <span class="uk-margin-left"> Created: 26-01-2018</span> </p>
</blockquote>
<p><span class="uk-label">Nature</span>&nbsp;<span class=" uk-label uk-label-danger">Life science</span>&nbsp;<span class="uk-label uk-label-success">Environment</span></p>
<div *ngFor='let manager of community.managers; let i = index'>
<p> <span>Curated by: {{manager}} </span> <span class="uk-margin-left"> Created: 26-01-2018</span> </p>
</div>
</div>
<div class="uk-child-width-1-6@l uk-child-width-1-6@m uk-child-width-1-3@s uk-text-center uk-grid" uk-grid="">
<div class="uk-first-column">
<div class="uk-card uk-card-default uk-card-small uk-card-body">

View File

@ -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(
@ -105,13 +105,13 @@ export class CommunityComponent {
this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/projects').subscribe(
projectTotal => {
this.projectTotal = projectTotal;
console.log(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);
//console.log(contentProviderTotal);
});
// this._communityService.countTotal('https://dev-openaire.d4science.org/openaire/community/'+this.communityId+'/organizations').subscribe(
@ -123,6 +123,7 @@ export class CommunityComponent {
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;
//console.log(publicationResults);
});
this._communityService.getResults('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets?fq=communityid%20exact%20%22'+this.communityId+'%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(

View File

@ -111,6 +111,21 @@ export class CommunityService {
community['logoUrl'] = resData[0].logoUrl;
community['description'] = resData[0].description;
if(resData[0].managers != null) {
if(community['managers'] == undefined) {
community['managers'] = new Array<string>();
}
let managers = resData[0].managers;
let length = Array.isArray(managers) ? managers.length : 1;
for(let i=0; i<length; i++) {
let manager = Array.isArray(managers) ? managers[i] : managers;
community.managers[i] = manager;
}
}
} else if(!Array.isArray(resData)) {
community['title'] = resData.name;
@ -119,6 +134,20 @@ export class CommunityService {
community['queryId'] = resData.queryId;
community['logoUrl'] = resData.logoUrl;
community['description'] = resData.description;
if(resData.managers != null) {
if(community['managers'] == undefined) {
community['managers'] = new Array<string>();
}
let managers = resData.managers;
let length = Array.isArray(managers) ? managers.length : 1;
for(let i=0; i<length; i++) {
let manager = Array.isArray(managers) ? managers[i] : managers;
community.managers[i] = manager;
}
}
}
}
return community;