|
|
@ -157,9 +157,9 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { |
|
|
disabled: hideTimezone |
|
|
disabled: hideTimezone |
|
|
}] |
|
|
}] |
|
|
}); |
|
|
}); |
|
|
this.updateValidators(); |
|
|
this.updateValidators(this.timewindowForm.get('aggregation.type').value); |
|
|
this.timewindowForm.get('aggregation.type').valueChanges.subscribe(() => { |
|
|
this.timewindowForm.get('aggregation.type').valueChanges.subscribe((aggregationType: AggregationType) => { |
|
|
this.updateValidators(); |
|
|
this.updateValidators(aggregationType); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -172,8 +172,7 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { |
|
|
return limit; |
|
|
return limit; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private updateValidators() { |
|
|
private updateValidators(aggType: AggregationType) { |
|
|
const aggType = this.timewindowForm.get('aggregation.type').value; |
|
|
|
|
|
if (aggType !== AggregationType.NONE) { |
|
|
if (aggType !== AggregationType.NONE) { |
|
|
this.timewindowForm.get('aggregation.limit').clearValidators(); |
|
|
this.timewindowForm.get('aggregation.limit').clearValidators(); |
|
|
} else { |
|
|
} else { |
|
|
|