diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index a9447d76..056192a1 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -14,11 +14,11 @@
{{dynamic_content}}
-
+ -
+
  • - - Link this project to research results + + + + + Link this project to... + [classTitle]="'landing-modal-header'" [classBody]="'uk-padding-remove landing-modal'"> @@ -626,7 +634,7 @@ width="12" x="3.5" y="2.5"> -
    Research results
    +
    Research outcomes
  • @@ -695,43 +703,53 @@ Download report + [classTitle]="'landing-modal-header'" [classBody]="'uk-padding-remove landing-modal'">
    - + + + + + + Select content type report to download - - All research outcomes + + All research outcomes + Publications Research data Software Other research products @@ -760,8 +778,7 @@
  • -
    -
    +
    --> - -
    - -
    - - +
    + +
    -
    +
    -
    Description
    -
    -
    +
    +
    Description
    +
    {{projectInfo.description.substring(0, showNumDescription)}} ... + projectInfo.description.length > thresholdDescription">...
    @@ -811,135 +825,142 @@
    -
    -
    + - - + + + + + +
    - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + + context: { fetch: fetchPublications, type: 'publication', urlParam: 'articleId'}">
    - - - + + +
    -
    - + + + + + +
    + context: { fetch: fetchDatasets, type: 'dataset', urlParam: 'datasetId'}">
    - - - + + +
    -
    - + + +
    + context: { fetch: fetchSoftware, type: 'software', urlParam: 'softwareId'}">
    - - - + + +
    -
    - + + + + +
    + context: { fetch: fetchOrps, type: 'other', urlParam: 'orpId'}">
    - - - + + +
    -
    - + + + + + +
    + class="uk-grid uk-child-width-1-1 uk-child-width-1-2@m">
    Produced research outcomes per year
    @@ -968,20 +989,94 @@
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    -
    +
    - Powered by OpenAIRE Open Research Graph - - Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} + Powered by OpenAIRE Open Research Graph + + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
    -
    +
    Any information missing or wrong? Report an Issue
    @@ -1035,3 +1130,6 @@ [properties]="properties" [entityType]="'project'" [title]="projectName" [fields]="feedbackFields" [showForm]="showFeedback" (show)="showFeedback = $event">
    + + + \ No newline at end of file diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 7cd08bf3..5a978549 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -73,7 +73,11 @@ export class ProjectComponent { public showLoading: boolean = true; // Active tab variable for responsiveness - public activeTab: string = "Publications"; + public activeTab: string = ""; + + public firstTab: string = ""; + public _numberOfTabs: number = 0; + public tabsAreInitialized: boolean = false; @ViewChild('statisticsModal') statisticsModal; @@ -88,7 +92,7 @@ export class ProjectComponent { private reloadOrps: boolean = true; // Variables for entity selections on the right column - public share_research_results_type: string = ""; + public share_research_results_type: string = "results"; public download_research_results_type: string = ""; // Variables for publications, research data, software tabs @@ -493,6 +497,10 @@ export class ProjectComponent { } public openDownloadReportModal() { + if(this.fetchPublications.searchUtils.totalResults > 0 || this.fetchDatasets.searchUtils.totalResults > 0 || + this.fetchSoftware.searchUtils.totalResults > 0 || this.fetchOrps.searchUtils.totalResults > 0) { + this.download_research_results_type = "results"; + } this.downloadReportModal.cancelButton = false; this.downloadReportModal.okButton = false; this.downloadReportModal.alertTitle = "Download report"; @@ -770,4 +778,70 @@ export class ProjectComponent { public scroll() { HelperFunctions.scroll(); } + + public get hasPrimaryInfo(): boolean { + return !!this.projectInfo && ( + !!this.projectInfo.description + ); + } + + public get hasSecondaryInfo(): boolean { + return !!this.projectInfo && ( + (!!this.projectInfo.organizations && this.projectInfo.organizations.length > 0) + ); + } + + public get numberOfTabs(): number { + if(this.tabsAreInitialized) { + return this._numberOfTabs; + } + + if(!this.projectInfo + || this.fetchPublications.searchUtils.status == this.errorCodes.LOADING + || this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING + || this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING + || this.fetchOrps.searchUtils.status == this.errorCodes.LOADING) { + return 0; + } + + if (this.hasPrimaryInfo || this.hasSecondaryInfo) { + this.firstTab = "summary"; + this._numberOfTabs++; + } + if(this.fetchPublications.searchUtils.totalResults > 0 || this.fetchDatasets.searchUtils.totalResults > 0 + || this.fetchSoftware.searchUtils.totalResults > 0 || this.fetchOrps.searchUtils.totalResults > 0) { + if(this.fetchPublications.searchUtils.totalResults > 0) { + if(this._numberOfTabs == 0) { + this.firstTab = 'publications'; + this.searchPublicationsInit(); + } + this._numberOfTabs++; + } + if(this.fetchDatasets.searchUtils.totalResults > 0) { + if(this._numberOfTabs == 0) { + this.firstTab = 'datasets'; + this.searchDatasetsInit(); + } + this._numberOfTabs++; + } + if(this.fetchSoftware.searchUtils.totalResults > 0) { + if(this._numberOfTabs == 0) { + this.firstTab = 'software'; + this.searchSoftwareInit(); + } + this._numberOfTabs++; + } + if(this.fetchOrps.searchUtils.totalResults > 0) { + if(this._numberOfTabs == 0) { + this.firstTab = 'other'; + this.searchOrpsInit(); + } + this._numberOfTabs++; + } + this._numberOfTabs++; + } + this.activeTab = this.firstTab; + this.tabsAreInitialized = true; + return this._numberOfTabs; + } }