From 3e3379d038fb12bc788482c812837f4d4a639f82 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 27 Sep 2021 12:14:17 +0300 Subject: [PATCH 1/3] [Trunk | Explore]: 1. parsingFunctions.class.ts: created field "notebookKeyword" to be compared with subjects. 2. resultLanding.component.html: Property "egiNotebookLink" is used for Notebook button on top right section. 3. env-properties.ts: Added property "egiNotebookLink". 4. environment.beta.ts & environment.ts: Added property "egiNotebookLink". --- .../landing-utils/parsingFunctions.class.ts | 17 ++++++++++++++--- .../result/resultLanding.component.html | 2 +- utils/properties/env-properties.ts | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 77a87a55..7913502d 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -7,6 +7,7 @@ import {Injectable} from '@angular/core'; }) export class ParsingFunctions { public notebookInSubjects: boolean = false; + private notebookKeyword: string = "eosc jupyter notebook"; public open = 'assets/common-assets/unlock.svg'; public closed = 'assets/common-assets/lock.svg'; @@ -534,7 +535,12 @@ export class ParsingFunctions { } let content: string = subject.content; - if(content && content.toLowerCase().includes("notebook")) { + console.log("keyword subject: "+content); + + if(content && content.toLowerCase().includes(this.notebookKeyword)) { + // console.log("included in keyword subject: "+content); + console.log("included"); + this.notebookInSubjects = true; } subjects.push(content); @@ -548,8 +554,13 @@ export class ParsingFunctions { } let content: string = subject.content; let classname: string = subject.classname; - if( (content && content.toLowerCase().includes("notebook") || - (classname && classname.toLowerCase().includes("notebook")))) { + console.log("other subject: "+classname + ": " +content); + + if( (content && content.toLowerCase().includes(this.notebookKeyword) || + (classname && classname.toLowerCase().includes(this.notebookKeyword)))) { + // console.log("included in other subject: "+classname + ": "+content); + console.log("included"); + this.notebookInSubjects = true; } otherSubjects.get(classname).push(content); diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index b254baa6..db41463f 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -125,7 +125,7 @@
  • + target="_blank" [href]="properties.egiNotebookLink"> egi_notebook diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 3bcc7b59..6f87114f 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -135,4 +135,5 @@ export interface EnvProperties { notificationsAPIURL?: string; myOrcidLinksPage?: string; footerGrantText?: string; + egiNotebookLink?: string; } From aab0341bea0d10fcdf287aa29d4cb6dfc4e65d4e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 27 Sep 2021 12:19:24 +0300 Subject: [PATCH 2/3] [Explore | Trunk]: 1. dataProvider.service.ts & project.service.ts & resultLanding.service.ts & searchDataproviders.service.ts & searchOrganizations.service.ts & searchProjects.service.ts & searchResearchResults.service.ts: Removed case sensitivity in parsing relations (rels.rel.to.class). 2. orcid.service.ts: Removed unused imports | Added comment related to KPI metrics calculated by orcid API. --- landingPages/dataProvider/dataProvider.service.ts | 2 +- landingPages/project/project.service.ts | 4 ++-- landingPages/result/resultLanding.service.ts | 12 ++++++------ orcid/orcid.service.ts | 5 ++--- services/searchDataproviders.service.ts | 2 +- services/searchOrganizations.service.ts | 2 +- services/searchProjects.service.ts | 2 +- services/searchResearchResults.service.ts | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index 3882851f..7446a6c7 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -240,7 +240,7 @@ export class DataProviderService { for(let i=0; i(); diff --git a/landingPages/project/project.service.ts b/landingPages/project/project.service.ts index ae4c65d6..b74a1d37 100644 --- a/landingPages/project/project.service.ts +++ b/landingPages/project/project.service.ts @@ -174,7 +174,7 @@ export class ProjectService { this.projectInfo.organizations = [];//new Map(); if(!Array.isArray(data[2])) { - if(data[2].hasOwnProperty("to") && data[2]['to'].class == "hasParticipant") { + if(data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") { let acronym: string = ""; let name: string = ""; let id: string = ""; @@ -200,7 +200,7 @@ export class ProjectService { let acronym: string = ""; let name: string = ""; let id: string = ""; - if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") { + if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class && data[2][i]['to'].class.toLowerCase() == "hasparticipant") { if(data[2][i].hasOwnProperty("legalshortname")) { acronym = data[2][i].legalshortname; } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index c4e029f6..6d0a2ee8 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -185,22 +185,22 @@ export class ResultLandingService { for(let i=0; i(); diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 92b0a2d8..1877c7a9 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -305,7 +305,7 @@ export class SearchResearchResultsService { let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel']; if (relation.hasOwnProperty("to")) { - if (relation['to'].class == "isProducedBy") { + if (relation['to'].class && relation['to'].class.toLowerCase() == "isproducedby") { result['projects'] = this.parseProjects(result['projects'], relation); } } From 532be0e56870c597f2be121bfeb5e1d032489b34 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 29 Sep 2021 14:34:03 +0300 Subject: [PATCH 3/3] [Trunk | Explore]: 1. assets/common-assets: Added "eosc-logo.png" & deleted "egi-fed.notebook.png". 2. resultLanding.component.ts: Removed local styles for "notebook-button" class. 3. resultLanding.component.html: Logo and name of button for egi notebook updated. 4. parsingFunctions.class.ts: When "eosc jupyter notebook" is in subjects, show as classified subject (vocabulary) "EOSC: EOSC Jupyter Notebook" [Paolo's request]. --- .../landing-utils/parsingFunctions.class.ts | 46 +++++++++++++------ .../result/resultLanding.component.html | 8 ++-- .../result/resultLanding.component.ts | 4 -- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 7913502d..1c9b1da0 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -8,6 +8,8 @@ import {Injectable} from '@angular/core'; export class ParsingFunctions { public notebookInSubjects: boolean = false; private notebookKeyword: string = "eosc jupyter notebook"; + private notebook_label: string = "EOSC"; + private notebook_value: string = "EOSC Jupyter Notebook"; public open = 'assets/common-assets/unlock.svg'; public closed = 'assets/common-assets/lock.svg'; @@ -530,28 +532,28 @@ export class ParsingFunctions { classifiedSubjects.get(subject.classname).push(subject.content); } else { if (subject.classid == "keyword") { - if (subjects == undefined) { - subjects = new Array(); - } - let content: string = subject.content; console.log("keyword subject: "+content); if(content && content.toLowerCase().includes(this.notebookKeyword)) { // console.log("included in keyword subject: "+content); console.log("included"); - this.notebookInSubjects = true; + + if (classifiedSubjects == undefined) { + classifiedSubjects = new Map(); + } + if (!classifiedSubjects.has(subject.classname)) { + classifiedSubjects.set(this.notebook_label, new Array()); + } + classifiedSubjects.get(this.notebook_label).push(this.notebook_value); + } else { + if (subjects == undefined) { + subjects = new Array(); + } + subjects.push(content); } - subjects.push(content); } else { - if (otherSubjects == undefined) { - otherSubjects = new Map(); - } - - if (!otherSubjects.has(subject.classname)) { - otherSubjects.set(subject.classname, new Array()); - } let content: string = subject.content; let classname: string = subject.classname; console.log("other subject: "+classname + ": " +content); @@ -562,8 +564,24 @@ export class ParsingFunctions { console.log("included"); this.notebookInSubjects = true; + + if (classifiedSubjects == undefined) { + classifiedSubjects = new Map(); + } + if (!classifiedSubjects.has(subject.classname)) { + classifiedSubjects.set(this.notebook_label, new Array()); + } + classifiedSubjects.get(this.notebook_label).push(this.notebook_value); + } else { + if (otherSubjects == undefined) { + otherSubjects = new Map(); + } + + if (!otherSubjects.has(subject.classname)) { + otherSubjects.set(subject.classname, new Array()); + } + otherSubjects.get(classname).push(content); } - otherSubjects.get(classname).push(content); } } } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index db41463f..ca909b46 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -126,11 +126,11 @@ && (properties.environment == 'beta' || properties.environment == 'development')"> - - egi_notebook + + eosc_logo - EGI Notebook + EOSC SERVICE: EGI NOTEBOOK
  • diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index fe218259..fe70d83f 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -27,10 +27,6 @@ import {$e} from "codelyzer/angular/styles/chars"; @Component({ - styles: [ - '.notebook-button { background-color: #f2f2f2; border: 1px solid #f2f2f2; } ' + - '.notebook-button:hover { background-color: #e5e5e5; border-color: #e5e5e5; } ' - ], selector: 'result-landing', templateUrl: 'resultLanding.component.html', })