Link to task diagnostics in block card (#1463)

This commit is contained in:
Shuchang Zheng
2025-01-02 04:41:06 -08:00
committed by GitHub
parent 3510a81f3b
commit 628662604d

View File

@@ -1,8 +1,10 @@
import { CubeIcon } from "@radix-ui/react-icons"; import { ExternalLinkIcon } from "@radix-ui/react-icons";
import { WorkflowRunBlock } from "../types/workflowRunTypes"; import { WorkflowRunBlock } from "../types/workflowRunTypes";
import { cn } from "@/util/utils"; import { cn } from "@/util/utils";
import { WorkflowBlockIcon } from "../editor/nodes/WorkflowBlockIcon"; import { WorkflowBlockIcon } from "../editor/nodes/WorkflowBlockIcon";
import { workflowBlockTitle } from "../editor/nodes/types"; import { workflowBlockTitle } from "../editor/nodes/types";
import { Button } from "@/components/ui/button";
import { Link } from "react-router-dom";
type Props = { type Props = {
active: boolean; active: boolean;
@@ -21,7 +23,7 @@ function BlockCard({ block, onClick, active }: Props) {
)} )}
onClick={onClick} onClick={onClick}
> >
<div className="flex justify-between"> <div className="flex items-center justify-between">
<div className="flex gap-3"> <div className="flex gap-3">
<WorkflowBlockIcon <WorkflowBlockIcon
workflowBlockType={block.block_type} workflowBlockType={block.block_type}
@@ -29,10 +31,18 @@ function BlockCard({ block, onClick, active }: Props) {
/> />
<span>{workflowBlockTitle[block.block_type]}</span> <span>{workflowBlockTitle[block.block_type]}</span>
</div> </div>
<div className="flex items-center gap-1 rounded bg-slate-elevation5 px-2 py-1"> {block.task_id && (
<CubeIcon className="size-4" /> <Button
<span className="text-xs">Block</span> title="Go to task diagnostics"
</div> asChild
size="icon"
className="size-8 bg-slate-800 text-primary hover:bg-slate-700"
>
<Link to={`/tasks/${block.task_id}/diagnostics`}>
<ExternalLinkIcon />
</Link>
</Button>
)}
</div> </div>
</div> </div>
); );