From 4242a65199dcef141c844a5dda5116317d528045 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 May 2022 17:01:35 +0300 Subject: [PATCH 1/2] [Library | new-theme]: [NEW] #6915 - Added new fields in datasources/services. 1. dataProviderInfo.ts: Added fields jurisdiction, thematic, contentpolicy, identifiers. 2. dataProvider.service.ts: Parse new fields. 3. dataProvider.component.html: Added label "Thematic" when true | moved "web page" under the labels | Show identifiers, jurisdiction and contentpolicy. 4. dataProvider.module.ts: Import ResultLandingUtilsModule. 5. parsingFunctions.class.ts: In method "parseIdentifiers()" added parsing for classid "re3data". 6. showIdentifiers.component.ts: Show identifier when key is "re3data" too. 7. string-utils.class.ts: In Identifier class added class and check for "re3data". 8. searchDataproviders.service.ts: In method "parseResults()" parse "pid" and set identifiers. 9. newSearchPage.component.ts: In method "createKeywordQuery()" added check for identifiers for entityTypes "datasource" and "service". --- .../dataProvider/dataProvider.component.html | 38 ++++++++++++++----- .../dataProvider/dataProvider.module.ts | 3 +- .../dataProvider/dataProvider.service.ts | 14 +++++++ .../landing-utils/parsingFunctions.class.ts | 6 +-- .../showIdentifiers.component.ts | 4 +- .../searchUtils/newSearchPage.component.ts | 2 +- services/searchDataproviders.service.ts | 7 +++- utils/entities/dataProviderInfo.ts | 4 ++ utils/string-utils.class.ts | 9 ++++- 9 files changed, 68 insertions(+), 19 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index e97c8941..5eef7d89 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -87,16 +87,6 @@ [types]="dataProviderInfo.type ? [dataProviderInfo.type] : null"> - -
- Web page: - - {{dataProviderInfo.title.url}} - -
-
@@ -123,6 +113,24 @@ {{country}}  + + Thematic + +
+ + +
+ Web page: + + {{dataProviderInfo.title.url}} + +
+ + +
+
@@ -221,6 +229,16 @@ {{dataProviderInfo.countries.join(", ")}} +
+
Jurisdiction
+ {{dataProviderInfo.jurisdiction}} +
+ +
+
Content policy
+ {{dataProviderInfo.contentpolicy}} +
+
diff --git a/landingPages/dataProvider/dataProvider.module.ts b/landingPages/dataProvider/dataProvider.module.ts index 025c71a6..f791ebbe 100644 --- a/landingPages/dataProvider/dataProvider.module.ts +++ b/landingPages/dataProvider/dataProvider.module.ts @@ -33,6 +33,7 @@ import {IconsModule} from "../../utils/icons/icons.module"; import {IconsService} from "../../utils/icons/icons.service"; import {graph} from "../../utils/icons/icons"; import {LoadingModalModule} from "../../utils/modal/loadingModal.module"; +import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; @NgModule({ imports: @@ -41,7 +42,7 @@ import {LoadingModalModule} from "../../utils/modal/loadingModal.module"; DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule, ResultLandingUtilsModule ], declarations: [StatisticsTabComponent, diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index 3ed5b775..b8deb782 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -169,6 +169,20 @@ export class DataProviderService { // this.dataProviderInfo.description = (data[0]['description'][0]) ? String(data[0]['description'][0]) : ""; // } this.dataProviderInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description?data[0].description:[]); + + this.dataProviderInfo.thematic = data[0].thematic; + + if(data[0].jurisdiction != null) { + this.dataProviderInfo.jurisdiction = data[0].jurisdiction.classname; + } + + if(data[0].contentpolicy != null) { + this.dataProviderInfo.contentpolicy = data[0].contentpolicy.classname; + } + + if(data[0].pid != null) { + this.dataProviderInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[0].pid); + } } if(data[1] != null) { diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 13cf27d8..b5c11707 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -551,7 +551,7 @@ export class ParsingFunctions { let identifiers = new Map(); if (pid.hasOwnProperty("classid") && pid['classid'] != "") { - if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid") { + if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") { if (!identifiers.has(pid.classid)) { identifiers.set(pid.classid, new Array()); } @@ -559,7 +559,7 @@ export class ParsingFunctions { } } else { for (let i = 0; i < pid.length; i++) { - if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid") { + if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data") { if (!identifiers.has(pid[i].classid)) { identifiers.set(pid[i].classid, new Array()); } @@ -583,7 +583,6 @@ export class ParsingFunctions { for (let i = 0; i < length; i++) { subject = Array.isArray(_subjects) ? _subjects[i] : _subjects; - console.log(subject); if (subject.classid != "") { if (subject.inferred && subject.inferred == true) { if(subject.classid === "SDG") { @@ -642,7 +641,6 @@ export class ParsingFunctions { } } } - console.log(this.eoscSubjectsFound); return [subjects, otherSubjects, classifiedSubjects, fos, sdg, this.eoscSubjectsFound]; } diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 70ec65ab..5203b285 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -26,7 +26,7 @@ import {properties} from "../../../../environments/environment"; {{key}}: - {{item}} @@ -115,6 +115,8 @@ export class ShowIdentifiersComponent implements AfterViewInit { return properties.pmidURL; } else if(key == "handle") { return properties.handleURL; + } else if(key == "re3data") { + return properties.r3DataURL; } } diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index b961b16a..8b194ece 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -957,7 +957,7 @@ export class NewSearchPageComponent { let params = ""; let doisParams = ""; var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value); - if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result")) { + if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "datasource" || entityType == "service")) { for (let identifier of DOIs) { // console.log(identifier) // pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\" diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index fdae6660..7d54195f 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -345,7 +345,12 @@ export class SearchDataprovidersService { result['countries'] = res[0]; result['subjects'] = this.getDataproviderSubjects(resData); //console.log(result['subjects']); - results.push(result); + + if(resData['pid']) { + result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']); + } + + results.push(result); } return results; diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index df0adb95..8688fe3f 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -27,6 +27,10 @@ export class DataProviderInfo { journal: {"journal": "", "issn": string, "lissn": string, "eissn": string}; description: string[] = []; subjects: string[]; + jurisdiction: string; + thematic: boolean; + contentpolicy: string; + identifiers: Map; //key is the classname fundedContent: string; // search query diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index bf517bbc..15ab8fa6 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -149,7 +149,7 @@ export class DOI { } export class Identifier { - class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" = null; + class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" = null; id: string; public static getDOIsFromString(str: string): string[] { @@ -200,6 +200,8 @@ export class Identifier { return {"class": "pmid", "id": pid}; } else if (Identifier.isValidHANDLE(pid)) { return {"class": "handle", "id": pid}; + } else if (Identifier.isValidRe3Data(pid)) { + return {"class": "re3data", "id": pid}; } //set it as a doi, to catch the case that doi has not valid format return (strict?null:{"class": "doi", "id": pid}); @@ -250,6 +252,11 @@ export class Identifier { let exp = /^[0-9a-zA-Z-]*\/[0-9a-zA-Z-]*$/g; return str.match(exp) != null; } + + public static isValidRe3Data(str: string): boolean { + let exp = /(r3d[1-9]\d{0,8})/g; + return str.match(exp) != null; + } } export class StringUtils { From 64b0e163fa1231154019e63a626fddf77a7ce421 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 May 2022 17:14:50 +0300 Subject: [PATCH 2/2] [Aggregator & Library | new-theme]: [Bug fix] Set properly "dashboard" and "adminToolsPortalType" properties and show "Check compatible EOSC services" button in eosc portal too. 1. env-properties.ts: a. In Dashboard type added "aggregator". b. In PortalType added "funder", "ri", "project", "organization", "aggregator", "eosc". 2. environments/: Set "dashboard" property to "aggregator" and only for eosc set "adminToolsPortalType" property to "eosc". 3. entitiesSelection.component.ts: Added check if adminToolsPortalType is "eosc". 4. resultLanding.component.ts: In method "hasRightSidebarInfo()" check if adminToolsPortalType is "eosc" to show "Check compatible EOSC services" button. 5. resultLanding.component.html: Show "Check compatible EOSC services" for adminToolsPortalType "explore" or "eosc". --- landingPages/result/resultLanding.component.html | 4 ++-- landingPages/result/resultLanding.component.ts | 3 ++- searchPages/searchUtils/entitiesSelection.component.ts | 2 +- utils/properties/env-properties.ts | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 7d697502..ae640db0 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -369,7 +369,7 @@
- -
1 && (properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'eosc') && (properties.environment == 'beta' || properties.environment == 'development') && (!viewAll || viewAll=='egiNotebook')"> 0) diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 21c6c349..97e7981f 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -40,7 +40,7 @@ export class EntitiesSelectionComponent { /** TODO change conditions base on PortalType instead of customFilter */ ngOnInit() { - if ((this.customFilter && this.customFilter.queryFieldName == "communityId") || (['explore', 'aggregator'].includes(this.properties.adminToolsPortalType))) { + if ((this.customFilter && this.customFilter.queryFieldName == "communityId") || (['explore', 'aggregator', 'eosc'].includes(this.properties.adminToolsPortalType))) { this.subscriptions.push(this.config.communityInformationState.subscribe(data => { if (data) { let showEntity = {}; diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index dcc85cd0..e710c8c4 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -1,6 +1,6 @@ export type Environment = "development" | "test" | "beta" | "production"; -export type Dashboard = "explore" | "connect" | "monitor"; -export type PortalType = "explore" | "connect" | "community" | "monitor" | "aggregator"; +export type Dashboard = "explore" | "connect" | "monitor" | "aggregator"; +export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc"; export interface EnvProperties { environment?: Environment;