From ed651812265a1302194289ae5d76b7202b20c6c1 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Wed, 22 Jun 2016 14:08:32 +0000 Subject: [PATCH] Adding new functionalities (add orcid pub, add dataset, access rights, add and remove entities from selection lists, ) - better layout for linking git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43017 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/app.component.ts | 33 +-- .../claimContext/claimContext.component.ts | 140 ++++++----- .../claimDataset/claimDataset.component.ts | 106 ++++++--- .../claimProject/claimProject.component.ts | 90 ++++--- .../claimPublication.component.html | 75 +++--- .../claimPublication.component.ts | 63 +++-- .../insertClaim/insertClaim.component.ts | 2 +- src/app/linking/linking.component.ts | 48 +++- src/app/linking/linkingHome.component.ts | 13 +- .../linking/selected/selected.component.ts | 225 ++++++++++++++---- src/app/services/openaireProjects.service.ts | 5 +- 11 files changed, 517 insertions(+), 283 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1a5b56c2..c3c92b66 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -45,38 +45,9 @@ import 'rxjs/Rx';
  • Claims
  • Linking
  • Home
  • - - - - + diff --git a/src/app/linking/claimContext/claimContext.component.ts b/src/app/linking/claimContext/claimContext.component.ts index cc70c156..b4e588ed 100644 --- a/src/app/linking/claimContext/claimContext.component.ts +++ b/src/app/linking/claimContext/claimContext.component.ts @@ -8,42 +8,33 @@ import {ContextsService} from '../../services/contexts.service'; @Component({ selector: 'claim-contexts', template: ` -
    -
    +
    +
    +
    +
    - +
    +
    - - -
    - -

    Select concepts:

    - + +
    • @@ -51,14 +42,9 @@ import {ContextsService} from '../../services/contexts.service';
    -
    - - -
    -
    +
    + + `, providers:[ ContextsService ] @@ -84,16 +70,30 @@ public categories:string[]; selectedCategoryLabel:string ="Category:"; @Output() selectedCategoryChange = new EventEmitter(); public concepts:string[]; +public warningMessage = ""; +public infoMessage = ""; constructor(private _contextService: ContextsService,myElement: ElementRef) { this.elementRef = myElement; } filter() { - if (this.query !== ""){ - this.filteredList = this.concepts.filter(function(el){ + this.warningMessage = ""; + this.infoMessage = ""; + if(this.selectedCommunityId == "0"){ + this.warningMessage = "Please select Community"; + }else if (this.query !== ""){ + this.warningMessage = ""; + this.infoMessage = ""; + if(this.selectedCategoryId == "0"){ + this.warningMessage = "Specify category for more concepts"; + } + this.filteredList = this.concepts.filter(function(el){ return el.label.toLowerCase().indexOf(this.query.toLowerCase()) > -1; }.bind(this)); + if(this.filteredList.length == 0 ){ + this.infoMessage = "No results found"; + } }else{ this.filteredList = []; } @@ -102,25 +102,40 @@ filter() { select(item){ this.query = ""; this.filteredList = []; - var index:number =this.selectedList.indexOf(item); - if (index == -1) { - var context= { community: this.selectedCommunityId, category: this.selectedCategoryId, concept: item }; + var context= { community: this.selectedCommunityLabel, category: this.selectedCategoryLabel, concept: item }; + var found:boolean = false; + this.warningMessage = ""; + for (var _i = 0; _i < this.selectedList.length; _i++) { + let item = this.selectedList[_i]; + if(item.concept.id == context.concept.id){ + found=true; + this.warningMessage = "Concept already in selected list"; + } + } + if (!found) { this.selectedList.push(context); this.contextsChange.emit({ value: this.selectedList }); } + // var index:number =this.selectedList.indexOf(context); + // if (index == -1) { + // this.selectedList.push(context); + // this.contextsChange.emit({ + // value: this.selectedList + // }); + // } } -remove(item){ - var index:number =this.selectedList.indexOf(item); - if (index > -1) { - this.selectedList.splice(index, 1); - } - this.contextsChange.emit({ - value: this.selectedList - }); -} +// remove(item){ +// var index:number =this.selectedList.indexOf(item); +// if (index > -1) { +// this.selectedList.splice(index, 1); +// } +// this.contextsChange.emit({ +// value: this.selectedList +// }); +// } handleClick(event){ var clickedComponent = event.target; var inside = false; @@ -138,6 +153,9 @@ getCommunities () { this._contextService.getCommunities().subscribe( data => { this.communities = data.communities; + // var concept= ["{id: this.communities['id'], label: this.communities['label'] }"]; + // this.filteredList.push(concept); + // this.concepts.push(concept); }, err => console.error(err) ); @@ -149,6 +167,10 @@ getCommunities () { data => { this.categories = data.category; this.concepts = []; + this.filteredList = []; + if (this.query !== ""){ + this.filter(); + } }, err => console.error(err) @@ -160,21 +182,31 @@ getCommunities () { this._contextService.getConcepts(this.selectedCategoryId, "").subscribe( data => { this.concepts = data.concept; - + if (this.query !== ""){ + this.filter(); + } }, err => console.error(err) ); + }else{ + this.concepts=[]; } } communityChanged(communityId:string, communityLabel:string){ + this.warningMessage = ""; + this.infoMessage = ""; this.selectedCommunityId= communityId; this.selectedCommunityLabel= communityLabel; this.getCategories(); + } categoryChanged(categoryId:string, categoryLabel:string){ + this.warningMessage = ""; + this.infoMessage = ""; this.selectedCategoryId = categoryId; this.selectedCategoryLabel = categoryLabel; this.getConcepts(); + } } diff --git a/src/app/linking/claimDataset/claimDataset.component.ts b/src/app/linking/claimDataset/claimDataset.component.ts index 552f0e8c..f231cc2d 100644 --- a/src/app/linking/claimDataset/claimDataset.component.ts +++ b/src/app/linking/claimDataset/claimDataset.component.ts @@ -30,29 +30,48 @@ import {SearchDataciteService} from '../../services/searchDatacite.service'; + +
    -
    -

    {{resultsNum }} Total Results

    - +
    +

    {{dataciteResultsNum }} Total Results

    +
    +
    -

    + + +
    -

    Menu 1

    -

    Some content in menu 1.

    +
    +
    Under Development.... +
    +
    @@ -80,51 +99,72 @@ export class ClaimDatasetComponent { @Input() public selectedDatasets = [] ; @Output() datasetsChange = new EventEmitter(); - results=[]; - resultsNum : Observable ; + dataciteResults=[]; + dataciteResultsNum : Observable = null; + openaireResults=[]; + openaireResultsNum : Observable = null ; + + public warningMessage = ""; + public infoMessage = ""; searchDatacite (term: string, size : number, page : number) { this.getDataciteResults(term,size,page); - console.info('searchDatacite in searchDatacite file'); + this.warningMessage = ""; + this.infoMessage = ""; + } getDataciteResults (term: string, size : number, page : number) { - console.info("In getDataciteResults (start) "+term); - this._searchDataciteService.searchDataciteResults(term, size, page).subscribe( + this._searchDataciteService.searchDataciteResults(term, size, page).subscribe( data => { - this.results = data.docs; + this.dataciteResults = data.docs; this.page=page; - this.resultsNum = data.numFound; + this.dataciteResultsNum = data.numFound; }, err => console.error(err) ); - console.info("In getDataciteResults (end) "+term); - } + } add(item, itemId,itemType,itemSource,itemTitle, itemUrl){ - var result ={id: itemId, type : itemType, source : itemSource, title: itemTitle, url: itemUrl, result: item}; + var result ; + if(itemSource == 'datacite'){ + result = {id: itemId, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''}; + }else if (itemSource == 'openaire'){ + + } + var found:boolean = this.isSelected( result.id); + this.warningMessage = ""; + if (!found) { this.selectedDatasets.push(result); - var index:number =this.results.indexOf(item); - if (index > -1) { - this.results.splice(index, 1); - } this.datasetsChange.emit({ value: this.selectedDatasets - }); - } - remove(item){ - var index:number =this.selectedDatasets.indexOf(item); - if (index > -1) { - this.selectedDatasets.splice(index, 1); - this.datasetsChange.emit({ - value: this.selectedDatasets - }); - } + }); + }else{ + this.warningMessage = "Dataset already in selected list"; + } } + + pageChange($event) { this.page=$event.value; - this.results=[]; + this.dataciteResults=[]; this.searchDatacite(this.keyword,10,this.page); + this.warningMessage = ""; + this.infoMessage = ""; + + } + isSelected(id:string){ + + var found:boolean = false; + this.warningMessage = ""; + for (var _i = 0; _i < this.selectedDatasets.length; _i++) { + let item = this.selectedDatasets[_i]; + if(item.id == id){ + found=true; + break; + } + } + return found; } } diff --git a/src/app/linking/claimProject/claimProject.component.ts b/src/app/linking/claimProject/claimProject.component.ts index afbc7299..d5d33dfa 100644 --- a/src/app/linking/claimProject/claimProject.component.ts +++ b/src/app/linking/claimProject/claimProject.component.ts @@ -14,27 +14,35 @@ import {OpenaireProjectsService} from '../../services/openaireProjects.service'; --> - + + `, providers:[ OpenaireProjectsService ] @@ -67,38 +77,49 @@ selectedFunderName:string ="Select funder:"; @Output() cselectedFunderChange = new EventEmitter(); public projects:string[]; - +public warningMessage = ""; +public infoMessage = ""; constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) { this.elementRef = myElement; } filter() { - if(this.selectedFunderId != '0' && this.query !== "" && this.query.length >= 3 ){ + console.info("Search projects"); + if (this.selectedFunderId == '0' ){ + this.warningMessage = "Please select a funder first"; + this.infoMessage = ""; + }else if ( this.query == "" || this.query.length < 3){ + this.warningMessage = "Please type a keyword, containing at least 3 characters" + this.infoMessage = ""; + }else{ + this.warningMessage = ""; + this.infoMessage = ""; this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe( data => { - this.filteredList = data; + this.filteredList =(data == null)?[]:data; + this.infoMessage = (data == null)?"No Results found":""; }, err => console.error(err) ); } - - // if (this.query !== ""){ - // this.filteredList = this.concepts.filter(function(el){ - // return el.label.toLowerCase().indexOf(this.query.toLowerCase()) > -1; - // }.bind(this)); - // }else{ - // this.filteredList = []; - // } } select(item){ this.query = ""; this.filteredList = []; - var index:number =this.selectedProjects.indexOf(item); - if (index == -1) { - //{{item.field[0]['@value']}} - {{item.field[1]['@value']}} - var project= { funderId: this.selectedFunderId, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] }; + var project= { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] }; + var index:number =this.selectedProjects.indexOf(project); + var found:boolean = false; + this.warningMessage = ""; + for (var _i = 0; _i < this.selectedProjects.length; _i++) { + let item = this.selectedProjects[_i]; + if(item.projectId == project.projectId){ + found=true; + this.warningMessage = "Project already in selected list"; + } + } + if (!found) { this.selectedProjects.push(project); this.projectsChange.emit({ value: this.selectedProjects @@ -140,23 +161,14 @@ getFunders () { getProjects () { if(this.selectedFunderId != '0'){ - // this._contextService.getConcepts(this.selectedCategory, "").subscribe( - // data => { - // this.concepts = data.concept; - // - // }, - // err => console.error(err) - // ); + } } funderChanged(funderId:string, funderName:string){ this.selectedFunderId = funderId; this.selectedFunderName = funderName; console.info("Selected funder:"+this.selectedFunderId+ ' name:'+funderName ); - this.selectedProjects = []; -} -// categoryChanged(){ -// this.getConcepts(); -// } + +} } diff --git a/src/app/linking/claimPublication/claimPublication.component.html b/src/app/linking/claimPublication/claimPublication.component.html index 02a5e7e6..12a0a3b7 100644 --- a/src/app/linking/claimPublication/claimPublication.component.html +++ b/src/app/linking/claimPublication/claimPublication.component.html @@ -16,61 +16,76 @@
    + + + +
    -

    {{crossrefResultsNum }} Total Results

    - +
    -

    -
    + +
    No results found
    +
    - -

    TODO put openaire results here...

    +
    +
    Under Development.... +
    +

    No authors found for keyword: {{keyword}}

    -
    -

    Not the right author? Choose one of these:

    +
    +
    Not the right author? Choose one of these: - -
    - -
    -

    {{orcidResultsNum }} Total Results for author - {{authorGivenName}} {{authorFamilyName}} : {{authorId}} -

    -
    + Results for + {{authorGivenName}} {{authorFamilyName}} - {{authorId}} : +
    - -
    -

    {{item['work-title']['title'].value}} ({{item['publication-date']['year'].value}})

    -
    -
    +
    +
      +
    • + {{item['work-title']['title'].value}} + +
    • +
    +
    No results found
    +
    diff --git a/src/app/linking/claimPublication/claimPublication.component.ts b/src/app/linking/claimPublication/claimPublication.component.ts index 8917565d..73d586ef 100644 --- a/src/app/linking/claimPublication/claimPublication.component.ts +++ b/src/app/linking/claimPublication/claimPublication.component.ts @@ -56,6 +56,9 @@ export class ClaimPublicationComponent { authorsNum : number ; + public warningMessage = ""; + public infoMessage = ""; + searchOrcid (term: string) { this.authorIds = new Array(); this.authorGivenNames = new Array(); @@ -151,7 +154,9 @@ export class ClaimPublicationComponent { } search(term: string, size : number, page : number){ - this.getCrossrefResults(term,size,page); + this.warningMessage = ""; + this.infoMessage = ""; + this.getCrossrefResults(term,size,page); this.searchOrcid(term); } @@ -170,25 +175,30 @@ search(term: string, size : number, page : number){ } - add(item, itemSource, itemType, itemUrl, itemTitle){ - var result ={id: item.DOI, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''}; - console.info("Add result:"+result.id+" "+result.source+" "+item); - var index:number =this.selectedPublications.indexOf(result); - item.selected=true; - if (index== -1) { - this.selectedPublications.push(result); + add(item, id, itemSource, itemType, itemUrl, itemTitle){ + var result ; + if(itemSource == 'crossref'){ + result = {id: id, type :itemType, source : 'openaire', title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''}; + }else if (itemSource == 'orcid'){ + result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''}; + }else if (itemSource == 'openaire'){ + + } + var found:boolean = this.isSelected(result.id); + this.warningMessage = ""; + if (!found) { + this.selectedPublications.push(result); + this.publicationsChange.emit({ + value: this.selectedPublications + }); + }else{ + this.warningMessage = "Publication already in selected list"; } - //do not remove it from the list - // var index:number =this.crossrefResults.indexOf(item); - // if (index > -1) { - // this.crossrefResults.splice(index, 1); - // } - this.publicationsChange.emit({ - value: this.selectedPublications - }); } remove(item){ + this.warningMessage = ""; + this.infoMessage = ""; var index:number =this.selectedPublications.indexOf(item); item.selected=false; if (index > -1) { @@ -210,12 +220,19 @@ search(term: string, size : number, page : number){ this.orcidResultsToShow = this.orcidResults.slice(($event.value-1)*this.size, $event.value*this.size); } - isSelected(item){ - var index:number =this.selectedPublications.indexOf(item); - if (index > -1) { - return true; - }else{ - return false; - } + isSelected(id:string){ + + var found:boolean = false; + this.warningMessage = ""; + for (var _i = 0; _i < this.selectedPublications.length; _i++) { + let item = this.selectedPublications[_i]; + if(item.id == id){ + found=true; + this.warningMessage = "Publication already in selected list"; + } + } + return found; + + } } diff --git a/src/app/linking/insertClaim/insertClaim.component.ts b/src/app/linking/insertClaim/insertClaim.component.ts index 81eeb7d2..93e9cac5 100644 --- a/src/app/linking/insertClaim/insertClaim.component.ts +++ b/src/app/linking/insertClaim/insertClaim.component.ts @@ -11,7 +11,7 @@ import {ClaimsService} from '../../services/claims.service'; directives: [...ROUTER_DIRECTIVES], template: ` - +
    diff --git a/src/app/linking/linking.component.ts b/src/app/linking/linking.component.ts index d5ba238f..c269737f 100644 --- a/src/app/linking/linking.component.ts +++ b/src/app/linking/linking.component.ts @@ -23,8 +23,16 @@ import {LinkingHomeComponent} from './linkingHome.component'; - +
    + +
    @@ -38,7 +46,7 @@ import {LinkingHomeComponent} from './linkingHome.component'; -->
    - +
    -->
    - +
    - +
    - +
    @@ -107,10 +117,10 @@ export class LinkingComponent { publications=[]; datasets=[]; show = "home"; - searchType="publication"; + searchType="publication"; //publication or dataset date='8-6-2016'; keyword: string = ""; - chosenType:string ="project"; + linkType:string ="project"; // link type (selected in home page) : project, context, software, etc ngOnInit() { } @@ -130,11 +140,11 @@ export class LinkingComponent { } prev(){ if(this.show == 'result'){ - if(this.chosenType == 'project'){ + if(this.linkType == 'project'){ this.show='project'; - }else if(this.chosenType == 'context'){ + }else if(this.linkType == 'context'){ this.show='context'; - }else if(this.chosenType == 'software'){ + }else if(this.linkType == 'software'){ this.show='software'; }else{ this.show='home'; @@ -185,9 +195,23 @@ export class LinkingComponent { typeChanged(type:string) { this.searchType = type; } - chosenTypeChange($event) { - this.chosenType = this.show; + linkTypeChange($event) { + this.linkType =$event.value; this.show=$event.value; + } + showChange($event) { + this.show=$event.value; + this.showChangedType($event.value); + + + } + showChangedType(type:string) { + this.show=type; + if(this.show == 'project' || this.show == 'context' || this.show == 'software'){ + this.linkType = this.show; + } + + } } diff --git a/src/app/linking/linkingHome.component.ts b/src/app/linking/linkingHome.component.ts index 6ffd41d7..2c874f12 100644 --- a/src/app/linking/linkingHome.component.ts +++ b/src/app/linking/linkingHome.component.ts @@ -1,4 +1,4 @@ -import {Component, Output, EventEmitter } from '@angular/core'; +import {Component, Output, EventEmitter} from '@angular/core'; import {RouteConfig, ROUTER_DIRECTIVES, Router} from '@angular/router-deprecated'; import {JSONP_PROVIDERS} from '@angular/http'; import {Observable} from 'rxjs/Observable'; @@ -42,13 +42,12 @@ import {Observable} from 'rxjs/Observable'; }) export class LinkingHomeComponent { - @Output() chosenTypeChange = new EventEmitter(); - chosenType:string = "result"; + @Output() linkTypeChange = new EventEmitter(); + linkType:string = "project"; select(type:string){ - console.info('Changed!'+type); - this.chosenType = type; - this.chosenTypeChange.emit({ - value: this.chosenType + this.linkType = type; + this.linkTypeChange.emit({ + value: this.linkType }); } diff --git a/src/app/linking/selected/selected.component.ts b/src/app/linking/selected/selected.component.ts index c6c8935b..395f90c3 100644 --- a/src/app/linking/selected/selected.component.ts +++ b/src/app/linking/selected/selected.component.ts @@ -1,60 +1,130 @@ -import {Component, Input,Output} from '@angular/core'; +import {Component, Input,Output, EventEmitter} from '@angular/core'; import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component'; @Component({ selector: 'claim-selected', template: ` -
    -
    Selected Publications:
    - Source: {{pub.source}} - Title: -

    - - -

    -
    + +
    +
    + +
    +
      +
    • Selected Concepts ({{(contexts.length)}}) + +
    • +
    • + {{context.community }} > {{context.category}} > {{context.concept.label}} + + +
    • +
    • There are no contexts
    • +
    +
    +
    -
    -
      -
    • Selected Concepts:
    • -
    • {{context.community}} - Category: {{context.category}}
    • -
    -
    -
    -
      -
    • Selected Projects
    • -
    • - - {{project.projectAcronym}} - {{project.projectName}} +
      + +
      +
        +
      • Selected Projects ({{(projects.length)}}) +
      • -
      +
    • + + {{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'()'+project.projectAcronym+')':''}} + +
    • +
    • There are no projects
    • +
    +
    +
    -
    -
    Selected datasets:
    - Datasets: Source: {{dataset.source}} - Title: -
    -
    +
    + - `, + +
    +
      +
    • Selected Research Results + +
    • +
    • There are no Research Results
    • +
    +
    +--> + +
    +
      +
    • Research Results ({{(datasets.length+publications.length)}}) + +
    • +
    • There are no Research Results
    • +
    • {{publications. length }} Selected Publications: + +
    • +
    • + + + {{pub.title}} + {{pub.title}} + + + + + + + + + +
    • +
    • {{datasets.length}} Selected Research Data: + +
    • +
    • + + + {{dataset.title}} + {{dataset.title}} + + + + + + + + + +
    • + +
    +
    + `, directives: [ PublicationTitleFormatter] @@ -70,16 +140,69 @@ export class ClaimSelectedComponent { @Input() publications=[]; @Input() datasets=[]; @Input() showAccessRights=false; + @Input() show='home'; + @Output() projectsChange = new EventEmitter(); + @Output()publicationsChange = new EventEmitter(); + @Output() datasetsChange = new EventEmitter(); + @Output() contextsChange = new EventEmitter(); + @Output() showChange = new EventEmitter(); + removeContext(item:any){ + var index:number =this.contexts.indexOf(item); + if (index > -1) { + this.contexts.splice(index, 1); + } + this.contextsChange.emit({ + value: this.contexts + }); + } + removePublication(item:any){ + var index:number =this.publications.indexOf(item); + if (index > -1) { + this.publications.splice(index, 1); + } + this.publicationsChange.emit({ + value: this.publications + }); + } + removeDataset(item:any){ + var index:number =this.datasets.indexOf(item); + if (index > -1) { + this.datasets.splice(index, 1); + } + this.datasetsChange.emit({ + value: this.datasets + }); + } + removeProject(item:any){ + var index:number =this.projects.indexOf(item); + if (index > -1) { + this.projects.splice(index, 1); + } + this.projectsChange.emit({ + value: this.projects + }); + } + showType(type){ + if(type != this.show){ + this.show = type; + this.showChange.emit({ + value: this.show + }); + } + } accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"]; - - - - - - - +} + + + +@Component({ + selector: 'add-more', + template: `` +}) +export class Addmore { + @Input() type = 'publication'; } diff --git a/src/app/services/openaireProjects.service.ts b/src/app/services/openaireProjects.service.ts index 5d9ddc9f..c0c8e69f 100644 --- a/src/app/services/openaireProjects.service.ts +++ b/src/app/services/openaireProjects.service.ts @@ -9,7 +9,8 @@ import {Observable} from 'rxjs/Observable'; export class OpenaireProjectsService { constructor( private http: Http) {} // searchUrl="http://services.openaire.eu:8380/search/"; - searchUrl="http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; + // searchUrl="http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; + searchUrl="http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/"; getFunders():any { let url = this.searchUrl+'search?action=refine&rTransformer=results_openaire_browse&fields=funderid&query=%28oaftype+exact+project%29&locale=en_GB&format=json'; ////"&rows=".$size."&offset=".($page-1)*$size @@ -26,7 +27,7 @@ export class OpenaireProjectsService { ////"&rows=".$size."&offset=".($page-1)*$size return this.http.get( url) - .map(request => request.json().response.results.result) + .map(request => (request.json().response.results)?request.json().response.results.result:request.json().response.results) .do(funders => console.log("getFunders : "+funders)) .catch(this.handleError);