Browse Source

Fix missing 'type' property in alarm rule condition on save

When a NO_DATA filter is present, the condition type control gets
disabled. Angular's FormGroup.value excludes disabled controls,
causing the 'type' field to be omitted from the saved result.
This leads to a JSON parse error on the backend.

Explicitly include the type control value in the save output
while keeping unit/value/count excluded when disabled.
pull/15421/head
Vladyslav_Prykhodko 4 months ago
committed by Vladyslav Prykhodko
parent
commit
a5244922ec
  1. 5
      ui-ngx/src/app/modules/home/components/alarm-rules/cf-alarm-rule-condition-dialog.component.ts

5
ui-ngx/src/app/modules/home/components/alarm-rules/cf-alarm-rule-condition-dialog.component.ts

@ -332,7 +332,10 @@ export class CfAlarmRuleConditionDialogComponent extends DialogComponent<CfAlarm
}
save(): void {
this.dialogRef.close(this.conditionFormGroup.value as AlarmRuleCondition);
this.dialogRef.close({
...this.conditionFormGroup.value,
type: this.conditionFormGroup.get('type').value,
} as AlarmRuleCondition);
}
onTestScript($event: Event) {

Loading…
Cancel
Save