mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-23 18:36:16 +00:00
fix: fix the trace explorer back navigation issue (#8760)
This commit is contained in:
parent
17533b2f1c
commit
88312e971d
@ -10,7 +10,6 @@ import { QuickFiltersSource, SignalType } from 'components/QuickFilters/types';
|
|||||||
import WarningPopover from 'components/WarningPopover/WarningPopover';
|
import WarningPopover from 'components/WarningPopover/WarningPopover';
|
||||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
|
import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
|
||||||
import { QueryParams } from 'constants/query';
|
|
||||||
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
|
||||||
import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
|
import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
|
||||||
import ExportPanel from 'container/ExportPanel';
|
import ExportPanel from 'container/ExportPanel';
|
||||||
@ -65,7 +64,7 @@ function TracesExplorer(): JSX.Element {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
|
|
||||||
// Get panel type from URL
|
// Get panel type from URL
|
||||||
const panelTypesFromUrl = useGetPanelTypesQueryParam(PANEL_TYPES.LIST);
|
const panelTypesFromUrl = useGetPanelTypesQueryParam(PANEL_TYPES.LIST);
|
||||||
@ -88,14 +87,6 @@ function TracesExplorer(): JSX.Element {
|
|||||||
}
|
}
|
||||||
}, [panelTypesFromUrl, selectedView]);
|
}, [panelTypesFromUrl, selectedView]);
|
||||||
|
|
||||||
// Update URL when selectedView changes
|
|
||||||
useEffect(() => {
|
|
||||||
setSearchParams((prev: URLSearchParams) => {
|
|
||||||
prev.set(QueryParams.selectedExplorerView, selectedView);
|
|
||||||
return prev;
|
|
||||||
});
|
|
||||||
}, [selectedView, setSearchParams]);
|
|
||||||
|
|
||||||
const [shouldReset, setShouldReset] = useState(false);
|
const [shouldReset, setShouldReset] = useState(false);
|
||||||
|
|
||||||
const [defaultQuery, setDefaultQuery] = useState<Query>(() =>
|
const [defaultQuery, setDefaultQuery] = useState<Query>(() =>
|
||||||
@ -141,6 +132,7 @@ function TracesExplorer(): JSX.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSelectedView(view);
|
setSelectedView(view);
|
||||||
|
|
||||||
handleExplorerTabChange(
|
handleExplorerTabChange(
|
||||||
view === ExplorerViews.TIMESERIES ? PANEL_TYPES.TIME_SERIES : view,
|
view === ExplorerViews.TIMESERIES ? PANEL_TYPES.TIME_SERIES : view,
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user