Skip to content

Commit

Permalink
[UI v2] feat: Adds deployment flow link (#17020)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinvillarosa authored Feb 6, 2025
1 parent 9e834e6 commit b3a815d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui-v2/src/components/deployments/deployment-details-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useSuspenseQuery } from "@tanstack/react-query";

import { DeploymentDetailsHeader } from "./deployment-details-header";
import { DeploymentDetailsTabs } from "./deployment-details-tabs";
import { DeploymentFlowLink } from "./deployment-flow-link";

type DeploymentDetailsPageProps = {
id: string;
Expand All @@ -16,7 +17,7 @@ export const DeploymentDetailsPage = ({ id }: DeploymentDetailsPageProps) => {
<div className="flex align-middle justify-between">
<div className="flex flex-col gap-2">
<DeploymentDetailsHeader deployment={data} />
<div className="border border-red-400">{"<FlowLink />"}</div>
<DeploymentFlowLink flowId={data.flow_id} />
</div>
<div className="flex align-middle gap-2">
<div className="border border-red-400">{"<RunButton />"}</div>
Expand Down
26 changes: 26 additions & 0 deletions ui-v2/src/components/deployments/deployment-flow-link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { buildFLowDetailsQuery } from "@/api/flows";
import { Icon } from "@/components/ui/icons";
import { useQuery } from "@tanstack/react-query";
import { Link } from "@tanstack/react-router";

type DeploymentFlowLinkProps = {
flowId: string;
};

export const DeploymentFlowLink = ({ flowId }: DeploymentFlowLinkProps) => {
const { data } = useQuery(buildFLowDetailsQuery(flowId));

return (
<div className="flex items-center gap-1 text-sm">
Flow
<Link
to="/flows/flow/$id"
params={{ id: flowId }}
className="flex items-center gap-1"
>
<Icon id="Workflow" className="h-4 w-4" />
{data?.name}
</Link>
</div>
);
};

0 comments on commit b3a815d

Please sign in to comment.