From 94b6c6f387c0ca6c322e79c2e0a8828c1758c625 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 24 Oct 2022 13:18:27 +0300 Subject: [PATCH] about page redesign, add methodological-approach page, update submodules --- src/app/about/about.module.ts | 36 +++ src/app/{faqs => about}/faqs.component.html | 0 src/app/{faqs => about}/faqs.component.ts | 0 src/app/about/how-it-works.component.ts | 318 ++++++++++++++++++++ src/app/app-routing.module.ts | 5 - src/app/faqs/faq-routing.module.ts | 14 - src/app/faqs/faqs.module.ts | 30 -- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/monitor-assets/about/hero.svg | 99 ++++++ src/assets/monitor-assets/about/steps.svg | 159 ---------- 11 files changed, 455 insertions(+), 210 deletions(-) create mode 100644 src/app/about/about.module.ts rename src/app/{faqs => about}/faqs.component.html (100%) rename src/app/{faqs => about}/faqs.component.ts (100%) create mode 100644 src/app/about/how-it-works.component.ts delete mode 100644 src/app/faqs/faq-routing.module.ts delete mode 100644 src/app/faqs/faqs.module.ts create mode 100644 src/assets/monitor-assets/about/hero.svg delete mode 100644 src/assets/monitor-assets/about/steps.svg diff --git a/src/app/about/about.module.ts b/src/app/about/about.module.ts new file mode 100644 index 0000000..c393a44 --- /dev/null +++ b/src/app/about/about.module.ts @@ -0,0 +1,36 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {RouterModule} from "@angular/router"; +import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; +import {isDevelopmentGuard} from "../openaireLibrary/error/isDevelopmentGuard.guard"; +import {HowItWorksComponent} from "./how-it-works.component"; +import {FaqsComponent} from "./faqs.component"; +import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module"; +import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; +import {SliderTabsModule} from "../openaireLibrary/sharedComponents/tabs/slider-tabs.module"; + +@NgModule({ + declarations: [HowItWorksComponent, FaqsComponent], + imports: [CommonModule, RouterModule.forChild([ + { + path: '', + redirectTo: 'how-it-works', + canDeactivate: [PreviousRouteRecorder] + }, + { + path: 'how-it-works', + component: HowItWorksComponent, + canLoad: [isDevelopmentGuard] + }, + { + path: 'faq', + component: FaqsComponent, + canLoad: [isDevelopmentGuard] + }, + ]), BreadcrumbsModule, SliderTabsModule], + exports: [HowItWorksComponent, FaqsComponent], + providers: [PreviousRouteRecorder, PiwikService] +}) +export class AboutModule { + +} \ No newline at end of file diff --git a/src/app/faqs/faqs.component.html b/src/app/about/faqs.component.html similarity index 100% rename from src/app/faqs/faqs.component.html rename to src/app/about/faqs.component.html diff --git a/src/app/faqs/faqs.component.ts b/src/app/about/faqs.component.ts similarity index 100% rename from src/app/faqs/faqs.component.ts rename to src/app/about/faqs.component.ts diff --git a/src/app/about/how-it-works.component.ts b/src/app/about/how-it-works.component.ts new file mode 100644 index 0000000..f66d6bf --- /dev/null +++ b/src/app/about/how-it-works.component.ts @@ -0,0 +1,318 @@ +import {ChangeDetectorRef, Component} from "@angular/core"; +import {Router} from '@angular/router'; +import {Meta, Title} from '@angular/platform-browser'; +import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; +import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; +import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; +import {Subscriber} from "rxjs"; +import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component"; +import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; +import {properties} from "../../environments/environment"; + +@Component({ + selector: 'how-it-works', + template: ` +
+
+
+
+ +
+
+

How it works.

+
+ Join the OpenAIRE Monitor service and we will create for you a dashboard to track and understand and position your organization's research activities and their impact, discover and evaluate Open Science trends for your organization and make data-driven decisions. Here's how it works. +
+ +
+
+
+
+ +
+
+
+
+ + + +
+
+ + + +
+
+ +
+ ` +}) +export class HowItWorksComponent { + + public url: string = null; + public pageTitle: string = "OpenAIRE - Monitor | How it works"; + public description: string = "OpenAIRE - Monitor | How it works"; + public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'About - How it works'}]; + public properties: EnvProperties = properties; + public sections: string[] = ['Funders', 'Research Initiatives', 'Research Institutions']; + public offset: number; + subscriptions = []; + + constructor( + private _router: Router, + private _meta: Meta, + private _title: Title, + private seoService: SEOService, + private _piwikService: PiwikService, + private helper: HelperService, + 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.description); + } + + ngAfterViewInit() { + if (typeof document !== 'undefined') { + this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height')); + this.cdr.detectChanges(); + } + } + + ngOnDestroy() { + this.subscriptions.forEach(subscription => { + if (subscription instanceof Subscriber) { + subscription.unsubscribe(); + } + }); + } + + private updateDescription(description: string) { + this._meta.updateTag({content: description}, "name='description'"); + this._meta.updateTag({content: description}, "property='og:description'"); + } + + 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 updateUrl(url: string) { + this._meta.updateTag({content: url}, "property='og:url'"); + } +} \ No newline at end of file diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d16a1f3..a37d5c5 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -30,11 +30,6 @@ const routes: Routes = [ path: 'get-started', loadChildren: () => import('./get-started/get-started.module').then(m => m.GetStartedModule) }, - { - path: 'faqs', - loadChildren: () => import('./faqs/faqs.module').then(m => m.FaqsModule), - canLoad: [isDevelopmentGuard] - }, { path: 'my-dashboards', loadChildren: () => import('./my-stakeholders/my-stakeholders.module').then(m => m.MyStakeholdersModule)}, diff --git a/src/app/faqs/faq-routing.module.ts b/src/app/faqs/faq-routing.module.ts deleted file mode 100644 index bc0b65d..0000000 --- a/src/app/faqs/faq-routing.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; - -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {FaqsComponent} from "./faqs.component"; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: '', component: FaqsComponent, canDeactivate: [PreviousRouteRecorder] } - ]) - ] -}) -export class FaqRoutingModule { } diff --git a/src/app/faqs/faqs.module.ts b/src/app/faqs/faqs.module.ts deleted file mode 100644 index 3d31695..0000000 --- a/src/app/faqs/faqs.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {RouterModule} from '@angular/router'; -import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; - -import {FaqsComponent} from "./faqs.component"; -import {FaqRoutingModule} from "./faq-routing.module"; -import {HelperModule} from "../openaireLibrary/utils/helper/helper.module"; -import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module"; -import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; -import {BreadcrumbsModule} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.module'; -import {IconsModule} from "../openaireLibrary/utils/icons/icons.module"; - -@NgModule({ - imports: [ - CommonModule, RouterModule, FaqRoutingModule, HelperModule, - Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, IconsModule - ], - declarations: [ - FaqsComponent - ], - exports: [ - FaqsComponent - ], - providers:[ - PreviousRouteRecorder, PiwikService - ] -}) -export class FaqsModule { } diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index f1618b9..256c949 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit f1618b92e8739b4845955c9c4f02a2e1fc31242a +Subproject commit 256c94946f9cca08b0f160db806c6dbc286e91ec diff --git a/src/assets/common-assets b/src/assets/common-assets index 936fac2..fc2e0b8 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 936fac297322fa252af930cab3c0e69efe57c1a5 +Subproject commit fc2e0b805ae3011f0f181983b27905908e528083 diff --git a/src/assets/monitor-assets/about/hero.svg b/src/assets/monitor-assets/about/hero.svg new file mode 100644 index 0000000..cce9851 --- /dev/null +++ b/src/assets/monitor-assets/about/hero.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/monitor-assets/about/steps.svg b/src/assets/monitor-assets/about/steps.svg deleted file mode 100644 index 483a331..0000000 --- a/src/assets/monitor-assets/about/steps.svg +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -