From e658c5d23aa85a6fc5359fbe77486cb6b5208403 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 28 Apr 2022 12:13:06 +0300 Subject: [PATCH] [Library | new-theme]: Redesign of project landing page and small upadates on result landing and common components. 1. addThis.component.ts: Updated social icons of addThis. 2. landing-header.component.ts: Added "uk-text-small" in subtitle. 3. metrics.component.ts: Added method "clickedMetrics()" to set "metricsClicked" | Added metricsClicked and metrics.infos conditions for loading table or iframes | Added customContainerClass and customIframeClass in . 4. project.component: Updated project landing page according to UI redesign. 5. project.module.ts: Import LoadingModule, IconsModule, InputModule. 6. project.service.ts: Use parsingFunctions.parseDescription. 7. projectService.module.ts: iconsService.registerIcons([link, graph]). 8. resultLanding.component.html: Small fixes in ui | Added right arrow on tooltips of actions that are links to other pages | Display of description updated as innerHtml (#7345). 9. orcid-work.component.ts: Added flex=true in . 10. input.component.ts: Added disabled?: boolean in Option interface and show disabled options as muted. 11. projectInfo.ts: Updated description to be string[] instead of string. 12. iframe.component.ts: Added @Input() customContainerClass: string = ""; and @Input() customIframeClass: string = ""; 13. search-tab.component.ts: Updated according to redesign | Update "getEntityName()" to return values from OpenaireEntities. 14. tabs.component.ts: Added "uk-height-1-1" in custom tabs | In #mytabs::before set left:0. --- .../landing-utils/addThis.component.ts | 2 +- .../landing-header.component.ts | 2 +- .../metrics/metrics.component.ts | 15 +- landingPages/project/project.component.html | 1451 ++++++++--------- landingPages/project/project.component.ts | 168 +- landingPages/project/project.module.ts | 5 +- landingPages/project/project.service.ts | 11 +- landingPages/project/projectService.module.ts | 5 + .../result/resultLanding.component.html | 20 +- .../result/resultLanding.component.ts | 3 +- orcid/orcid-work.component.ts | 16 +- sharedComponents/input/input.component.ts | 6 +- utils/entities/projectInfo.ts | 2 +- utils/iframe.component.ts | 10 +- utils/tabs/contents/search-tab.component.ts | 66 +- utils/tabs/tabs.component.ts | 4 +- 16 files changed, 901 insertions(+), 885 deletions(-) diff --git a/landingPages/landing-utils/addThis.component.ts b/landingPages/landing-utils/addThis.component.ts index 3f349672..97310993 100644 --- a/landingPages/landing-utils/addThis.component.ts +++ b/landingPages/landing-utils/addThis.component.ts @@ -17,7 +17,7 @@ declare var addthis: addthis; @Component({ selector: 'addThis', template: ` -
+
` }) export class AddThisComponent implements OnInit { diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index d4619117..afe7228c 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -51,7 +51,7 @@ import {AlertModal} from "../../../utils/modal/alert";
- +
diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts index a462671d..4c11d6fa 100644 --- a/landingPages/landing-utils/metrics/metrics.component.ts +++ b/landingPages/landing-utils/metrics/metrics.component.ts @@ -12,7 +12,7 @@ import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive"; styleUrls: ['metrics.component.css'], template: `
- + usage counts
{{total | number}}
@@ -38,7 +38,7 @@ import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive";
-
    @@ -77,10 +77,12 @@ import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive";
  • - +
  • - +
@@ -236,6 +238,11 @@ export class MetricsComponent { } } + public clickedMetrics() { + setTimeout( () => { + this.metricsClicked = true; + }); + } public toggle(event) { this.metricsClicked = true; diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index 32037909..dfdcb5a9 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -1,23 +1,666 @@ - +
+
+ +
+ +
+
+ +
+
+ + +
+
+ +
+ + + + +
+
+
Actions
+ +
+
+
+ + +
+ +
+ +
+ + + Powered by OpenAIRE Research Graph + + + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} + +
+ +
+ Anything wrong? + Report an Issue +
+
+
+ +
+ +
+ +
+ + + + + + + +
+ + + Open Access mandate for Publications and Research Data +   + + + + Open Access mandate for Publications +   + + + + Open Access mandate for Research Data +   + + + + {{projectInfo.funding.funderName}} +   + + + + Special Clause 39 +   + +
+
+
+
+ + Funder: + {{projectInfo.funding.funderName}} + + + Project code: + {{projectInfo.funding.code}} + + + Call for proposal: + {{projectInfo.funding.callIdentifier}} + +
+
+ + Funded under: + {{projectInfo.funding.fundingStream}} + + + Overall Budget: + {{projectInfo.funding.budget | number}} + {{projectInfo.funding.currency}} + + + Funder Contribution: + {{projectInfo.funding.contribution | number}} + {{projectInfo.funding.currency}} + +
+
+
+ + Status: + {{projectInfo.status}} + +
+
+ + +
+ + {{projectInfo.startDate | date: 'dd MMM yyyy'}} (Started) + + + {{projectInfo.endDate | date: 'dd MMM yyyy'}} + (Ended) + (Ending) + +
+
+ +
+
Open Access mandate
+
+ + Publications: + + No + + + Research Data: + No + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ No summary information available +
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+
Description
+
+
+
+ +
+
+
+
+
+ +
Partners
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ View less +
+
+
+
+
+
+ + +
+ + +
+
+ + +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
+ + + + +
+
Statistics
+ +
+
+
+
Produced + {{openaireEntities.RESULTS}} per year +
+ +
+
+
+
+
Access mode of + {{openaireEntities.RESULTS}} +
+ +
+
+
+
+
+ {{openaireEntities.RESULTS}} per datasource +
+ +
+
+
+
+
+ + + + + + +
+ +
+ + + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
{{getDynamicContent(embed_research_results_type)}}
+ +
+ +
+ For further information contact us at + {{properties.helpdeskEmail}} +
+ + + + + + +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+ No reports available +
+
+
+
+ + + -
-
-
+ + + -
- - - - -
-
- - - - -
- Open Access mandate for Publications and Research Data - {{" "}} - - Open Access mandate for Publications - {{" "}} - - Open Access mandate for Research Data - {{" "}} - - {{projectInfo.funding.funderName}} - {{" "}} - - Special Clause 39 - {{" "}} -
-
    -
  • - - Funder: - {{projectInfo.funding.funderName}} - - - Project code: - {{projectInfo.funding.code}} - - - Call for proposal: - {{projectInfo.funding.callIdentifier}} - -
  • -
  • - - Funded under: - {{projectInfo.funding.fundingStream}} - - - Overall Budget: - {{projectInfo.funding.budget | number}} - {{projectInfo.funding.currency}} - - - Funder Contribution: - {{projectInfo.funding.contribution | number}} - {{projectInfo.funding.currency}} - -
  • -
  • - - Status: - {{projectInfo.status}} - -
  • -
  • - - -
    - -
    Start Date
    -
    {{projectInfo.startDate | date: 'dd MMM yyyy'}}
    -
    - -
    End Date
    -
    {{projectInfo.endDate | date: 'dd MMM yyyy'}}
    -
    -
    -
  • -
  • - - - {{projectInfo.urlInfo}} - - -
  • -
