Skip to content

Commit

Permalink
some more minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK committed Nov 8, 2024
1 parent 9021282 commit e8b0e8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { useState } from 'react';
import { useParams } from 'react-router-dom';
import sentryDataCache from '~/integrations/sentry/data/sentryDataCache';
import { getDuration } from '~/integrations/sentry/utils/duration';
import sentryDataCache from '../../../../data/sentryDataCache';
import { getDuration } from '../../../../utils/duration';
import DateTime from '../../../DateTime';
import SpanDetails from '../../spans/SpanDetails';
import SpanTree from '../../spans/SpanTree';

type TraceTreeViewProps = { traceId: string };

export const DEFAULT_SPAN_NODE_WIDTH = 50;

export default function TraceTreeview({ traceId }: TraceTreeViewProps) {
const { spanId } = useParams();

const [spanNodeWidth, setSpanNodeWidth] = useState<number>(50);
const [spanNodeWidth, setSpanNodeWidth] = useState<number>(DEFAULT_SPAN_NODE_WIDTH);

const trace = sentryDataCache.getTraceById(traceId);
const span = spanId ? sentryDataCache.getSpanById(traceId, spanId) : undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link, Navigate, Route, Routes, useParams } from 'react-router-dom';
import Tabs from '~/components/Tabs';
import Tabs from '../../../../../components/Tabs';
import { default as dataCache, default as sentryDataCache } from '../../../data/sentryDataCache';
import EventList from '../../events/EventList';
import TraceContext from './components/TraceContext';
Expand Down Expand Up @@ -30,7 +30,7 @@ export default function TraceDetails() {
.getEventsByTrace(traceId)
.filter(
e =>
e.type != 'transaction' &&
e.type !== 'transaction' &&
(e.contexts?.trace?.trace_id ? sentryDataCache.isTraceLocal(e.contexts?.trace?.trace_id) : null) !== false,
).length;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState, type ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { format as formatSQL } from 'sql-formatter';
import SidePanel, { SidePanelHeader } from '~/ui/SidePanel';
import SidePanel, { SidePanelHeader } from '../../../../../ui/SidePanel';
import dataCache from '../../../data/sentryDataCache';
import { SentryErrorEvent, Span, TraceContext } from '../../../types';
import type { SentryErrorEvent, Span, TraceContext } from '../../../types';
import { formatBytes } from '../../../utils/bytes';
import { getDuration } from '../../../utils/duration';
import DateTime from '../../DateTime';
Expand Down

0 comments on commit e8b0e8a

Please sign in to comment.