import { Component , Input , OnInit } from '@angular/core' ; import { CmdbMode } from '../../../framework/modes.enum' ; import { FormBuilder , FormControl , FormGroup , Validators } from '@angular/forms' ; import { ExportdJob } from '../../../settings/models/exportd-job' ; import { ExportdJobBaseStepComponent } from '../exportd-job-base-step.component' ; @ Component ( { selector : 'cmdb-task-scheduling-step' , templateUrl : './exportd-job-scheduling-step.component.html' , styleUrls : [ './exportd-job-scheduling-step.component.scss' ] } ) export class ExportdJobSchedulingStepComponent extends ExportdJobBaseStepComponent implements OnInit { @ Input ( ) set preData ( data ) { if ( data !== undefined && data . scheduling !== undefined ) { this . eventForm . patchValue ( data . scheduling . event ) ; this . taskType = data . exportd_type ; } } public eventForm : FormGroup ; /**
     * Type of execution (PULL or PUSH)
     */ public taskType : string ; /**
     * Information on the exception rule
     */ public info : string = 'Excludes jobs that have been executed manually ' + 'and jobs that are executed automatically after they have been created.' ; constructor ( private formBuilder ) { super ( ) ; this . eventForm = this . formBuilder . group ( { active : new FormControl ( false , Validators . required ) , subset : new FormControl ( false , Validators . required ) , } ) ; } public ngOnInit ( ) { if ( this . mode === CmdbMode . Edit ) { this . eventForm . markAllAsTouched ( ) ; } } }