fix(graph): encode id in project node tooltip (#14530)

This commit is contained in:
Anton Fedorov 2023-01-23 19:53:30 +03:00 committed by GitHub
parent e7f065e6b3
commit d43d6b6de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ export function ProjectNodeActions({ id }: ProjectNodeToolTipProps) {
projectGraphService.getSnapshot().context.tracing;
const routeConstructor = useRouteConstructor();
const navigate = useNavigate();
const encodedId = encodeURIComponent(id);
function onExclude() {
projectGraphService.send({
@ -21,17 +22,13 @@ export function ProjectNodeActions({ id }: ProjectNodeToolTipProps) {
}
function onStartTrace() {
navigate(
routeConstructor(`/projects/trace/${encodeURIComponent(id)}`, true)
);
navigate(routeConstructor(`/projects/trace/${encodedId}`, true));
}
function onEndTrace() {
navigate(
routeConstructor(
`/projects/trace/${encodeURIComponent(start)}/${encodeURIComponent(
id
)}`,
`/projects/trace/${encodeURIComponent(start)}/${encodedId}`,
true
)
);
@ -39,7 +36,7 @@ export function ProjectNodeActions({ id }: ProjectNodeToolTipProps) {
return (
<div className="grid grid-cols-3 gap-4">
<TooltipLinkButton to={routeConstructor(`/projects/${id}`, true)}>
<TooltipLinkButton to={routeConstructor(`/projects/${encodedId}`, true)}>
Focus
</TooltipLinkButton>
<TooltipButton onClick={onExclude}>Exclude</TooltipButton>