Webhook Replay Test URL (#3769)

Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
Marc Kelechava
2025-10-22 14:26:14 -07:00
committed by GitHub
parent e8472df6d1
commit aeefc301ed
8 changed files with 964 additions and 12 deletions

View File

@@ -41,7 +41,8 @@ import { Label } from "@/components/ui/label";
import { CodeEditor } from "./components/CodeEditor";
import { cn } from "@/util/utils";
import { ScrollArea, ScrollAreaViewport } from "@/components/ui/scroll-area";
import { CopyApiCommandDropdown } from "@/components/CopyApiCommandDropdown";
import { ApiWebhookActionsMenu } from "@/components/ApiWebhookActionsMenu";
import { WebhookReplayDialog } from "@/components/WebhookReplayDialog";
import { type ApiCommandOptions } from "@/util/apiCommands";
import { useBlockScriptsQuery } from "@/routes/workflows/hooks/useBlockScriptsQuery";
import { constructCacheKeyValue } from "@/routes/workflows/editor/utils";
@@ -108,6 +109,7 @@ function WorkflowRun() {
}, [blockScriptsPublished, setHasPublishedCode]);
const { data: workflowRunTimeline } = useWorkflowRunTimelineQuery();
const [replayOpen, setReplayOpen] = useState(false);
const cancelWorkflowMutation = useMutation({
mutationFn: async () => {
@@ -304,7 +306,7 @@ function WorkflowRun() {
</div>
<div className="flex gap-2">
<CopyApiCommandDropdown
<ApiWebhookActionsMenu
getOptions={() =>
({
method: "POST",
@@ -319,6 +321,15 @@ function WorkflowRun() {
},
}) satisfies ApiCommandOptions
}
webhookDisabled={workflowRunIsLoading || !workflowRunIsFinalized}
onTestWebhook={() => setReplayOpen(true)}
/>
<WebhookReplayDialog
runId={workflowRunId ?? ""}
disabled={workflowRunIsLoading || !workflowRunIsFinalized}
open={replayOpen}
onOpenChange={setReplayOpen}
hideTrigger
/>
<Button asChild variant="secondary">
<Link to={`/workflows/${workflowPermanentId}/debug`}>