Skip to content

Commit d43d6b6

Browse files
authored
fix(graph): encode id in project node tooltip (#14530)
1 parent e7f065e commit d43d6b6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

graph/client/src/app/ui-tooltips/project-node-actions.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function ProjectNodeActions({ id }: ProjectNodeToolTipProps) {
1111
projectGraphService.getSnapshot().context.tracing;
1212
const routeConstructor = useRouteConstructor();
1313
const navigate = useNavigate();
14+
const encodedId = encodeURIComponent(id);
1415

1516
function onExclude() {
1617
projectGraphService.send({
@@ -21,25 +22,21 @@ export function ProjectNodeActions({ id }: ProjectNodeToolTipProps) {
2122
}
2223

2324
function onStartTrace() {
24-
navigate(
25-
routeConstructor(`/projects/trace/${encodeURIComponent(id)}`, true)
26-
);
25+
navigate(routeConstructor(`/projects/trace/${encodedId}`, true));
2726
}
2827

2928
function onEndTrace() {
3029
navigate(
3130
routeConstructor(
32-
`/projects/trace/${encodeURIComponent(start)}/${encodeURIComponent(
33-
id
34-
)}`,
31+
`/projects/trace/${encodeURIComponent(start)}/${encodedId}`,
3532
true
3633
)
3734
);
3835
}
3936

4037
return (
4138
<div className="grid grid-cols-3 gap-4">
42-
<TooltipLinkButton to={routeConstructor(`/projects/${id}`, true)}>
39+
<TooltipLinkButton to={routeConstructor(`/projects/${encodedId}`, true)}>
4340
Focus
4441
</TooltipLinkButton>
4542
<TooltipButton onClick={onExclude}>Exclude</TooltipButton>

0 commit comments

Comments
 (0)