diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsx index e903945fea..9db261afd0 100644 --- a/frontend/src/container/FormAlertRules/index.tsx +++ b/frontend/src/container/FormAlertRules/index.tsx @@ -380,8 +380,8 @@ function FormAlertRules({ const isAlertAvialableToSave = isAlertAvialable && - isNewRule && - currentQuery.queryType === EQueryType.QUERY_BUILDER; + currentQuery.queryType === EQueryType.QUERY_BUILDER && + alertType !== AlertTypes.METRICS_BASED_ALERT; return ( <> diff --git a/frontend/src/container/NewWidget/index.tsx b/frontend/src/container/NewWidget/index.tsx index 2352f506c5..3919f8fe12 100644 --- a/frontend/src/container/NewWidget/index.tsx +++ b/frontend/src/container/NewWidget/index.tsx @@ -20,6 +20,8 @@ import { import { AppState } from 'store/reducers'; import AppActions from 'types/actions'; import { FLUSH_DASHBOARD } from 'types/actions/dashboard'; +import { EQueryType } from 'types/common/dashboard'; +import { DataSource } from 'types/common/queryBuilder'; import AppReducer from 'types/reducer/app'; import DashboardReducer from 'types/reducer/dashboards'; @@ -161,15 +163,29 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element { FeatureKeys.QUERY_BUILDER_PANELS, ); + const isSaveDisabled = useMemo( + () => + isQueryBuilderActive && + currentQuery.queryType === EQueryType.QUERY_BUILDER && + currentQuery.builder.queryData.find( + (query) => query.dataSource !== DataSource.METRICS, + ) !== undefined, + [ + currentQuery.builder.queryData, + currentQuery.queryType, + isQueryBuilderActive, + ], + ); + return ( - {isQueryBuilderActive && ( + {isSaveDisabled && ( )}