diff --git a/frontend/src/container/FormAlertRules/BasicInfo.tsx b/frontend/src/container/FormAlertRules/BasicInfo.tsx index 595e6facd6..3d96e7fb79 100644 --- a/frontend/src/container/FormAlertRules/BasicInfo.tsx +++ b/frontend/src/container/FormAlertRules/BasicInfo.tsx @@ -2,6 +2,7 @@ import { Form, Select } from 'antd'; import { useTranslation } from 'react-i18next'; import { AlertDef, Labels } from 'types/api/alerts/def'; import { requireErrorMessage } from 'utils/form/requireErrorMessage'; +import { popupContainer } from 'utils/selectPopupContainer'; import ChannelSelect from './ChannelSelect'; import LabelSelect from './labels'; @@ -36,6 +37,7 @@ function BasicInfo({ alertDef, setAlertDef }: BasicInfoProps): JSX.Element { name={['labels', 'severity']} > { const s = (value as string) || 'critical'; diff --git a/frontend/src/container/FormAlertRules/ChartPreview/index.tsx b/frontend/src/container/FormAlertRules/ChartPreview/index.tsx index c00b78b449..9fdc30d835 100644 --- a/frontend/src/container/FormAlertRules/ChartPreview/index.tsx +++ b/frontend/src/container/FormAlertRules/ChartPreview/index.tsx @@ -9,9 +9,12 @@ import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange'; import getChartData from 'lib/getChartData'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; +import { useSelector } from 'react-redux'; +import { AppState } from 'store/reducers'; import { AlertDef } from 'types/api/alerts/def'; import { Query } from 'types/api/queryBuilder/queryBuilderData'; import { EQueryType } from 'types/common/dashboard'; +import { GlobalReducer } from 'types/reducer/globalTime'; import { ChartContainer, FailedMessageContainer } from './styles'; import { covertIntoDataFormats } from './utils'; @@ -41,6 +44,9 @@ function ChartPreview({ }: ChartPreviewProps): JSX.Element | null { const { t } = useTranslation('alerts'); const threshold = alertDef?.condition.target || 0; + const { minTime, maxTime } = useSelector( + (state) => state.globalTime, + ); const thresholdValue = covertIntoDataFormats({ value: threshold, @@ -100,6 +106,8 @@ function ChartPreview({ 'chartPreview', userQueryKey || JSON.stringify(query), selectedInterval, + minTime, + maxTime, ], retry: false, enabled: canQuery, diff --git a/frontend/src/container/FormAlertRules/RuleOptions.tsx b/frontend/src/container/FormAlertRules/RuleOptions.tsx index 8ece1562fe..1456268bd2 100644 --- a/frontend/src/container/FormAlertRules/RuleOptions.tsx +++ b/frontend/src/container/FormAlertRules/RuleOptions.tsx @@ -20,6 +20,7 @@ import { defaultMatchType, } from 'types/api/alerts/def'; import { EQueryType } from 'types/common/dashboard'; +import { popupContainer } from 'utils/selectPopupContainer'; import { FormContainer, InlineSelect, StepHeading } from './styles'; @@ -45,6 +46,7 @@ function RuleOptions({ const renderCompareOps = (): JSX.Element => ( ( ( (