From 7687746c7775e837ac03c593f2ec5dc03b20299d Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 7 Jan 2021 17:01:02 +0000 Subject: [PATCH] [Usage-Counts | Trunk]: Fix search bug on alalytics. Change loading --- src/app/about/about.component.ts | 19 +++++---- src/app/analytics/analytics.component.html | 8 ++-- src/app/analytics/analytics.component.ts | 27 ++++++++----- src/app/analytics/analytics.module.ts | 4 +- src/app/contact/contact.component.ts | 32 +++++++++------ src/app/home/home.component.ts | 46 ++++++++++++---------- src/app/resources/resources.component.ts | 19 +++++---- src/app/sushilite/sushilite.component.ts | 4 +- 8 files changed, 93 insertions(+), 66 deletions(-) diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index 6986a29..d551b43 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -1,10 +1,10 @@ -import {Component, HostListener, OnInit} from '@angular/core'; +import {Component, HostListener, OnDestroy, OnInit} from '@angular/core'; import {faqs} from './faqs'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {properties} from '../../environments/environment'; -import {Subscription} from 'rxjs'; +import {Subscriber, Subscription} from 'rxjs'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; @@ -13,7 +13,7 @@ import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; templateUrl: 'about.component.html', styleUrls: ['about.component.css'], }) -export class AboutComponent implements OnInit { +export class AboutComponent implements OnInit, OnDestroy { faqs: any[] = faqs; properties: EnvProperties = properties; description = "UsageCounts service is an OpenAIRE service built to cover the needs of content providers and consumers and offer added value to assist them in reaching their goals. UsageCounts forms metrics of usage activity of Open Access Repositories categorizing the data retrieved by country, number of downloads, number of views, number of repositories and all derivative quantitative open metrics, comprehensively. Architecture. "; @@ -58,6 +58,14 @@ export class AboutComponent implements OnInit { })); } + public ngOnDestroy() { + this.subs.forEach(subscription => { + if (subscription instanceof Subscriber) { + subscription.unsubscribe(); + } + }); + } + goTo(id: string) { const yOffset = -100; const element = document.getElementById(id); @@ -66,9 +74,4 @@ export class AboutComponent implements OnInit { window.scrollTo({top: y, behavior: 'smooth'}); } } - public ngOnDestroy() { - for (let sub of this.subs) { - sub.unsubscribe(); - } - } } diff --git a/src/app/analytics/analytics.component.html b/src/app/analytics/analytics.component.html index 58bce2c..396d2e4 100644 --- a/src/app/analytics/analytics.component.html +++ b/src/app/analytics/analytics.component.html @@ -58,8 +58,8 @@
Results
-