All files / src/app/components/leftbar leftbar.component.ts

100% Statements 8/8
100% Branches 2/2
100% Functions 5/5
100% Lines 7/7

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 35                            66x 31x     31x     31x 31x   30x             5x      
import { Component, Input } from '@angular/core';
import { RouterLink } from '@angular/router';
import { TwinPadStatus } from '../../models/status';
import { NgClass, NgIf } from '@angular/common';
import { LoginService } from '../../services/login.service';
import { Device } from '../../models/devices';
import { StatusCountPipe } from '../../status-count.pipe';
 
@Component({
    selector: 'app-leftbar',
    imports: [RouterLink, NgClass, NgIf, StatusCountPipe],
    templateUrl: './leftbar.component.html',
    styleUrl: './leftbar.component.css'
})
export class LeftbarComponent{
  showSubMenu = false;
  @Input() status: TwinPadStatus;
  @Input() cloudStatus: boolean;
  @Input() devices: Device[] | undefined = undefined;
  addCustomView: string;
 
  constructor(private loginService: LoginService){
    this.loginService.getProfile().subscribe({
      next: value => {
        this.addCustomView = "/customViewsBuilder/"+value.id+"/new";
      },
      error: _ => {}
    });
  }
 
  toggleSubMenu(){
    this.showSubMenu = !this.showSubMenu;
  }
}