Skip to content

Commit

Permalink
[bugfix] clear qbdata when cascade change (apache#2545)
Browse files Browse the repository at this point in the history
Co-authored-by: YuLuo <yuluo08290126@gmail.com>
  • Loading branch information
Aias00 and yuluo-yx authored Aug 18, 2024
1 parent 5b50307 commit 031e83d
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -593,6 +593,7 @@ export class AlertSettingComponent implements OnInit {
};

cascadeOnChange(values: string[]): void {
this.resetQbDataDefault();
if (values == null || values.length != 3) {
return;
}
Expand Down Expand Up @@ -645,26 +646,30 @@ export class AlertSettingComponent implements OnInit {
} catch (e) {
console.error(e);
this.isExpr = true;
this.resetQbData({ condition: 'and', rules: [] });
this.resetQbDataDefault();
return;
}
}

onManageModalCancel() {
this.cascadeValues = [];
this.isExpr = false;
this.resetQbData({ condition: 'and', rules: [] });
this.resetQbDataDefault();
this.isManageModalVisible = false;
}

resetQbData(qbData: RuleSet) {
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;
}

Expand Down

0 comments on commit 031e83d

Please sign in to comment.