mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 16:49:01 +08:00
fix: save rules/dashboard is now enabled for metrics irrespective of feature flag disabled (#2946)
* fix: save rules/dashboard is now enabled for metrics irrespective of feature flag disabled * chore: check is updated for alerts * chore: alert condition is updated * chore: condition for alert is updated
This commit is contained in:
parent
3f4cd130ed
commit
a6237d8640
@ -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 (
|
||||
<>
|
||||
|
@ -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 (
|
||||
<Container>
|
||||
<ButtonContainer>
|
||||
{isQueryBuilderActive && (
|
||||
{isSaveDisabled && (
|
||||
<Tooltip title={MESSAGE.PANEL}>
|
||||
<Button
|
||||
icon={<LockFilled />}
|
||||
type="primary"
|
||||
disabled={isQueryBuilderActive}
|
||||
disabled={isSaveDisabled}
|
||||
onClick={onSaveDashboard}
|
||||
>
|
||||
Save
|
||||
@ -177,12 +193,8 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{!isQueryBuilderActive && (
|
||||
<Button
|
||||
type="primary"
|
||||
disabled={isQueryBuilderActive}
|
||||
onClick={onSaveDashboard}
|
||||
>
|
||||
{!isSaveDisabled && (
|
||||
<Button type="primary" disabled={isSaveDisabled} onClick={onSaveDashboard}>
|
||||
Save
|
||||
</Button>
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user