diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts index 9d7605c59d..dca556b221 100644 --- a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts +++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts @@ -64,8 +64,6 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor { @coerceBoolean() isEdit = false; - hideFlagValue = false; - @Input() @coerceBoolean() hideFlag = false; @@ -208,7 +206,7 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor { } onHideFlagChange() { - this.hideFlagChange.emit(this.hideFlagValue); + this.hideFlagChange.emit(this.hideFlag); } onTimeInputChange(type: string) { diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts index 7b30759cdf..171a692e44 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts @@ -157,9 +157,9 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { disabled: hideTimezone }] }); - this.updateValidators(); - this.timewindowForm.get('aggregation.type').valueChanges.subscribe(() => { - this.updateValidators(); + this.updateValidators(this.timewindowForm.get('aggregation.type').value); + this.timewindowForm.get('aggregation.type').valueChanges.subscribe((aggregationType: AggregationType) => { + this.updateValidators(aggregationType); }); } @@ -172,8 +172,7 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit { return limit; } - private updateValidators() { - const aggType = this.timewindowForm.get('aggregation.type').value; + private updateValidators(aggType: AggregationType) { if (aggType !== AggregationType.NONE) { this.timewindowForm.get('aggregation.limit').clearValidators(); } else {