Project

General

Profile

1
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
2
import {ActivatedRoute, Router} from '@angular/router';
3
import {Meta, Title} from '@angular/platform-browser';
4
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
5
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
6
import {properties} from '../../environments/environment';
7
import {Subscription} from 'rxjs';
8
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
9
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service';
10

    
11
declare var UIkit: any;
12

    
13
@Component({
14
  selector: 'about',
15
  templateUrl: 'about.component.html',
16
  styleUrls: ['about.component.css'],
17
})
18
export class AboutComponent implements OnInit {
19
  @ViewChild('tabs') tabs: ElementRef;
20
  public architectureImage: string = "gray.png";
21
  public aggregationReadMore: boolean = false;
22
  public dedupClusteringReadMore: boolean = false;
23
  public dedupMatchingAndElectionReadMore: boolean = false;
24
  public enrichmentPropagationReadMore: boolean = false;
25
  public enrichmentMiningReadMore: boolean = false;
26
  properties:EnvProperties = properties;
27
  subs: Subscription[] = [];
28
  description = "The OpenAIRE Research Graph includes metadata and links between scientific products (e.g. literature, datasets, software, other research products), organizations, funders, funding streams, projects, communities, and (provenance) data sources.  Information on how we build it, the architecture, the infrastructure and the team.";
29
  title = "OpenAIRE - Research Graph | About";
30
  public breadcrumbs: Breadcrumb[] = [
31
    {
32
      name: 'home',
33
      route: '/'
34
    },
35
    {
36
      name: 'about'
37
    }
38
  ];
39

    
40
  constructor(private _title: Title,
41
              private route: ActivatedRoute, private _router: Router,
42
              private _piwikService:PiwikService,
43
              private _meta: Meta,  private seoService: SEOService) {
44
  }
45
  
46
  ngOnInit() {
47
    this._title.setTitle(this.title);
48
    this._meta.updateTag({content:this.description},"name='description'");
49
    this._meta.updateTag({content:this.description},"property='og:description'");
50
    this._meta.updateTag({content:this.title},"property='og:title'");
51
    var url = this.properties.domain + this.properties.baseLink+this._router.url;
52
    this.seoService.createLinkForCanonicalURL(url, false);
53
    this._meta.updateTag({content:url},"property='og:url'");
54
    if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
55
      this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe());
56
    }
57
  }
58

    
59
  changeTab(index: number) {
60
    UIkit.switcher(this.tabs.nativeElement).show(index);
61
  }
62
  public ngOnDestroy() {
63
    for (let sub of this.subs) {
64
      sub.unsubscribe();
65
    }
66
  }
67

    
68
}
(3-3/8)