From 3bd6a28c1b90980135c04d6d4b52714357fa1853 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 3 Nov 2022 12:15:13 +0200 Subject: [PATCH 1/4] move fos/sdg component to openaireLibrary submodule --- fos/fos-routing.module.ts | 13 +++ fos/fos.component.html | 159 +++++++++++++++++++++++++++ fos/fos.component.less | 5 + fos/fos.component.ts | 219 ++++++++++++++++++++++++++++++++++++++ fos/fos.module.ts | 34 ++++++ sdg/sdg-routing.module.ts | 13 +++ sdg/sdg.component.html | 72 +++++++++++++ sdg/sdg.component.less | 30 ++++++ sdg/sdg.component.ts | 97 +++++++++++++++++ sdg/sdg.module.ts | 34 ++++++ 10 files changed, 676 insertions(+) create mode 100644 fos/fos-routing.module.ts create mode 100644 fos/fos.component.html create mode 100644 fos/fos.component.less create mode 100644 fos/fos.component.ts create mode 100644 fos/fos.module.ts create mode 100644 sdg/sdg-routing.module.ts create mode 100644 sdg/sdg.component.html create mode 100644 sdg/sdg.component.less create mode 100644 sdg/sdg.component.ts create mode 100644 sdg/sdg.module.ts diff --git a/fos/fos-routing.module.ts b/fos/fos-routing.module.ts new file mode 100644 index 00000000..fb248a66 --- /dev/null +++ b/fos/fos-routing.module.ts @@ -0,0 +1,13 @@ +import {NgModule} from '@angular/core'; +import {RouterModule} from '@angular/router'; + +import {FosComponent} from './fos.component'; +import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: FosComponent, canDeactivate: [PreviousRouteRecorder] } + ]) + ] +}) +export class FosRoutingModule { } diff --git a/fos/fos.component.html b/fos/fos.component.html new file mode 100644 index 00000000..af6ee6e0 --- /dev/null +++ b/fos/fos.component.html @@ -0,0 +1,159 @@ + +
+
+ +
+
+
+
+
+ + Beta + +
+

+ Fields of Science . +

+
+ We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Research Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential. +
+
+ Our work is based on the work from our partner Athena Research Center: SciNoBo : A Hierarchical Multi-Label Classifier of Scientific Publications - https://doi.org/10.1145/3487553.3524677 +
+ + +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ + +
+ + +
+
+
+
+ + + + +
+
+

+ + +

+
+
+

+ + +

+
+ + +
+
+
+
+
+
+
+
+ +
+

No results were found.

