From 66c89f85845932d94fe06e1a3f5e3514fb7d73bd Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 20 Nov 2017 11:50:23 +0000 Subject: [PATCH] Project landing page: Functionalities for 'Software' in APP BOX added -- no changes or additions in display | HtmlProjectReport: case for type=='Software' added in component and service git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@49957 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../htmlProjectReport.component.ts | 33 +++++++++++++++---- .../htmlProjectReport.service.ts | 15 +++++++-- .../landingPages/project/project.component.ts | 16 ++++++++- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.component.ts b/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.component.ts index 280d47b4..b08ccf15 100644 --- a/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.component.ts +++ b/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.component.ts @@ -76,14 +76,21 @@ export class HtmlProjectReportComponent{ this.showLoading = false; this.warningMessage="Requested size is not an integer"; } -console.info(params['type']); - if(params['type'] && (params['type'] == "dataset" || params['type'] == "publication")){ - this.resultsType = (params['type'] == "dataset") ? 'research data' : params['type']; + + if(params['type'] && (params['type'] == "publication" || params['type'] == "dataset" || params['type'] == "software")){ + if(params['type'] == "publication") { + this.resultsType = 'publication'; + } else if(params['type'] == "dataset") { + this.resultsType = 'research data'; + } else if(params['type'] == "software") { + this.resultsType = 'software'; + } + this.updateTitle("Project's "+this.resultsType+" report"); - this.updateDescription("project, project "+ this.resultsType +" report, funding, open access, publications, research data"); + this.updateDescription("project, project "+ this.resultsType +" report, funding, open access, publications, research data, software"); } else { this.showLoading = false; - this.warningMessage="Requested type should be publication or research data"; + this.warningMessage="Requested type should be publication or research data or software"; } //showLoading is true if no warnings @@ -130,7 +137,13 @@ console.info(params['type']); } ); - this.header2 = this.totalResults+((this.resultsType == "publication")?" publications":" research data"); + if(this.resultsType == "publication") { + this.header2 += this.totalResults + " publications"; + } else if(this.resultsType == "research data") { + this.header2 += this.totalResults + " research data"; + } else if(this.resultsType == "software") { + this.header2 += this.totalResults + " software"; + } } private createClipboard() { @@ -170,7 +183,13 @@ console.info(params['type']); } createHeader1(data: {"title": string, "acronym": string, "callIdentifier": string}) { - this.header1 = ((this.resultsType == "publication")?"Publications":"Research Data") + " of Project "; + if(this.resultsType == "publication") { + this.header1 += "Publications"; + } else if(this.resultsType == "research data") { + this.header1 += "Research Data"; + } else if(this.resultsType == "software") { + this.header1 += "Software"; + } if(data != undefined) { if(data.title != undefined && data.title != "") { diff --git a/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.service.ts b/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.service.ts index de681974..c0e650bf 100644 --- a/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.service.ts +++ b/portal-4cli/src/app/landingPages/htmlProjectReport/htmlProjectReport.service.ts @@ -12,8 +12,19 @@ export class HtmlProjectReportService { getHTML(id: string, size: number, type:string):any { console.info("getHTML in service"); - let resultTypeId: string = (type == "research data") ? 'dataset' : type; - let requestType: string = (resultTypeId == "dataset") ? 'datasets' : 'publications'; + let resultTypeId: string; + let requestType: string; + if(type == "publication") { + resultTypeId = 'publication'; + requestType = 'publications'; + } else if(type == "research data") { + resultTypeId = 'dataset'; + requestType = 'datasets'; + } else if(type == "software") { + resultTypeId = 'software'; + requestType = 'software' + } + //let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json"; let url = OpenaireProperties.getCsvAPIURL(); url += 'resources?format=html&page=0&size='+size+'&type='+requestType+'&query=(((oaftype exact result) and (resulttypeid exact '+resultTypeId+')) and (relprojectid exact "'+id+'"))'; diff --git a/portal-4cli/src/app/landingPages/project/project.component.ts b/portal-4cli/src/app/landingPages/project/project.component.ts index 39597b62..3e8f32d3 100644 --- a/portal-4cli/src/app/landingPages/project/project.component.ts +++ b/portal-4cli/src/app/landingPages/project/project.component.ts @@ -46,6 +46,7 @@ export class ProjectComponent{ // HTML variables in APP BOX public publications_dynamic: string; public datasets_dynamic: string; + public software_dynamic: string; public project ; @@ -53,6 +54,7 @@ export class ProjectComponent{ public downloadURLAPI: string; public csvParams: string; public csvParamsDatasets: string; + public csvParamsSoftware: string; // Message variables public warningMessage = ""; @@ -128,6 +130,16 @@ export class ProjectComponent{ + "\n-->" + "\n"; + this.software_dynamic = + ""; + this.getProjectInfo(this.projectId); this.searchPublications(); this.fetchDatasets.getNumForEntity("project", this.projectId); @@ -142,6 +154,7 @@ export class ProjectComponent{ this.createClipboard(); this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size="; this.csvParamsDatasets = "format=csv-special&page=0&type=datasets&query=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact "+this.projectId+"))&size="; + this.csvParamsSoftware = "format=csv-special&page=0&type=software&query=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact "+this.projectId+"))&size="; if (typeof document !== 'undefined') { this.element.nativeElement.scrollIntoView(); @@ -166,11 +179,12 @@ export class ProjectComponent{ private createClipboard() { if(typeof window !== 'undefined') { - let publ_clipboard, datasets_clipboard; + let publ_clipboard, datasets_clipboard, software_clipboard; let Clipboard; Clipboard = require('clipboard'); publ_clipboard = new Clipboard('.publ_clipboard_btn'); datasets_clipboard = new Clipboard('.datasets_clipboard_btn'); + software_clipboard = new Clipboard('.software_clipboard_btn'); } }