From 4227e0703a540b177cdb9e00d876f47b75201fd9 Mon Sep 17 00:00:00 2001 From: Zacqary Adam Xeper Date: Wed, 3 Mar 2021 10:39:38 -0600 Subject: [PATCH] [Metrics UI] Fix removing warning threshold from alert expressions (#93338) --- .../infra/public/alerting/inventory/components/expression.tsx | 2 +- .../public/alerting/metric_threshold/components/expression.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx index d43bbb6888a6e..7233ce3de7497 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx @@ -137,7 +137,7 @@ export const Expressions: React.FC = (props) => { const updateParams = useCallback( (id, e: InventoryMetricConditions) => { const exp = alertParams.criteria ? alertParams.criteria.slice() : []; - exp[id] = { ...exp[id], ...e }; + exp[id] = e; setAlertParams('criteria', exp); }, [setAlertParams, alertParams.criteria] diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx index 64190f5557707..6b6de68bae158 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx @@ -102,7 +102,7 @@ export const Expressions: React.FC = (props) => { const updateParams = useCallback( (id, e: MetricExpression) => { const exp = alertParams.criteria ? alertParams.criteria.slice() : []; - exp[id] = { ...exp[id], ...e }; + exp[id] = e; setAlertParams('criteria', exp); }, [setAlertParams, alertParams.criteria]