feat: add views tab to metrics explorer (#8091)

This commit is contained in:
Amlan Kumar Nandy 2025-05-30 12:39:24 +07:00 committed by GitHub
parent 80ded899c7
commit 1d77780c70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 19 deletions

View File

@ -1,12 +0,0 @@
import * as Sentry from '@sentry/react';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
function Views(): JSX.Element {
return (
<Sentry.ErrorBoundary fallback={<ErrorBoundaryFallback />}>
Views
</Sentry.ErrorBoundary>
);
}
export default Views;

View File

@ -1,3 +0,0 @@
import Views from './Views';
export default Views;

View File

@ -5,12 +5,12 @@ import { TabRoutes } from 'components/RouteTab/types';
import history from 'lib/history'; import history from 'lib/history';
import { useLocation } from 'react-use'; import { useLocation } from 'react-use';
import { Explorer, Summary } from './constants'; import { Explorer, Summary, Views } from './constants';
function MetricsExplorerPage(): JSX.Element { function MetricsExplorerPage(): JSX.Element {
const { pathname } = useLocation(); const { pathname } = useLocation();
const routes: TabRoutes[] = [Summary, Explorer]; const routes: TabRoutes[] = [Summary, Explorer, Views];
return ( return (
<div className="metrics-explorer-page"> <div className="metrics-explorer-page">

View File

@ -2,8 +2,8 @@ import { TabRoutes } from 'components/RouteTab/types';
import ROUTES from 'constants/routes'; import ROUTES from 'constants/routes';
import ExplorerPage from 'container/MetricsExplorer/Explorer'; import ExplorerPage from 'container/MetricsExplorer/Explorer';
import SummaryPage from 'container/MetricsExplorer/Summary'; import SummaryPage from 'container/MetricsExplorer/Summary';
import ViewsPage from 'container/MetricsExplorer/Views';
import { BarChart2, Compass, TowerControl } from 'lucide-react'; import { BarChart2, Compass, TowerControl } from 'lucide-react';
import SaveView from 'pages/SaveView';
export const Summary: TabRoutes = { export const Summary: TabRoutes = {
Component: SummaryPage, Component: SummaryPage,
@ -28,7 +28,7 @@ export const Explorer: TabRoutes = {
}; };
export const Views: TabRoutes = { export const Views: TabRoutes = {
Component: ViewsPage, Component: SaveView,
name: ( name: (
<div className="tab-item"> <div className="tab-item">
<TowerControl size={16} /> Views <TowerControl size={16} /> Views

View File

@ -5,6 +5,7 @@ export const SOURCEPAGE_VS_ROUTES: {
} = { } = {
logs: ROUTES.LOGS_EXPLORER, logs: ROUTES.LOGS_EXPLORER,
traces: ROUTES.TRACES_EXPLORER, traces: ROUTES.TRACES_EXPLORER,
metrics: ROUTES.METRICS_EXPLORER_EXPLORER,
} as const; } as const;
export const ROUTES_VS_SOURCEPAGE: { export const ROUTES_VS_SOURCEPAGE: {
@ -12,4 +13,5 @@ export const ROUTES_VS_SOURCEPAGE: {
} = { } = {
[ROUTES.LOGS_SAVE_VIEWS]: 'logs', [ROUTES.LOGS_SAVE_VIEWS]: 'logs',
[ROUTES.TRACES_SAVE_VIEWS]: 'traces', [ROUTES.TRACES_SAVE_VIEWS]: 'traces',
[ROUTES.METRICS_EXPLORER_VIEWS]: 'metrics',
} as const; } as const;