Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI v2] feat: Adds deployment flow link #17020

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
};