diff --git a/landingPages/landing-utils/addThis.component.ts b/landingPages/landing-utils/addThis.component.ts index fdd89ac0..90ccac1d 100644 --- a/landingPages/landing-utils/addThis.component.ts +++ b/landingPages/landing-utils/addThis.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, EventEmitter, - Inject, + Inject, Input, OnInit, Output, RendererFactory2, @@ -28,18 +28,22 @@ declare var addthis: addthis; @Component({ selector: 'addThis', template: ` -
-
- Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page. -
+
+
+ Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page. +
` }) export class AddThisComponent implements OnInit { - subs=[]; + subs = []; showWarning = false; - constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) {} + @Input() url: string = null; + + constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { + } + public ngOnDestroy() { - for(let value of this.subs){ + for (let value of this.subs) { if (value instanceof Subscriber) { value.unsubscribe(); } else if (value instanceof Function) { @@ -47,12 +51,13 @@ export class AddThisComponent implements OnInit { } } } + ngOnInit() { - + this.subs.push(this.route.queryParams.subscribe(data => { this.showWarning = false; try { - if (!this.document.getElementById('addThisScript') && typeof document !== 'undefined') { + if (!this.document.getElementById('addThisScript') && typeof document !== 'undefined') { // console.log(" create script AddThis"); const renderer = this.rendererFactory.createRenderer(this.document, { id: '-1', @@ -71,20 +76,20 @@ export class AddThisComponent implements OnInit { renderer.appendChild(head, script); } if (typeof document !== 'undefined') { - if(typeof addthis !== 'undefined' && addthis.layers && addthis.layers.refresh) { + if (typeof addthis !== 'undefined' && addthis.layers && addthis.layers.refresh) { // console.log("Add This: Call Refresh") addthis.layers.refresh(); } } this.subs.push(setTimeout(() => { - if(this.document.getElementById('addThis') && !this.document.getElementById('addThis').innerText){ + if (this.document.getElementById('addThis') && !this.document.getElementById('addThis').innerText) { this.showWarning = true; } }, 4000)); - }catch (e) { - // console.error(e) + } catch (e) { + // console.error(e) } - + })); } } diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 9aac2952..0cd7bf19 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -4,58 +4,64 @@ import {properties} from "../../../../environments/environment"; import {StringUtils} from '../../utils/string-utils.class'; declare var UIkit; + @Component({ selector: 'availableOn', template: ` -
+
- Source: - + Source: + + class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder custom-external"> {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} - - -
+ - - - - - - - - - - - - - - - - - - - - - - - - ` }) export class AvailableOnComponent { @Input() availableOn: HostedByCollectedFrom[]; - @Input() viewAll: boolean = false; - @Output() viewAllClicked = new EventEmitter(); - @ViewChild("dropElement") dropElement: ElementRef; - public lessBtn: boolean = false; + @Input() source: boolean = true; + /** @deprecated */ + @Output() viewAllClicked = new EventEmitter(); + @ViewChild("dropElement") dropElement: ElementRef; public threshold: number = 1; public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; public title: string = "Download from"; - + constructor() { } - + ngOnInit() { - } - - public removeUnknown(value: string): string { - if (value.toLowerCase() === 'unknown') { - return null; - } - return value; } - public getKeys( map) { + public getKeys(map) { return Array.from(map.keys()); } - public viewAllClick() { - if(this.availableOn.length <= this.threshold*2) { - this.viewAll = true; - this.lessBtn = true; - } else { - this.viewAll = true; - this.viewAllClicked.emit('availableOn'); - } - } - - public viewLessClick() { - this.viewAll = false; - this.viewAllClicked.emit(""); - } - public isUrl(str: string): boolean { return str.startsWith('http://') || str.startsWith('https://') || str.startsWith('//') || str.startsWith('www.'); } - get isOpen() { + get isOpen() { return (typeof document !== 'undefined') && this.dropElement && UIkit.drop(this.dropElement.nativeElement).isActive(); } - public sliceString(str: string, size: number) { - return StringUtils.sliceString(str, size) - } + public sliceString(str: string, size: number) { + return StringUtils.sliceString(str, size) + } } diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 20354042..8924f035 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -13,6 +13,7 @@ import {DOCUMENT} from "@angular/common"; import {EnvProperties} from "../../../utils/properties/env-properties"; import {properties} from "../../../../../environments/environment"; import {PiwikService} from "../../../utils/piwik/piwik.service"; +import {ResultPreview} from "../../../utils/result-preview/result-preview"; declare var Cite: any; // Based on https://citation.js.org/api/tutorial-getting_started.html browser release @@ -53,7 +54,7 @@ export class CiteThisComponent implements OnInit, OnDestroy { properties:EnvProperties; public citationText: string; public citation: Citation = new Citation(); - @Input() result: ResultLandingInfo; + @Input() result: any; @Input() id: string; @Input() type: string = "article"; @Input() piwikSiteId; diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts new file mode 100644 index 00000000..09bb4283 --- /dev/null +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -0,0 +1,228 @@ +import {Component, Input} from "@angular/core"; +import {EnvProperties} from "../../utils/properties/env-properties"; +import {properties} from "../../../../environments/environment"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; + +@Component({ + selector: 'entity-metadata', + template: ` +
+ + + + + + + Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}} + + + Open Access Mandate for {{openaireEntities.PUBLICATIONS}} + + + Open Access Mandate for {{openaireEntities.DATASETS}} + + + + + + + + + + + + + + {{entityType}} + + + + + {{removeUnknown(types, true).join(' , ')}} + + + + + {{year}} + + + + {{startYear}} + + + + {{endYear}} + + + + + {{startYear}} - {{endYear}} + + + + + + From + {{startDate | date: 'dd MMM yyyy'}} + + + + Until + {{endDate | date: 'dd MMM yyyy'}} + + + + + {{startDate | date: 'dd MMM yyyy'}} + (Started) + + - + + {{endDate | date: 'dd MMM yyyy'}} + {{currentDate >= endDate ? '(Ended)' : '(Ending)'}} + + + + + {{status}} + + + + {{date | date: 'dd MMM yyyy': 'UTC'}} + + + + Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}} + + + . Under curation + + + + + + {{country}} + + + + + + + {{language}} + + + + + + + {{programmingLanguage}} + + + + + + + + + + {{compatibility.info}} + {{compatibility.name}} + + + {{compatibility.info}} + + {{compatibility.info}} in OpenAIRE + + + + {{compatibility.name}} + + + + + + OpenAIRE Text Mining + + + + Thematic + + + + {{provenanceAction}} + + + + {{relationName}} + +
+ ` +}) +export class EntityMetadataComponent { + @Input() entityType: string; + @Input() types: string[]; + @Input() year: string; // search result + @Input() startDate: number; // project landing + @Input() startYear: string; // search result + @Input() endDate: number; // project landing + @Input() endYear: string; // search result + @Input() currentDate: number; // project landing + @Input() status: string; // project landing + @Input() openAccessMandatePublications: boolean // project landing + @Input() openAccessMandateDatasets: boolean // project landing + @Input() date: Date; + @Input() embargoEndDate: Date | string; + @Input() underCuration: boolean = false; + @Input() publisher; // showPublisher component + @Input() journal; // showPublisher component + @Input() countries; + @Input() languages; + @Input() programmingLanguages; + @Input() compatibility; // data provider landing + @Input() aggregationStatus; // data provider landing + @Input() thematic: boolean; // data provider landing + @Input() type; // data provider landing + @Input() provenanceAction: string; // search result + @Input() relationName: string; // search result + + properties: EnvProperties = properties; + public openaireEntities = OpenaireEntities; + + public removeUnknown(array: string[], type: boolean = false): string[] { + if (type) { + return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown'); + } else { + return array.filter(value => value.toLowerCase() !== 'unknown'); + } + } + + public removeDuplicates(array: string[]): string[] { + return array.filter(value => value.toLowerCase() !== this.entityType); + } + + public buildCurationTooltip(): string { + let tooltipContent: string = "
"; + + tooltipContent += "
Record in preview
"; + tooltipContent += "

Bibliographic record accepted by the system, but not yet processed by
OpenAIRE tools for information quality improvement and de-duplication

"; + + tooltipContent += "
"; + return tooltipContent; + } +} diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index bb3d9c45..0f006aa4 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -2,7 +2,6 @@ import {Component, Input} from "@angular/core"; import {EnvProperties} from "../../../utils/properties/env-properties"; import {Author} from "../../../utils/result-preview/result-preview"; import {AlertModal} from "../../../utils/modal/alert"; -import {OpenaireEntities} from "src/app/openaireLibrary/utils/properties/searchFields"; @Component({ selector: 'landing-header', @@ -14,140 +13,15 @@ import {OpenaireEntities} from "src/app/openaireLibrary/utils/properties/searchF
-
- - - - - - - Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}} - - - Open Access Mandate for {{openaireEntities.PUBLICATIONS}} - - - Open Access Mandate for {{openaireEntities.DATASETS}} - - - - - - - - - - - - - - - {{entityType}} - - - - - - {{removeUnknown(types, true).join(' , ')}} - - - - - From - {{startDate | date: 'dd MMM yyyy'}} - - - - Until - {{endDate | date: 'dd MMM yyyy'}} - - - - - {{startDate | date: 'dd MMM yyyy'}} - (Started) - - - - - {{endDate | date: 'dd MMM yyyy'}} - {{currentDate >= endDate ? '(Ended)' : '(Ending)'}} - - - - - {{status}} - - - - {{date | date: 'dd MMM yyyy': 'UTC'}} - - - - Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}} - - - . Under curation - - - - - - {{language}} - - - - - - - {{programmingLanguage}} - - - - - - - - - - {{compatibility.info}} - {{compatibility.name}} - - - {{compatibility.info}} - - {{compatibility.info}} in OpenAIRE - - - - {{compatibility.name}} - - - - - - OpenAIRE Text Mining - - - - Thematic - +
+
value.toLowerCase() !== 'unknown'); - } else { - return array.filter(value => value.toLowerCase() !== 'unknown'); - } - } - - public removeDuplicates(array: string[]): string[] { - return array.filter(value => value.toLowerCase() !== this.entityType); - } - - public buildCurationTooltip(): string { - let tooltipContent: string = "
"; - - tooltipContent += "
Record in preview
"; - tooltipContent += "

Bibliographic record accepted by the system, but not yet processed by
OpenAIRE tools for information quality improvement and de-duplication

"; - - tooltipContent += "
"; - return tooltipContent; - } } diff --git a/landingPages/landing-utils/landing-header/landing-header.module.ts b/landingPages/landing-utils/landing-header/landing-header.module.ts index 6ae684c9..9435afa8 100644 --- a/landingPages/landing-utils/landing-header/landing-header.module.ts +++ b/landingPages/landing-utils/landing-header/landing-header.module.ts @@ -6,10 +6,11 @@ import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module"; import {IconsModule} from "src/app/openaireLibrary/utils/icons/icons.module"; import {ShowPublisherModule} from "../showPublisher.module"; import {RouterModule} from "@angular/router"; +import {ResultLandingUtilsModule} from "../resultLandingUtils.module"; @NgModule({ - imports: [CommonModule, LandingModule, ShowAuthorsModule, IconsModule, ShowPublisherModule, RouterModule], + imports: [CommonModule, LandingModule, ShowAuthorsModule, IconsModule, ShowPublisherModule, RouterModule, ResultLandingUtilsModule], declarations: [LandingHeaderComponent], exports: [LandingHeaderComponent] }) -export class LandingHeaderModule {} \ No newline at end of file +export class LandingHeaderModule {} diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 364fc4ac..2c3ce256 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -1,5 +1,5 @@ -import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview"; -import {Context, Measure, Reference} from "../../utils/entities/resultLandingInfo"; +import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview"; +import {Context, Measure, Metric, Reference} from "../../utils/entities/resultLandingInfo"; import {Injectable} from '@angular/core'; import {properties} from "../../../../environments/environment"; import {StringUtils} from "../../utils/string-utils.class"; @@ -30,35 +30,35 @@ export class ParsingFunctions { value: 'Twitter Data' } ] - + public notebookInSubjects: boolean = false; private notebookKeyword: string = "eosc jupyter notebook"; private notebook_label: string = "EOSC"; private notebook_value: string = "EOSC Jupyter Notebook"; - + public open = 'open_access'; public closed = 'closed_access'; public unknown = 'question_mark'; - + private instanceWithDoiExists: boolean = false; - + constructor() { } - + public ngOnDestroy() { } - + public parseFundingByProjects(fundedByProjects: Project[], relation: any): Project[] { if (fundedByProjects == undefined) { fundedByProjects = []; } - + let fundedByProject: Project = { "id": "", "acronym": "", "title": "", "funderShortname": "", "funderName": "", "funding": "", "code": "", "provenanceAction": "", "validated": false }; - + if (relation.title != 'unidentified') { fundedByProject['id'] = relation['to'].content; fundedByProject['acronym'] = relation.acronym; @@ -75,11 +75,11 @@ export class ParsingFunctions { fundedByProject['code'] = ""; fundedByProject['provenanceAction'] = ""; } - + if (relation.hasOwnProperty("funding")) { let funding: { "funderName": string, "funderShortname": string, "stream": string }; funding = this.parseFundingTrees(relation.funding); - + if (funding.funderName) { fundedByProject['funderName'] = funding.funderName; } @@ -93,7 +93,7 @@ export class ParsingFunctions { fundedByProjects.push(fundedByProject); return fundedByProjects; } - + // publication & research data : for fundedByProjects | project landing : for funding public parseFundingTrees(fundingTree: any): { "funderName": string, "funderShortname": string, "stream": string } { let funding: { "funderName": string, "funderShortname": string, "stream": string } = { @@ -102,64 +102,64 @@ export class ParsingFunctions { "stream": "" }; let length = Array.isArray(fundingTree) ? fundingTree.length : 1; - + for (let i = 0; i < length; i++) { let fundingData = Array.isArray(fundingTree) ? fundingTree[i] : fundingTree; - + if (fundingData.hasOwnProperty("funder")) { funding.funderShortname = fundingData['funder'].shortname; funding.funderName = fundingData['funder'].name; } - + funding.stream = this.addFundingLevel0(fundingData, funding.stream); - + funding.stream = this.addFundingLevel1(fundingData, funding.stream); - + funding.stream = this.addFundingLevel2(fundingData, funding.stream); } return funding; } - + addFundingLevel0(parent: string, fundingStream: string): string { if (parent.hasOwnProperty("funding_level_0")) { let level0 = parent['funding_level_0']; - + fundingStream += (fundingStream) ? " ; " : ""; fundingStream += level0.name; } return fundingStream; } - + addFundingLevel1(parent: string, fundingStream: string): string { if (parent.hasOwnProperty("funding_level_1")) { let level1 = parent['funding_level_1']; - + // For projects' parsing if (level1.hasOwnProperty("parent")) { fundingStream = this.addFundingLevel0(level1.parent, fundingStream); } - + fundingStream += (fundingStream) ? " | " : ""; fundingStream += level1.name; } return fundingStream; } - + addFundingLevel2(parent: string, fundingStream: string): string { if (parent.hasOwnProperty("funding_level_2")) { let level2 = parent['funding_level_2']; - + // For projects' parsing if (level2.hasOwnProperty("parent")) { fundingStream = this.addFundingLevel1(level2.parent, fundingStream); } - + fundingStream += (fundingStream) ? " | " : ""; fundingStream += level2.name; } return fundingStream; } - + // publication & dataset landing : for collectedFrom parseCollectedFrom(collectedFrom: { "name": string, "id": string }[], _collectedFrom: any) { @@ -168,7 +168,7 @@ export class ParsingFunctions { collectedFrom[length]['name'] = _collectedFrom.name; collectedFrom[length]['id'] = _collectedFrom.id; } - + // publication & dataset landing : for downloadFrom addPublisherToHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[], publisher: string, journal: string, @@ -186,13 +186,13 @@ export class ParsingFunctions { years: [], accessRightIcon: "" }; - + if (journal) { available.downloadNames.push(publisher + "/ " + journal['journal']); } else { available.downloadNames.push(publisher); } - + available.downloadUrl = properties.doiURL + identifiers.get("doi")[0]; available.accessRightIcon = this.unknown; /* @@ -204,16 +204,16 @@ export class ParsingFunctions { } return hostedBy_collectedFrom; } - + // publication & dataset landing : for downloadFrom parseDownloadFrom(downloadFrom: Map, instance: any, url: string) { let key: string = instance['hostedby'].name; - + if (key) { this.addUrlAndAccessMode(downloadFrom, instance, key, url); } } - + // publication & dataset landing : for publishedIn parsePublishedIn(publishedIn: Map, instance: any, result: any, url: string, counter: number): number { if (result != null && result.hasOwnProperty("source")) { @@ -226,7 +226,7 @@ export class ParsingFunctions { } else { key = result['source']; } - + if (key) { this.addUrlAndAccessMode(publishedIn, instance, key, url); counter++; @@ -234,30 +234,30 @@ export class ParsingFunctions { } return counter; } - + // publication & dataset landing : for downloadFrom and publishedIn addUrlAndAccessMode(mapStructure: Map, instance: any, key: string, url: string) { if (!mapStructure.has(key)) { mapStructure.set(key, {"url": null, "accessMode": null, "bestAccessMode": null}); } - + if (mapStructure.get(key)['url'] == null) { mapStructure.get(key)['url'] = new Array(); } - + if (url) { mapStructure.get(key)['url'].push(url); } - + if (mapStructure.get(key)['accessMode'] == null) { mapStructure.get(key)['accessMode'] = new Array(); } - + if (instance.hasOwnProperty("accessright")) { if (url) { mapStructure.get(key)['accessMode'].push(instance['accessright'].classname); } - + if (this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['accessright'])) { mapStructure.get(key)['bestAccessMode'] = instance['accessright'].classname; } @@ -265,13 +265,13 @@ export class ParsingFunctions { mapStructure.get(key)['accessMode'].push(""); } } - + parseHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[], instance: any, url: string, globalAccessRight: string) { if (!url) { return; } - + let available: HostedByCollectedFrom = { "downloadNames": [], "downloadUrl": null, @@ -282,7 +282,7 @@ export class ParsingFunctions { "years": [], "license": "" }; - + if (instance.hasOwnProperty("hostedby")) { let downloadNames: Set = new Set(); let length = Array.isArray(instance['hostedby']) ? instance['hostedby'].length : 1; @@ -293,12 +293,12 @@ export class ParsingFunctions { } } available.downloadNames = Array.from(downloadNames); - + if (available.downloadNames.length == 0) { available.downloadNames.push(url.substring(0, 30) + '...'); // substring(from, to); } } - + if (instance.hasOwnProperty("collectedfrom")) { let length = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'].length : 1; for (let i = 0; i < length; i++) { @@ -308,7 +308,7 @@ export class ParsingFunctions { } } } - + if (instance.hasOwnProperty("instancetype")) { let types: Set = new Set(); let length = Array.isArray(instance['instancetype']) ? instance['instancetype'].length : 1; @@ -320,7 +320,7 @@ export class ParsingFunctions { } available.types = Array.from(types); } - + if (instance.hasOwnProperty("dateofacceptance")) { let years: Set = new Set(); let length = Array.isArray(instance['dateofacceptance']) ? instance['dateofacceptance'].length : 1; @@ -331,17 +331,17 @@ export class ParsingFunctions { } available.years = Array.from(years); } - + available['downloadUrl'] = url; if (url.includes("doi.org/")) { this.instanceWithDoiExists = true; } - + if (instance.hasOwnProperty("accessright")) { let length = Array.isArray(instance['accessright']) ? instance['accessright'].length : 1; for (let i = 0; i < length; i++) { let accessRight = Array.isArray(instance['accessright']) ? instance['accessright'][i] : instance['accessright']; - + if (this.changeBestAccessMode(available.accessRight, accessRight)) { available.accessRight = accessRight.classname; if (this.changeBestAccessMode(globalAccessRight, accessRight)) { @@ -349,9 +349,9 @@ export class ParsingFunctions { } } } - + } - + if (available.accessRight) { if (available.accessRight.toLowerCase().indexOf('open') !== -1) { available.accessRightIcon = this.open; @@ -363,18 +363,18 @@ export class ParsingFunctions { } else { available.accessRightIcon = this.unknown; } - + if (instance.hasOwnProperty("license")) { available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license']; } - + hostedBy_collectedFrom.push(available); } - + compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) { let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null); let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null); - + if (firstAccessRight === secondAccessRight) { return 0; } else { @@ -406,14 +406,14 @@ export class ParsingFunctions { } return 0; } - + // publication & dataset landing : for downloadFrom and publishedIn changeBestAccessMode(currentAccessMode: string, accessMode: any): boolean { if (!accessMode) { return false; } accessMode = accessMode.classid; - + switch (currentAccessMode) { case null: if (accessMode != "UNKNOWN") { @@ -422,22 +422,22 @@ export class ParsingFunctions { return false; case "CLOSED": if (accessMode == "OPEN" || - accessMode == "OPEN SOURCE" || - accessMode == "EMBARGO" || - accessMode == "RESTRICTED") { + accessMode == "OPEN SOURCE" || + accessMode == "EMBARGO" || + accessMode == "RESTRICTED") { return true; } return false; case "RESTRICTED": if (accessMode == "OPEN" || - accessMode == "OPEN SOURCE" || - accessMode == "EMBARGO") { + accessMode == "OPEN SOURCE" || + accessMode == "EMBARGO") { return true; } return false; case "EMBARGO": if (accessMode == "OPEN" || - accessMode == "OPEN SOURCE") { + accessMode == "OPEN SOURCE") { return true; } return false; @@ -449,13 +449,13 @@ export class ParsingFunctions { } return false; } - + // publication & dataset & software & orp landing : for relatedResearchResults parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] { if (researchResults == undefined) { researchResults = []; } - + let researchResult: RelationResult = { name: "", id: "", @@ -466,9 +466,9 @@ export class ParsingFunctions { provenanceAction: provenanceAction, relationName: relationName }; - + // researchResult.relationName = relation.to.class; - + if (relation['resulttype']) { if (relation['resulttype'].classname == "publication") { researchResult['class'] = "publication"; @@ -513,7 +513,7 @@ export class ParsingFunctions { researchResults.push(researchResult); return researchResults; } - + sortByPercentage(results: RelationResult[]): RelationResult[] { if (results) { return results.sort(function (a, b) { @@ -522,11 +522,11 @@ export class ParsingFunctions { } return results; } - + // publication & dataset landing : for identifiers parseIdentifiers(pid: any): Map { let identifiers = new Map(); - + if (pid.hasOwnProperty("classid") && pid['classid'] != "") { if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") { if (!identifiers.has(pid.classid)) { @@ -546,15 +546,15 @@ export class ParsingFunctions { } return identifiers; } - + // publication & dataset landing : for subjects and otherSubjects and classifiedSubjects parseEoscSubjects(_subjects: any): any[] { let eoscSubjectsFound = []; let setOfEoscSubjects: Set = new Set(); - + let subject; let length = Array.isArray(_subjects) ? _subjects.length : 1; - + for (let i = 0; i < length; i++) { subject = Array.isArray(_subjects) ? _subjects[i] : _subjects; let content: string = subject.code + ""; @@ -565,10 +565,10 @@ export class ParsingFunctions { eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"]; } } - + return eoscSubjectsFound; } - + // publication & dataset landing : for subjects and otherSubjects and classifiedSubjects parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map, Map, string[], string[],] { // let eoscSubjectsFound = []; @@ -577,12 +577,12 @@ export class ParsingFunctions { let classifiedSubjects: Map; let fos: string[]; let sdg: string[]; - + let setOfEoscSubjects: Set = new Set(); - + let subject; let length = Array.isArray(_subjects) ? _subjects.length : 1; - + for (let i = 0; i < length; i++) { subject = Array.isArray(_subjects) ? _subjects[i] : _subjects; if (subject.classid != "") { @@ -615,7 +615,7 @@ export class ParsingFunctions { if (classifiedSubjects == undefined) { classifiedSubjects = new Map(); } - + let content: string = subject.content + ""; // let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content); // let found: boolean = checkAndAddEoscSubjectResp["found"]; @@ -648,10 +648,10 @@ export class ParsingFunctions { } return [subjects, otherSubjects, classifiedSubjects, fos, sdg]; } - + checkAndAddEoscSubject(setOfEoscSubjects: Set, eoscSubjectsFound, subject, content) { let found: boolean = false; - + if (!setOfEoscSubjects.has(content)) { // looping through our declared array this.eoscSubjects.forEach(item => { @@ -664,10 +664,10 @@ export class ParsingFunctions { } return {"found": found, "setOfEoscSubject": setOfEoscSubjects, "eoscSubjectsFound": eoscSubjectsFound}; } - + parseContexts(_contexts: any): Context[] { let contexts = new Array(); - + let position = 0; let labels = ""; let context; @@ -675,7 +675,7 @@ export class ParsingFunctions { for (let i = 0; i < length; i++) { let numOfCategories: number = 0; // count categories with label context = Array.isArray(_contexts) ? _contexts[i] : _contexts; - + if (context.label && context.hasOwnProperty("type") && (context['type'] == "community" || context['type'] == "ri")) { if (context.hasOwnProperty("category")) { let category; @@ -688,7 +688,7 @@ export class ParsingFunctions { let length1 = Array.isArray(category['concept']) ? category['concept'].length : 1; for (let j = 0; j < length1; j++) { categoryConcept = Array.isArray(category['concept']) ? category['concept'][j] : category['concept']; - + // initalize if there is concept label or this is the last concept of the category and there were no concepts // otherwise we could have multiple entries for the same category but without concepts if (categoryConcept.label || (numOfConcepts == 0 && j == (length1 - 1))) { @@ -703,7 +703,7 @@ export class ParsingFunctions { contexts[position]['idCategory'] = category.id; contexts[position]['labelConcept'] = categoryConcept.label ? categoryConcept.label : null; contexts[position]['idConcept'] = categoryConcept.label ? categoryConcept.id : null; - + position++; numOfConcepts++; } @@ -743,7 +743,7 @@ export class ParsingFunctions { } return contexts; } - + public static getEnermapsConceptId(contexts: any): string { let enermapsconcepts = contexts.filter(c => { return c.idCategory == "enermaps::selection" && c.idConcept @@ -751,7 +751,7 @@ export class ParsingFunctions { return enermapsconcepts && enermapsconcepts.length > 0 ? enermapsconcepts[0].idConcept.split("enermaps::selection::")[1] : null; // return "hotmaps_heat_tot_curr_density" } - + parseTypes(types: string[], uniqueTypes: Set, instance: any) { if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) { if (!uniqueTypes.has(instance['instancetype'].classname)) { @@ -760,10 +760,10 @@ export class ParsingFunctions { } } } - + parseLanguages(_languages: any) { var languages = new Array(); - + if (!Array.isArray(_languages)) { if (_languages.classname != "Undetermined" && _languages.classname) { languages.push(_languages.classname); @@ -777,10 +777,10 @@ export class ParsingFunctions { } return languages; } - + parseCountries(_countries: any) { var countries = new Array(); - + if (!Array.isArray(_countries)) { if (_countries.classname != "Undetermined" && _countries.classname) { countries.push(_countries.classname); @@ -794,10 +794,10 @@ export class ParsingFunctions { } return countries; } - + parseProgrammingLanguages(_pLanguages) { var pLanguages = new Array(); - + if (!Array.isArray(_pLanguages)) { if (_pLanguages.classname != "Undetermined" && _pLanguages.classname) { pLanguages.push(_pLanguages.classname); @@ -811,7 +811,7 @@ export class ParsingFunctions { } return pLanguages; } - + parseReferences(citations: any): Reference[] { let references: Reference[] = []; citations = Array.isArray(citations) ? citations : [citations]; @@ -834,7 +834,7 @@ export class ParsingFunctions { }); return references; } - + static parseRelCanonicalId(record, type) { try { if (record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"][type]) { @@ -846,9 +846,9 @@ export class ParsingFunctions { // console.error(e); } return record["result"]["header"]["dri:objIdentifier"]; - + } - + parseDescription(description, stripHTML: boolean = false): string { let abstracts = []; if (!Array.isArray(description)) { @@ -867,83 +867,89 @@ export class ParsingFunctions { return abstracts.length > 0 ? ('

' + abstracts.join('

') + '

') : abstracts.join(' '); } } - - parseMeasures(measures: any[]): Measure { - if (measures && measures.length) { - let parsed: Measure = { - "downloads": null, - "views": null, - "popularity": null, - "influence": null, - "citations": null, - "impulse": null - }; - measures.forEach(measure => { - if (measure.id == 'downloads') { - // parsed.downloads = measure.count == 0 ? ' - ' : measure.count; - parsed.downloads = measure.count; + + parseMeasures(elements: any[]): Measure { + if (elements && elements.length) { + let bip: Metric[] = []; + let counts: Metric[] = []; + let measure: Measure = {}; + elements.forEach(element => { + if (element.id == 'views') { + counts.push({name: 'views', icon: 'visibility', value: element.count, order: 0}); + measure.views = element.count; } - if (measure.id == 'views') { - // parsed.views = measure.count == 0 ? ' - ' : measure.count; - parsed.views = measure.count; + if (element.id == 'downloads') { + counts.push({name: 'downloads', icon: 'download', value: element.count, order: 1}); + measure.downloads = element.count; } - if (measure.id == 'influence') { - if (measure.class == 'C1') { - parsed.influence = 'Top 0.01%'; - } else if (measure.class == 'C2') { - parsed.influence = 'Top 0.1%'; - } else if (measure.class == 'C3') { - parsed.influence = 'Top 1%'; - } else if (measure.class == 'C4') { - parsed.influence = 'Top 10%'; - } else if (measure.class == 'A') { - parsed.influence = 'Exceptional'; - } else if (measure.class == 'B') { - parsed.influence = 'Substantial'; + if (element.id == 'influence_alt') { + bip.push({name: 'citations', icon: 'cite', value: element.score, order: 2}); + measure.citations = element.score; + } + if (element.id == 'popularity') { + let metric: Metric = {name: 'popularity', icon: 'fire', value: null, order: 3}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + 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 { - parsed.influence = 'Average'; + metric.value = 'Average'; } + measure.popularity = metric.value; + bip.push(metric); } - if (measure.id == 'popularity') { - if (measure.class == 'C1') { - parsed.popularity = 'Top 0.01%'; - } else if (measure.class == 'C2') { - parsed.popularity = 'Top 0.1%'; - } else if (measure.class == 'C3') { - parsed.popularity = 'Top 1%'; - } else if (measure.class == 'C4') { - parsed.popularity = 'Top 10%'; - } else if (measure.class == 'A') { - parsed.popularity = 'Exceptional'; - } else if (measure.class == 'B') { - parsed.popularity = 'Substantial'; + if (element.id == 'influence') { + let metric: Metric = {name: 'influence', icon: 'landmark', value: null, order: 4}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + 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 { - parsed.popularity = 'Average'; + metric.value = 'Average'; } + measure.influence = metric.value; + bip.push(metric); } - if (measure.id == 'influence_alt') { - // parsed['citations'] = measure.score == 0 ? ' - ' : measure.score; - parsed.citations = measure.score; - } - if (measure.id == 'impulse') { - if (measure.class == 'C1') { - parsed.impulse = 'Top 0.01%'; - } else if (measure.class == 'C2') { - parsed.impulse = 'Top 0.1%'; - } else if (measure.class == 'C3') { - parsed.impulse = 'Top 1%'; - } else if (measure.class == 'C4') { - parsed.impulse = 'Top 10%'; - } else if (measure.class == 'A') { - parsed.impulse = 'Exceptional'; - } else if (measure.class == 'B') { - parsed.impulse = 'Substantial'; + if (element.id == 'impulse') { + let metric: Metric = {name: 'impulse', icon: 'rocket', value: null, order: 5}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + 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 { - parsed.impulse = 'Average'; + metric.value = 'Average'; } + measure.impulse = metric.value; + bip.push(metric); } }); - return parsed; + measure.bip = bip.sort((a, b) => a.order - b.order); + measure.counts = counts.sort((a, b) => a.order - b.order); + return measure; } return null; } diff --git a/landingPages/landing-utils/resultLandingUtils.module.ts b/landingPages/landing-utils/resultLandingUtils.module.ts index d3646388..a1fe5846 100644 --- a/landingPages/landing-utils/resultLandingUtils.module.ts +++ b/landingPages/landing-utils/resultLandingUtils.module.ts @@ -17,6 +17,9 @@ import {SdgComponent} from "./sdg.component"; import {IconsModule} from "../../utils/icons/icons.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; import { SearchInputModule } from '../../sharedComponents/search-input/search-input.module'; +import {EntityMetadataComponent} from "./entity-metadata.component"; +import {IconsService} from "../../utils/icons/icons.service"; +import {closed_access, open_access} from "../../utils/icons/icons"; @NgModule({ @@ -27,7 +30,8 @@ import { SearchInputModule } from '../../sharedComponents/search-input/search-in declarations: [ ShowIdentifiersComponent,ShowSubjectsComponent, FundedByComponent,AvailableOnComponent,TabTableComponent, - RelatedToComponent, FosComponent, SdgComponent + RelatedToComponent, FosComponent, SdgComponent, + EntityMetadataComponent ], providers:[ ], @@ -37,4 +41,8 @@ import { SearchInputModule } from '../../sharedComponents/search-input/search-in RelatedToComponent, FosComponent, SdgComponent ] }) -export class ResultLandingUtilsModule { } +export class ResultLandingUtilsModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([open_access, closed_access]); + } +} diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index a388bc07..acb42d72 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -1,26 +1,26 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; -import {SharedModule} from '../../../openaireLibrary/shared/shared.module'; -import {MetricsModule} from '../landing-utils/metrics/metrics.module'; -import {LandingModule} from '../landing-utils/landing.module'; -import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; -import {IFrameModule} from '../../utils/iframe.module'; -import {AltMetricsModule} from '../../utils/altmetrics.module'; -import {PagingModule} from '../../utils/paging.module'; +import {SharedModule} from '../../../openaireLibrary/shared/shared.module'; +import {MetricsModule} from '../landing-utils/metrics/metrics.module'; +import {LandingModule} from '../landing-utils/landing.module'; +import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; +import {IFrameModule} from '../../utils/iframe.module'; +import {AltMetricsModule} from '../../utils/altmetrics.module'; +import {PagingModule} from '../../utils/paging.module'; -import {ResultLandingService} from './resultLanding.service'; -import {ResultLandingComponent} from './resultLanding.component'; -import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; -import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; +import {ResultLandingService} from './resultLanding.service'; +import {ResultLandingComponent} from './resultLanding.component'; +import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; +import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; -import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module'; -import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; -import {HelperModule} from "../../utils/helper/helper.module"; -import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; -import {AlertModalModule} from "../../utils/modal/alertModal.module"; +import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module'; +import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; +import {HelperModule} from "../../utils/helper/helper.module"; +import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; +import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {AnnotationModule} from "../annotation/annotation.module"; import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module"; import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module"; @@ -33,7 +33,7 @@ import {MatFormFieldModule} from "@angular/material/form-field"; import {MatSelectModule} from "@angular/material/select"; import {IconsModule} from "../../utils/icons/icons.module"; import {IconsService} from "../../utils/icons/icons.service"; -import {graph, link, quotes, cite, link_to, versions, rocket, fire, landmark, open_access, closed_access} from "../../utils/icons/icons"; +import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons"; import {InputModule} from "../../sharedComponents/input/input.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {RecaptchaModule} from 'ng-recaptcha'; @@ -61,6 +61,6 @@ import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-sugg }) export class ResultLandingModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([link, graph, quotes, cite, link_to, versions, rocket, fire, landmark, open_access, closed_access]) + this.iconsService.registerIcons([link, graph, quotes, cite, link_to, versions, rocket, fire, landmark]) } } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index e0b90f92..6c45f45e 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -330,7 +330,7 @@ export class ResultLandingService { this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom( this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher, - this.resultLandingInfo.journal.journal, this.resultLandingInfo.identifiers); + this.resultLandingInfo.journal?.journal, this.resultLandingInfo.identifiers); // res['result']['metadata']['oaf:entity']['oaf:result']['programmingLanguage'] if (data[12] != null) { diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 5f95479d..43a86311 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -17,71 +17,42 @@ declare var UIkit: any; @Component({ selector: 'orcid-work', template: ` - + - - - - - Add to  - - ORCID  - orcid  - - - - - - - - - - Delete from  - - ORCID  -   - - - - - - - - + [attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'" + [title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"> - + class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder" + [class.uk-disabled]="showLoading || !isLoggedIn || !pids" + [class.uk-text-muted]="showLoading || !isLoggedIn || !pids" + (mouseover)="hoverEvent($event)" (mouseout)="hoverEvent($event)"> + Claim + [top_margin]="false" [size]="'small'"> - + - + class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder" + [class.uk-disabled]="showLoading || !isLoggedIn || !pids" + [class.uk-text-muted]="showLoading || !isLoggedIn || !pids" + (mouseover)="hoverEvent($event, 'delete')" (mouseout)="hoverEvent($event, 'delete')"> + Remove + [top_margin]="false" [size]="'small'"> - - + + - - - - + + + + + - - - - + + + + - - - - - - + + + + + +
@@ -128,27 +99,29 @@ declare var UIkit: any;  ACTIONS - - - + View ORCID work - - + Update ORCID work @@ -158,7 +131,8 @@ declare var UIkit: any; - + Add to ORCID @@ -168,7 +142,8 @@ declare var UIkit: any; - + Delete from ORCID @@ -188,9 +163,9 @@ declare var UIkit: any;
{{work.title?.title?.value}}
{{work.title?.subtitle?.value}}
- +
{{work['journal-title']?.value}}
- +
@@ -224,11 +199,11 @@ declare var UIkit: any; {{work['short-description']}}

- +
- +
@@ -238,24 +213,26 @@ declare var UIkit: any; (contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role']) || (contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']) - || + || (contributor['contributor-orcid'] && contributor['contributor-orcid']['path']) )"> ( - + {{contributor['contributor-attributes']['contributor-role']}} - , - + {{contributor['contributor-attributes']['contributor-sequence']}} - - , + , {{contributor['contributor-orcid']?.path}} @@ -276,28 +253,31 @@ declare var UIkit: any;
- This {{openaireEntities.RESULT}} is the result of merged {{openaireEntities.RESULTS}} in OpenAIRE. + This {{openaireEntities.RESULT}} is the result of merged {{openaireEntities.RESULTS}} in OpenAIRE.

- You have already added {{this.putCodes?.length}} works in your ORCID record related to the merged {{openaireEntities.RESULT}}. + You have already added {{this.putCodes?.length}} works in your ORCID record + related to the merged {{openaireEntities.RESULT}}.
If you continue with delete action, all these works will be deleted.
- If you continue with update action, all these works will be deleted and a new merged work will be added instead. + If you continue with update action, all these works will be deleted and a new merged work will be added + instead.
- - - - - + + + + + - - - - - + + + + +
` }) @@ -314,54 +294,54 @@ export class OrcidWorkComponent { @Input() updateDates: string[] = []; @Input() givenPutCode: boolean = false; @Input() pageType: string = "search"; - + public subscriptions: Subscription[] = []; @ViewChild('workModal') workModal; // @ViewChild('saveWorkModal') saveWorkModal; @ViewChild('grantModal') grantModal; // @ViewChild('messageModal') messageModal; @ViewChild('propagationModal') propagationModal; - + public requestGrant: boolean = false; public requestGrantMessage: string = "Please grant OpenAIRE to access and update your ORCID works."; private tokenUrl: string; public message: string = ""; public showLoading: boolean = false; - + public works: any[] = []; public orcidWorks: any[] = []; public window: any; - + public isLoggedIn: boolean = false; - + public currentAction: string = ""; - + public hoverAdd: boolean = false; public hoverDelete: boolean = false; - + public properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; - + constructor(private route: ActivatedRoute, private _router: Router, private orcidService: OrcidService, private resultLandingService: ResultLandingService, private userManagementService: UserManagementService) { - if(typeof document !== 'undefined') { + if (typeof document !== 'undefined') { this.tokenUrl = properties.orcidTokenURL - + "client_id="+properties.orcidClientId + + "client_id=" + properties.orcidClientId // + "&response_type=code&scope=/activities/update" // + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited" + "&response_type=code&scope=/activities/update /read-limited" - + "&redirect_uri="+location.origin+"/orcid?source=openaire"; + + "&redirect_uri=" + location.origin + "/orcid?source=openaire"; } } - + ngOnInit() { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { if (user) { this.isLoggedIn = true; - if(!this.givenPutCode) { + if (!this.givenPutCode) { this.getPutCode(); } } else { @@ -371,7 +351,7 @@ export class OrcidWorkComponent { this.isLoggedIn = false; })); } - + ngOnDestroy() { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { @@ -380,16 +360,16 @@ export class OrcidWorkComponent { } }); } - + public showUpdateDatesInTooltip() { const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; let response: string = ""; - if(this.updateDates != null && this.updateDates.length > 0) { + if (this.updateDates != null && this.updateDates.length > 0) { response += "

Last update in ORCID
"; - for(let i=0; i { let identifiersMap: Map = new Map(); - for(let identifier of identifiers) { - if(!identifiersMap.has(identifier['external-id-type'])) { + for (let identifier of identifiers) { + if (!identifiersMap.has(identifier['external-id-type'])) { identifiersMap.set(identifier['external-id-type'], new Array()); } identifiersMap.get(identifier['external-id-type']).push(identifier['external-id-value']); } return identifiersMap; } - + openGrantWindow() { - if(!Session.isLoggedIn()){ + if (!Session.isLoggedIn()) { //this.userValidMessage = "User session has expired. Please login again."; - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { // this.tokenUrl = location.origin+"/orcid"; this.window = window.open(this.tokenUrl, '_blank', 'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes'); // this.requestGrant = false; this.closeGrantModal(); - + let self = this; window.onmessage = function (ev) { if (ev.isTrusted && ev.origin == location.origin && ev.data == 'success') { @@ -441,17 +426,17 @@ export class OrcidWorkComponent { } } } - + private getPutCode() { this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe( putCodes => { this.putCodes = putCodes; }, error => { - + } )) } - + private getResultLandingInfo(action: string) { this.subscriptions.push(this.resultLandingService.getResultLandingInfo(this.resultId, null, this.type, null, properties).subscribe( resultLandingInfo => { @@ -463,7 +448,7 @@ export class OrcidWorkComponent { } this.pids = pidsArray.join(); } - if(action == "save") { + if (action == "save") { this.saveWork(); } else if (action == "update") { this.updateWork(); @@ -475,18 +460,23 @@ export class OrcidWorkComponent { } )) } - + public saveWorkPreparation() { - if(!Session.isLoggedIn()){ + if (!Session.isLoggedIn()) { //this.userValidMessage = "User session has expired. Please login again."; - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); } else { this.showLoading = true; - + if (this.resultLandingInfo) { this.saveWork(); } else { @@ -495,42 +485,42 @@ export class OrcidWorkComponent { } } } - + private saveWork() { this.subscriptions.push(this.orcidService.saveWork(this.resultLandingInfo, this.pids).subscribe( response => { - + // for testing only // this.openGrantModal("Add work in your ORCID record"); // this.requestGrant = true; // this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works."; - - if(response == null) { + + if (response == null) { this.handleError(null); console.error("Error posting landing info: null"); } else { - this.putCodes.push(""+response['put-code']); + this.putCodes.push("" + response['put-code']); this.creationDates.push(response['created-date']['value']); this.updateDates.push(response['last-modified-date']['value']); - + // this.closeGrantModal(); // this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!"; - this.message = "You have successfully added work \""+this.resultTitle+"\" in your ORCID record!"; + this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!"; // this.openMessageModal("Work added successfully"); - + // message: 'You have successfully added work with pids: '+this.pids+' in your ORCID record!', UIkit.notification({ - message: 'You have successfully added work "'+this.resultTitle+'" in your ORCID record!' - // + - // '

Manager your ORCID links' + message: 'You have successfully added work "' + this.resultTitle + '" in your ORCID record!' + // + + // '

Manager your ORCID links' , - // '

Manager your ORCID links', - // '

Manager your ORCID links', + // '

Manager your ORCID links', + // '

Manager your ORCID links', status: 'success', timeout: 6000, pos: 'bottom-right' }); - + this.showLoading = false; } }, @@ -540,23 +530,28 @@ export class OrcidWorkComponent { } )); } - + goToOrcidLinksPage() { this._router.navigate([this.properties.myOrcidLinksPage]); } - + private updateWorkPreparation() { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); - } else if(this.putCodes.length > 1) { + } else if (this.putCodes.length > 1) { this.openPropagationModal("Update ORCID work"); } else { this.showLoading = true; - + if (this.resultLandingInfo) { this.updateWork(); } else { @@ -565,18 +560,18 @@ export class OrcidWorkComponent { } } } - + private updateWork() { this.subscriptions.push(this.orcidService.updateWork(this.resultLandingInfo, this.pids, this.putCodes[0]).subscribe( response => { - if(response) { + if (response) { this.updateDates[0] = response['last-modified-date'].value; - + // message: 'You have successfully updated work with pids: ' + this.pids + ' in your ORCID record!', UIkit.notification({ message: 'You have successfully updated work "' + this.resultTitle + '" in your ORCID record!' - // + - // '

Manager your ORCID links' + // + + // '

Manager your ORCID links' , status: 'success', timeout: 6000, @@ -591,36 +586,41 @@ export class OrcidWorkComponent { } )); } - + public confirmedPropagation() { this.propagationModal.cancel(); - + this.deleteWorks(true); //} // if(this.currentAction == "update") { // this.saveWork(); // } } - + public getOrcidWorks() { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { this.showLoading = true; this.subscriptions.push(this.orcidService.getOrcidWorks(this.putCodes).subscribe( (response) => { let error: boolean = true; - if(response && response['bulk']) { + if (response && response['bulk']) { response = response['bulk'].filter(res => { return (!res.error && res.work); }); - if(response && response.length > 0) { + if (response && response.length > 0) { error = false; this.orcidWorks = response; this.openWorkModal(); } } - if(error) { + if (error) { UIkit.notification({ message: 'There was an error getting this work.
Please make sure you have not deleted it from your ORCID iD.', status: 'warning', @@ -637,20 +637,25 @@ export class OrcidWorkComponent { )); } } - - + + public deleteWorks(confirmed: boolean = false) { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); - } else if(this.putCodes.length > 1 && !confirmed) { + } else if (this.putCodes.length > 1 && !confirmed) { this.openPropagationModal("Delete ORCID work"); } else { this.showLoading = true; - + if (!this.resultLandingInfo && this.identifiers) { let pidsArray: string[] = []; for (let key of Array.from(this.identifiers.keys())) { @@ -658,11 +663,11 @@ export class OrcidWorkComponent { } this.pids = pidsArray.join(); } - + this.subscriptions.push(this.orcidService.deleteWorks(this.putCodes).subscribe( deletedPutCodes => { let deletedAll: boolean = true; - + if (deletedPutCodes) { for (let i = 0; i < deletedPutCodes.length; i++) { let deletedPutCode = deletedPutCodes[i]; @@ -678,24 +683,24 @@ export class OrcidWorkComponent { } else { deletedAll = false; } - + if (!deletedAll) { this.handleError(null); console.error("Error deleting landing info: null"); } else { - if(this.currentAction == "update") { + if (this.currentAction == "update") { this.saveWork(); } else { // this.closeGrantModal(); // this.message = "You have successfully deleted work with pids: " + this.pids + " from your ORCID record!"; this.message = "You have successfully deleted work \"" + this.resultTitle + "\" from your ORCID record!"; // this.openMessageModal("Work deleted successfully"); - + // message: 'You have successfully deleted work with pids: ' + this.pids + ' from your ORCID record!', UIkit.notification({ message: 'You have successfully deleted work "' + this.resultTitle + '" from your ORCID record!' - // + - // '

Manager your ORCID links' + // + + // '

Manager your ORCID links' , status: 'success', timeout: 6000, @@ -713,7 +718,7 @@ export class OrcidWorkComponent { } } } - + openGrantModal(title: string) { this.grantModal.cancelButton = true; this.grantModal.okButton = true; @@ -722,22 +727,22 @@ export class OrcidWorkComponent { this.grantModal.alertTitle = title; this.grantModal.open(); } - + closeGrantModal() { this.grantModal.cancel(); } - + openWorkModal() { this.workModal.cancelButton = false; this.workModal.okButton = false; this.workModal.alertTitle = "Work in your ORCID record"; this.workModal.open(); } - + closeWorkModal() { this.workModal.cancel(); } - + // openMessageModal(title: string) { // this.messageModal.cancelButton = false; // this.messageModal.okButton = false; @@ -748,7 +753,7 @@ export class OrcidWorkComponent { // closeMessageModal() { // this.messageModal.cancel(); // } - + openPropagationModal(title: string) { this.propagationModal.cancelButton = true; this.propagationModal.okButton = true; @@ -757,43 +762,43 @@ export class OrcidWorkComponent { this.propagationModal.alertTitle = title; this.propagationModal.open(); } - + closePropagationModal() { this.propagationModal.cancel(); } - + handleError(error) { - if(error && error.status == "401") { + if (error && error.status == "401") { this.openGrantModal("Add, delete or edit work in your ORCID record"); this.requestGrant = true; this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works. "; - // + "If you have already granted OpenAIRE, you just need to login again to ORCID!"; - } else if(error && error.status == "403") { + // + "If you have already granted OpenAIRE, you just need to login again to ORCID!"; + } else if (error && error.status == "403") { this.openGrantModal("Add, delete or edit work in your ORCID record"); this.requestGrant = true; this.requestGrantMessage = "Please login again to ORCID." // this.openGrantModal(); } else { this.message = ""; - if(error && error.status == "409") { + if (error && error.status == "409") { this.message = "There is already a work in your ORCID record with the same information of the work you are trying to add now.

"; } - if(this.currentAction == "get") { + if (this.currentAction == "get") { // this.message += "There was an error getting work with pids: " + this.pids + " from your ORCID record.
Please try again later."; this.message += "There was an error getting work \"" + this.resultTitle + "\" from your ORCID record.
Please try again later."; - } else if(this.currentAction == "add") { + } else if (this.currentAction == "add") { // this.message += "There was an error adding work with pids: "+this.pids+" to your ORCID record.
Please try again later."; - this.message += "There was an error adding work with pids: \""+this.pids+"\" to your ORCID record.
Please try again later."; - } else if(this.currentAction == "update") { + this.message += "There was an error adding work with pids: \"" + this.pids + "\" to your ORCID record.
Please try again later."; + } else if (this.currentAction == "update") { // this.message += "There was an error updating work with pids: "+this.pids+" to your ORCID record.
Please try again later."; - this.message += "There was an error updating work \""+this.resultTitle+"\" to your ORCID record.
Please try again later."; - } else if(this.currentAction == "delete") { + this.message += "There was an error updating work \"" + this.resultTitle + "\" to your ORCID record.
Please try again later."; + } else if (this.currentAction == "delete") { // this.message += "There was an error deleting work with pids: "+this.pids+" from your ORCID record.
Please try again later."; - this.message += "There was an error deleting work \""+this.resultTitle+"\" from your ORCID record.
Please try again later."; + this.message += "There was an error deleting work \"" + this.resultTitle + "\" from your ORCID record.
Please try again later."; } else { this.message += "There was an error. Please try again later." } - + UIkit.notification({ message: this.message, status: 'danger', @@ -804,28 +809,28 @@ export class OrcidWorkComponent { } this.showLoading = false; } - + get tooltipAdd() { return "Add this work to your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); } - + get tooltipDelete() { return "Delete this work from your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); } - + get tooltipNoPid() { return "Only resources with a PID (persistent identifier) like DOI, handle, PMID can be added or deleted from your ORCID record"; } - + get tooltipNoLoggedInUser() { - return "Add or delete a work from your ORCID record. Please log in first." + return "Add or delete a work from your ORCID record. Please log in first." } - + hoverEvent($event, action: string = "add") { - if(action == "add") { + if (action == "add") { this.hoverAdd = $event.type == "mouseover"; this.hoverDelete = false; - } else if(action == "delete") { + } else if (action == "delete") { this.hoverDelete = $event.type == "mouseover"; this.hoverAdd = false; } diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index b2e4ed18..64d58153 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -252,9 +252,10 @@ [href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)" target="_blank"> OpenAIRE - Explore.
-
+
-
+
{{searchUtils.totalResults|number}} {{type}}, page @@ -267,9 +268,10 @@ {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}} -
+
-
+
+
- -
- - + +

@@ -69,25 +62,22 @@ [no title available]

-
- -
- {{type}} - . - - {{beforeTitle.join(' . ')}} - - - . Embargo End Date: {{result.embargoEndDate | date: 'dd MMM yyyy'}} - + +
+
-
- + - - - + <!– –> + <!– Special Clause 39–> + <!– {{' '}}–> @@ -143,11 +133,11 @@ {{result.compatibility}} in OpenAIRE {{' '}}
-
+
--> -
+
-
+
Funder: {{result.funderShortname}} @@ -163,7 +153,7 @@
-
+
Overall Budget: {{result.budget | number}} @@ -176,31 +166,16 @@
-
- Authors:  +
-
+
- -
- Publisher: - {{result.publisher}} -
- -
- {{(result.countries.length == 1) ? 'Country' : 'Countries'}}: - - {{country}}{{(i < (result.countries.slice(0, 10).length - 1)) ? ", " : ""}} - {{(i == result.countries.slice(0, 10).length - 1 && result.countries.length > 10) ? "..." : ""}} - -
-
+
Project: @@ -217,7 +192,7 @@
+ class="uk-margin-xsmall-bottom"> Partners: {{organization.name}} @@ -227,7 +202,7 @@
+ class="uk-margin-xsmall-bottom"> Website URL: @@ -236,7 +211,7 @@
- -
+

@@ -297,7 +239,7 @@
-
- - - - - - - - - {{" " + result.measure[2] + " popularity" }} - - -
- - - - +
+
+
+ +
+
+ + + + + + + + + Added in ORCID: - - {{" " + result.measure[2] + " popularity" }} - - - {{" " + (result.measure[0] == 'A' ? 'In top 0.01%' : '') + (result.measure[0] == 'B' ? 'In top 1%' : '') + (result.measure[0] == 'C' ? 'In bottom 99%' : '')}} - - -
- Popularity: Citation-based measure reflecting the current impact. -
- -
- - - - - - - - {{" " + result.measure[3] + " influence" }} - - -
- - - - - - - {{result.measure[3] + " influence" }} - - - {{" " + (result.measure[1] == 'A' ? 'In top 0.01%' : '') + (result.measure[1] == 'B' ? 'In top 1%' : '') + (result.measure[1] == 'C' ? 'In bottom 99%' : '')}} - - -
- Influence: Citation-based measure reflecting the total impact. -
- -
- - - - - - - - - - - Added in ORCID: - - - {{date | date: 'dd MMM yyyy'}} - - & + + {{date | date: 'dd MMM yyyy'}} + + & + - +
+
+ + + + {{result.measure.bip[0].value}} + +
+ + + + + + +
{{metric.name}}{{metric.value}}
+
+ BIP! + Powered by BIP! +
+
+
+ + + + {{result.measure.counts[0].value}} + +
+ + + + + + +
{{metric.name}}{{metric.value}}
+
+ Powered by + BIP! +
+
+
+
+
diff --git a/utils/result-preview/result-preview.component.less b/utils/result-preview/result-preview.component.less index d0ddcd5d..39c79987 100644 --- a/utils/result-preview/result-preview.component.less +++ b/utils/result-preview/result-preview.component.less @@ -14,4 +14,15 @@ .popularity-C, .popularity-C5, .influence-C, .influence-C5 { & svg a { fill: #444; - }} \ No newline at end of file + } +} + +.metrics { + & .uk-drop { + max-width: 200px; + } + + & table td { + padding: 2px 5px; + } +} diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index e6a6f884..225e0335 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -4,7 +4,6 @@ import {EnvProperties} from "../properties/env-properties"; import {RouterHelper} from "../routerHelper.class"; import {AlertModal} from "../modal/alert"; import {properties} from "../../../../environments/environment"; -import {Session} from "../../login/utils/helper.class"; import {Identifier, StringUtils} from "../string-utils.class"; import {OpenaireEntities} from "../properties/searchFields"; import {HelperFunctions} from "../HelperFunctions.class"; @@ -29,29 +28,43 @@ export class ResultPreviewComponent implements OnInit, OnChanges { public urlParam: string; public url: string; @Input() externalUrl: string; - public type: string; - public beforeTitle: string[] = []; + public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; @Input() showOrcid: boolean = true; @Input() showEnermaps: boolean = false; @Input() deposit: boolean = false; @Input() provenanceActionVocabulary = null; @Input() relationsVocabulary = null; + + /* Metadata */ + public type: string; + public types: string[]; + public provenanceAction: string; + public relationName: string; + public linking: boolean = false; + public share: boolean = false; + public cite: boolean = false; + public orcid: boolean = false; + ngOnInit(): void { if (this.hasLink) { if (this.result.resultType === "publication") { this.urlParam = "articleId"; this.url = properties.searchLinkToPublication.split('?')[0]; + this.resultActions(); } else if (this.result.resultType === "dataset") { this.urlParam = "datasetId"; this.url = properties.searchLinkToDataset.split('?')[0]; + this.resultActions(); } else if (this.result.resultType === "software") { this.urlParam = "softwareId"; this.url = properties.searchLinkToSoftwareLanding.split('?')[0]; + this.resultActions(); } else if (this.result.resultType === "other") { this.urlParam = "orpId"; this.url = properties.searchLinkToOrp.split('?')[0]; + this.resultActions(); } else if (this.result.resultType == "project") { if (this.result.id) { this.urlParam = "projectId"; @@ -80,7 +93,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { } this.checkPID(); } - this.initBeforeTitle(); + this.initMetadata(); if (this.result.languages) { this.result.languages = this.removeUnknown(this.result.languages); } @@ -89,6 +102,14 @@ export class ResultPreviewComponent implements OnInit, OnChanges { } } + resultActions() { + this.linking = true; + this.share = true; + this.cite = true; + this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator') && + this.showOrcid && this.result.identifiers && this.result.identifiers.size > 0; + } + ngOnChanges(changes: SimpleChanges) { if (changes.result && this.hasLink) { this.checkPID(); @@ -109,35 +130,28 @@ export class ResultPreviewComponent implements OnInit, OnChanges { return Identifier.getPIDFromIdentifiers(this.result.identifiers); } - public initBeforeTitle() { + public initMetadata() { if (this.result.resultType && this.result.resultType !== 'dataprovider') { this.type = this.getTypeName(this.result.resultType); } if (this.result.types) { - this.removeUnknown(this.removeDuplicates(this.result.types)).forEach(type => { - this.beforeTitle.push(type); - }); - } - if (this.result.year) { - this.beforeTitle.push(this.result.year.toString()); - } - if (this.result.startYear && this.result.endYear) { - this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString()); + this.types = this.removeUnknown(this.removeDuplicates(this.result.types)); } if (this.result.provenanceAction) { - let value = HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary, false); - if (value) { - this.beforeTitle.push(value); - } + this.provenanceAction = HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary, false); } if (this.result.relationName) { - this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary)); + this.relationName = HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary); } // if(this.result.percentage) { // this.beforeTitle.push((this.result.relation ? this.result.relation+": " : "") + this.result.percentage.toString() + "%"); // } } + get hasActions() { + return this.linking || this.share || this.cite || this.orcid; + } + public getTypeName(type: string): string { return StringUtils.getEntityName(type, false); } @@ -174,7 +188,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { return this.routerHelper.createQueryParam(this.urlParam, this.result.id) } - + public get isResultType() { return this.result.resultType == "publication" || this.result.resultType == "dataset" || this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result"; diff --git a/utils/result-preview/result-preview.module.ts b/utils/result-preview/result-preview.module.ts index 98f72da5..4f0ee949 100644 --- a/utils/result-preview/result-preview.module.ts +++ b/utils/result-preview/result-preview.module.ts @@ -6,10 +6,16 @@ import {ShowAuthorsModule} from "../authors/showAuthors.module"; import {ResultLandingUtilsModule} from "../../landingPages/landing-utils/resultLandingUtils.module"; import {OrcidModule} from "../../orcid/orcid.module"; import {IconsModule} from "../icons/icons.module"; +import {IconsService} from "../icons/icons.service"; +import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../icons/icons"; @NgModule({ imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule], declarations: [ResultPreviewComponent], exports: [ResultPreviewComponent] }) -export class ResultPreviewModule {} \ No newline at end of file +export class ResultPreviewModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([link, quotes, cite, link_to, rocket, fire, landmark]) + } +} diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index 1d15616b..9ab1f0d8 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -1,5 +1,5 @@ import {SearchResult} from "../entities/searchResult"; -import {Measure, ResultLandingInfo} from "../entities/resultLandingInfo"; +import {Measure, Metric, ResultLandingInfo} from "../entities/resultLandingInfo"; import {OrganizationInfo} from "../entities/organizationInfo"; export interface HostedByCollectedFrom { @@ -199,6 +199,7 @@ export class ResultPreview { resultPreview.identifiers = result.identifiers; resultPreview.enermapsId = result.enermapsId; resultPreview.measure = result.measure; + resultPreview.hostedBy_collectedFrom = result.hostedBy_collectedFrom; return resultPreview; }