diff --git a/web/app/workflows/[id]/page.tsx b/web/app/workflows/[id]/page.tsx index eebfa50..5f9e7e7 100644 --- a/web/app/workflows/[id]/page.tsx +++ b/web/app/workflows/[id]/page.tsx @@ -1,61 +1,29 @@ "use client"; import { useEffect, useState } from "react"; +import Link from "next/link"; import { useParams, useRouter } from "next/navigation"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import { api, Workflow, WorkflowStep, WorkflowStepRef, SecretGroupSummary } from "@/lib/api"; -import { Button, Card } from "@/components/ui"; +import { Button } from "@/components/ui"; +import { EditStepModal } from "@/components/workflows/EditStepModal"; +import { EditWorkflowModal } from "@/components/workflows/EditWorkflowModal"; const inputClass = - "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent"; + "w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder-text-secondary/50 focus:border-signal focus:outline-none focus:ring-1 focus:ring-signal"; -function NewStepForm({ onClose }: { onClose: () => void }) { - const queryClient = useQueryClient(); - const [name, setName] = useState(""); - const [interpreter, setInterpreter] = useState<"bash" | "powershell">("bash"); - const [script, setScript] = useState(""); - const [saving, setSaving] = useState(false); - const [error, setError] = useState(null); - - const create = async () => { - setSaving(true); - setError(null); - try { - await api.createStep({ - name: name.trim(), - description: "", - interpreter, - script, - declared_outputs: [], - secret_refs: [], - }); - queryClient.invalidateQueries({ queryKey: ["steps"] }); - onClose(); - } catch (e) { - setError((e as Error).message); - } finally { - setSaving(false); - } - }; +type DragPayload = { kind: "lib"; stepId: string } | { kind: "move"; from: number }; +function ShellBadge({ interpreter }: { interpreter: "bash" | "powershell" }) { + const isBash = interpreter === "bash"; return ( -
- {error &&
{error}
} - setName(e.target.value)} /> - -