Allow testing webhook response in setup flow (#3768)
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
||||
import { ProxySelector } from "@/components/ProxySelector";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "@/routes/workflows/editor/nodes/Taskv2Node/types";
|
||||
import { TestWebhookDialog } from "@/components/TestWebhookDialog";
|
||||
type Props = {
|
||||
initialValues: CreateNewTaskFormValues;
|
||||
};
|
||||
@@ -527,11 +528,31 @@ function CreateNewTaskForm({ initialValues }: Props) {
|
||||
</FormLabel>
|
||||
<div className="w-full">
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="https://"
|
||||
value={field.value === null ? "" : field.value}
|
||||
/>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Input
|
||||
className="w-full"
|
||||
{...field}
|
||||
placeholder="https://"
|
||||
value={field.value === null ? "" : field.value}
|
||||
/>
|
||||
<TestWebhookDialog
|
||||
runType="task"
|
||||
runId={null}
|
||||
initialWebhookUrl={
|
||||
field.value === null ? undefined : field.value
|
||||
}
|
||||
trigger={
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
className="self-start"
|
||||
disabled={!field.value}
|
||||
>
|
||||
Test Webhook
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { InboxIcon } from "@/components/icons/InboxIcon";
|
||||
import { MessageIcon } from "@/components/icons/MessageIcon";
|
||||
import { TrophyIcon } from "@/components/icons/TrophyIcon";
|
||||
import { ProxySelector } from "@/components/ProxySelector";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { KeyValueInput } from "@/components/KeyValueInput";
|
||||
import {
|
||||
@@ -45,6 +46,7 @@ import {
|
||||
MAX_STEPS_DEFAULT,
|
||||
} from "@/routes/workflows/editor/nodes/Taskv2Node/types";
|
||||
import { useAutoplayStore } from "@/store/useAutoplayStore";
|
||||
import { TestWebhookDialog } from "@/components/TestWebhookDialog";
|
||||
|
||||
const exampleCases = [
|
||||
{
|
||||
@@ -352,12 +354,30 @@ function PromptBox() {
|
||||
information
|
||||
</div>
|
||||
</div>
|
||||
<Input
|
||||
value={webhookCallbackUrl ?? ""}
|
||||
onChange={(event) => {
|
||||
setWebhookCallbackUrl(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Input
|
||||
className="w-full"
|
||||
value={webhookCallbackUrl ?? ""}
|
||||
onChange={(event) => {
|
||||
setWebhookCallbackUrl(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<TestWebhookDialog
|
||||
runType="task"
|
||||
runId={null}
|
||||
initialWebhookUrl={webhookCallbackUrl ?? undefined}
|
||||
trigger={
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
className="self-start"
|
||||
disabled={!webhookCallbackUrl}
|
||||
>
|
||||
Test Webhook
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-16">
|
||||
<div className="w-48 shrink-0">
|
||||
|
||||
@@ -33,6 +33,7 @@ import { TaskFormSection } from "./TaskFormSection";
|
||||
import { savedTaskFormSchema, SavedTaskFormValues } from "./taskFormTypes";
|
||||
import { OrganizationApiResponse, ProxyLocation } from "@/api/types";
|
||||
import { ProxySelector } from "@/components/ProxySelector";
|
||||
import { TestWebhookDialog } from "@/components/TestWebhookDialog";
|
||||
|
||||
type Props = {
|
||||
initialValues: SavedTaskFormValues;
|
||||
@@ -627,11 +628,31 @@ function SavedTaskForm({ initialValues }: Props) {
|
||||
</FormLabel>
|
||||
<div className="w-full">
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="https://"
|
||||
value={field.value === null ? "" : field.value}
|
||||
/>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Input
|
||||
className="w-full"
|
||||
{...field}
|
||||
placeholder="https://"
|
||||
value={field.value === null ? "" : field.value}
|
||||
/>
|
||||
<TestWebhookDialog
|
||||
runType="task"
|
||||
runId={null}
|
||||
initialWebhookUrl={
|
||||
field.value === null ? undefined : field.value
|
||||
}
|
||||
trigger={
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
className="self-start"
|
||||
disabled={!field.value}
|
||||
>
|
||||
Test Webhook
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user