Skip to content

Commit 9ba5701

Browse files
committed
implement merge comments
1 parent 98d1a24 commit 9ba5701

2 files changed

Lines changed: 11 additions & 18 deletions

File tree

extensions/ql-vscode/src/view/results/graph.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
import * as React from "react";
22
import { select } from "d3";
33
import { jumpToLocation } from "./result-table-utils";
4-
import {
5-
InterpretedResultSet,
6-
GraphInterpretationData,
7-
} from "../../common/interface-types";
84
import { graphviz, GraphvizOptions } from "d3-graphviz";
95
import { tryGetLocationFromString } from "../../common/bqrs-utils";
106
import { useCallback, useEffect } from "react";
11-
export type GraphProps = {
12-
resultSet: InterpretedResultSet<GraphInterpretationData>;
13-
offset: number;
7+
8+
type GraphProps = {
9+
graphData: string;
1410
databaseUri: string;
1511
};
1612

1713
const graphClassName = "vscode-codeql__result-tables-graph";
1814
const graphId = "graph-results";
1915

20-
export function Graph({ resultSet, offset, databaseUri }: GraphProps) {
21-
const graphData = resultSet.interpretation?.data?.dot[offset];
22-
16+
export function Graph({ graphData, databaseUri }: GraphProps) {
2317
const renderGraph = useCallback(() => {
24-
const graphData = resultSet.interpretation?.data?.dot[offset];
25-
2618
if (!graphData) {
2719
return;
2820
}
@@ -76,7 +68,7 @@ export function Graph({ resultSet, offset, databaseUri }: GraphProps) {
7668
}
7769
})
7870
.renderDot(graphData);
79-
}, [resultSet, offset, databaseUri]);
71+
}, [graphData, databaseUri]);
8072

8173
useEffect(() => {
8274
renderGraph();

extensions/ql-vscode/src/view/results/result-tables.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,12 @@ class ResultTable extends React.Component<
460460
return <PathTable {...this.props} resultSet={sarifResultSet} />;
461461
}
462462
case "GraphInterpretationData": {
463-
const grapResultSet = {
464-
...resultSet,
465-
interpretation: { ...resultSet.interpretation, data },
466-
};
467-
return <Graph {...this.props} resultSet={grapResultSet} />;
463+
return (
464+
<Graph
465+
graphData={data?.dot[this.props.offset]}
466+
databaseUri={this.props.databaseUri}
467+
/>
468+
);
468469
}
469470
}
470471
}

0 commit comments

Comments
 (0)