All files / src/app/app-root/sys-check-starter sys-check-starter.component.ts

7.69% Statements 1/13
0% Branches 0/2
0% Functions 0/5
7.69% Lines 1/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34                    1x                                              
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { BackendService } from '../../backend.service';
import { MainDataService } from '../../shared/shared.module';
import { SysCheckInfo } from '../../app.interfaces';
 
@Component({
  templateUrl: './sys-check-starter.component.html',
  styleUrls: ['./sys-check-starter.component.css']
})
export class SysCheckStarterComponent implements OnInit {
  checkConfigList: SysCheckInfo[] = [];
  loading = false;
 
  constructor(public mainDataService: MainDataService,
              private bs: BackendService,
              private router: Router) { }
 
  ngOnInit(): void {
    setTimeout(() => {
      this.mainDataService.appSubTitle$.next('System-Check Auswahl');
      this.loading = true;
      this.bs.getSysCheckInfosAcrossWorkspaces().subscribe(myConfigs => {
        this.checkConfigList = myConfigs || [];
        this.loading = false;
      });
    });
  }
 
  buttonStartCheck(checkInfo: SysCheckInfo): void {
    this.router.navigate([`/check/${checkInfo.workspaceId}/${checkInfo.name}`]);
  }
}