From 03b8781720f89cf38ef4337f20ee2274f1100849 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 8 Jun 2018 11:21:42 +0000 Subject: [PATCH] 1. Landing pages: tabs changed to 'uk-accordion' with custom css. 2. Remove 'uk-animation-fade' class from tabResult.component. 3. When errorMessages.component is used in landing pages' tabs, remove 'uk-animation-fade' class and add 'uk-margin-top' class. 4. First tab with extra query is closed too -> count query first -> add method in fetchPublications.class and case in searchPublications.service. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52401 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../dataProvider/dataProvider.component.html | 192 ++------- .../dataProvider/datasetsTab.component.ts | 17 +- .../dataProvider/datasourcesTab.component.ts | 11 +- .../organizationsTab.component.ts | 14 +- .../dataProvider/projectsTab.component.ts | 10 +- .../dataProvider/publicationsTab.component.ts | 13 +- .../relatedDatasourcesTab.component.ts | 18 +- .../dataProvider/softwareTab.component.ts | 11 +- .../dataProvider/statisticsTab.component.ts | 13 +- landingPages/dataset/dataset.component.html | 99 ++++- .../landing-utils/metrics.component.ts | 118 +++--- .../searchingProjectsInTab.component.ts | 9 +- .../organization/organization.component.html | 100 +++-- .../organization/organization.component.ts | 26 +- landingPages/project/project.component.html | 172 ++++++-- landingPages/project/project.component.ts | 23 +- .../publication/publication.component.html | 401 +++++++++++------- landingPages/software/software.component.html | 100 ++++- .../searchUtils/tabResult.component.html | 2 +- services/searchPublications.service.ts | 2 + utils/errorMessages.component.ts | 16 +- .../fetchPublications.class.ts | 36 ++ 22 files changed, 818 insertions(+), 585 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index c7864c13..ea408f67 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -60,77 +60,7 @@
  • Countries: {{dataProviderInfo.countries.join(", ")}}
  • -
    - -
  • - Research Data + Research Data + + {{fetchDatasets.searchUtils.totalResults | number}} + +

    + [paramsForSearchLink]="paramsForSearchLink" + [fetchDatasets]="fetchDatasets" [(properties)]=properties>

  • - Software + Software + + {{fetchSoftware.searchUtils.totalResults | number}} + +
  • - Projects + Projects + + {{fetchProjects.searchUtils.totalResults | number}} + +
  • - Content Providers + Content Providers + + {{fetchDataproviders.searchUtils.totalResults | number}} + +
  • - Organizations + Organizations + + {{dataProviderInfo.organizations.length | number}} + +
    @@ -210,7 +160,7 @@
    - +

    Latest Research Result Timeline

    @@ -259,85 +209,7 @@
  • - - +
    @@ -346,9 +218,9 @@ Share - Bookmark
    - + [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'" + (metricsResults)="metricsResults($event)" [(properties)] = properties> + diff --git a/landingPages/dataProvider/datasetsTab.component.ts b/landingPages/dataProvider/datasetsTab.component.ts index d48eb521..4ea12491 100644 --- a/landingPages/dataProvider/datasetsTab.component.ts +++ b/landingPages/dataProvider/datasetsTab.component.ts @@ -7,16 +7,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'datasetsTab', template: ` - - - - +
    @@ -25,9 +16,9 @@ import{EnvProperties} from '../../utils/properties/env-properties'; View all {{fetchDatasets.searchUtils.totalResults | number}} results
    - +
    ` diff --git a/landingPages/dataProvider/datasourcesTab.component.ts b/landingPages/dataProvider/datasourcesTab.component.ts index e6d7d996..650965ea 100644 --- a/landingPages/dataProvider/datasourcesTab.component.ts +++ b/landingPages/dataProvider/datasourcesTab.component.ts @@ -7,16 +7,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'datasourcesTab', template: ` - - - - +
    diff --git a/landingPages/dataProvider/organizationsTab.component.ts b/landingPages/dataProvider/organizationsTab.component.ts index c2581474..c17c4a6c 100644 --- a/landingPages/dataProvider/organizationsTab.component.ts +++ b/landingPages/dataProvider/organizationsTab.component.ts @@ -13,16 +13,16 @@ import {Component, Input} from '@angular/core';
    -
    -

    +

    +

    - {{item['name']}} +

    {{item['name']}}

    -

    -

    - {{item['name']}} -

    +

    +

    +

    {{item['name']}}

    +

    ` diff --git a/landingPages/dataProvider/projectsTab.component.ts b/landingPages/dataProvider/projectsTab.component.ts index f6832c70..054acfdf 100644 --- a/landingPages/dataProvider/projectsTab.component.ts +++ b/landingPages/dataProvider/projectsTab.component.ts @@ -8,15 +8,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'projectsTab', template: ` - - - - +
    diff --git a/landingPages/dataProvider/publicationsTab.component.ts b/landingPages/dataProvider/publicationsTab.component.ts index e290b682..b7c18fa4 100644 --- a/landingPages/dataProvider/publicationsTab.component.ts +++ b/landingPages/dataProvider/publicationsTab.component.ts @@ -7,21 +7,10 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'publicationsTab', template: ` - - - - - - +
    - View all {{fetchPublications.searchUtils.totalResults | number}} results diff --git a/landingPages/dataProvider/relatedDatasourcesTab.component.ts b/landingPages/dataProvider/relatedDatasourcesTab.component.ts index 3189433c..ecf62c46 100644 --- a/landingPages/dataProvider/relatedDatasourcesTab.component.ts +++ b/landingPages/dataProvider/relatedDatasourcesTab.component.ts @@ -11,23 +11,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'relatedDatasourcesTab', template: ` - - - - - +
    -->
    @@ -224,6 +286,13 @@ +
  • + + +
  • +
    • diff --git a/landingPages/landing-utils/metrics.component.ts b/landingPages/landing-utils/metrics.component.ts index 9a4ccf6c..5df3bdbb 100644 --- a/landingPages/landing-utils/metrics.component.ts +++ b/landingPages/landing-utils/metrics.component.ts @@ -10,68 +10,68 @@ import{EnvProperties} from '../../utils/properties/env-properties'; selector: 'metrics', template: `
      - -
      -
      Project metrics are derived from aggregating individual research results metrics.
      -
      -
      -
      {{pageViews | number}}
      -
      views in OpenAIRE
      + +
      +
      Project metrics are derived from aggregating individual research results metrics.
      +
      +
      +
      {{pageViews | number}}
      +
      views in OpenAIRE
      +
      -
      -
      -
      -
      {{metrics.totalViews | number}} - - ( {{metrics.totalOpenaireViews | number}} from OpenAIRE ) -
      -
      views in local repository
      +
      +
      +
      {{metrics.totalViews | number}} + + ( {{metrics.totalOpenaireViews | number}} from OpenAIRE ) +
      +
      views in local repository
      +
      -
      -
      -
      -
      {{metrics.totalDownloads | number}} - - ( {{metrics.totalOpenaireDownloads | number}} from OpenAIRE ) -
      -
      downloads in local repository
      +
      +
      +
      {{metrics.totalDownloads | number}} + + ( {{metrics.totalOpenaireDownloads | number}} from OpenAIRE ) +
      +
      downloads in local repository
      +
      +
      -
      - -

      The information is available from the following content providers:

      - - - - - - - - - - - - - - - -
      FromNumber Of ViewsNumber Of Downloads
      - - {{metrics.infos.get(key).name}} - - - {{metrics.infos.get(key).numOfViews | number}} - - ( {{metrics.infos.get(key).openaireViews | number}} from OpenAIRE ) - - - {{metrics.infos.get(key).numOfDownloads | number}} - - ( {{metrics.infos.get(key).openaireDownloads | number}} from OpenAIRE ) - -
      +

      The information is available from the following content providers:

      + + + + + + + + + + + + + + + +
      FromNumber Of ViewsNumber Of Downloads
      + + {{metrics.infos.get(key).name}} + + + {{metrics.infos.get(key).numOfViews | number}} + + ( {{metrics.infos.get(key).openaireViews | number}} from OpenAIRE ) + + + {{metrics.infos.get(key).numOfDownloads | number}} + + ( {{metrics.infos.get(key).openaireDownloads | number}} from OpenAIRE ) + +
      @@ -159,4 +159,8 @@ export class MetricsComponent { } ); } + + public getKeys( map) { + return Array.from(map.keys()); + } } diff --git a/landingPages/landing-utils/searchingProjectsInTab.component.ts b/landingPages/landing-utils/searchingProjectsInTab.component.ts index a08d169a..fa830249 100644 --- a/landingPages/landing-utils/searchingProjectsInTab.component.ts +++ b/landingPages/landing-utils/searchingProjectsInTab.component.ts @@ -12,14 +12,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @Component({ selector: 'searchingProjectsTab', template: ` - - - +
      diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index 892facee..ac50a3a0 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -14,6 +14,73 @@ Organization {{organizationInfo.country}} + + + {{fetchProjects.searchUtils.totalResultsNoFilters | number}} @@ -37,18 +103,14 @@ [class]="activeTab == 'Content Providers'?'uk-active':''"> Content Providers - {{fetchDataproviders.searchUtils.totalResults | number}}
    • -
    + --> -
    diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 3fa0b6ba..9d15c055 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -74,7 +74,8 @@ export class OrganizationComponent { //private fundersSet: Set; //private emptyFundersSet: boolean = true; - // Request results for content providers only the one time (first time tab is clicked) + // Request results for publications and content providers only the one time (first time tab is clicked) + private reloadPublications: boolean = true; private reloadDataproviders: boolean = true; // Helper variables to specify funder in downloadPublicationsFile function @@ -197,8 +198,8 @@ export class OrganizationComponent { } var refineFields:string [] = ["funder"]; - this.searchPublications(); - + //this.searchPublications(); + this.fetchPublications.getNumForEntity("organization", this.organizationId, this.properties); this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields,this.properties); this.fetchDataproviders.getNumForEntity("organization", this.organizationId,this.properties); @@ -257,23 +258,30 @@ export class OrganizationComponent { private searchPublications() { this.fetchPublications.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties); this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications; - if(this.fetchPublications.searchUtils.totalResults > 0) { + //if(this.fetchPublications.searchUtils.totalResults > 0) { + this.reloadPublications = false; //this.activeTab = "Publications"; - } else { + //} else { //this.projectsClicked = true; - } + //} } private searchDataproviders() { this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties); this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders; - if(this.fetchDataproviders.searchUtils.totalResults > 0) { + //if(this.fetchDataproviders.searchUtils.totalResults > 0) { this.reloadDataproviders = false; //this.activeTab = "Content Providers"; - } else { + //} else { - } + //} + } + + public searchPublicationsInit() { + if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) { + this.searchPublications(); + } } public searchDataprovidersInit() { diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index 9f6b27d7..0d51cc3e 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -78,7 +78,127 @@
  • --> - + --> -
    @@ -388,7 +473,10 @@
    - + +
    diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 88678a2f..cff38756 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -71,7 +71,8 @@ export class ProjectComponent{ // Active tab variable for responsiveness public activeTab: string = "Publications"; - // Request results for research data and software only the one time (first time tab is clicked) + // Request results for publications, research data and software only the one time (first time tab is clicked) + private reloadPublications: boolean = true; private reloadDatasets: boolean = true; private reloadSoftware: boolean = true; @@ -186,7 +187,8 @@ actionsAfterLoadId(){ + "\n"; this.getProjectInfo(this.projectId); - this.searchPublications(); + //this.searchPublications(); + this.fetchPublications.getNumForEntity("project", this.projectId, this.properties); this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties); this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties); } @@ -218,11 +220,12 @@ actionsAfterLoadId(){ private searchPublications() { this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10, this.properties); this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and"; - if(this.fetchPublications.searchUtils.totalResults > 0) { + //if(this.fetchPublications.searchUtils.totalResults > 0) { //this.activeTab = "Publications"; - } else { + //} else { //this.searchDatasetsInit(); - } + //} + this.reloadPublications = false; } private searchDatasets() { @@ -239,6 +242,16 @@ actionsAfterLoadId(){ this.reloadSoftware = false; } + public searchPublicationsInit() { + console.info("searchPublicationsInit"); + if(this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) { + this.searchPublications(); + } else if(this.fetchPublications.searchUtils.totalResults == 0) { + //this.statsClicked=true; + //this.activeTab = "Statistics"; + } + } + public searchDatasetsInit() { console.info("searchDatasetsInit"); if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) { diff --git a/landingPages/publication/publication.component.html b/landingPages/publication/publication.component.html index afaa40b3..63b323af 100644 --- a/landingPages/publication/publication.component.html +++ b/landingPages/publication/publication.component.html @@ -104,15 +104,253 @@ + + + - + --> - -