|
|
@ -77,12 +77,16 @@ export class CreateCfAlarmRulesComponent implements ControlValueAccessor, Valida |
|
|
private usedSeverities: AlarmSeverity[] = []; |
|
|
private usedSeverities: AlarmSeverity[] = []; |
|
|
|
|
|
|
|
|
private propagateChange = (v: any) => { }; |
|
|
private propagateChange = (v: any) => { }; |
|
|
|
|
|
private onValidatorChange = () => { }; |
|
|
|
|
|
|
|
|
constructor(private fb: FormBuilder, |
|
|
constructor(private fb: FormBuilder, |
|
|
private destroyRef: DestroyRef) { |
|
|
private destroyRef: DestroyRef) { |
|
|
this.createAlarmRulesFormGroup.valueChanges.pipe( |
|
|
this.createAlarmRulesFormGroup.valueChanges.pipe( |
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
).subscribe(() => this.updateModel()); |
|
|
).subscribe(() => this.updateModel()); |
|
|
|
|
|
this.createAlarmRulesFormGroup.statusChanges.pipe( |
|
|
|
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
|
|
|
).subscribe(() => this.onValidatorChange()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
registerOnChange(fn: any): void { |
|
|
registerOnChange(fn: any): void { |
|
|
@ -92,6 +96,10 @@ export class CreateCfAlarmRulesComponent implements ControlValueAccessor, Valida |
|
|
registerOnTouched(fn: any): void { |
|
|
registerOnTouched(fn: any): void { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
registerOnValidatorChange(fn: () => void): void { |
|
|
|
|
|
this.onValidatorChange = fn; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
createAlarmRulesFormArray(): UntypedFormArray { |
|
|
createAlarmRulesFormArray(): UntypedFormArray { |
|
|
return this.createAlarmRulesFormGroup.get('createAlarmRules') as UntypedFormArray; |
|
|
return this.createAlarmRulesFormGroup.get('createAlarmRules') as UntypedFormArray; |
|
|
} |
|
|
} |
|
|
|