Add subjects
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51036 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
843d77efbf
commit
f65fcb4216
|
@ -46,6 +46,20 @@ export class CommunitiesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(resData[0].subjects != null) {
|
||||||
|
if(result['subjects'] == undefined) {
|
||||||
|
result['subjects'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
let subjects = resData[0].subjects;
|
||||||
|
let length = Array.isArray(subjects) ? subjects.length : 1;
|
||||||
|
|
||||||
|
for(let i=0; i<length; i++) {
|
||||||
|
let subject = Array.isArray(subjects) ? subjects[i] : subjects;
|
||||||
|
result.subjects[i] = subject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
result['title'] = resData.name;
|
result['title'] = resData.name;
|
||||||
result['shortTitle'] = resData.shortName;
|
result['shortTitle'] = resData.shortName;
|
||||||
|
@ -67,6 +81,20 @@ export class CommunitiesService {
|
||||||
result.managers[i] = manager;
|
result.managers[i] = manager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(resData.subjects != null) {
|
||||||
|
if(result['subjects'] == undefined) {
|
||||||
|
result['subjects'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
let subjects = resData.subjects;
|
||||||
|
let length = Array.isArray(subjects) ? subjects.length : 1;
|
||||||
|
|
||||||
|
for(let i=0; i<length; i++) {
|
||||||
|
let subject = Array.isArray(subjects) ? subjects[i] : subjects;
|
||||||
|
result.subjects[i] = subject;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
communities.push(result);
|
communities.push(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,14 @@
|
||||||
<p> {{community.description}}</p>
|
<p> {{community.description}}</p>
|
||||||
</div>
|
</div>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p><span class="uk-label">Nature</span> <span class=" uk-label uk-label-danger">Life science</span> <span class="uk-label uk-label-success">Environment</span></p>
|
<div *ngIf="community.subjects != null">
|
||||||
<div *ngFor='let manager of community.managers; let i = index'>
|
<p *ngFor='let subject of community.subjects; let i = index'> <span class="uk-label"> {{subject}}</span> </p>
|
||||||
<p> <span>Curated by: {{manager}} </span> <span class="uk-margin-left"> Created: 26-01-2018</span> </p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p><span *ngIf="community.managers !=null">
|
||||||
|
<span *ngFor='let manager of community.managers; let i = index'>Curated by: {{manager}} </span>
|
||||||
|
</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-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-first-column">
|
||||||
|
|
|
@ -84,7 +84,7 @@ export class CommunityComponent {
|
||||||
community => {
|
community => {
|
||||||
this.community = community;
|
this.community = community;
|
||||||
this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
|
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(
|
this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid='+this.communityId).subscribe(
|
||||||
|
|
|
@ -112,7 +112,6 @@ export class CommunityService {
|
||||||
community['description'] = resData[0].description;
|
community['description'] = resData[0].description;
|
||||||
|
|
||||||
if(resData[0].managers != null) {
|
if(resData[0].managers != null) {
|
||||||
|
|
||||||
if(community['managers'] == undefined) {
|
if(community['managers'] == undefined) {
|
||||||
community['managers'] = new Array<string>();
|
community['managers'] = new Array<string>();
|
||||||
}
|
}
|
||||||
|
@ -126,6 +125,20 @@ export class CommunityService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(resData[0].subjects != null) {
|
||||||
|
if(community['subjects'] == undefined) {
|
||||||
|
community['subjects'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
let subjects = resData[0].subjects;
|
||||||
|
let length = Array.isArray(subjects) ? subjects.length : 1;
|
||||||
|
|
||||||
|
for(let i=0; i<length; i++) {
|
||||||
|
let subject = Array.isArray(subjects) ? subjects[i] : subjects;
|
||||||
|
community.subjects[i] = subject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if(!Array.isArray(resData)) {
|
} else if(!Array.isArray(resData)) {
|
||||||
|
|
||||||
community['title'] = resData.name;
|
community['title'] = resData.name;
|
||||||
|
@ -148,6 +161,20 @@ export class CommunityService {
|
||||||
community.managers[i] = manager;
|
community.managers[i] = manager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(resData.subjects != null) {
|
||||||
|
if(community['subjects'] == undefined) {
|
||||||
|
community['subjects'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
let subjects = resData.subjects;
|
||||||
|
let length = Array.isArray(subjects) ? subjects.length : 1;
|
||||||
|
|
||||||
|
for(let i=0; i<length; i++) {
|
||||||
|
let subject = Array.isArray(subjects) ? subjects[i] : subjects;
|
||||||
|
community.subjects[i] = subject;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return community;
|
return community;
|
||||||
|
|
|
@ -6,6 +6,6 @@ export class CommunityInfo {
|
||||||
logoUrl: string;
|
logoUrl: string;
|
||||||
description: string;
|
description: string;
|
||||||
managers: string[];
|
managers: string[];
|
||||||
date:string;
|
date:Date;
|
||||||
subject: string[];
|
subjects: string[];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue