From acdb1cc6c70bdcb02291ecdc680b1c27b3371e98 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 18 May 2018 15:56:15 +0000 Subject: [PATCH] 1. #3662: For 'Similar Research Results' use 'similarity' field instead of 'trust' used in 'Related Research Results' (publication, dataset, software landing). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52103 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/dataset/dataset.component.html | 4 +-- .../landing-utils/parsingFunctions.class.ts | 33 +++++++++---------- .../landing-utils/tabTable.component.ts | 15 +++++---- .../publication/publication.component.html | 4 +-- landingPages/software/software.component.html | 4 +-- utils/entities/datasetInfo.ts | 4 +-- utils/entities/publicationInfo.ts | 4 +-- utils/entities/softwareInfo.ts | 4 +-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/landingPages/dataset/dataset.component.html b/landingPages/dataset/dataset.component.html index 525b5c39..53aec2d0 100644 --- a/landingPages/dataset/dataset.component.html +++ b/landingPages/dataset/dataset.component.html @@ -156,7 +156,7 @@
{{provenanceaction}}
- +
@@ -166,7 +166,7 @@ No similar research results available
- +
diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 72ff3c7d..7d09f51e 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -347,43 +347,42 @@ export class ParsingFunctions { return false; } - // publication & dataset landing : for relatedResearchResults + // publication & dataset & software landing : for relatedResearchResults parseRelatedResearchResults(relatedResearchResults: Map, relation: any, provenanceAction: string) : + "percentage": number, "class": string}[]>, relation: any, provenanceAction: string) : Map { + "percentage": number, "class": string}[]> { if(relatedResearchResults == undefined) { relatedResearchResults = new Map(); + "percentage": number, "class": string }[]>(); } if(!relatedResearchResults.has(provenanceAction)) { relatedResearchResults.set(provenanceAction, new Array<{ "name": string, "id": string, "date": string, - "trust": number, "class": string }>()); + "percentage": number, "class": string }>()); } - relatedResearchResults.get(provenanceAction).push(this.parseRelatedOrSimilarResearchResult(relation)); + relatedResearchResults.get(provenanceAction).push(this.parseRelatedOrSimilarResearchResult(relation, "trust")); return relatedResearchResults; } - // publication & dataset landing : for similarResearchResults + // publication & dataset & software landing : for similarResearchResults parseSimilarResearchResults(similarResearchResults: { "name": string, "id": string, "date": string, - "trust": number, "class": string}[], relation: any) : - { "name": string, "id": string, "date": string, "trust": number, "class": string }[] { + "percentage": number, "class": string}[], relation: any) : + { "name": string, "id": string, "date": string, "percentage": number, "class": string }[] { if(similarResearchResults == undefined) { similarResearchResults = new Array<{"name": string, "id": string, "date": string, - "trust": number, "class": string}>(); + "percentage": number, "class": string}>(); } - similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation)); + similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "similarity")); return similarResearchResults; } - // publication & dataset landing : for relatedResearchResults and similarResearchResults - parseRelatedOrSimilarResearchResult(relation: any): {"name": string, "id": string, "date": string, "trust": number, "class": string} { - let researchResult: {"name": string, "id": string, "date": string, "trust": number, "class": string} - = {"name": "", "id": "", "date": "", "trust": null, "class": ""} - + // publication & dataset & software landing : for relatedResearchResults and similarResearchResults + parseRelatedOrSimilarResearchResult(relation: any, percentageName: string): {"name": string, "id": string, "date": string, "percentage": number, "class": string} { + let researchResult: {"name": string, "id": string, "date": string, "percentage": number, "class": string} + = {"name": "", "id": "", "date": "", "percentage": null, "class": ""} if(relation['resulttype'].classname == "publication") { researchResult['class'] = "publication"; } else if(relation['resulttype'].classname == "dataset") { @@ -398,7 +397,7 @@ export class ParsingFunctions { var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date; //researchResult['date'] = relation.dateofacceptance.substring(0,4);; - researchResult['trust'] = Math.round(relation.trust*100); + researchResult['percentage'] = Math.round(relation[percentageName]*100); return researchResult; } diff --git a/landingPages/landing-utils/tabTable.component.ts b/landingPages/landing-utils/tabTable.component.ts index 59b78734..020a49df 100644 --- a/landingPages/landing-utils/tabTable.component.ts +++ b/landingPages/landing-utils/tabTable.component.ts @@ -15,7 +15,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; @@ -54,12 +54,12 @@ import{EnvProperties} from '../../utils/properties/env-properties'; -
-
{{item['trust']}}%
- +
+
{{item['percentage']}}%
+
-
-

No trust available

+
+

No {{percentageName}} available

@@ -70,7 +70,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; }) export class TabTableComponent { - @Input() info: { "name": string, "url": string, "date": string, "trust": number}[];//Map; + @Input() percentageName: string = "Trust"; + @Input() info: { "name": string, "url": string, "date": string, "percentage": number}[];//Map; @Input() properties:EnvProperties; public routerHelper:RouterHelper = new RouterHelper(); public searchLinkToPublication: string; diff --git a/landingPages/publication/publication.component.html b/landingPages/publication/publication.component.html index 7c3c0fd0..504b46f3 100644 --- a/landingPages/publication/publication.component.html +++ b/landingPages/publication/publication.component.html @@ -295,7 +295,7 @@
{{provenanceaction}}
- +
@@ -307,7 +307,7 @@
- +
diff --git a/landingPages/software/software.component.html b/landingPages/software/software.component.html index 86e37bcd..5b85796b 100644 --- a/landingPages/software/software.component.html +++ b/landingPages/software/software.component.html @@ -157,7 +157,7 @@
{{provenanceaction}}
- +
@@ -167,7 +167,7 @@ No similar research results available
- +
diff --git a/utils/entities/datasetInfo.ts b/utils/entities/datasetInfo.ts index cd590c21..c3eff86e 100644 --- a/utils/entities/datasetInfo.ts +++ b/utils/entities/datasetInfo.ts @@ -39,8 +39,8 @@ export class DatasetInfo { "funderShortname": string, "funderName": string, "funding": string, "code": string, "provenanceAction": string, "inline": boolean}[]; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; - relatedResearchResults: Map; - similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; + relatedResearchResults: Map; // percentage is for trust + similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; record; } diff --git a/utils/entities/publicationInfo.ts b/utils/entities/publicationInfo.ts index 8f1e98a6..dd876b63 100644 --- a/utils/entities/publicationInfo.ts +++ b/utils/entities/publicationInfo.ts @@ -50,8 +50,8 @@ export class PublicationInfo { //similarPublications: {"name": string, "url": string, "date": string, "trust": number}[]; //similarDatasets: {"name": string, "url": string, "date": string, "trust": number}[]; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; - relatedResearchResults: Map; - similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; + relatedResearchResults: Map; // percentage is for trust + similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity references: { "name": string, "url": string}[]; contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[]; diff --git a/utils/entities/softwareInfo.ts b/utils/entities/softwareInfo.ts index 15191ec7..b0094f89 100644 --- a/utils/entities/softwareInfo.ts +++ b/utils/entities/softwareInfo.ts @@ -39,8 +39,8 @@ export class SoftwareInfo { "funderShortname": string, "funderName": string, "funding": string, "code": string, "provenanceAction": string, "inline": boolean}[]; researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"}; - relatedResearchResults: Map; - similarResearchResults: { "name": string, "id": string, "date": string, "trust": number, "class": string}[]; + relatedResearchResults: Map; // percentage is for trust + similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[]; record; }