+
+
+
+
+
diff --git a/fos/fos.component.less b/fos/fos.component.less new file mode 100644 index 00000000..c8020e14 --- /dev/null +++ b/fos/fos.component.less @@ -0,0 +1,5 @@ +@import (reference) "~src/assets/openaire-theme/less/_import-variables"; + +.custom-bottom-border { + border-bottom: 5px solid fade(@explore-color, @global-opacity); +} diff --git a/fos/fos.component.ts b/fos/fos.component.ts new file mode 100644 index 00000000..0fc13908 --- /dev/null +++ b/fos/fos.component.ts @@ -0,0 +1,219 @@ +import {HttpClient} from "@angular/common/http"; +import {ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild} from "@angular/core"; +import {Subscription} from "rxjs"; + +import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component"; +import {EnvProperties} from "../utils/properties/env-properties"; +import {properties} from "src/environments/environment"; +import {FormBuilder, FormControl} from "@angular/forms"; +import {ActivatedRoute, Router} from "@angular/router"; +import {Meta, Title} from "@angular/platform-browser"; +import {Location} from "@angular/common"; +import {StringUtils} from "../utils/string-utils.class"; +import {SEOService} from "../sharedComponents/SEO/SEO.service"; +import {PiwikService} from "../utils/piwik/piwik.service"; +import {debounceTime, distinctUntilChanged} from "rxjs/operators"; +import Timeout = NodeJS.Timeout; + +declare var UIkit; + +@Component({ + selector: 'fos', + templateUrl: 'fos.component.html', + styleUrls: ['fos.component.less'] +}) +export class FosComponent implements OnInit, OnDestroy { + public url: string = null; + public pageTitle: string = "OpenAIRE | Fields of Science"; + public pageDescription: string = "We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Research Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential."; + + public fos: any[] = []; + public fosOptions: string[] = []; + public activeSection: string; + + public keywordControl: FormControl; + public keyword: string; + + public viewResults = []; + + public result = []; + + properties: EnvProperties = properties; + public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Fields of Science'}]; + + private subscriptions: Subscription[] = []; + private observer: IntersectionObserver; + private timeout: Timeout; + @ViewChild('tabs') tabs: ElementRef; + public sliderInit: boolean = false; + + constructor( + private httpClient: HttpClient, + private fb: FormBuilder, + private location: Location, + private route: ActivatedRoute, + private _router: Router, + private _meta: Meta, + private _title: Title, + private seoService: SEOService, + private _piwikService: PiwikService, + private cdr: ChangeDetectorRef + ) {} + + ngOnInit() { + if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { + this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe()); + } + this.url = this.properties.domain + this.properties.baseLink + this._router.url; + this.seoService.createLinkForCanonicalURL(this.url); + this.updateUrl(this.url); + this.updateTitle(this.pageTitle); + this.updateDescription(this.pageDescription); + this.httpClient.get(properties.domain+'/assets/common-assets/vocabulary/fos.json').subscribe(data => { + this.fos = data['fos']; + this.convertFosToOptions(); + if (typeof document !== 'undefined') { + setTimeout(()=> { + let slider = UIkit.slider(this.tabs.nativeElement); + slider.clsActive = 'uk-slider-active'; + slider.updateActiveClasses(); + this.sliderInit = true; + slider.slides.forEach(item => { + item.classList.remove('uk-active'); + }); + if (this.route.snapshot.fragment) { + this.activeSection = this.route.snapshot.fragment; + let i = this.fos.findIndex(item => item.id == this.route.snapshot.fragment); + slider.show(i); + } else { + this.activeSection = this.fos[0].id; + } + this.cdr.detectChanges(); + }); + } + this.subscriptions.push(this.route.fragment.subscribe(fragment => { + if(fragment) { + this.activeSection = fragment; + if(this.tabs) { + let slider = UIkit.slider(this.tabs.nativeElement); + let i = this.fos.findIndex(item => item.id == fragment); + slider.show(i); + } + } else { + this.activeSection = this.fos[0].id; + } + })); + this.keywordControl = this.fb.control(''); + this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => { + this.keyword = value; + this.findMatches(this.keyword); + if (typeof document !== 'undefined') { + setTimeout(() => { + this.setObserver(); + }); + } + })); + }); + } + + public ngOnDestroy() { + for (let sub of this.subscriptions) { + sub.unsubscribe(); + } + if(this.observer) { + this.observer.disconnect(); + } + } + + private setObserver() { + if(this.observer) { + this.observer.disconnect(); + } + this.observer = new IntersectionObserver((entries) => { + entries.forEach(entry => { + if(entry.isIntersecting) { + if(this.timeout) { + clearTimeout(this.timeout); + } + this.timeout = setTimeout(() => { + this._router.navigate(['./'], {fragment: entry.target.id, relativeTo: this.route, state: {disableScroll: true}}); + }, 200); + } + }); + }, {threshold: 0.25, rootMargin: '-100px'}); + this.fos.forEach(fos => { + let element = document.getElementById(fos.id); + if(element) { + this.observer.observe(element); + } + }); + } + + convertFosToOptions() { + this.fosOptions = []; + this.fos.forEach(fos => { + this.fosOptions.push(fos.id); + if(fos.children) { + fos.children.forEach(child => { + this.fosOptions.push(child.id); + if(child.children) { + child.children.forEach(child2 => { + this.fosOptions.push(child2.id); + }); + } + }); + } + }); + } + + findMatches(value: string) { + this.viewResults = JSON.parse(JSON.stringify(this.fos)); + let matchLevel1: boolean = false; + let matchLevel2: boolean = false; + // 1st level search + if(this.viewResults.length) { + this.viewResults = this.viewResults.filter(item => { + matchLevel1 = !!item.id.includes(value?.toLowerCase()); + // // 2nd level search + if(item.children?.length && !matchLevel1) { + item.children = item.children.filter(subItem => { + matchLevel2 = !!subItem.id.includes(value?.toLowerCase()); + // 3rd level search + if(subItem.children?.length && !matchLevel2) { + subItem.children = subItem.children.filter(subSubItem => subSubItem.id.includes(value?.toLowerCase())); + } + return subItem.children?.length > 0 || matchLevel2; + }); + } + return item.children?.length > 0; + }); + } + } + + highlightKeyword(name) { + if(name.includes(this.keyword.toLowerCase())) { + return name.replace(new RegExp(this.keyword, "gi"), (matchedValue) => `${matchedValue}`); + } else { + return name; + } + } + + public urlEncodeAndQuote(str: string): string { + return StringUtils.quote(StringUtils.URIEncode(str)); + } + + private updateUrl(url: string) { + this._meta.updateTag({content: url}, "property='og:url'"); + } + + private updateTitle(title: string) { + var _title = ((title.length > 50) ? title.substring(0, 50) : title); + this._title.setTitle(_title); + this._meta.updateTag({content: _title}, "property='og:title'"); + } + + private updateDescription(description: string) { + this._meta.updateTag({content: description}, "name='description'"); + this._meta.updateTag({content: description}, "property='og:description'"); + } +} diff --git a/fos/fos.module.ts b/fos/fos.module.ts new file mode 100644 index 00000000..d0f1f833 --- /dev/null +++ b/fos/fos.module.ts @@ -0,0 +1,34 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {FormsModule} from "@angular/forms"; +import {RouterModule} from "@angular/router"; +import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; +import {IconsModule} from "../utils/icons/icons.module"; +import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; +import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; +import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; +import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; +import {PiwikService} from "../utils/piwik/piwik.service"; + +import {FosRoutingModule} from './fos-routing.module'; +import {FosComponent} from './fos.component'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, RouterModule, + FosRoutingModule, BreadcrumbsModule, IconsModule, + SearchInputModule, Schema2jsonldModule, SEOServiceModule + ], + declarations: [ + FosComponent + ], + providers: [ + PreviousRouteRecorder, PiwikService + ], + exports: [ + FosComponent + ] +}) +export class FosModule { + +} \ No newline at end of file diff --git a/sdg/sdg-routing.module.ts b/sdg/sdg-routing.module.ts new file mode 100644 index 00000000..96963f04 --- /dev/null +++ b/sdg/sdg-routing.module.ts @@ -0,0 +1,13 @@ +import {NgModule} from '@angular/core'; +import {RouterModule} from '@angular/router'; + +import {SdgComponent} from './sdg.component'; +import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SdgComponent, canDeactivate: [PreviousRouteRecorder] } + ]) + ] +}) +export class SdgRoutingModule { } diff --git a/sdg/sdg.component.html b/sdg/sdg.component.html new file mode 100644 index 00000000..2bad4bed --- /dev/null +++ b/sdg/sdg.component.html @@ -0,0 +1,72 @@ + +
+
+ +
+
+
+
+
+ + Beta + +

