Browse Source

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

pull/9307/head
rusikv 3 years ago
parent
commit
1b93dc7666
  1. 3
      ui-ngx/src/app/shared/components/time/timewindow-panel.component.html
  2. 1
      ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts

3
ui-ngx/src/app/shared/components/time/timewindow-panel.component.html

@ -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"

1
ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts

@ -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({

Loading…
Cancel
Save