diff --git a/deposit/searchResultsInDeposit.component.html b/deposit/searchResultsInDeposit.component.html index cfd55620..d622be32 100644 --- a/deposit/searchResultsInDeposit.component.html +++ b/deposit/searchResultsInDeposit.component.html @@ -19,7 +19,7 @@
  • + [isCard]="true" deposit="true" [isMobile]="isMobile">
  • diff --git a/deposit/searchResultsInDeposit.component.ts b/deposit/searchResultsInDeposit.component.ts index cfe75527..34e9ae46 100644 --- a/deposit/searchResultsInDeposit.component.ts +++ b/deposit/searchResultsInDeposit.component.ts @@ -19,6 +19,7 @@ export class SearchResultsInDepositComponent { @Input() status: number; @Input() type: string; @Input() properties:EnvProperties; + @Input() isMobile: boolean = false; public urlParam: string; diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index cad44497..a34ba066 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -1,5 +1,5 @@ import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview"; -import {Context, Measure, Metric, Reference} from "../../utils/entities/resultLandingInfo"; +import {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo"; import {Injectable} from '@angular/core'; import {properties} from "../../../../environments/environment"; import {StringUtils} from "../../utils/string-utils.class"; @@ -878,19 +878,43 @@ export class ParsingFunctions { if (elements && elements.length) { let bip: Metric[] = []; let counts: Metric[] = []; + let countsPerDatasource: MetricPerDatasource[] = []; let measure: Measure = {}; + + let datasourcePosition: Map = new Map(); + + let views: number = 0; + let downloads: number = 0; elements.forEach(element => { if (element.id == 'views') { - counts.push({name: 'views', icon: 'visibility', value: element.count, order: 0}); - measure.views = element.count; + views += element.count; + let datasourceId = element.datasource; + if(datasourceId) { + if(datasourcePosition.has(element.datasource)) { + countsPerDatasource[datasourcePosition.get(element.datasource)].views = element.count; + } else { + datasourcePosition.set(element.datasource, countsPerDatasource.length); + countsPerDatasource.push({"datasourceId": element.datasource, "views": element.count, "downloads": 0}) + } + } + // measure.views = element.count; } if (element.id == 'downloads') { - counts.push({name: 'downloads', icon: 'download', value: element.count, order: 1}); - measure.downloads = element.count; + downloads += element.count; + let datasourceId = element.datasource; + if(datasourceId) { + if(datasourcePosition.has(element.datasource)) { + countsPerDatasource[datasourcePosition.get(element.datasource)].downloads = element.count; + } else { + datasourcePosition.set(element.datasource, countsPerDatasource.length); + countsPerDatasource.push({"datasourceId": element.datasource, "views": 0, "downloads": element.count}) + } + } + // measure.downloads = element.count; } if (element.id == 'influence_alt' || element.id == 'citation_count') { bip.push({name: 'citations', icon: 'cite', value: element.score, order: 2}); - measure.citations = element.score; + // measure.citations = element.score; } if (element.id == 'popularity') { let metric: Metric = {name: 'popularity', icon: 'fire', value: null, order: 3}; @@ -902,14 +926,10 @@ export class ParsingFunctions { metric.value = 'Top 1%'; } else if (element.class == 'C4') { metric.value = 'Top 10%'; - } else if (element.class == 'A') { - metric.value = 'Exceptional'; - } else if (element.class == 'B') { - metric.value = 'Substantial'; } else { metric.value = 'Average'; } - measure.popularity = metric.value; + // measure.popularity = metric.value; bip.push(metric); } if (element.id == 'influence') { @@ -922,14 +942,10 @@ export class ParsingFunctions { metric.value = 'Top 1%'; } else if (element.class == 'C4') { metric.value = 'Top 10%'; - } else if (element.class == 'A') { - metric.value = 'Exceptional'; - } else if (element.class == 'B') { - metric.value = 'Substantial'; } else { metric.value = 'Average'; } - measure.influence = metric.value; + // measure.influence = metric.value; bip.push(metric); } if (element.id == 'impulse') { @@ -942,17 +958,24 @@ export class ParsingFunctions { metric.value = 'Top 1%'; } else if (element.class == 'C4') { metric.value = 'Top 10%'; - } else if (element.class == 'A') { - metric.value = 'Exceptional'; - } else if (element.class == 'B') { - metric.value = 'Substantial'; } else { metric.value = 'Average'; } - measure.impulse = metric.value; + // measure.impulse = metric.value; bip.push(metric); } }); + + if(views > 0) { + counts.push({name: 'views', icon: 'visibility', value: views, order: 0}); + } + if(downloads > 0) { + counts.push({name: 'downloads', icon: 'download', value: downloads, order: 1}); + } + if(countsPerDatasource && countsPerDatasource.length > 0) { + measure.countsPerDatasource = countsPerDatasource; + } + measure.bip = bip.sort((a, b) => a.order - b.order); measure.counts = counts.sort((a, b) => a.order - b.order); return measure; diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 6df0320b..ca097000 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -1240,6 +1240,24 @@ +
    + + + + + + + + + + + + + + + +
    Data sourceViewsDownloads
    {{datasource.datasourceId}}{{datasource.views}}{{datasource.downloads}}
    +
    Powered by diff --git a/orcid/my-orcid-links/searchMyOrcidResults.component.html b/orcid/my-orcid-links/searchMyOrcidResults.component.html index 4cbd7292..c1d1ede4 100644 --- a/orcid/my-orcid-links/searchMyOrcidResults.component.html +++ b/orcid/my-orcid-links/searchMyOrcidResults.component.html @@ -23,7 +23,7 @@