[Library|Trunk]

Claim get Context: return only the communities with status not hidden #4253
	
	Sherpa link - not for production #4271




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55901 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-05-29 13:56:09 +00:00
parent 54bc77b446
commit 655e80e607
7 changed files with 23 additions and 9 deletions

View File

@ -275,7 +275,7 @@ getCommunities () {
}else{
this.loading = true;
this._contextService.getCommunities(this.properties.contextsAPI).subscribe(
this._contextService.getPublicCommunities(this.properties.contextsAPI).subscribe(
data => {
this.communities = data;
if(this.communities.length > 0){

View File

@ -19,16 +19,28 @@ export class ContextsService {
let key = url;
//console.info('ContextsService: request communities '+url);
return this.http.get(url)
.map(res => <any> res.json()).map(res => this.parseCommunities(res) )
.map(res => <any> res.json()).map(res => this.parseCommunities(res, true) )
// .do(request => console.info("Get claims: offset = "))
.catch(this.handleError);
}
parseCommunities(data){
public getPublicCommunities( apiUrl:string):any {
let url = apiUrl + 's/';
let key = url;
//console.info('ContextsService: request communities '+url);
return this.http.get(url)
.map(res => <any> res.json()).map(res => this.parseCommunities(res, false) )
// .do(request => console.info("Get claims: offset = "))
.catch(this.handleError);
}
parseCommunities(data, getall){
var communities = [];
for(var i = 0; i< data.length; i++){
if(data[i].type && (data[i].type == "ri" || data[i].type == "community")){
communities.push(data[i]);
if(getall || data[i].status!='hidden') {
communities.push(data[i]);
}
}
}
return communities;

View File

@ -44,7 +44,7 @@
</span>
<ul class="uk-list">
<showPublisher
<showPublisher [properties]="properties"
[journal]="dataProviderInfo.journal"></showPublisher>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1"><span class="uk-text-bold">Results with funding information: </span>
{{dataProviderInfo.aggregationStatus.fundedContent | number}}

View File

@ -42,7 +42,7 @@
<ul class="uk-list">
<showPublisher [publisher]="datasetInfo.publisher"
[journal]="datasetInfo.journal"></showPublisher>
[journal]="datasetInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="datasetInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{datasetInfo.embargoEndDate}}</li>
<li *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>

View File

@ -1,4 +1,5 @@
import {Component, Input} from '@angular/core';
import {EnvProperties} from "../../utils/properties/env-properties";
@Component({
selector: 'showPublisher',
@ -46,7 +47,7 @@ import {Component, Input} from '@angular/core';
></span
><span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])">)</span>
</li>
<li *ngIf="journal && (journal['issn'] ||
<li *ngIf=" properties.environment != 'production' && journal && (journal['issn'] ||
journal['lissn'] || journal['eissn'] )">
<span class="custom-external custom-icon"
uk-tooltip="title: Publisher copyright policies & self-archiving">
@ -62,6 +63,7 @@ export class ShowPublisherComponent {
@Input() publisher;
@Input() journal;
@Input() sherpaUrl = 'http://www.sherpa.ac.uk/romeo/search.php?issn=';
@Input() properties:EnvProperties;
constructor() {

View File

@ -29,7 +29,7 @@
<ul class="uk-list">
<showPublisher [publisher]="orpInfo.publisher"
[journal]="orpInfo.journal"></showPublisher>
[journal]="orpInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="orpInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{orpInfo.embargoEndDate}}</li>
<li *ngIf="orpInfo.identifiers && orpInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="orpInfo.identifiers"></showIdentifiers>

View File

@ -33,7 +33,7 @@
<ul class="uk-list">
<showPublisher [publisher]="publicationInfo.publisher"
[journal]="publicationInfo.journal"></showPublisher>
[journal]="publicationInfo.journal" [properties]="properties"></showPublisher>
<li *ngIf="publicationInfo.embargoEndDate"><span class="uk-text-bold">Embargo end date:</span> {{publicationInfo.embargoEndDate}}</li>
<li *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.size > 0">
<showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>