import { Component , OnInit } from '@angular/core' ; import { ConfigEditBaseComponent } from '../config.edit' ; import { ReplaySubject } from 'rxjs' ; import { FormControl , Validators } from '@angular/forms' ; @ Component ( { selector : 'cmdb-check-field-edit' , templateUrl : './check-field-edit.component.html' } ) export class CheckFieldEditComponent extends ConfigEditBaseComponent implements OnInit { protected protected subscriber : ReplaySubject < void > = new ReplaySubject < void > ( ) ; /**
     * Name form control.
     */ public nameControl : FormControl = new FormControl ( '' , Validators . required ) ; /**
     * Label form control.
     */ public labelControl : FormControl = new FormControl ( '' , Validators . required ) ; /**
     * Description form control.
     */ public descriptionControl : FormControl = new FormControl ( '' ) ; /**
     * Value form control.
     */ public valueControl : FormControl = new FormControl ( false ) ; /**
     * Helper form control.
     */ public helperTextControl : FormControl = new FormControl ( '' ) ; constructor ( ) { super ( ) ; } public ngOnInit ( ) { this . data . options = [ { name : 'option-1' , label : 'Option 1' } ] ; this . form . addControl ( 'name' , this . nameControl ) ; this . form . addControl ( 'label' , this . labelControl ) ; this . form . addControl ( 'description' , this . descriptionControl ) ; this . form . addControl ( 'value' , this . valueControl ) ; this . form . addControl ( 'helperText' , this . helperTextControl ) ; this . disableControlOnEdit ( this . nameControl ) ; this . patchData ( this . data , this . form ) ; } }