-
    -
  • -
    Open Access mandate
    -
    - - Publications: - - No - - - Research Data: - - No - -
    -
  • -
-
- -
- - - - - -
-
- -
- -
- - -
-
- -
- -
-
-
Description
-
- {{projectInfo.description.substring(0, showNumDescription)}} - ... -
- - -
-
- - -
- -
- - - - -
-
- - -
- - - -
- -
- - - - -
-
- - -
- - - -
- -
- -
-
- - -
- - - -
-
- - - - -
-
- - -
- - - -
- -
- -
- -
- No Data Management Plans (DMPs) available. - Link existing DMPs with this project or start a new DMP in Argos. -
-
-
-
- - - - -
-
- - -
-
-
Produced - research - outcomes per year -
- -
-
-
Access mode of - research - outcomes -
- -
-
-
Research - outcomes per datasource -
- -
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- -
- graph - Powered by OpenAIRE Research Graph - - . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} - -
- -
- Any information missing or wrong? - Report an Issue -
-
-
- -
- - - - - -
- - -
-
-
Produced research - outcomes per year -
- -
-
-
Access mode of research - outcomes -
- -
-
-
Research outcomes per - datasource -
- -
-
-
-
-
-
- -
- - - + + + + {{(organization.acronym) ? organization.acronym : ''}} + {{(!organization.acronym && organization.name) ? organization.name : ''}} + + + {{organization.acronym}} + {{organization.name}} + + , + + ... + \ No newline at end of file diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 0c34b5bc..1b59991b 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, Input, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -27,6 +27,8 @@ import {SearchResult} from "../../utils/entities/searchResult"; import {IndexInfoService} from "../../utils/indexInfo.service"; import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; +import {Option} from "../../sharedComponents/input/input.component"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ selector: 'project', @@ -78,8 +80,9 @@ export class ProjectComponent { @ViewChild('statisticsModal') statisticsModal; @ViewChild('linkProjectModal') linkProjectModal; - @ViewChild('shareResultsModal') shareResultsModal; + @ViewChild('embedResultsModal') embedResultsModal; @ViewChild('downloadReportModal') downloadReportModal; + @ViewChild('addThisModal') addThisModal // Request results for publications, research data and software only the one time (first time tab is clicked) private reloadPublications: boolean = true; @@ -89,7 +92,7 @@ export class ProjectComponent { private reloadDmps: boolean = true; // Variables for entity selections on the right column - public share_research_results_type: string = "results"; + public embed_research_results_type: string = "result"; public download_research_results_type: string = ""; // Variables for publications, research data, software tabs @@ -119,12 +122,38 @@ export class ProjectComponent { public thresholdDescription: number = 670; public showNumDescription: number = 670; - // Organizations variables for view more/less functionality + // // Organizations variables for view more/less functionality + // public thresholdOrganizations: number = 20; + // public showNumOrganizations: number = 20; + /*Show all organizations*/ + public viewAllOrganizations: boolean = false; + public lessBtnOrganizations: boolean = false; public thresholdOrganizations: number = 20; - public showNumOrganizations: number = 20; + @ViewChild('organizationsModal') organizationsModal; + + + public resultTypesForEmbedding: Option[]=[ + {label: "All "+OpenaireEntities.RESULTS, value: "result"}, + {label: OpenaireEntities.PUBLICATIONS, value: "publication"}, + {label: OpenaireEntities.DATASETS, value: "dataset"}, + {label: OpenaireEntities.SOFTWARE, value: "software"}, + {label: OpenaireEntities.OTHER, value: "other"}]; + + public resultTypesForDownloading: Option[]=[ + {label: "All "+OpenaireEntities.RESULTS, value: "results", disabled: true}, + {label: OpenaireEntities.PUBLICATIONS, value: "publications", disabled: true}, + {label: OpenaireEntities.DATASETS, value: "datasets", disabled: true}, + {label: OpenaireEntities.SOFTWARE, value: "software", disabled: true}, + {label: OpenaireEntities.OTHER, value: "other", disabled: true}]; + + public offset: number; + @ViewChild("graph_and_feedback") graph_and_feedback; + public stickyHeader: boolean = false; subscriptions = []; properties: EnvProperties; + public openaireEntities = OpenaireEntities; + constructor(private route: ActivatedRoute, private _router: Router, private _location: Location, @@ -137,7 +166,8 @@ export class ProjectComponent { private _searchResearchResultsService: SearchResearchResultsService, private _reportsService: ReportsService, private htmlService: HtmlProjectReportService, - private indexInfoService: IndexInfoService) {} + private indexInfoService: IndexInfoService, + private cdr: ChangeDetectorRef) {} ngOnInit() { @@ -191,21 +221,29 @@ export class ProjectComponent { this.createClipboard(); })); + this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + } + + calcGraphOffset() { + if(this.graph_and_feedback && window) { + return window.innerHeight-this.graph_and_feedback.nativeElement.offsetHeight+"px"; + } + return 0; } public getFileNameType(type: string) { if(type == "results") { - return "research-outcomes"; + return OpenaireEntities.RESULTS.replace(" ", "-"); } else if(type == "publications") { - return "publications"; + return OpenaireEntities.PUBLICATIONS.replace(" ", "-"); } else if(type == "datasets") { - return "research-data"; + return OpenaireEntities.DATASETS.replace(" ", "-"); } else if(type == "software") { - return "software"; + return OpenaireEntities.SOFTWARE.replace(" ", "-"); } else if(type == "other") { - return "other-research-products"; + return OpenaireEntities.OTHER.replace(" ", "-"); } - return "results"; + return OpenaireEntities.RESULTS.replace(" ", "-"); } public getCsvParams(type: string) { @@ -402,7 +440,8 @@ export class ProjectComponent { } this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this._router.url); this.updateTitle(this.projectName); - this.updateDescription(this.projectInfo.description?this.projectInfo.description: ("project" + (this.projectInfo.title?"," + this.projectInfo.title:"") + (this.projectInfo.funding && this.projectInfo.funding.funderName?", funder: " + this.projectInfo.funding.funderName:"") + (this.projectInfo.acronym?"," + this.projectInfo.acronym:""))); + // this.updateDescription(this.projectInfo.description?this.projectInfo.description: ("project" + (this.projectInfo.title?"," + this.projectInfo.title:"") + (this.projectInfo.funding && this.projectInfo.funding.funderName?", funder: " + this.projectInfo.funding.funderName:"") + (this.projectInfo.acronym?"," + this.projectInfo.acronym:""))); + this.updateDescription((this.projectInfo.description && this.projectInfo.description[0] ? (this.projectInfo.description[0].substr(0,157) + (this.projectInfo.description[0].substr(0,157).length == 157?"...":"")) : (this.projectInfo.title))); if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { this.subscriptions.push(this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe()); } @@ -427,17 +466,17 @@ export class ProjectComponent { //stats tab charts if (this.properties.useNewStatistisTool) { this.chartScientificResultsUrl = this.properties.statisticsFrameNewAPIURL + - 'chart?json='+StringUtils.URIEncode('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research outcomes","type":"column","query":{"name":"projScient","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Produced research outcomes per year"},"subtitle":{},"yAxis":{"title":{"text":"Research outcomes"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); + 'chart?json='+StringUtils.URIEncode('{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+OpenaireEntities.RESULTS+'","type":"column","query":{"name":"projScient","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Produced '+OpenaireEntities.RESULTS+' per year"},"subtitle":{},"yAxis":{"title":{"text":"'+OpenaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); this.chartAccessModeUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json='+StringUtils.URIEncode( - '{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research outcomes","type":"pie","query":{"name":"projOA","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Access mode of research outcomes"},"subtitle":{},"yAxis":{"title":{"text":"Research outcomes"}},"xAxis":{"title":{"text":"Access mode"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); + '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+OpenaireEntities.RESULTS+'","type":"pie","query":{"name":"projOA","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Access mode of '+OpenaireEntities.RESULTS+'"},"subtitle":{},"yAxis":{"title":{"text":"'+OpenaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Access mode"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); this.chartDatasourcesUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json='+StringUtils.URIEncode( - '{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research outcomes","type":"bar","query":{"name":"projPubsRepos","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Research outcomes per datasource"},"subtitle":{},"yAxis":{"title":{"text":"Research outcomes"}},"xAxis":{"title":{"text":"Datasource"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":true}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); + '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+OpenaireEntities.RESULTS+'","type":"bar","query":{"name":"projPubsRepos","parameters":["'+this.projectId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+OpenaireEntities.RESULTS+' per datasource"},"subtitle":{},"yAxis":{"title":{"text":"'+OpenaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Datasource"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":true}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); } else { - this.chartScientificResultsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Outcomes"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; - this.chartAccessModeUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projOA","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Outcomes"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; - this.chartDatasourcesUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projPubsRepos","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Outcomes"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; + this.chartScientificResultsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'+OpenaireEntities.RESULTS+'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; + this.chartAccessModeUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projOA","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'+OpenaireEntities.RESULTS+'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; + this.chartDatasourcesUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"projPubsRepos","projTitle":"' + this.projectId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'+OpenaireEntities.RESULTS+'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%'; } this.showLoading = false; @@ -479,27 +518,34 @@ export class ProjectComponent { return !(this.totalViews && this.totalDownloads && this.pageViews) || this.totalViews > 0 || this.totalDownloads > 0||this.pageViews > 0; } - public openStatistics() { - this.statsClicked = true; - this.statisticsModal.cancelButton = false; - this.statisticsModal.okButton = false; - this.statisticsModal.alertTitle = "Statistics of"; - this.statisticsModal.open(); + public viewAllOrganizationsClick() { + this.viewAllOrganizations = true; + if(this.projectInfo.organizations.length <= this.thresholdOrganizations*2) { + this.lessBtnOrganizations = true; + } else { + this.openOrganizationsModal(); + } } - public openLinkProjectModal() { - this.linkProjectModal.cancelButton = false; - this.linkProjectModal.okButton = false; - this.linkProjectModal.alertTitle = "Link this project to"; - //this.linkProjectModal.alertHeader = false; - this.linkProjectModal.open(); + public openOrganizationsModal() { + this.organizationsModal.cancelButton = false; + this.organizationsModal.okButton = false; + this.organizationsModal.alertTitle = "Organizations"; + this.organizationsModal.open(); } - public openShareResultsModal() { - this.shareResultsModal.cancelButton = false; - this.shareResultsModal.okButton = false; - this.shareResultsModal.alertTitle = "Share results"; - this.shareResultsModal.open(); + public openAddThisModal() { + this.addThisModal.cancelButton = false; + this.addThisModal.okButton = false; + this.addThisModal.alertTitle = "Share this project in your social networks"; + this.addThisModal.open(); + } + + public openEmbedResultsModal() { + this.embedResultsModal.cancelButton = false; + this.embedResultsModal.okButton = false; + this.embedResultsModal.alertTitle = "Embed results"; + this.embedResultsModal.open(); } public openDownloadReportModal() { @@ -527,20 +573,20 @@ export class ProjectComponent { } if (type == "publications") { - this.header2 = this.fetchPublications.searchUtils.totalResults.toLocaleString('en-US') + " publications"; + this.header2 = this.fetchPublications.searchUtils.totalResults.toLocaleString('en-US') + " "+OpenaireEntities.PUBLICATIONS; } else if (type == "datasets") { - this.header2 = this.fetchDatasets.searchUtils.totalResults.toLocaleString('en-US') + " research data"; + this.header2 = this.fetchDatasets.searchUtils.totalResults.toLocaleString('en-US') + " "+OpenaireEntities.DATASETS; } else if (type == "software") { - this.header2 = this.fetchSoftware.searchUtils.totalResults.toLocaleString('en-US') + " software"; + this.header2 = this.fetchSoftware.searchUtils.totalResults.toLocaleString('en-US') + " "+OpenaireEntities.SOFTWARE; } else if (type == "other") { - this.header2 = this.fetchOrps.searchUtils.totalResults.toLocaleString('en-US') + " other research products"; + this.header2 = this.fetchOrps.searchUtils.totalResults.toLocaleString('en-US') + " "+OpenaireEntities.OTHER; } else if (type == "results") { let totalResults: number = (+this.fetchPublications.searchUtils.totalResults) + (+this.fetchDatasets.searchUtils.totalResults) + (+this.fetchSoftware.searchUtils.totalResults) + (+this.fetchOrps.searchUtils.totalResults); - this.header2 = totalResults.toLocaleString('en-US') + " research outcomes"; + this.header2 = totalResults.toLocaleString('en-US') + " "+OpenaireEntities.RESULTS; } } @@ -687,7 +733,10 @@ export class ProjectComponent { this.searchOrps(1, this.searchNumber); } else if (activeTabId == 'statistics') { this.activeTab = 'statistics'; - this.statsClicked = true; + setTimeout( () => { + this.statsClicked = true; + // this.cdr.detectChanges(); + }); } else if (activeTabId == 'dmps') { this.activeTab = 'dmps'; this.searchDmps(1, this.searchNumber); @@ -696,8 +745,10 @@ export class ProjectComponent { } private updateDescription(description: string) { - this._meta.updateTag({content: description.substring(0, 160)}, "name='description'"); - this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'"); + // this._meta.updateTag({content: description.substring(0, 160)}, "name='description'"); + // this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'"); + this._meta.updateTag({content: description}, "name='description'"); + this._meta.updateTag({content: description}, "property='og:description'"); } private updateTitle(title: string) { @@ -794,9 +845,7 @@ export class ProjectComponent { } public get hasPrimaryInfo(): boolean { - return !!this.projectInfo && ( - !!this.projectInfo.description - ); + return !!this.projectInfo && (!!this.projectInfo.description && this.projectInfo.description.length > 0); } public get hasSecondaryInfo(): boolean { @@ -858,4 +907,29 @@ export class ProjectComponent { // this.tabsAreInitialized = true; // return this._numberOfTabs; // } + + public buildResultTypesForDownloading() { + this.resultTypesForDownloading = [ + {label: "All "+OpenaireEntities.RESULTS, value: "results", disabled: + (!this.projectInfo.funding || + (this.fetchPublications.searchUtils.totalResults == 0 && + this.fetchDatasets.searchUtils.totalResults == 0 && + this.fetchSoftware.searchUtils.totalResults == 0 && + this.fetchOrps.searchUtils.totalResults == 0))}, + {label: OpenaireEntities.PUBLICATIONS, value: "publications", disabled: + (!this.projectInfo.funding || this.fetchPublications.searchUtils.totalResults == 0 + || this.fetchPublications.searchUtils.status != this.errorCodes.DONE)}, + {label: OpenaireEntities.DATASETS, value: "datasets", disabled: + (!this.projectInfo.funding || this.fetchDatasets.searchUtils.totalResults == 0 + || this.fetchDatasets.searchUtils.status != this.errorCodes.DONE)}, + {label: OpenaireEntities.SOFTWARE, value: "software", disabled: + (!this.projectInfo.funding || this.fetchSoftware.searchUtils.totalResults == 0 + || this.fetchSoftware.searchUtils.status != this.errorCodes.DONE)}, + {label: OpenaireEntities.OTHER, value: "other", disabled: + (!this.projectInfo.funding || this.fetchOrps.searchUtils.totalResults == 0 + || this.fetchOrps.searchUtils.status != this.errorCodes.DONE)} + ]; + console.log(this.resultTypesForDownloading); + + } } diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index 2010caf0..d86bdd49 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -27,6 +27,9 @@ import {FeedbackModule} from "../feedback/feedback.module"; import {AltMetricsModule} from "../../utils/altmetrics.module"; import {TabsModule} from "../../utils/tabs/tabs.module"; import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; +import {LoadingModule} from "../../utils/loading/loading.module"; +import {IconsModule} from "../../utils/icons/icons.module"; +import {InputModule} from "../../sharedComponents/input/input.module"; @NgModule({ imports: [ @@ -36,7 +39,7 @@ import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; SearchResearchResultsServiceModule, ProjectServiceModule, Schema2jsonldModule, SEOServiceModule, HelperModule, LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule, - TabsModule, SearchTabModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule ], declarations: [ ProjectComponent diff --git a/landingPages/project/project.service.ts b/landingPages/project/project.service.ts index b74a1d37..e72d922f 100644 --- a/landingPages/project/project.service.ts +++ b/landingPages/project/project.service.ts @@ -162,11 +162,12 @@ export class ProjectService { this.projectInfo.funding.contribution = data[0].fundedamount;//"200100"; this.projectInfo.funding.currency = data[0].currency;//"EUR"; } - if(!Array.isArray(data[0]['summary'])) { - this.projectInfo.description = (data[0]['summary']) ? String(data[0]['summary']) : ""; - } else { - this.projectInfo.description = (data[0]['summary'][0]) ? String(data[0]['summary'][0]) : ""; - } + // if(!Array.isArray(data[0]['summary'])) { + // this.projectInfo.description = (data[0]['summary']) ? String(data[0]['summary']) : ""; + // } else { + // this.projectInfo.description = (data[0]['summary'][0]) ? String(data[0]['summary'][0]) : ""; + // } + this.projectInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].summary?data[0].summary:[]); } // ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel'] diff --git a/landingPages/project/projectService.module.ts b/landingPages/project/projectService.module.ts index 9eda7c04..49509ba7 100644 --- a/landingPages/project/projectService.module.ts +++ b/landingPages/project/projectService.module.ts @@ -3,6 +3,8 @@ import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; import {ProjectService} from './project.service'; +import {IconsService} from "../../utils/icons/icons.service"; +import {graph, link} from "../../utils/icons/icons"; @NgModule({ @@ -16,4 +18,7 @@ import {ProjectService} from './project.service'; exports: [] }) export class ProjectServiceModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([link, graph]) + } } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index e12756d4..fea97d7c 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -42,7 +42,7 @@
  • @@ -136,11 +136,11 @@
    - {{resultLandingInfo.accessMode}} -   + + {{resultLandingInfo.accessMode}} +   + @@ -203,7 +203,7 @@
    -
    +
    No summary information available @@ -216,8 +216,8 @@
    Abstract
    -
    - {{description}}
    +
    @@ -503,7 +503,7 @@ diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 991e92e5..8726ea9d 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -124,12 +124,11 @@ export class ResultLandingComponent { public offset: number; @ViewChild("graph_and_feedback") graph_and_feedback; + public stickyHeader: boolean = false; public viewAll: string = ""; public noCommunities: boolean = false; - public stickyHeader: boolean = false; - public rightSidebarOffcanvasClicked: boolean = false; constructor(private _resultLandingService: ResultLandingService, diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 53fdada4..aeb0a72e 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -26,12 +26,12 @@ declare var UIkit: any;
    - + Add to  ORCID  - orcid{{" "}} + orcid  @@ -42,12 +42,12 @@ declare var UIkit: any; class="uk-align-right uk-margin-remove-bottom"> - + Delete from  ORCID  - {{" "}} +   @@ -123,7 +123,7 @@ declare var UIkit: any; : 'View this work from your ORCID record'"> - + View ORCID work @@ -136,7 +136,7 @@ declare var UIkit: any; + showUpdateDatesInTooltip())"> - + Update ORCID work @@ -146,7 +146,7 @@ declare var UIkit: any; [attr.uk-tooltip]="tooltipAdd"> - + Add to ORCID @@ -156,7 +156,7 @@ declare var UIkit: any; [attr.uk-tooltip]="tooltipDelete"> - + Delete from ORCID diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 8fde102d..60f56a01 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -25,7 +25,8 @@ export interface Option { icon?: string, iconClass?: string, value: any, - label: string + label: string, + disabled?: boolean } export interface Placeholder { @@ -130,7 +131,8 @@ declare var UIkit;
  • - {{option.label}} + {{option.label}}
  • diff --git a/utils/entities/projectInfo.ts b/utils/entities/projectInfo.ts index f8eabf29..086583a3 100644 --- a/utils/entities/projectInfo.ts +++ b/utils/entities/projectInfo.ts @@ -15,7 +15,7 @@ export class ProjectInfo { organizations: { "acronym": string, "name": string, "id": string }[];//Map; url: string; urlInfo: string; - description: string; + description: string[] = []; //publications: any; researchData: any; diff --git a/utils/iframe.component.ts b/utils/iframe.component.ts index 26e22b8d..11da725e 100644 --- a/utils/iframe.component.ts +++ b/utils/iframe.component.ts @@ -4,11 +4,11 @@ import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'; @Component({ selector: 'i-frame', template: ` -
    - +
    +
    -
    - +
    +
    ` }) @@ -19,6 +19,8 @@ export class IFrameComponent { @Input() height: number; @Input() unit: string = 'px'; @Input() addClass: boolean= true; + @Input() customContainerClass: string = ""; + @Input() customIframeClass: string = ""; public style: any; constructor(private sanitizer: DomSanitizer) { diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index 46a2d771..06ac7793 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -1,46 +1,50 @@ import {Component, Input} from '@angular/core'; import {EnvProperties} from "../../properties/env-properties"; import {ErrorCodes} from "../../properties/errorCodes"; +import {OpenaireEntities} from "../../properties/searchFields"; @Component({ selector: 'search-tab', template: ` - -
    -
    - Recent - {{getEntityName(resultType, true, true)}} + + + +
    +
    + Recent + {{getEntityName(resultType)}} - {{customTitle}} -
    -
    - - - View all - in search page - + {{customTitle}} +
    +
    - +
    + + - -
    + + + + + + + ` }) @@ -57,21 +61,21 @@ export class SearchTabComponent { public errorCodes: ErrorCodes = new ErrorCodes(); - public getEntityName(entityType: string, plural: boolean, full: boolean): string { + public getEntityName(entityType: string): string { if (entityType == "publication") { - return "publication" + (plural ? "s" : ""); + return OpenaireEntities.PUBLICATIONS; } else if (entityType == "dataset") { - return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); + return OpenaireEntities.DATASETS; } else if (entityType == "software") { - return "software"; + return OpenaireEntities.SOFTWARE; } else if (entityType == "other") { - return (full ? ("other research product" + (plural ? "s" : "")) : "other"); + return OpenaireEntities.OTHER; } else if (entityType == "result") { - return ((full ? "research outcome" : "result") + (plural ? "s" : "")); + return OpenaireEntities.RESULTS; } else if (entityType == "project") { - return "project" + (plural ? "s" : ""); + return OpenaireEntities.PROJECTS; } else if (entityType == "dataprovider") { - return ((full ? "content provider" : "dataprovider") + (plural ? "s" : "")); + return OpenaireEntities.DATASOURCES; } } } diff --git a/utils/tabs/tabs.component.ts b/utils/tabs/tabs.component.ts index 963228e6..58682962 100644 --- a/utils/tabs/tabs.component.ts +++ b/utils/tabs/tabs.component.ts @@ -51,7 +51,7 @@ import {TabComponent} from './tab.component';
    -