Add workflow title to workflow page (#648)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { getClient } from "@/api/AxiosClient";
|
import { getClient } from "@/api/AxiosClient";
|
||||||
import { WorkflowRunApiResponse } from "@/api/types";
|
import { WorkflowApiResponse, WorkflowRunApiResponse } from "@/api/types";
|
||||||
import { StatusBadge } from "@/components/StatusBadge";
|
import { StatusBadge } from "@/components/StatusBadge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import {
|
import {
|
||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
PaginationNext,
|
PaginationNext,
|
||||||
PaginationPrevious,
|
PaginationPrevious,
|
||||||
} from "@/components/ui/pagination";
|
} from "@/components/ui/pagination";
|
||||||
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
@@ -52,6 +53,17 @@ function WorkflowPage() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { data: workflow, isLoading: workflowIsLoading } =
|
||||||
|
useQuery<WorkflowApiResponse>({
|
||||||
|
queryKey: ["workflow", workflowPermanentId],
|
||||||
|
queryFn: async () => {
|
||||||
|
const client = await getClient(credentialGetter);
|
||||||
|
return client
|
||||||
|
.get(`/workflows/${workflowPermanentId}`)
|
||||||
|
.then((response) => response.data);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if (!workflowPermanentId) {
|
if (!workflowPermanentId) {
|
||||||
return null; // this should never happen
|
return null; // this should never happen
|
||||||
}
|
}
|
||||||
@@ -59,7 +71,19 @@ function WorkflowPage() {
|
|||||||
return (
|
return (
|
||||||
<div className="space-y-8">
|
<div className="space-y-8">
|
||||||
<header className="flex justify-between">
|
<header className="flex justify-between">
|
||||||
<h1 className="text-lg font-semibold">{workflowPermanentId}</h1>
|
<div className="flex flex-col gap-2">
|
||||||
|
{workflowIsLoading ? (
|
||||||
|
<>
|
||||||
|
<Skeleton className="h-7 w-56" />
|
||||||
|
<Skeleton className="h-7 w-56" />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<h1 className="text-lg font-semibold">{workflow?.title}</h1>
|
||||||
|
<h2 className="text-sm">{workflowPermanentId}</h2>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link to="run">Create New Run</Link>
|
<Link to="run">Create New Run</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user