Skip to content

Commit

Permalink
Breadcrumb nav updates
Browse files Browse the repository at this point in the history
This fixes up the breadcrumb so we have clickable nav.
It's still not running on the runs page but it'll do for now.
  • Loading branch information
elijahbenizzy authored and skrawcz committed Apr 30, 2024
1 parent 3702194 commit 1446df6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ const extractTableData = (
projectVersionName: "",
projectId: projectId,
codeArtifact: codeArtifactsById.get(node.code_artifacts?.[0]),

// runInfo: [],
};
});
Expand Down
28 changes: 20 additions & 8 deletions ui/frontend/src/components/dashboard/NavBreadCrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ChevronRightIcon, HomeIcon } from "@heroicons/react/20/solid";
import { DAGTemplateWithoutData, Project } from "../../state/api/friendlyApi";
import { Link } from "react-router-dom";

export const NavBreadCrumb = (props: {
project: Project;
Expand All @@ -18,19 +19,27 @@ export const NavBreadCrumb = (props: {
: index == 3
? props.dagTemplates[0]?.name
: pathName;
let linkPath =
"/dashboard/" +
pathNameRelativeToDashboard.slice(0, index + 1).join("/");
if (linkPath.endsWith("/project")) {
linkPath = "/dashboard/projects";
} else if (linkPath.endsWith("/version")) {
linkPath = linkPath.replace("/version", "/versions");
}
return (
// TODO -- enable when we can get this working -- we just need to link for links that exist
// Should be easy I just don't have time now
<span
// to={
// "/dashboard/" +
// pathNameRelativeToDashboard.slice(0, index + 1).join("/")
// }
<Link
to={
"/dashboard/" +
pathNameRelativeToDashboard.slice(0, index + 1).join("/")
}
key={linkName}
className="ml-4 font-medium hover:text-gray-800"
className="ml-4 font-medium hover:text-gray-800 cursor-pointer hover:scale-105"
>
{linkName}
</span>
</Link>
);
}),
];
Expand All @@ -41,7 +50,10 @@ export const NavBreadCrumb = (props: {
const elements = getElements();

return (
<nav className="flex max-w-full bg-transparent" aria-label="Breadcrumb">
<nav
className="flex max-w-full bg-transparent z-50"
aria-label="Breadcrumb"
>
<ol role="list" className="flex items-center space-x-4 flex-wrap">
<li>
<div>
Expand Down

0 comments on commit 1446df6

Please sign in to comment.