Skip to content

Commit 91ea069

Browse files
fix(ui): TE-XXX remove alertId in insight call on edit page && call insight if config changes (#1797)
1 parent 1d32033 commit 91ea069

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

thirdeye-ui/src/app/components/alert-wizard-v2/alert-template/preview-chart/preview-chart.component.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* the License.
1414
*/
1515
import { Box } from "@material-ui/core";
16-
import { isEqual } from "lodash";
16+
import { cloneDeep, isEqual } from "lodash";
1717
import React, { FunctionComponent, useEffect, useMemo, useState } from "react";
1818
import { useTranslation } from "react-i18next";
1919
import { useSearchParams } from "react-router-dom";
@@ -154,9 +154,12 @@ export const PreviewChart: FunctionComponent<PreviewChartProps> = ({
154154
const handleAutoRangeClick = (): void => {
155155
if (
156156
getAlertInsightStatus === ActionStatus.Initial ||
157-
getAlertInsightStatus === ActionStatus.Error
157+
getAlertInsightStatus === ActionStatus.Error ||
158+
!isEqual(alertForCurrentEvaluation, alert)
158159
) {
159-
getAlertInsight({ alert }).then(
160+
const copiedAlert = cloneDeep(alert);
161+
delete copiedAlert.id;
162+
getAlertInsight({ alert: copiedAlert }).then(
160163
(insights) => {
161164
if (insights) {
162165
searchParams.set(

0 commit comments

Comments
 (0)