From 83984ddf79b04a7bad70cac7a44d33ba365654db Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 4 May 2022 18:09:35 +0300 Subject: [PATCH] [Explore & Library & common-assets | new-theme]: No animation in sticky tabs | Tabs stop being sticky when bottom component is in viewport | Updates in powered by bottom message | Updates in statistics in datasource landing. 1. landing-utils.css: Commented transition ease-out in #main-tabs-div. 2. app.component.ts: Added id="bottom" in . 3. newSearchPage.component.html: Updated "Powered by OpenAIRE Research Graph" to make the link underlined on hover. 4. metrics.component.ts: Add classes "uk-text-small uk-text-meta" in "Powered by". 5. resultLanding.component.html & project.component.html & dataProvider.component.html: a. Updated "Powered by OpenAIRE Research Graph" to make the link underlined on hover. b. Add uk-sticky attribute in id="main-tabs-div" only if shouldSticky is true (bottom is not in the viewport). 6. resultLanding.component.ts & project.component.ts & dataProvider.component.ts: Added fields shouldSticky and observer, check in ngAfterViewInit() if bottom is intersecting and kill the observer in ngOnDestroy(). 7. statisticsTab.component.ts: Added customContainerClass="uk-background-default" customIframeClass="uk-blend-multiply" in . 8. showAuthors.component.ts: [Bug fix] In "View less authors" make only the link clickable, not the whole row. --- .../dataProvider/dataProvider.component.html | 8 ++++---- .../dataProvider/dataProvider.component.ts | 16 ++++++++++++++++ .../dataProvider/dataProvider.service.ts | 2 -- .../dataProvider/statisticsTab.component.ts | 15 ++++++++++----- .../landing-utils/metrics/metrics.component.ts | 2 +- landingPages/project/project.component.html | 8 ++++---- landingPages/project/project.component.ts | 16 ++++++++++++++++ .../result/resultLanding.component.html | 8 ++++---- landingPages/result/resultLanding.component.ts | 17 ++++++++++++++++- .../searchUtils/newSearchPage.component.html | 5 +++-- utils/authors/showAuthors.component.ts | 4 ++-- 11 files changed, 76 insertions(+), 25 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index 4c42e5e8..fcecfd70 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -49,9 +49,9 @@
- - Powered by OpenAIRE Research Graph - + + Powered by OpenAIRE Research Graph + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} @@ -125,7 +125,7 @@
diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index 79ea718b..b4e19223 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -124,6 +124,9 @@ export class DataProviderComponent { public graph_offset: number = 0; @ViewChild("graph_and_feedback") graph_and_feedback; + public shouldSticky: boolean = true; + private observer: IntersectionObserver; + subscriptions = []; properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; @@ -185,6 +188,15 @@ export class DataProviderComponent { ngAfterViewInit() { if (typeof document !== 'undefined') { this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + let bottom = document.getElementById('bottom'); + if(bottom) { + this.observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + this.shouldSticky = !entry.isIntersecting; + }) + }); + this.observer.observe(bottom); + } } } @@ -242,6 +254,10 @@ export class DataProviderComponent { this.fetchPublications.clearSubscriptions(); this.fetchDataproviders.clearSubscriptions(); this.fetchProjects.clearSubscriptions(); + + if(this.observer) { + this.observer.disconnect(); + } } private getDataProviderInfo(id: string) { diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index 28c150ad..92ad7fcb 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -153,8 +153,6 @@ export class DataProviderService { } } - console.log(this.dataProviderInfo.provenance); - this.dataProviderInfo.subjects = []; length = Array.isArray(data[0]['subjects']) ? data[0]['subjects'].length : 1; for(let i=0; i
Produced {{openaireEntities.RESULTS}} per year
- +
{{openaireEntities.RESULTS}} Types
- +
@@ -36,7 +38,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
{{openaireEntities.RESULTS}} per funder
- +
@@ -44,7 +47,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; class="uk-padding uk-padding-remove-top">
{{openaireEntities.PROJECTS}} with most {{openaireEntities.PUBLICATIONS}}
- +
@@ -52,7 +56,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; class="uk-padding uk-padding-remove-top">
{{openaireEntities.PROJECTS}} with most {{openaireEntities.DATASETS}}
- +
diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts index 51d57651..a746ae07 100644 --- a/landingPages/landing-utils/metrics/metrics.component.ts +++ b/landingPages/landing-utils/metrics/metrics.component.ts @@ -116,7 +116,7 @@ import {OpenaireEntities} from "../../../utils/properties/searchFields";
- Powered by + Powered by usage counts diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index 5bc20c71..52b390e6 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -88,9 +88,9 @@
- - Powered by OpenAIRE Research Graph - + + Powered by OpenAIRE Research Graph + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} @@ -235,7 +235,7 @@
diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 58b2cfdc..1de8bdea 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -151,6 +151,9 @@ export class ProjectComponent { public graph_offset: number = 0; @ViewChild("graph_and_feedback") graph_and_feedback; + public shouldSticky: boolean = true; + private observer: IntersectionObserver; + subscriptions = []; properties: EnvProperties; public openaireEntities = OpenaireEntities; @@ -227,6 +230,15 @@ export class ProjectComponent { ngAfterViewInit() { if (typeof document !== 'undefined') { this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + let bottom = document.getElementById('bottom'); + if(bottom) { + this.observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + this.shouldSticky = !entry.isIntersecting; + }) + }); + this.observer.observe(bottom); + } } } @@ -314,6 +326,10 @@ export class ProjectComponent { this.fetchSoftware.clearSubscriptions(); this.fetchOrps.clearSubscriptions(); this.fetchDmps.clearSubscriptions(); + + if(this.observer) { + this.observer.disconnect(); + } } private createClipboard() { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index cb0368d7..b61e4e3a 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -78,9 +78,9 @@
- - Powered by OpenAIRE Research Graph - + + Powered by OpenAIRE Research Graph + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} @@ -160,7 +160,7 @@
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 0a568a84..163f6aab 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, Input, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -129,6 +129,9 @@ export class ResultLandingComponent { public graph_offset: number = 0; @ViewChild("graph_and_feedback") graph_and_feedback; + public shouldSticky: boolean = true; + private observer: IntersectionObserver; + public viewAll: string = ""; public noCommunities: boolean = false; @@ -219,6 +222,15 @@ export class ResultLandingComponent { ngAfterViewInit() { if (typeof document !== 'undefined') { this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + let bottom = document.getElementById('bottom'); + if(bottom) { + this.observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + this.shouldSticky = !entry.isIntersecting; + }) + }); + this.observer.observe(bottom); + } } } @@ -290,6 +302,9 @@ export class ResultLandingComponent { } }); this._vocabulariesService.clearSubscriptions(); + if(this.observer) { + this.observer.disconnect(); + } } public pidInit(event) { diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index d3264e69..af8c60a9 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -340,8 +340,9 @@
- - Powered by OpenAIRE Research Graph + + Powered by OpenAIRE Research Graph +
diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index 36bae34a..4beae32e 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -85,8 +85,8 @@ import {properties} from "../../../../environments/environment";
-