diff --git a/apps/webapp/app/components/runs/Table.tsx b/apps/webapp/app/components/runs/RunsTable.tsx similarity index 67% rename from apps/webapp/app/components/runs/Table.tsx rename to apps/webapp/app/components/runs/RunsTable.tsx index fa76d1aa7..6380c9628 100644 --- a/apps/webapp/app/components/runs/Table.tsx +++ b/apps/webapp/app/components/runs/RunsTable.tsx @@ -2,7 +2,7 @@ import { BeakerIcon, InformationCircleIcon } from "@heroicons/react/24/outline"; import { Link } from "@remix-run/react"; import classNames from "classnames"; import humanizeDuration from "humanize-duration"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import type { WorkflowRunListPresenter } from "~/models/workflowRunListPresenter.server"; import { dateDifference, formatDateTime } from "~/utils"; import { runStatusIcon, runStatusLabel } from "./runStatus"; @@ -14,10 +14,12 @@ export function RunsTable({ total, hasFilters, runs, + basePath, }: { total: number; hasFilters: boolean; runs: Awaited>["runs"]; + basePath?: string; }) { return ( @@ -53,37 +55,42 @@ export function RunsTable({ ) : ( - runs.map((run) => ( - - - {run.startedAt ? formatDateTime(run.startedAt, "long") : "–"} - - - {run.id} - - - - {runStatusIcon(run.status, "small")} - {runStatusLabel(run.status)} - - - - {run.finishedAt ? formatDateTime(run.finishedAt, "long") : "–"} - - - {run.startedAt && run.finishedAt - ? humanizeDuration( - dateDifference(run.startedAt, run.finishedAt) - ) - : "–"} - - - {run.isTest && ( - - )} - - - )) + runs.map((run) => { + const path = basePath ? `${basePath}/${run.id}` : run.id; + return ( + + + {run.startedAt ? formatDateTime(run.startedAt, "long") : "–"} + + + {run.id} + + + + {runStatusIcon(run.status, "small")} + {runStatusLabel(run.status)} + + + + {run.finishedAt + ? formatDateTime(run.finishedAt, "long") + : "–"} + + + {run.startedAt && run.finishedAt + ? humanizeDuration( + dateDifference(run.startedAt, run.finishedAt) + ) + : "–"} + + + {run.isTest && ( + + )} + + + ); + }) )}
diff --git a/apps/webapp/app/models/workflowRunPresenter.server.ts b/apps/webapp/app/models/workflowRunPresenter.server.ts index 4cc2bdca3..5009dedd7 100644 --- a/apps/webapp/app/models/workflowRunPresenter.server.ts +++ b/apps/webapp/app/models/workflowRunPresenter.server.ts @@ -5,7 +5,8 @@ import { TriggerMetadataSchema, } from "@trigger.dev/common-schemas"; import type { CatalogIntegration } from "internal-catalog"; -import { DisplayProperties, slack } from "internal-integrations"; +import type { DisplayProperties } from "internal-integrations"; +import { slack } from "internal-integrations"; import invariant from "tiny-invariant"; import type { PrismaClient } from "~/db.server"; import { prisma } from "~/db.server"; diff --git a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx index 16386814b..36e484ec8 100644 --- a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx +++ b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx @@ -6,7 +6,7 @@ import { Panel } from "~/components/layout/Panel"; import { PanelHeader } from "~/components/layout/PanelHeader"; import { PrimaryLink, SecondaryLink } from "~/components/primitives/Buttons"; import { Header1, Header2 } from "~/components/primitives/text/Headers"; -import { RunsTable } from "~/components/runs/Table"; +import { RunsTable } from "~/components/runs/RunsTable"; import { TriggerBody } from "~/components/triggers/Trigger"; import { triggerInfo } from "~/components/triggers/triggerTypes"; import { useConnectionSlots } from "~/hooks/useConnectionSlots"; @@ -89,7 +89,12 @@ export default function Page() { View all - + ) : ( diff --git a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/$runId.tsx b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/$runId.tsx index 97ea09bd1..5db8e1146 100644 --- a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/$runId.tsx +++ b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/$runId.tsx @@ -36,11 +36,7 @@ import { TriggerBody } from "~/components/triggers/Trigger"; import { useFetcher } from "@remix-run/react"; import { useCurrentOrganization } from "~/hooks/useOrganizations"; import { useCurrentWorkflow } from "~/hooks/useWorkflows"; -import { - BasicConnectButton, - ConnectButton, -} from "~/components/integrations/ConnectButton"; -import { IntegrationIcon } from "~/components/integrations/ConnectionSelector"; +import { BasicConnectButton } from "~/components/integrations/ConnectButton"; export const loader = async ({ request, params }: LoaderArgs) => { await requireUserId(request); @@ -54,7 +50,7 @@ export const loader = async ({ request, params }: LoaderArgs) => { return typedjson({ run }); } catch (error: any) { console.error(error); - throw new Response("Error ", { status: 404 }); + throw new Response("Error ", { status: 400 }); } }; diff --git a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/index.tsx b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/index.tsx index 2d3c33dfa..b5801a90d 100644 --- a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/index.tsx +++ b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/runs/index.tsx @@ -15,7 +15,7 @@ import { runStatusLabel, runStatusTitle, } from "~/components/runs/runStatus"; -import { RunsTable } from "~/components/runs/Table"; +import { RunsTable } from "~/components/runs/RunsTable"; import type { WorkflowRunStatus } from "~/models/workflowRun.server"; import { WorkflowRunListPresenter } from "~/models/workflowRunListPresenter.server"; import { requireUserId } from "~/services/session.server";