Project

General

Profile

1
import {Component, OnInit} from '@angular/core';
2
import {Router} from '@angular/router';
3

    
4
@Component({
5
  selector: 'app-sources-register',
6
  templateUrl: 'sources-register.component.html'
7
})
8

    
9
export class SourcesRegisterComponent implements OnInit {
10

    
11
  constructor(private router: Router) {}
12

    
13
  ngOnInit() {
14
    const body = document.getElementsByTagName('body')[0];
15
    body.classList.remove('top_bar_active');   // remove the class
16
    body.classList.remove('page_heading_active');
17
    body.classList.remove('landing');
18
    body.classList.add('dashboard');
19
  }
20

    
21
  // fixme still when I click the link inside the text in overlay, this event happens as well (I go to the first step of the wizard)
22
  goTo(datasourceType: string) {
23
    if (datasourceType === 'repository') {
24
      this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
25
    } else if (datasourceType === 'data') {
26
      this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
27
    } else if (datasourceType === 'journal') {
28
      this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`);
29
    } else if (datasourceType === 'aggregator') {
30
      this.router.navigateByUrl(`/sources/register/${datasourceType}?step=basicInformation`);
31
    } else if (datasourceType === 'cris') {
32
      this.router.navigateByUrl(`/sources/register/${datasourceType}?step=selectDatasource`);
33
    }
34
  }
35
}
(2-2/6)