This is an automated email from the ASF dual-hosted git repository.

kerwin612 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 031e83d70 [bugfix] clear qbdata when cascade change (#2545)
031e83d70 is described below

commit 031e83d7014c52d90f432caceb1bb2a54ff14068
Author: aias00 <[email protected]>
AuthorDate: Sun Aug 18 09:30:09 2024 +0800

    [bugfix] clear qbdata when cascade change (#2545)
    
    Co-authored-by: YuLuo <[email protected]>
---
 .../routes/alert/alert-setting/alert-setting.component.ts   | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git 
a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts 
b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts
index beb75d5e8..cfcb9326d 100644
--- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts
+++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts
@@ -164,7 +164,7 @@ export class AlertSettingComponent implements OnInit {
   onNewAlertDefine() {
     this.define = new AlertDefine();
     this.define.tags = [];
-    this.resetQbData({ condition: 'and', rules: [] });
+    this.resetQbDataDefault();
     this.isManageModalAdd = true;
     this.isManageModalVisible = true;
     this.isManageModalOkLoading = false;
@@ -593,6 +593,7 @@ export class AlertSettingComponent implements OnInit {
   };
 
   cascadeOnChange(values: string[]): void {
+    this.resetQbDataDefault();
     if (values == null || values.length != 3) {
       return;
     }
@@ -645,7 +646,7 @@ export class AlertSettingComponent implements OnInit {
     } catch (e) {
       console.error(e);
       this.isExpr = true;
-      this.resetQbData({ condition: 'and', rules: [] });
+      this.resetQbDataDefault();
       return;
     }
   }
@@ -653,7 +654,7 @@ export class AlertSettingComponent implements OnInit {
   onManageModalCancel() {
     this.cascadeValues = [];
     this.isExpr = false;
-    this.resetQbData({ condition: 'and', rules: [] });
+    this.resetQbDataDefault();
     this.isManageModalVisible = false;
   }
 
@@ -661,10 +662,14 @@ export class AlertSettingComponent implements OnInit {
     this.qbFormCtrl.reset((this.qbData = qbData));
   }
 
+  resetQbDataDefault() {
+    this.resetQbData({ condition: 'and', rules: [] });
+  }
+
   resetManageModalData() {
     this.cascadeValues = [];
     this.isExpr = false;
-    this.resetQbData({ condition: 'and', rules: [] });
+    this.resetQbDataDefault();
     this.isManageModalVisible = false;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to