mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 16:58:59 +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 =
|
const isAlertAvialableToSave =
|
||||||
isAlertAvialable &&
|
isAlertAvialable &&
|
||||||
isNewRule &&
|
currentQuery.queryType === EQueryType.QUERY_BUILDER &&
|
||||||
currentQuery.queryType === EQueryType.QUERY_BUILDER;
|
alertType !== AlertTypes.METRICS_BASED_ALERT;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -20,6 +20,8 @@ import {
|
|||||||
import { AppState } from 'store/reducers';
|
import { AppState } from 'store/reducers';
|
||||||
import AppActions from 'types/actions';
|
import AppActions from 'types/actions';
|
||||||
import { FLUSH_DASHBOARD } from 'types/actions/dashboard';
|
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 AppReducer from 'types/reducer/app';
|
||||||
import DashboardReducer from 'types/reducer/dashboards';
|
import DashboardReducer from 'types/reducer/dashboards';
|
||||||
|
|
||||||
@ -161,15 +163,29 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
|
|||||||
FeatureKeys.QUERY_BUILDER_PANELS,
|
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 (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<ButtonContainer>
|
<ButtonContainer>
|
||||||
{isQueryBuilderActive && (
|
{isSaveDisabled && (
|
||||||
<Tooltip title={MESSAGE.PANEL}>
|
<Tooltip title={MESSAGE.PANEL}>
|
||||||
<Button
|
<Button
|
||||||
icon={<LockFilled />}
|
icon={<LockFilled />}
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={isQueryBuilderActive}
|
disabled={isSaveDisabled}
|
||||||
onClick={onSaveDashboard}
|
onClick={onSaveDashboard}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
@ -177,12 +193,8 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isQueryBuilderActive && (
|
{!isSaveDisabled && (
|
||||||
<Button
|
<Button type="primary" disabled={isSaveDisabled} onClick={onSaveDashboard}>
|
||||||
type="primary"
|
|
||||||
disabled={isQueryBuilderActive}
|
|
||||||
onClick={onSaveDashboard}
|
|
||||||
>
|
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user