Skip to content

Commit

Permalink
remove prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Feb 8, 2024
1 parent 77ab881 commit 2ba3f25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
3 changes: 0 additions & 3 deletions web/src/components/RunDetailTrace/TracePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import Visualization from './Visualization';
import {FillPanel} from '../ResizablePanels';
import SkipTraceCollectionInfo from '../SkipTraceCollectionInfo';

const HEADER_HEIGHT = 210;

type TProps = {
run: TestRun;
testId: string;
Expand Down Expand Up @@ -55,7 +53,6 @@ const TracePanel = ({run, testId, runEvents, skipTraceCollection}: TProps) => {
runState={run.state}
trace={run.trace}
type={visualizationType}
containerHeight={window.innerHeight - HEADER_HEIGHT}
/>
</S.VisualizationContainer>
</S.SectionLeft>
Expand Down
13 changes: 2 additions & 11 deletions web/src/components/RunDetailTrace/Visualization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,14 @@ import {VisualizationType} from './RunDetailTrace';
import TraceDAG from './TraceDAG';

interface IProps {
containerHeight: number;
isDAGDisabled: boolean;
runEvents: TestRunEvent[];
runState: TTestRunState;
trace: Trace;
type: VisualizationType;
}

const Visualization = ({
containerHeight,
isDAGDisabled,
runEvents,
runState,
trace,
trace: {spans, rootSpan},
type,
}: IProps) => {
const Visualization = ({isDAGDisabled, runEvents, runState, trace, trace: {spans, rootSpan}, type}: IProps) => {
const dispatch = useAppDispatch();
const selectedSpan = useAppSelector(TraceSelectors.selectSelectedSpan);

Expand All @@ -54,7 +45,7 @@ const Visualization = ({
return type === VisualizationType.Dag && !isDAGDisabled ? (
<TraceDAG trace={trace} onNavigateToSpan={onNavigateToSpan} />
) : (
<TimelineV2 containerHeight={containerHeight} nodeType={NodeTypesEnum.TraceSpan} spans={spans} />
<TimelineV2 nodeType={NodeTypesEnum.TraceSpan} spans={spans} />
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import SpanNodeFactory from './SpanNodeFactoryV2';
import TimelineProvider from './Timeline.provider';
import * as S from './TimelineV2.styled';

const HEADER_HEIGHT = 210;

export interface IProps {
containerHeight: number;
nodeType: NodeTypesEnum;
spans: Span[];
}

const Timeline = ({containerHeight, nodeType, spans}: IProps) => {
const Timeline = ({nodeType, spans}: IProps) => {
const listRef = useRef<List>(null);
const nodes = useMemo(() => TimelineModel(spans, nodeType), [spans, nodeType]);

Expand All @@ -23,7 +24,7 @@ const Timeline = ({containerHeight, nodeType, spans}: IProps) => {
<NavigationWrapper />
<S.Container>
<List
height={containerHeight}
height={window.innerHeight - HEADER_HEIGHT}
itemCount={nodes.length}
itemData={nodes}
itemSize={32}
Expand Down

0 comments on commit 2ba3f25

Please sign in to comment.