Browse Source

Merge remote-tracking branch 'upstream/lts-4.3' into rc

pull/15852/head
Vladyslav_Prykhodko 3 months ago
parent
commit
2e4190e7e0
  1. 16
      ui-ngx/src/app/modules/home/components/alarm-rules/cf-alarm-rule-condition.component.ts

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

@ -143,19 +143,23 @@ export class CfAlarmRuleConditionComponent implements ControlValueAccessor, Vali
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if (changes.arguments && !changes.arguments.firstChange) { if (changes.arguments && !changes.arguments.firstChange) {
this.recalculateArgumentValidity(); if (this.recalculateArgumentValidity()) {
this.onValidatorChange(); this.onValidatorChange();
}
} }
} }
private recalculateArgumentValidity(): void { private recalculateArgumentValidity(): boolean {
const prevFiltersValid = this.filtersArgumentsValid;
const prevSchedulerValid = this.schedulerArgumentsValid;
if (!this.modelValue || !this.arguments) { if (!this.modelValue || !this.arguments) {
this.filtersArgumentsValid = true; this.filtersArgumentsValid = true;
this.schedulerArgumentsValid = true; this.schedulerArgumentsValid = true;
return; } else {
this.filtersArgumentsValid = this.areFilterAndPredicateArgumentsValid(this.modelValue, this.arguments);
this.schedulerArgumentsValid = this.isScheduleArgumentValid(this.modelValue, Object.keys(this.arguments));
} }
this.filtersArgumentsValid = this.areFilterAndPredicateArgumentsValid(this.modelValue, this.arguments); return prevFiltersValid !== this.filtersArgumentsValid || prevSchedulerValid !== this.schedulerArgumentsValid;
this.schedulerArgumentsValid = this.isScheduleArgumentValid(this.modelValue, Object.keys(this.arguments));
} }
private isScheduleArgumentValid(obj: any, validArguments: string[]): boolean { private isScheduleArgumentValid(obj: any, validArguments: string[]): boolean {

Loading…
Cancel
Save