mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 01:55:57 +08:00
fix: feature flag is added when we are switching the tab (#2930)
This commit is contained in:
parent
cf05345ccd
commit
3f4cd130ed
@ -4,8 +4,11 @@ import { PANEL_TYPES } from 'constants/queryBuilder';
|
|||||||
import { QueryBuilder } from 'container/QueryBuilder';
|
import { QueryBuilder } from 'container/QueryBuilder';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import { AppState } from 'store/reducers';
|
||||||
import { AlertTypes } from 'types/api/alerts/alertTypes';
|
import { AlertTypes } from 'types/api/alerts/alertTypes';
|
||||||
import { EQueryType } from 'types/common/dashboard';
|
import { EQueryType } from 'types/common/dashboard';
|
||||||
|
import AppReducer from 'types/reducer/app';
|
||||||
|
|
||||||
import ChQuerySection from './ChQuerySection';
|
import ChQuerySection from './ChQuerySection';
|
||||||
import PromqlSection from './PromqlSection';
|
import PromqlSection from './PromqlSection';
|
||||||
@ -20,8 +23,14 @@ function QuerySection({
|
|||||||
// init namespace for translations
|
// init namespace for translations
|
||||||
const { t } = useTranslation('alerts');
|
const { t } = useTranslation('alerts');
|
||||||
|
|
||||||
|
const { featureResponse } = useSelector<AppState, AppReducer>(
|
||||||
|
(state) => state.app,
|
||||||
|
);
|
||||||
|
|
||||||
const handleQueryCategoryChange = (queryType: string): void => {
|
const handleQueryCategoryChange = (queryType: string): void => {
|
||||||
setQueryCategory(queryType as EQueryType);
|
featureResponse.refetch().then(() => {
|
||||||
|
setQueryCategory(queryType as EQueryType);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderPromqlUI = (): JSX.Element => <PromqlSection />;
|
const renderPromqlUI = (): JSX.Element => <PromqlSection />;
|
||||||
|
@ -20,6 +20,7 @@ import AppActions from 'types/actions';
|
|||||||
import { Widgets } from 'types/api/dashboard/getAll';
|
import { Widgets } from 'types/api/dashboard/getAll';
|
||||||
import { Query } from 'types/api/queryBuilder/queryBuilderData';
|
import { Query } from 'types/api/queryBuilder/queryBuilderData';
|
||||||
import { EQueryType } from 'types/common/dashboard';
|
import { EQueryType } from 'types/common/dashboard';
|
||||||
|
import AppReducer from 'types/reducer/app';
|
||||||
import DashboardReducer from 'types/reducer/dashboards';
|
import DashboardReducer from 'types/reducer/dashboards';
|
||||||
|
|
||||||
import ClickHouseQueryContainer from './QueryBuilder/clickHouse';
|
import ClickHouseQueryContainer from './QueryBuilder/clickHouse';
|
||||||
@ -32,6 +33,9 @@ function QuerySection({
|
|||||||
}: QueryProps): JSX.Element {
|
}: QueryProps): JSX.Element {
|
||||||
const { currentQuery, redirectWithQueryBuilderData } = useQueryBuilder();
|
const { currentQuery, redirectWithQueryBuilderData } = useQueryBuilder();
|
||||||
const urlQuery = useUrlQuery();
|
const urlQuery = useUrlQuery();
|
||||||
|
const { featureResponse } = useSelector<AppState, AppReducer>(
|
||||||
|
(state) => state.app,
|
||||||
|
);
|
||||||
|
|
||||||
const { dashboards } = useSelector<AppState, DashboardReducer>(
|
const { dashboards } = useSelector<AppState, DashboardReducer>(
|
||||||
(state) => state.dashboards,
|
(state) => state.dashboards,
|
||||||
@ -72,7 +76,9 @@ function QuerySection({
|
|||||||
const handleQueryCategoryChange = (qCategory: string): void => {
|
const handleQueryCategoryChange = (qCategory: string): void => {
|
||||||
const currentQueryType = qCategory as EQueryType;
|
const currentQueryType = qCategory as EQueryType;
|
||||||
|
|
||||||
handleStageQuery({ ...currentQuery, queryType: currentQueryType });
|
featureResponse.refetch().then(() => {
|
||||||
|
handleStageQuery({ ...currentQuery, queryType: currentQueryType });
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRunQuery = (): void => {
|
const handleRunQuery = (): void => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user