From b25c6dd2f79dbfed406a05642f4036f2c7b842ee Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 9 Mar 2023 10:54:03 +0200 Subject: [PATCH] [Library | develop & EOSC Explore | master]: Redirect to eosc search for any page except landing | If property adminToolsPortalType is eosc, open search links to OpenAIRE Explore in a new tab. 1. home.component.html: Commented everything. 2. home.component.ts: Commented everything and added redirect to EOSC search. 3. app.component.ts: Commented . 4. app-routing.module.ts: Removed unused routes | For any route other than landing, redirect to home page. 5. index.html: Removed BETA badge | Updated title from "Search OpenAIRE" to "Search EOSC". 6. errorPage.component.ts & relatedDatasourcesTab.component.ts & showAuthors.component.ts & search-tab.component.ts: If property adminToolsPortalType is eosc, open search page in OpenAIRE Explore in a new tab. 7. fos.component.ts & sdg.component.ts: If property adminToolsPortalType is eosc, open search page in OpenAIRE Explore in a new tab | If property adminToolsPortalType is eosc, do not show "feedback/suggest" link. 8. open-aire-jsonld-converter.service.ts: If property adminToolsPortalType is eosc, do not add fos and sdgs as doc.isPartOf. --- error/errorPage.component.ts | 15 ++++++++++++++- .../relatedDatasourcesTab.component.ts | 12 ++++++++---- landingPages/landing-utils/fos.component.ts | 16 ++++++++++++---- landingPages/landing-utils/sdg.component.ts | 15 +++++++++++---- .../open-aire-jsonld-converter.service.ts | 18 ++++++++++-------- utils/authors/showAuthors.component.ts | 7 ++++++- utils/tabs/contents/search-tab.component.ts | 16 ++++++++++++++-- 7 files changed, 75 insertions(+), 24 deletions(-) diff --git a/error/errorPage.component.ts b/error/errorPage.component.ts index afddac90..c0526aab 100644 --- a/error/errorPage.component.ts +++ b/error/errorPage.component.ts @@ -7,6 +7,7 @@ import {properties} from "../../../environments/environment"; import {RESPONSE} from '../utils/tokens'; import {Response} from 'express'; import {OpenaireEntities} from "../utils/properties/searchFields"; +import {EnvProperties} from "../utils/properties/env-properties"; @Component({ selector: 'error', @@ -23,7 +24,8 @@ import {OpenaireEntities} from "../utils/properties/searchFields";
Not valid or missing {{page_type_name}} id. - Search another {{page_type_name}}? + Search another {{page_type_name}}? + Search another {{page_type_name}} in OpenAIRE?

@@ -48,7 +50,9 @@ export class ErrorPageComponent { public page_type: string; public searchPage: string; public searchPagePrams: {}; + public searchPagePramsString: string = ""; public page_type_name: string; + public properties: EnvProperties = properties; constructor (private _location: Location, private _meta: Meta, private _title: Title, private route: ActivatedRoute, @@ -84,17 +88,21 @@ export class ErrorPageComponent { if (this.page_type == "publication") { this.searchPage = properties.searchLinkToResults; this.searchPagePrams = {type: 'publications'} + this.searchPagePramsString = "&type=publications"; this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase(); } else if (this.page_type == "software") { this.searchPage = properties.searchLinkToResults; this.searchPagePrams = {type: 'software'} + this.searchPagePramsString = "&type=software"; this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase(); } else if (this.page_type == "dataset") { this.searchPagePrams = {type: 'datasets'} + this.searchPagePramsString = "&type=datasets"; this.searchPage = properties.searchLinkToResults; this.page_type_name = OpenaireEntities.DATASET.toLowerCase(); } else if (this.page_type == "orp") { this.searchPagePrams = {type: 'orps'} + this.searchPagePramsString = "&type=orps"; this.searchPage = properties.searchLinkToResults; this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase(); } else if (this.page_type == "organization") { @@ -113,6 +121,11 @@ export class ErrorPageComponent { this.searchPage = properties.searchLinkToResults; this.page_type_name = OpenaireEntities.RESULT.toLowerCase(); } + + + if(properties.adminToolsPortalType == 'eosc') { + this.searchPage = "https://explore.openaire.eu"+this.searchPage+this.searchPagePramsString; + } } }); } diff --git a/landingPages/dataProvider/relatedDatasourcesTab.component.ts b/landingPages/dataProvider/relatedDatasourcesTab.component.ts index f5e7da2f..c4671349 100644 --- a/landingPages/dataProvider/relatedDatasourcesTab.component.ts +++ b/landingPages/dataProvider/relatedDatasourcesTab.component.ts @@ -46,10 +46,14 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; - + + {{result.count | number}} + + {{result.count | number}} diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index c1ffc00a..7f004327 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -14,17 +14,25 @@ import {StringUtils} from "../../utils/string-utils.class"; {{title}} - + View all + + View all & feedback - Feedback
diff --git a/landingPages/landing-utils/sdg.component.ts b/landingPages/landing-utils/sdg.component.ts index c8ba6336..3be35a5d 100644 --- a/landingPages/landing-utils/sdg.component.ts +++ b/landingPages/landing-utils/sdg.component.ts @@ -15,10 +15,13 @@ import {StringUtils} from "../../utils/string-utils.class"; {{title}} - + View all + View all & feedback - Feedback
@@ -27,8 +30,12 @@ import {StringUtils} from "../../utils/string-utils.class"; loading="lazy" alt="sdg_colors" style="width:27px; height:27px">
diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts index 2f9dc612..54d42f10 100644 --- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts +++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts @@ -112,14 +112,16 @@ export class OpenAireJsonldConverterService { doc.license = this.getLicense(result); doc.keyword = this.getKeyword(result); doc.isPartOf = []; - let fosSubjects = this.getKeyword(result,"FOS"); - let sdgSubjects = this.getKeyword(result,"SDG"); - for(let fos of fosSubjects?fosSubjects:[]){ - doc.isPartOf.push(URL.split('/search/')[0]+ searchActionRoute + "?fos=" + encodeURIComponent('"'+fos+'"')); - } - for(let sdg of sdgSubjects?sdgSubjects:[] ){ - doc.isPartOf.push(URL.split('/search/')[0]+ searchActionRoute + "?sdg=" + encodeURIComponent('"'+sdg+'"')); - } + if(properties.adminToolsPortalType !== 'eosc') { + let fosSubjects = this.getKeyword(result, "FOS"); + let sdgSubjects = this.getKeyword(result, "SDG"); + for (let fos of fosSubjects ? fosSubjects : []) { + doc.isPartOf.push(URL.split('/search/')[0] + searchActionRoute + "?fos=" + encodeURIComponent('"' + fos + '"')); + } + for (let sdg of sdgSubjects ? sdgSubjects : []) { + doc.isPartOf.push(URL.split('/search/')[0] + searchActionRoute + "?sdg=" + encodeURIComponent('"' + sdg + '"')); + } + } return doc; } diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index b31ea38e..27aa7e0c 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -60,12 +60,17 @@ import {properties} from "../../../../environments/environment"; {{author.fullName}} in OpenAIRE
diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index daa12d88..198f4cbc 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -7,7 +7,7 @@ import {StringUtils} from "../../string-utils.class"; @Component({ selector: 'search-tab', template: ` - @@ -19,10 +19,14 @@ import {StringUtils} from "../../string-utils.class"; {{customTitle}}
- + View all in search page + + View all in OpenAIRE +
@@ -72,4 +76,12 @@ export class SearchTabComponent { get results() { return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results; } + + get paramsForExternalUrl() { + let parameters: string = ""; + Object.keys(this.params).forEach(paramKey => { + parameters += (parameters ? "&" : "?") + paramKey+"="+this.params[paramKey]; + }) + return parameters; + } }