Skip to content

Commit

Permalink
fix(graph): encode id in project node tooltip (#14530)
Browse files Browse the repository at this point in the history
  • Loading branch information
fapspirit authored Jan 23, 2023
1 parent e7f065e commit d43d6b6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions graph/client/src/app/ui-tooltips/project-node-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -21,25 +22,21 @@ 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
)
);
}

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>
Expand Down

1 comment on commit d43d6b6

@vercel
Copy link

@vercel vercel bot commented on d43d6b6 Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev

Please sign in to comment.