All files / src/app/ceph/cluster/hosts/host-details host-details.component.ts

92.31% Statements 12/13
70% Branches 7/10
100% Functions 3/3
90.91% Lines 10/11

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 286x   6x   6x             6x     6x     3x 3x     6x 2x       6x  
import { Component, Input, OnChanges } from '@angular/core';
 
import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
import { Permission } from '../../../../shared/models/permissions';
import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
 
@Component({
  selector: 'cd-host-details',
  template: require('./host-details.component.html'),
  styles: []
})
export class HostDetailsComponent implements OnChanges {
  grafanaPermission: Permission;
  @Input()
  selection: CdTableSelection;
  host: any;
 
  constructor(private authStorageService: AuthStorageService) {
    this.grafanaPermission = this.authStorageService.getPermissions().grafana;
  }
 
  ngOnChanges() {
    Iif (this.selection.hasSelection) {
      this.host = this.selection.first();
    }
  }
}