Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: feature flag is added when we are switching the tab (#2930)

Palash Gupta3f4cd130ed63
diff --git a/frontend/src/container/FormAlertRules/QuerySection.tsx b/frontend/src/container/FormAlertRules/QuerySection.tsx
index b8c88ab683..4ccac39fc4 100644
--- a/frontend/src/container/FormAlertRules/QuerySection.tsx
+++ b/frontend/src/container/FormAlertRules/QuerySection.tsx
@@ -4,8 +4,11 @@ import { PANEL_TYPES } from 'constants/queryBuilder';
import { QueryBuilder } from 'container/QueryBuilder';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
+import { useSelector } from 'react-redux';
+import { AppState } from 'store/reducers';
import { AlertTypes } from 'types/api/alerts/alertTypes';
import { EQueryType } from 'types/common/dashboard';
+import AppReducer from 'types/reducer/app';
import ChQuerySection from './ChQuerySection';
import PromqlSection from './PromqlSection';
@@ -20,8 +23,14 @@ function QuerySection({
// init namespace for translations
const { t } = useTranslation('alerts');
+ const { featureResponse } = useSelector<AppState, AppReducer>(
+ (state) => state.app,
+ );
+
const handleQueryCategoryChange = (queryType: string): void => {
- setQueryCategory(queryType as EQueryType);
+ featureResponse.refetch().then(() => {
+ setQueryCategory(queryType as EQueryType);
+ });
};
const renderPromqlUI = (): JSX.Element => <PromqlSection />;
diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
index 655ecaaee7..d3e52120b3 100644
--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx
@@ -20,6 +20,7 @@ import AppActions from 'types/actions';
import { Widgets } from 'types/api/dashboard/getAll';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { EQueryType } from 'types/common/dashboard';
+import AppReducer from 'types/reducer/app';
import DashboardReducer from 'types/reducer/dashboards';
import ClickHouseQueryContainer from './QueryBuilder/clickHouse';
@@ -32,6 +33,9 @@ function QuerySection({
}: QueryProps): JSX.Element {
const { currentQuery, redirectWithQueryBuilderData } = useQueryBuilder();
const urlQuery = useUrlQuery();
+ const { featureResponse } = useSelector<AppState, AppReducer>(
+ (state) => state.app,
+ );
const { dashboards } = useSelector<AppState, DashboardReducer>(
(state) => state.dashboards,
@@ -72,7 +76,9 @@ function QuerySection({
const handleQueryCategoryChange = (qCategory: string): void => {
const currentQueryType = qCategory as EQueryType;
- handleStageQuery({ ...currentQuery, queryType: currentQueryType });
+ featureResponse.refetch().then(() => {
+ handleStageQuery({ ...currentQuery, queryType: currentQueryType });
+ });
};
const handleRunQuery = (): void => {