+ Science for UN Sustainable Development Goals +

+

+ Laying the foundation for new approaches and solutions. +

+
+ We have developed a classification scheme for UN Sustainable Development Goals, to view contributions of research towards complex challenges for humanity such as climate change, biodiversity loss, pollution and poverty reduction. +
+
+ + +
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+ +
+
diff --git a/sdg/sdg.component.less b/sdg/sdg.component.less new file mode 100644 index 00000000..d24ff52d --- /dev/null +++ b/sdg/sdg.component.less @@ -0,0 +1,30 @@ +@import (reference) "~src/assets/openaire-theme/less/_import-variables"; + +@sdgs: #E6233D, #DF9F00, #19A220, #D70023, #FF0B00, #00BFE8, #FFC300, #B10240, #FF5D00, +#F50D86, #FF8A00, #CA8A03, #2B772B, #0098DF, #00B91C, #0069A2, #1C336A; + +custom-sdg-dot:after { + content: ""; + background-image: url("~src/assets/common-assets/sdg/sdg-dot-img.svg"); + display: inline-block; + background-size: 100% 100%; + height: 18px; + width: 18px; + margin-left: 10px; +} + +.sdg-card { + width: 265px; + height: 255px; + + img { + height: @global-control-height; + width: auto; + } + + each(@sdgs, { + &.sdg-@{index} { + background-color: @value !important; + } + }) +} diff --git a/sdg/sdg.component.ts b/sdg/sdg.component.ts new file mode 100644 index 00000000..ca24d9ae --- /dev/null +++ b/sdg/sdg.component.ts @@ -0,0 +1,97 @@ +import {HttpClient} from "@angular/common/http"; +import {Component, OnDestroy, OnInit} from "@angular/core"; +import {Subscription} from "rxjs"; + +import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component"; +import {EnvProperties} from "../utils/properties/env-properties"; +import {properties} from "src/environments/environment"; +import {RefineFieldResultsService} from "../services/refineFieldResults.service"; +import {OpenaireEntities} from "../utils/properties/searchFields"; +import {StringUtils} from "../utils/string-utils.class"; +import {Router} from '@angular/router'; +import {Meta, Title} from "@angular/platform-browser"; +import {SEOService} from "../sharedComponents/SEO/SEO.service"; +import {PiwikService} from "../utils/piwik/piwik.service"; + +@Component({ + selector: 'sdg', + templateUrl: 'sdg.component.html', + styleUrls: ['sdg.component.less'] +}) +export class SdgComponent implements OnInit, OnDestroy { + public url: string = null; + public pageTitle: string = "OpenAIRE | Sustainable Development Goals"; + public pageDescription: string = "Laying the foundation for new approaches and solutions. We have developed a classification scheme for UN Sustainable Development Goals, to view contributions of research towards complex challenges for humanity such as climate change, biodiversity loss, pollution and poverty reduction."; + + private sdgs: any = []; + private sdgsResearchOutcomes: any = []; + public displayedSdgs: any = []; + + public loading: boolean; + properties: EnvProperties = properties; + openaireEntities = OpenaireEntities; + public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Sustainable Development Goals'}]; + + subscriptions: Subscription[] = []; + + constructor( + private httpClient: HttpClient, private refineFieldResultsService: RefineFieldResultsService, + private _router: Router, + private _meta: Meta, + private _title: Title, + private seoService: SEOService, + private _piwikService: PiwikService + ) {} + + ngOnInit() { + this.loading = true; + if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { + this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe()); + } + this.url = this.properties.domain + this.properties.baseLink + this._router.url; + this.seoService.createLinkForCanonicalURL(this.url); + this.updateUrl(this.url); + this.updateTitle(this.pageTitle); + this.updateDescription(this.pageDescription); + this.httpClient.get(properties.domain+'/assets/common-assets/vocabulary/sdg.json').subscribe(data => { + this.sdgs = data['sdg']; + }); + this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['sdg'], 'result', this.properties, null).subscribe(data => { + this.sdgsResearchOutcomes = data[1][0].values; + let merged =[]; + for(let i=0; i innerItem.id === this.sdgs[i].id)) + }); + } + this.displayedSdgs = merged; + this.loading = false; + }); + } + + public ngOnDestroy() { + for (let sub of this.subscriptions) { + sub.unsubscribe(); + } + } + + public urlEncodeAndQuote(str: string): string { + return StringUtils.quote(StringUtils.URIEncode(str)); + } + + private updateUrl(url: string) { + this._meta.updateTag({content: url}, "property='og:url'"); + } + + private updateTitle(title: string) { + var _title = ((title.length > 50) ? title.substring(0, 50) : title); + this._title.setTitle(_title); + this._meta.updateTag({content: _title}, "property='og:title'"); + } + + private updateDescription(description: string) { + this._meta.updateTag({content: description}, "name='description'"); + this._meta.updateTag({content: description}, "property='og:description'"); + } +} diff --git a/sdg/sdg.module.ts b/sdg/sdg.module.ts new file mode 100644 index 00000000..258d0e01 --- /dev/null +++ b/sdg/sdg.module.ts @@ -0,0 +1,34 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {FormsModule} from "@angular/forms"; +import {RouterModule} from "@angular/router"; +import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; +import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; +import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module"; +import {LoadingModule} from "../utils/loading/loading.module"; +import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; +import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; +import {PiwikService} from "../utils/piwik/piwik.service"; + +import {SdgRoutingModule} from './sdg-routing.module'; +import {SdgComponent} from './sdg.component'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, RouterModule, + SdgRoutingModule, BreadcrumbsModule, RefineFieldResultsServiceModule, + LoadingModule, Schema2jsonldModule, SEOServiceModule + ], + declarations: [ + SdgComponent + ], + providers: [ + PreviousRouteRecorder, PiwikService + ], + exports: [ + SdgComponent + ] +}) +export class SdgModule { + +} \ No newline at end of file From 510d48d9bf9b45b33c7be68aeeb47695e1d56905 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 3 Nov 2022 15:55:10 +0200 Subject: [PATCH 2/4] add piwikId and customFilter parameters for fos/sdg components --- fos/fos.component.ts | 5 +++-- sdg/sdg.component.ts | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fos/fos.component.ts b/fos/fos.component.ts index 0fc13908..926fd219 100644 --- a/fos/fos.component.ts +++ b/fos/fos.component.ts @@ -1,5 +1,5 @@ import {HttpClient} from "@angular/common/http"; -import {ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild} from "@angular/core"; +import {ChangeDetectorRef, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild} from "@angular/core"; import {Subscription} from "rxjs"; import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component"; @@ -26,6 +26,7 @@ export class FosComponent implements OnInit, OnDestroy { public url: string = null; public pageTitle: string = "OpenAIRE | Fields of Science"; public pageDescription: string = "We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Research Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential."; + @Input() piwikSiteId = null; public fos: any[] = []; public fosOptions: string[] = []; @@ -62,7 +63,7 @@ export class FosComponent implements OnInit, OnDestroy { ngOnInit() { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe()); } this.url = this.properties.domain + this.properties.baseLink + this._router.url; this.seoService.createLinkForCanonicalURL(this.url); diff --git a/sdg/sdg.component.ts b/sdg/sdg.component.ts index ca24d9ae..f3bde8be 100644 --- a/sdg/sdg.component.ts +++ b/sdg/sdg.component.ts @@ -1,7 +1,6 @@ import {HttpClient} from "@angular/common/http"; -import {Component, OnDestroy, OnInit} from "@angular/core"; +import {Component, Input, OnDestroy, OnInit} from "@angular/core"; import {Subscription} from "rxjs"; - import {Breadcrumb} from "../utils/breadcrumbs/breadcrumbs.component"; import {EnvProperties} from "../utils/properties/env-properties"; import {properties} from "src/environments/environment"; @@ -22,6 +21,7 @@ export class SdgComponent implements OnInit, OnDestroy { public url: string = null; public pageTitle: string = "OpenAIRE | Sustainable Development Goals"; public pageDescription: string = "Laying the foundation for new approaches and solutions. We have developed a classification scheme for UN Sustainable Development Goals, to view contributions of research towards complex challenges for humanity such as climate change, biodiversity loss, pollution and poverty reduction."; + @Input() piwikSiteId = null; private sdgs: any = []; private sdgsResearchOutcomes: any = []; @@ -30,6 +30,7 @@ export class SdgComponent implements OnInit, OnDestroy { public loading: boolean; properties: EnvProperties = properties; openaireEntities = OpenaireEntities; + @Input() customFilter = null; public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Sustainable Development Goals'}]; subscriptions: Subscription[] = []; @@ -46,9 +47,10 @@ export class SdgComponent implements OnInit, OnDestroy { ngOnInit() { this.loading = true; if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe()); + this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe()); } this.url = this.properties.domain + this.properties.baseLink + this._router.url; + console.log(this.url); this.seoService.createLinkForCanonicalURL(this.url); this.updateUrl(this.url); this.updateTitle(this.pageTitle); @@ -56,7 +58,12 @@ export class SdgComponent implements OnInit, OnDestroy { this.httpClient.get(properties.domain+'/assets/common-assets/vocabulary/sdg.json').subscribe(data => { this.sdgs = data['sdg']; }); - this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['sdg'], 'result', this.properties, null).subscribe(data => { + let refineParams = null; + if(this.customFilter) { + let refineValue = StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId))); + refineParams = '&fq=' + refineValue; + } + this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['sdg'], 'result', this.properties, refineParams).subscribe(data => { this.sdgsResearchOutcomes = data[1][0].values; let merged =[]; for(let i=0; i Date: Thu, 3 Nov 2022 16:04:51 +0200 Subject: [PATCH 3/4] remove console.log from sdg component --- sdg/sdg.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/sdg/sdg.component.ts b/sdg/sdg.component.ts index f3bde8be..47cffd86 100644 --- a/sdg/sdg.component.ts +++ b/sdg/sdg.component.ts @@ -50,7 +50,6 @@ export class SdgComponent implements OnInit, OnDestroy { this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe()); } this.url = this.properties.domain + this.properties.baseLink + this._router.url; - console.log(this.url); this.seoService.createLinkForCanonicalURL(this.url); this.updateUrl(this.url); this.updateTitle(this.pageTitle); From cb57b78351af8ce08e178ff1bc69d73c43044cc2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 7 Nov 2022 12:55:55 +0200 Subject: [PATCH 4/4] [Library]: searchResult.ts & result-preview.ts: Added field objId: string; | searchResearchResults.service.ts: Set in parsing objId | result-preview.component.html: Updated link to Bip Finder - use objId (openaire id) instead of id (pid related). --- services/searchResearchResults.service.ts | 1 + utils/entities/searchResult.ts | 1 + utils/result-preview/result-preview.component.html | 4 ++-- utils/result-preview/result-preview.ts | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 023aba7d..4609e22c 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -315,6 +315,7 @@ export class SearchResearchResultsService { } result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; + result['objId'] = result['id']; let canId = ParsingFunctions.parseRelCanonicalId(Array.isArray(data) ? data[i] : data, "result"); if (canId) { result['id'] = canId; diff --git a/utils/entities/searchResult.ts b/utils/entities/searchResult.ts index 490a5c9f..63bb5054 100644 --- a/utils/entities/searchResult.ts +++ b/utils/entities/searchResult.ts @@ -4,6 +4,7 @@ export class SearchResult { title: ResultTitle; id: string; relcanId: string; + objId: string; DOIs: string[]=[]; identifiers: Map; measure: Array; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 942b2552..6d4321a5 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -346,7 +346,7 @@ Popularity: Citation-based measure reflecting the current impact. @@ -385,7 +385,7 @@ Influence: Citation-based measure reflecting the total impact. diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index e2c79a92..7e9d5d1f 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -72,6 +72,7 @@ export interface Organization { } export class ResultPreview { + objId: string; relcanId: string; id: string; title: string; @@ -146,6 +147,7 @@ export class ResultPreview { let resultPreview: ResultPreview = new ResultPreview(); resultPreview.id = result.id; resultPreview.relcanId = result.relcanId; + resultPreview.objId = result.objId; resultPreview.title = result.title.name; resultPreview.accessMode = result.title.accessMode; // resultPreview.sc39 = result.title.sc39;