UI: combined logic of indexchanged and tabchanged event handlers of timewindow panel

This commit is contained in:
rusikv 2023-09-27 13:02:56 +03:00
parent a21ce12528
commit 1b93dc7666
2 changed files with 2 additions and 2 deletions

View File

@ -17,8 +17,7 @@
--> -->
<form [formGroup]="timewindowForm" class="mat-content"> <form [formGroup]="timewindowForm" class="mat-content">
<mat-tab-group [ngClass]="{'tb-headless': historyOnly}" <mat-tab-group [ngClass]="{'tb-headless': historyOnly}"
(selectedIndexChange)="timewindowForm.markAsDirty()" [(selectedIndex)]="timewindow.selectedTab" (selectedTabChange)="onTimewindowTypeChange()" [(selectedIndex)]="timewindow.selectedTab">
(selectedTabChange)="onTimewindowTypeChange()">
<mat-tab label="{{ 'timewindow.realtime' | translate }}"> <mat-tab label="{{ 'timewindow.realtime' | translate }}">
<section fxLayout="row"> <section fxLayout="row">
<section *ngIf="isEdit" fxLayout="column" fxLayoutAlign="start center" <section *ngIf="isEdit" fxLayout="column" fxLayoutAlign="start center"

View File

@ -188,6 +188,7 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit {
} }
onTimewindowTypeChange() { onTimewindowTypeChange() {
this.timewindowForm.markAsDirty();
const timewindowFormValue = this.timewindowForm.getRawValue(); const timewindowFormValue = this.timewindowForm.getRawValue();
if (this.timewindow.selectedTab === TimewindowType.REALTIME) { if (this.timewindow.selectedTab === TimewindowType.REALTIME) {
this.timewindowForm.get('realtime').patchValue({ this.timewindowForm.get('realtime').patchValue({