All files / src/app/ceph/cluster/mgr-modules/mgr-module-details mgr-module-details.component.ts

80% Statements 12/15
70% Branches 7/10
75% Functions 3/4
75% Lines 9/12

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   8x   6x 5x             6x  
import { Component, Input, OnChanges } from '@angular/core';
 
import { MgrModuleService } from '../../../../shared/api/mgr-module.service';
import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
 
@Component({
  selector: 'cd-mgr-module-details',
  template: require('./mgr-module-details.component.html'),
  styles: []
})
export class MgrModuleDetailsComponent implements OnChanges {
  module_config: any;
 
  @Input()
  selection: CdTableSelection;
 
  constructor(private mgrModuleService: MgrModuleService) {}
 
  ngOnChanges() {
    Iif (this.selection.hasSelection) {
      const selectedItem = this.selection.first();
      this.mgrModuleService.getConfig(selectedItem.name).subscribe((resp: any) => {
        this.module_config = resp;
      });
    }
  }
}