Project

General

Profile

1 54479 myrto.kouk
/**
2
 * Created by myrto on 11/24/17.
3
 */
4
import { Component, OnInit } from '@angular/core';
5 58098 stefania.m
import { PiwikInfo, Repository } from '../../../domain/typeScriptClasses';
6 54479 myrto.kouk
import { ActivatedRoute, Router } from '@angular/router';
7 58098 stefania.m
import { PiwikService } from '../../../services/piwik.service';
8
import { AuthenticationService } from '../../../services/authentication.service';
9
import { SharedService } from "../../../services/shared.service";
10 54479 myrto.kouk
11
@Component ({
12
  selector: 'app-metrics-instructions',
13
  templateUrl: 'metrics-instructions.component.html'
14
})
15
16
export class MetricsInstructionsComponent implements OnInit {
17 58098 stefania.m
18 54479 myrto.kouk
  piwik: PiwikInfo;
19
  errorMessage: string;
20
21
  constructor(
22
    private route: ActivatedRoute,
23
    private router: Router,
24
    private piwikService: PiwikService,
25 58098 stefania.m
    private authService: AuthenticationService,
26
    private sharedService: SharedService) {}
27 54479 myrto.kouk
28
  ngOnInit() {
29 58098 stefania.m
30
    if(this.sharedService.getRepository())
31
      this.piwik = this.sharedService.getRepository().piwikInfo;
32
33
    this.sharedService.repository$.subscribe(
34
      r => {
35
        this.piwik = r.piwikInfo;
36
      }
37
    );
38
39 57129 stefania.m
    let body = document.getElementsByTagName('body')[0];
40
    body.classList.remove("top_bar_active");   //remove the class
41 57150 stefania.m
    body.classList.remove("page_heading_active");
42 58065 stefania.m
    body.classList.remove("landing");
43
    body.classList.add("dashboard");
44 54479 myrto.kouk
  }
45
}