Project

General

Profile

1
/**
2
 * Created by myrto on 11/24/17.
3
 */
4
import { Component, OnInit } from '@angular/core';
5
import { PiwikInfo, Repository } from '../../../domain/typeScriptClasses';
6
import { ActivatedRoute, Router } from '@angular/router';
7
import { PiwikService } from '../../../services/piwik.service';
8
import { AuthenticationService } from '../../../services/authentication.service';
9
import { SharedService } from "../../../services/shared.service";
10

    
11
@Component ({
12
  selector: 'app-metrics-instructions',
13
  templateUrl: 'metrics-instructions.component.html'
14
})
15

    
16
export class MetricsInstructionsComponent implements OnInit {
17

    
18
  piwik: PiwikInfo;
19
  errorMessage: string;
20

    
21
  constructor(
22
    private route: ActivatedRoute,
23
    private router: Router,
24
    private piwikService: PiwikService,
25
    private authService: AuthenticationService,
26
    private sharedService: SharedService) {}
27

    
28
  ngOnInit() {
29

    
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
    let body = document.getElementsByTagName('body')[0];
40
    body.classList.remove("top_bar_active");   //remove the class
41
    body.classList.remove("page_heading_active");
42
    body.classList.remove("landing");
43
    body.classList.add("dashboard");
44
  }
45
}
(4-4/15)