From 09017aee044937977f2c8e8de1897bcd723b91de Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 16 Mar 2018 14:54:44 +0000 Subject: [PATCH] 1. Change of SearchResult field for funders (used for project results): instead of funders: {"funderShortname": string, "funderName": string}[] now: funderShortname: string // only 1 funder per project and we don't use the full name 2. Addition of SearchResult field for project results: acronym: string, code: string 3. Parsing of funders changed (searchProjects.service): when more than 1 funders in 'fundingtree', keep 'shortname' of the first one 4. Parsing of project's acronym and code parsed and stored in corresponding fields (not in the title.name) 5. Adjust new fields display in 'tabResult.component' and 'searchResult.component' git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51317 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../searchUtils/searchResult.component.html | 15 +++--- .../searchUtils/tabResult.component.html | 28 +++++----- services/searchProjects.service.ts | 54 +++++++++++-------- utils/entities/searchResult.ts | 5 +- 4 files changed, 56 insertions(+), 46 deletions(-) diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index 23393e07..a86b89cc 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -10,24 +10,21 @@

-

-

-

- [no title available] -

+

{{result.acronym}}-({{result.code}})

+

[no title available]({{result.code}})

{{result.types.join(", ")}} {{result.languages.join(", ")}} {{result.title.accessMode}} - + + {{result['funderShortname']}}> Open Access mandate Special Clause 39 @@ -94,7 +91,7 @@ (start {{result.startYear}} - end {{result.endYear}}) --> -
Start year: {{result.startYear}} - End year: {{result.endYear}})
+
Start year: {{result.startYear}} - End year: {{result.endYear}}
Organization: diff --git a/searchPages/searchUtils/tabResult.component.html b/searchPages/searchUtils/tabResult.component.html index cf370265..a37081fd 100644 --- a/searchPages/searchUtils/tabResult.component.html +++ b/searchPages/searchUtils/tabResult.component.html @@ -10,15 +10,16 @@ - - - - - [no title available] - + + {{result.acronym}} + - + + ({{result.code}}) + + + [no title available] + ({{result.code}}) +
@@ -67,15 +68,16 @@ Embargo End Date: {{result.embargoEndDate}} -
- - +
+ + {{result['funderShortname']}}> + (start {{result.startYear}} - end {{result.endYear}})
diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index dd2e9dd1..766638db 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -123,35 +123,27 @@ export class SearchProjectsService { var result: SearchResult = new SearchResult(); result.openAccessMandate = (resData['oamandatepublications'])?true:false; result['title'] = {"name": '', "accessMode": '', "sc39": ''}; - if(resData['acronym'] != undefined && resData['acronym'] != "") { - result['title'].name = resData['acronym'] + " - "; - } + // if(resData['acronym'] != undefined && resData['acronym'] != "") { + // result['title'].name = resData['acronym'] + " - "; + // } if(Array.isArray(resData['title'])) { - // resData['title'][0].hasOwnProperty("content") { - result['title'].name += resData['title'][0]; - // } + result['title'].name += resData['title'][0]; } else { - // resData['title'].hasOwnProperty("content") { - result['title'].name += resData['title']; - // } + result['title'].name += resData['title']; } - if(result['title'].name != '') { - result['title'].name += " ("+resData['code']+")" - } + // if(result['title'].name != '') { + // result['title'].name += " ("+resData['code']+")" + // } if(resData['ecsc39'] == true) { result['title'].sc39 = "sc39"; } + result.acronym = resData['acronym']; + result.code = resData['code']; - - // if(resData['title'].hasOwnProperty("content")) { - // result['title'].name = resData['title'].content; - // } - //result['title'].url = OpenaireProperties.getsearchLinkToProject(); - //result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; - result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; + result.id = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; if(resData['rels'].hasOwnProperty("rel")) { let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1; @@ -182,21 +174,37 @@ export class SearchProjectsService { } } if(resData.hasOwnProperty("fundingtree")) { + /*let funderSet: Set; if(result['funders'] == undefined) { result['funders'] = new Array< {"funderShortname": string, "funderName": string}>(); + funderSet = new Set(); } let fundingLength = Array.isArray(resData['fundingtree']) ? resData['fundingtree'].length : 1; for(let z=0; z